Giter Site home page Giter Site logo

Comments (8)

marceloodiniz avatar marceloodiniz commented on May 26, 2024 1

@justinyoo, the new version (v0.6.0-preview) did NOT resolved my problem!

from azure-functions-openapi-extension.

justinyoo avatar justinyoo commented on May 26, 2024

@marceloodiniz Unfortunately, I'm not able to reproduce your issue on my end.

Here's the screenshot I presented at Global Integration Bootcamp about less than a month ago, which uses the same v0.5.1-preview.

image

Can you please try the sample code in this repo and check if it's working or not on your end?

from azure-functions-openapi-extension.

marceloodiniz avatar marceloodiniz commented on May 26, 2024

Hi @justinyoo.

I get the sample project and have the same problem:

image

If I change the swagger.json url on Swagger UI to use HTTPS, it works:

image

Maybe is some config on Function App.

from azure-functions-openapi-extension.

jscheeres avatar jscheeres commented on May 26, 2024

Same issue here

from azure-functions-openapi-extension.

justinyoo avatar justinyoo commented on May 26, 2024

@marceloodiniz Thanks for the issue! A new version, v0.6.0-preview, has been released and if I use the new version, it sorts out your issue from my end. Could you please have a look and let us know?

from azure-functions-openapi-extension.

justinyoo avatar justinyoo commented on May 26, 2024

@marceloodiniz As I haven't heard from you for a while, I'm closing this issue for now. If you still have the same issue, please open a new one and link to this.

from azure-functions-openapi-extension.

mikemassa84 avatar mikemassa84 commented on May 26, 2024

@justinyoo, I am having the same issue and narrowed the cause down to running a function app on a Linux hosted app service plan.

Here is what I found:

  • Windows Consumption Plan - Success
  • Linux Consumption Plan - Success
  • Linux Hosted Plan (P1v2) - Failure

You can see the error here:
https://openapitestl.azurewebsites.net/api/swagger/ui

I used the same function code on each plan. It is the Function1 template that is created by Visual Studio (2019) when picking the Http trigger with OpenAPI option.

public static class Function1
{
	[FunctionName("Function1")]
	[OpenApiOperation(operationId: "Run", tags: new[] { "name" })]
	[OpenApiSecurity("function_key", SecuritySchemeType.ApiKey, Name = "code", In = OpenApiSecurityLocationType.Query)]
	[OpenApiParameter(name: "name", In = ParameterLocation.Query, Required = true, Type = typeof(string), Description = "The **Name** parameter")]
	[OpenApiResponseWithBody(statusCode: HttpStatusCode.OK, contentType: "text/plain", bodyType: typeof(string), Description = "The OK response")]
	public static async Task<IActionResult> Run(
		[HttpTrigger(AuthorizationLevel.Function, "get", "post", Route = null)] HttpRequest req,
		ILogger log)
	{
		log.LogInformation("C# HTTP trigger function processed a request.");

		string name = req.Query["name"];

		string requestBody = await new StreamReader(req.Body).ReadToEndAsync();
		dynamic data = JsonConvert.DeserializeObject(requestBody);
		name = name ?? data?.name;

		string responseMessage = string.IsNullOrEmpty(name)
			? "This HTTP triggered function executed successfully. Pass a name in the query string or in the request body for a personalized response."
			: $"Hello, {name}. This HTTP triggered function executed successfully.";

		return new OkObjectResult(responseMessage);
	}
}

from azure-functions-openapi-extension.

justinyoo avatar justinyoo commented on May 26, 2024

@mikemassa84 Thanks for the issue! It seems that we would need to raise the issue to the other place because it looks more relevant to the instance itself, rather than this library. Would you please raise the issue to here and tag this issue?

from azure-functions-openapi-extension.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.