Apicurio / apicurio-studio

Open Source API Design
https://www.apicur.io/studio/
Apache License 2.0
983 stars 493 forks source link

Editor flags oneOf / anyOf as issue on array items #1805

Open Stwissel opened 2 years ago

Stwissel commented 2 years ago

We have a need to specify a data type array where the members must be of one type. When adding such a definition:

            type: array
            anyOf:
                -
                    items:
                        type: number
                -
                    items:
                        type: string

the editor flags it as issue:

When I add another type for items, the second error gets repeated once more.

I check the result: The swagger editor loads it, the online validator is happy, ReDoc correctly identifies it (see screenshot below - from an extended example). Is this a bug in the Editor?

Screenshot 2022-02-08 at 11 15 50 PM

EricWittmann commented 2 years ago

Thank you for the bug report. I'll need to dig into this. It could very easily be a bug in our validation layer. Or it could be something that's not actually technically allowed but everyone does it anyway. Most of our validation rules come straight from the OpenAPI spec, but that doesn't mean we've understood it correctly or implemented it correctly. I'll take a look.

Stwissel commented 2 years ago

Appreciate your help here. If I can assist, let me know. The various validators (including the one in vert.x) seem to be OK with it. Btw. you still have access to the API in question (14792)