-
Notifications
You must be signed in to change notification settings - Fork 6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Pre-calculate type aliases before processing models (#6559)
A type alias in this context is where a model is simply another name for a primitive type, such as `MyString` in the following model definitions: MyList: type: array items: $ref: '#/definitions/MyString' MyString: type: string It is valid to use a type alias as a property in another object or array model, even if the object/array is defined before the alias is, as in the example above. However, the current alias logic only looks "back" in list of previously defined models, meaning that `MyList` would not know that `MyString` is an alias. This change fixes the incorrect behavior by pre-calculating the list of aliases before any models are processed. It also changes the test endpoint to verify the correct behavior even when an object is defined before an alias it uses.
- Loading branch information
Showing
3 changed files
with
38 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters