-
-
Notifications
You must be signed in to change notification settings - Fork 240
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
Falsely Identifying Strings as Octals #936
Falsely Identifying Strings as Octals #936
Comments
@raworre Indeed, this seems strange to me as well. The doco states And YAML specs are pretty clear with regards to expected formats: YAML 1.2 tags (https://yaml.org/spec/1.2/spec.html#id2761292) vs YAML 1.1 tags (https://yaml.org/spec/1.1/#id858600) And the regexp to validate them
@P0lip any idea? |
@nulltoken yeah, seems indeed to be a bug. On it EDIT: |
@P0lip Dammit! You're right! Maybe should the doco be updated to reflect that (along with links to the proper parts of the YAML 1.2 specs)? |
Yeah, that's indeed a good idea. |
Falsely Identifying Strings as Octals
Issue Description
When linting OpenAPI 3.x.x specifications, Spectral lint is not appropriately
parsing strings per the YAML specification. This issue seems to present itself
when strings that are made up of numbers that begin with the digit
0
, andcontain the digits
8
or9
, are not quoted in the OpenAPI specification.Since these are not valid octal strings, Spectral should be parsing these as
the YAML !!str type as opposed to the
!!int type.
Steps to Reproduce
When linting the above OpenAPI specification, we get the following error.
In the example above, the error at location
44:13
references the array exampleitem
08
.Spectral seem to be incorrectly interpereting these values as octals rather than
strings.
Expected Behavior
Per the YAML specification, the given example should be valid.
Environment
The text was updated successfully, but these errors were encountered: