Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid Route Path Error #86

Closed
chandra-rayaprol opened this issue Apr 8, 2021 · 4 comments
Closed

Invalid Route Path Error #86

chandra-rayaprol opened this issue Apr 8, 2021 · 4 comments
Labels
question Further information is requested resolved Request has been resolved

Comments

@chandra-rayaprol
Copy link

Initializing the Route parameter in the HTTPAttribute is resulting in undefined path errors in the generated swagger file. Could you please advise?

// Swagger Errors
{"messages":[""attribute paths.'/AddUserAccount'(post).responses is missing","attribute paths.'/Account/DeleteUserAccount'(delete).responses is missing","attribute]
}
public async Task<IActionResult> AddUserAccount( [HttpTrigger(AuthorizationLevel.Function, "post", Route = "AddUserAccount")] HttpRequest req, ILogger log) { // await azureAccount.AddUserAccount(req.Claims()); return new OkResult(); }
`

@chandra-rayaprol chandra-rayaprol changed the title Invalid ROutPath Error Invalid Route Path Error Apr 8, 2021
@justinyoo
Copy link
Contributor

@RaysApps Have you added [OpenApiResponseWithBody()] or [OpenApiResponseWithoutBody()] decorators?

This document helps you: https://github.com/Azure/azure-functions-openapi-extension/blob/main/docs/enable-open-api-endpoints.md#enable-openapi-document

@justinyoo justinyoo added question Further information is requested resolved Request has been resolved labels Apr 9, 2021
@chandra-rayaprol
Copy link
Author

Thank you for sharing the relevant doc. I've migrated a lot of Asp.net core web APIs to Azure HTTP functions and noticed invalid errors in the swagger UI after publishing to Azure. Is it possible to report them as errors at build time?

@danielabbatt
Copy link
Contributor

danielabbatt commented Apr 10, 2021 via email

@justinyoo
Copy link
Contributor

@RaysApps @danielabbatt That's a good idea! Let me dig into it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested resolved Request has been resolved
Projects
None yet
Development

No branches or pull requests

3 participants