swagger-api / swagger-api/swagger-codegen

[aspnetcore] Server generation does not manage pipeline context properly

Open
#9,233 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Mustache
Stars
17.8k
Forks
6k
PR merge metrics
No merged PRs in 30d

Description

The server asp.net core code generated by Swagger.editor, does not work properly.
When you execute the UI from Visual studio 2017, you are not able to try the API because you always get a 404 error saying that the operators and the channel property are missing (both of them are mandatory)

By debugging the code, seems clear that the two propeties are not part of the context.ActionArguments checked in the ValidateModelStateAttribute class.

I am using the file generate by the current version of https://editor.swagger.io/

Here is the definition file:

swagger-original.zip

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Inspect the generated ASP.NET Core server and the ValidateModelStateAttribute mentioned in the report. Reproduce the 404 with the attached Swagger definition in Visual Studio 2017, then verify that operators and channel reach ActionArguments and the API request no longer fails because they are missing.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
api, backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.