Closed ESchouten closed 9 months ago
huh... out of curiosity, do you know if this is actually invalid json schema? or is this just causing issues w/ ReDoc and their parser?
Either way, worth fixing in the next version of Kompendium, but, this project has fallen pretty far off my personal priorities, so, can't guarantee when the next release will be. Hopefully some time early 2024, will probably wait for Ktor 3 to come out and fix up any compatibility issues that occur as well.
@unredundant I am not sure, my OpenAPI client generator does not fall over this difference, just Redoc, so it could be either way
fwiw, the intellij openapi inspection tool (this screenshot is inspecting one of the kompendium tests) is powered by redoc, and seems to render totally fine.
With that said, from poking around the json schema docs, it does seem like the general expectation for enums is that they omit the type
value.
So, i'm guessing that this is technically a bug in Kompendium, but one that only impacts certain versions of redoc.
will be fixed in v4 :)
oh nvm i forgot this was only for list
can replicate error now :)
oh man I definitely just did something dumb in the code haha
"schemas": {
"TestEnum": {
"$ref": "#/components/schemas/TestEnum"
},
"List-TestEnum": {
"items": {
"enum": [
"YES",
"NO"
]
},
"type": "array"
}
},
for some reason, when the code hits a type of List<Enum>
it puts the type information inside of the list schema, and then just does a self reference inside of the actual enum definition.
Describe the bug v3.6.0, PR #368 breaks redoc when an endpoints return type contains a list of Enums. Redoc error: Error: "Self-referencing circular pointer"
When inspecting the generated components/models the following difference is observed; since 3.6.0 the lists items property contains
"type": "string"
v3.5.0:v3.6.0: