swagger-api / swagger-api/swagger-codegen

[C#] Interfaces created for OneOf not implemented

Open
#12,351 1 comment 1 reaction 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

Description

When I try to generate the C# files for the OAS spec from here (raw), the interfaces generated for the OneOf sections do not have implementations.

image
image
image

This interface has no implementations, so I cannot create a valid request.

Strangely, the interface created is not prefixed with I.

Have I misconfigured something? Am I using the codegen tool incorrectly? Is the OAS not well-structured?

Swagger-codegen version

3.0.54

Swagger declaration file content or url

https://digital.nhs.uk/restapi/oas/324177

Command line used for generation

java -jar .\swagger-codegen-cli.jar generate -i https://digital.nhs.uk/restapi/oas/324177 -l csharp

Steps to reproduce
  1. Run command above.
  2. Navigate to IO.Swagger.Model.OneOfR4PrepareBodyEntryItems

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

Run the reported Java command with the linked OAS document and inspect IO.Swagger.Model.OneOfR4PrepareBodyEntryItems in the generated C# output. Trace the C# generator path that handles the OneOf sections and compare the generated interface with the referenced schema. Done means the generated OneOf types have usable implementations and valid C# naming.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.