question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Providing different versions of endpoints

See original GitHub issue

Could you please provide any information on how I can handle versioning with your extension? Unfortunately, I haven’t found any examples or information about versioning in this repo.

Example: I have two version of one function

[Function("HttpTrigger_V1")]
public static HttpResponseData RunV1(
	[HttpTrigger(AuthorizationLevel.Function, "get", Route = "v1/httpTrigger")]
	HttpRequestData req,
	FunctionContext executionContext)
{
	var response = req.CreateResponse(HttpStatusCode.OK);
	response.Headers.Add("Content-Type", "text/plain; charset=utf-8");
	response.WriteString("Welcome to Azure Functions! v1 ");

	return response;
}

[Function("HttpTrigger_V2")]
public static HttpResponseData RunV2(
	[HttpTrigger(AuthorizationLevel.Function, "get", Route = "v2/httpTrigger")]
	HttpRequestData req,
	FunctionContext executionContext)
{
	var response = req.CreateResponse(HttpStatusCode.OK);
	response.Headers.Add("Content-Type", "text/plain; charset=utf-8");
	response.WriteString("Welcome to Azure Functions! v2");

	return response;
}

How can I document it in a proper way to see that this is exactly one function with different versions in swagger?

Issue Analytics

  • State:open
  • Created a year ago
  • Reactions:1
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

7reactions
ihordyrmancommented, Apr 5, 2022

@justinyoo thank you for your response. Unfortunately, this is not exactly what I want to achieve.

I’m looking for a way to create a dropdown with available versions in swagger UI. image

1reaction
VultureJDcommented, Jan 17, 2023

+1 to this request. @justinyoo If we could configure multiple IOpenApiConfigurationOptions, that would be ideal. This is how tools like Swashbuckle handle multiple Swagger documents.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Version REST APi as a whole, or by endpoint
A simple method to get most up-to-date versions without negotiation: The client requests the highest version it can handle, for example v3/fruit ...
Read more >
API versioning for multiple endpoints released at different ...
I have a public facing REST API and SDK with multiple resources being managed: /api/v1/foo and /api/v1/bar. Both are currently version 1. I...
Read more >
How to Version a REST API
URI path versioning implies orchestrated releases of application versions that will require one of two approaches: maintaining one version while ...
Read more >
Managing Multiple Versions of Your API with .NET and ...
There are several different approaches to versioning REST APIs in .NET, including using the version number in the URL, using the Accept header, ......
Read more >
Versioning an API | Cloud Endpoints with OpenAPI
Endpoints can run more than one major version of an API concurrently. By providing both versions of the API, your customers can pick...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found