Fixed issue where spec with resource listings were not handled. #21
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.
Overview
This PR fixes conversion from swagger 1.2 definitions that had resource listings in them. Previously, such definitions would throw a TypeError. With this PR we'll handle such definitions in more simpler way by creating a simple GET endpoint for each API path.
We're also introducing support for throwing UserErrors in the case when the issue is with User definitions.
RCA
Swagger v1.2 definitions can have either Resource listing or API Declaration as value of
apisfield. (Ref). When resource listing are present, till now we tried to read the provided resource which always resulted in TypeError since we're never able to access local files mentioned in definition.Solution
We're making changes to create very simple collection with GET operation and path instead of providing TypeError. We're also adding support for UserErrors and report errors as such when applicable.