You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
I'm trying to minimize diffs when using yaml-diff-patch on OpenAPI specs like
openapi: 3.0.0paths:
/models/{model}:
get:
# etc
The /models/{model} key gets quoted after a roundtrip.
EDIT: I thought this is an implicit key but I think I misinterpreted the spec, so seems like this is valid?
Question: is it actually a valid key? It seems to parse okay and linting tools seem okay with it. But, I found in your code that you intentionally quote implicit keys containing { or }, and the YAML spec seems pretty clear on this:
In addition, inside flow collections, or when used as implicit keys, plain scalars must not contain the “[”, “]”, “{”, “}” and “,” characters. These characters would cause ambiguity with flow collection structures.
Describe the solution you'd like
If an implicit key like /models/{model} is actually unambiguous, can we have defaultKeyType: 'PLAIN' not quote it?
Describe alternatives you've considered
If using an unquoted key in this form is bad and not technically valid, I'm wondering if there's a good example why it shouldn't be done I can relay back to folks who are outputting YAML in this format?
Additional context
The text was updated successfully, but these errors were encountered:
This will probably require some spelunking in the YAML spec and the codebase to figure out if it the check can be safely relaxed, or if the parser should complain about the input. And if the parser really should complain about the input, then the fix might require a major release because it may break user code.
Given the potential impact and delicacy of the work, receiving some targeted funding would indeed help with its prioritisation. As I'm the only maintainer and Finnish donation laws are rather strict, the only platform that's currently set up to funnel any donations is thanks.dev, though you'll also find me on PayPal as eemeli@gmail.com.
Is your feature request related to a problem? Please describe.
I'm trying to minimize diffs when using
yaml-diff-patch
on OpenAPI specs likeThe
/models/{model}
key gets quoted after a roundtrip.EDIT: I thought this is an implicit key but I think I misinterpreted the spec, so seems like this is valid?
Question: is it actually a valid key? It seems to parse okay and linting tools seem okay with it. But, I found in your code that you intentionally quote implicit keys containing
{
or}
, and the YAML spec seems pretty clear on this:Describe the solution you'd like
If an implicit key like
/models/{model}
is actually unambiguous, can we havedefaultKeyType: 'PLAIN'
not quote it?Describe alternatives you've considered
If using an unquoted key in this form is bad and not technically valid, I'm wondering if there's a good example why it shouldn't be done I can relay back to folks who are outputting YAML in this format?
Additional context
The text was updated successfully, but these errors were encountered: