RapiPdf icon indicating copy to clipboard operation
RapiPdf copied to clipboard

Feature request: Support for x-enumNames

Open andyrooger opened this issue 5 years ago • 1 comments

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 avatar Jun 06 '20 17:06 andyrooger

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.

andyrooger avatar Jun 08 '20 00:06 andyrooger