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

Swagger Docu doesn't shows example values #2654

Closed
tualatin opened this issue May 25, 2023 · 1 comment
Closed

Swagger Docu doesn't shows example values #2654

tualatin opened this issue May 25, 2023 · 1 comment

Comments

@tualatin
Copy link

tualatin commented May 25, 2023

Create a OpenAPI spec, add a simple property like this

[...] 
    testProperty:
      description: For test only
      type: string
      example: Test-Test-Test
[...]

Start the latest openapi generator 2.6.0 (6.6.0) and let create the C# code. Take a look into the created class, you will find this

[...]
/// <sumary>
/// For test only
/// </sumary>
/// <value>For test only</value>
/// <example>&quot;Test-Test-Test&quot;</example>
[DataMember(Name="testProperty", EmitDefaultValue=false)]
public string TestProperty { get; set; }
[...]

Start your application and take a look into your swagger doc. The example value is ignored! When you remove the "&quot;" from the example XML comment, than the example value is available.

The example value should shown, when the text is in " parts.

@dldl-cmd
Copy link
Contributor

dldl-cmd commented Oct 7, 2023

Duplicate of #2088

@martincostello martincostello closed this as not planned Won't fix, can't repro, duplicate, stale Apr 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants