Skip to content

Emit a specific error when a cycle is encountered #247

Closed as not planned
Closed as not planned
@czechboy0

Description

@czechboy0
          I was trying out this generator for the first time and triggered this issue. The problem is that the error message can be misleading:

Encountered a JSON Schema $ref cycle that prevents fully dereferencing document at '#/components/schemas/KommentarDTO'. This type of reference cycle is not inherently problematic for JSON Schemas, but it does mean OpenAPIKit cannot fully resolve references because attempting to do so results in an infinite loop over any reference cycles. You should still be able to parse the document, just avoid requesting a locallyDereferenced() copy.

I understood this to mean I have to change some generator config setting to not try to request a locallyDereferenced copy. Spent some time trying to "fix" this first ☺️. Only once I read the source code comment I now understand that there is no workaround at this moment and that the openapi file that I would like to use will not work. I think it would be useful to catch this specific error and state that cyclic jsons are not supported yet?

Originally posted by @hactar in #130 (comment)

Metadata

Metadata

Assignees

Labels

area/generatorAffects: plugin, CLI, config file.kind/enhancementImprovements to existing feature.size/SSmall task. (A couple of hours of work.)

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions