RapiDoc icon indicating copy to clipboard operation
RapiDoc copied to clipboard

Scherma property type "string" gets rendered incorrectly when followed by enum

Open DanielaGordas opened this issue 3 years ago • 3 comments

Hi @mrin9,

When the property type is string and it is followed by a list of enum the type gets incorrectly rendered in the schema as enum instead of string like in the example below:

Screenshot 2022-09-20 at 10 26 21 Screenshot 2022-09-20 at 10 12 24

Using openapi: 3.1.0

I was wondering if there is any quick fix for this? Thanks in advance!

DanielaGordas avatar Sep 20 '22 08:09 DanielaGordas

this is more of a feature than a bug. When the schema has more than just the type such as enum, format or is it nullable etc, we prefer showing more specific one. This is what we found is desired in most cases.

image

mrin9 avatar Sep 20 '22 14:09 mrin9

Thanks for the quick reply and for the explanation. I can see why that's preferred in many of the cases listed.

Is there any workaround to still display the type as string but also use the enum to list the allowed options?

Thanks!

DanielaGordas avatar Sep 21 '22 10:09 DanielaGordas

there is none at the moment. I have added this question in our next internal user-survey. will keep this issue open for some time for our open source community users to vote/comment on it

mrin9 avatar Sep 21 '22 15:09 mrin9