menes-dotnet/Menes

OpenApiSchemaValidator should check whether schema items represent unresolved references before using them to validate against

jongeorge1 opened this issue · 0 comments

Describe the bug

OpenApiSchema instances have a flag UnresolvedReference which indicates that the instance is a placeholder reference to an actual schema, and that the current instance does not contain valid data.

At the moment, we do not handle this and as a result we map unresolved references to object types, meaning that if the reference is actual to an array item then validation will fail. There may be further ramifications; this is the scenario I have encountered so far.

We need to determine what the correct behaviour is if a reference is unresolved; should we attempt to resolve the reference manually, throw an exception or skip validation for unresolved items? We also have the option of allowing this behaviour to be controlled by the caller.