Ask a Question

oneOf always rendered in the bottom of an object

SOLVED
HenrikHL
Contributor

oneOf always rendered in the bottom of an object

Hi,

I have been fighting a little with this and I can simply not get the following to render in "correct order":

HenrikHL_0-1673451054960.png

Whenever I declare something using the oneOf - it always renders in the bottom of the object (in the image above called object1). I would like the oneOf to be rendered above the attribute henrik.

Is this possible? And if not - why not?

5 REPLIES 5
HenrikHL
Contributor

It would be super nice if the SwaggerHub team (or anybody else) could answer if this is intended behavior or a bug...

Rache1
SmartBear Alumni (Retired)

Hi @HenrikHL I have asked our team and will let you know as soon as I have an answer. Apologies and thank you for your patience. 

HenrikHL
Contributor

Thanks @Rache1 looking forward to hear what they say 🙂

tlai
SmartBear Alumni (Retired)

@HenrikHL Thank you for your question. SwaggerUI renders the schema models based on a predefined list of model types, and it is happenstance that "oneOf" is last to get parsed and rendered. There is no intentional ordering of "priorities" per se. So in this case, a schema model of a (default) "property" will get rendered first, followed by "allOf", then "oneOf".

 

HenrikHL
Contributor

Thank you @tlai for the explanation.

cancel
Showing results for 
Search instead for 
Did you mean: