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

Feature request: Support for x-enumNames #59

Open
andyrooger opened this issue Jun 6, 2020 · 1 comment · May be fixed by #60
Open

Feature request: Support for x-enumNames #59

andyrooger opened this issue Jun 6, 2020 · 1 comment · May be fixed by #60

Comments

@andyrooger
Copy link
Contributor

This is a custom property from NSwag. So e.g. a C# enum looks like the following in the OpenAPI spec:

public enum DataType {
    String,
    Integer
}
{
    ...
    "DataType": {
        "type": "integer",
        "description": "",
        "x-enumNames": [
            "String",
            "Integer"
        ],
        "enum": [
            1,
            2
        ]
    }
    ...
}

The RapiPDF doc currently tells users they can use 1 or 2 which is technically correct, but not so helpful. We can add a description manually, but it would be great to take this information from the spec automatically when it's available.

andyrooger added a commit to andyrooger/RapiPdf that referenced this issue Jun 6, 2020
@andyrooger andyrooger linked a pull request Jun 6, 2020 that will close this issue
@andyrooger
Copy link
Contributor Author

Still quite useful but in the meantime I've realised that I can work around this in NSwag by turning on the "generateEnumMappingDescription": true, option in nswag.json to generate the mappings as a description.

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

Successfully merging a pull request may close this issue.

1 participant