Fix/all of string prop #612
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Current behavior:
When in a defined spec you happen to have a schema defined like this
the conversion process generates a message like this
Expected behavior:
It should generate a message like this:
Issue causes:
In resolveRefs method, we are trying to identify the type of the schema whether it is Array, object, a reference, etc.
But the default behavior is considering the schema as an object
When we have a schema like the one mentioned before, the generated schema for
was
So the allOf merger was trying to merge a schema type object into a schema type string throwing an error and cached by the process adding the message in the result: Error: Could not resolve allOf schema.
The way we resolve:
If we know that we are processing a schema that comes from an allOf parent then we are returning the same schema instead of defaulting to a schema with type as object, and no other properties. So the result of the method is the same
And the merger can merge the string with this sub-schema.