-
Notifications
You must be signed in to change notification settings - Fork 533
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Parser (v3) doesn't handle "enum" when "format" demands decoding a string #1049
Comments
Found in 2.0.9 |
Hi @kerrykimbrough can you please send us a PR to speed things up, if you have a possible solution, if you don't just a PR with a test which should fail until fixed. Thanks. |
OK, PR is on the way |
kerrykimbrough
added a commit
to kerrykimbrough/swagger-parser
that referenced
this issue
Mar 26, 2019
…atted string values using getDecodedObject()
gracekarina
added a commit
that referenced
this issue
Apr 13, 2019
(issue #1049) OpenAPIDeserializer: Rework handling of formatted string values using getDecodedObject()
closed by #1062 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
See attached example. Consider the schema for
param0
, which has type=string and format=date-time.Because of this format, an instance of
DateTimeSchema
is created. Then to handle the "enum" array,OpenAPIDeserializer.getSchema()
iterates over eachTextNode
in the array, callingDateTimeSchema.addEnumItemObject()
with the corresponding String value. This invokesDateTimeSchema.cast()
, which should decode the String as an RFC3339 date-time.But it doesn't. Instead, since a String is not a Date, it just substitutes null. Yikes!
The same problem occurs with other string formats that required decoding, specifically "byte" and "date".
string-8.json.txt
The text was updated successfully, but these errors were encountered: