This PR updates the custom Swagger templates to leverage updates incorporated in Swagger v2.2.3. The updated v2.2.3 default templates may be found here, which resolve a number of issues that had previously been worked around with the modified templates. For instance, handling long types in Python 2 is now supported. Thus, I was able to remove some of the custom patches when applying these updates. The updated templates also offer some additional input validation, so for example, the length of a string will now be checked according to its maxLength and minLength properties and its pattern property will now be used for a regular expression match.
Due to some issues in the OneFS schemas, two additional workaround were required. First, since Swagger v2.2.3 does not support multi-types, I had to add a check to ensure that primitive data types would not be parsed as collections, since some properties in the response objects can either be primitives or collections. Second, some required properties can actually appear as null in the response object. This is being addressed by removing the required property in these cases.
This PR updates the custom Swagger templates to leverage updates incorporated in Swagger v2.2.3. The updated v2.2.3 default templates may be found here, which resolve a number of issues that had previously been worked around with the modified templates. For instance, handling
long
types in Python 2 is now supported. Thus, I was able to remove some of the custom patches when applying these updates. The updated templates also offer some additional input validation, so for example, the length of a string will now be checked according to itsmaxLength
andminLength
properties and itspattern
property will now be used for a regular expression match.Due to some issues in the OneFS schemas, two additional workaround were required. First, since Swagger v2.2.3 does not support multi-types, I had to add a check to ensure that primitive data types would not be parsed as collections, since some properties in the response objects can either be primitives or collections. Second, some required properties can actually appear as
null
in the response object. This is being addressed by removing therequired
property in these cases.