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

examples property is not added to the comment alongside decription #4999

Open
herme063 opened this issue Oct 14, 2024 · 0 comments
Open

examples property is not added to the comment alongside decription #4999

herme063 opened this issue Oct 14, 2024 · 0 comments

Comments

@herme063
Copy link

I added example in my json schema:

"type": "object",
"properties": {
    "joke": {
        "modelReference": "http://www.test.com#Something.joke",
        "type": "string",
        "description": "This is to tell a joke",
        "examples": [
            "What did one hat say to the other?",
            "You wait here. I’ll go on a head."
        ]
    }
}

The generated property is missing the examples:

/// <summary>
/// This is to tell a joke
/// </summary>
[Newtonsoft.Json.JsonProperty("joke", 
    Required = Newtonsoft.Json.Required.Default, 
    NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public string Joke { get; set; }

How do I enable this in the generated class?

I using Nswag.exe openapics2client command version v13.18.2.0.

I tried to embed the <example> in the description field, but it gets replaced with html code &lt;example&gt;

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

1 participant