swagger-api / swagger-api/swagger-codegen

[aspnetcore] is omitting the last method in my spec

Open
#11,750 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

I am trying to generate aspnetcore code for my spec and it is omitting the final method which is POST transactionDocs. No code is generated for this method in the Controllers/GuardianExternalApi.cs like it is for all other methods.

This issue is present on version 3.0.9 onwards. The issue does not exist in version 3.0.8 and previous, so the issue was introduced with 3.0.9.

Here is the spec:
https://app.swaggerhub.com/apis/FundingShield/Guardian/2.2

Here is the command I am using to generate code that is missing the method via the current public docker image:

docker run --rm -v ${PWD}:/local swaggerapi/swagger-codegen-cli-v3 generate \
    -i "https://api.swaggerhub.com/apis/FundingShield/Guardian/2.2" \
    -l aspnetcore \
    -o /local/out/io.swagger.guardian.server2.2 \
    -c /local/swagger-codegen-configs/guardian-server-swagger-codegen.config

Here is the command I am using to generate code that is not missing the method via the public docker image v3.0.8:

docker run --rm -v ${PWD}:/local swaggerapi/swagger-codegen-cli-v3:3.0.8 generate \
    -i "https://api.swaggerhub.com/apis/FundingShield/Guardian/2.2" \
    -l aspnetcore \
    -o /local/out/io.swagger.guardian.server2.2 \
    -c /local/swagger-codegen-configs/guardian-server-swagger-codegen.config

Here are the contents of guardian-server-swagger-codegen.config

{
  "packageName": "IO.GuardianAPI"
}

Thanks in advance,

Joel

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

Reproduce the generation using the linked spec and the supplied Docker commands for versions 3.0.8 and 3.0.9. Compare the generated Controllers/GuardianExternalApi.cs output, focusing on the missing POST transactionDocs method; done means the method is generated in 3.0.9 as it was in 3.0.8.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, docker
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
50/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.