-
Notifications
You must be signed in to change notification settings - Fork 158
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
Use +
as marker for path parameters when splitting a specification
#1336
Comments
Spoke too soon... The |
#
as marker for path parameters when splitting a specification+
as marker for path parameters when splitting a specification
Hi @meden, |
Note: This might be tangentially related to #1285. |
@tatomyr definitely, sorry for using the wrong template.
Indeed it would be the "safest" and most flexible solution. A possible way to do it could be something like a parameter:
E.g. the current behavior would correspond to the parameter:
Having no enclosing characters should also be allowed. |
When you say "refer" do you mean using Here is a working example: https://github.com/Rebilly/api-definitions/blob/main/openapi/openapi.yaml#L621-L622 |
I'm not talking about escaping in YAML, but referring the file in a shell (e.g. by hitting I'm asking to have a way to produce file names without special characters. BTW, at least with this IntelliJ IDEA plugin, using curly braces in |
Ran into this issue as well. I actually do think it is a bug. The CLI is creating invalid URIs. I spent quite a bit of time
Default behavior should produce valid URIs and then let people change it to { } if that's what they want. |
~ seems to be a good character and it is infrequently used in text |
Changing the default behaviour is probably not an option until the next major release, since it will break a large number of existing workflows. However I think either |
Sounds good, just allowing an alternative option would be great. In the end
I blame the spec writera for their not specifying a format that is a valid
uri 😄
…On Tue, Jun 4, 2024 at 2:16 AM Lorna Jane Mitchell ***@***.***> wrote:
Changing the default behaviour is probably not an option until the next
major release, since it will break a large number of existing workflows.
However I think either + or ~ should be considered as an optional
parameter to use so that we can make this functionality available sooner.
—
Reply to this email directly, view it on GitHub
<#1336 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAKWZQ3CN2T2EDA2MI7T3D3ZFWAYNAVCNFSM6AAAAAA7TECLEKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNBXGAZDINJTHA>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Found another parsing library in Python that also throws exceptions when there is a {} in the ref path. https://github.com/manchenkoff/openapi3-parser
|
I think it’s a broader issue. There are also problems with certain symbols on Windows. We might need a configuration option for the split:
'{': '+'
'}': '+'
':': _ This could also be a good place to configure the root path item ( @RomanHotsiy @adamaltman what do you think? |
Describe the bug
When splitting an existing specification, and individual path files are generated, the parameters in path are enclosed in
{}
in the names of corresponding generated path files.The characters
{
and}
need escaping when referred in Linux shell, and this makes harder to manage them.To Reproduce
Steps to reproduce the behavior:
redocly.yaml
fileopenapi-bundle.yaml
file having at least one endpoint with path parametersopenapi split openapi-bundle.yaml --outDir ./split
paths/book_\{bookId\}.yaml
Expected behavior
It would be preferable to have filenames without special characters in their names.
A good candidate seems to be
#
+
, as it looks like it is not needing any escaping in Windows. To preserve retro-compatibility, the marker character could eventually be configurable.Redocly Version(s)
1.0.0-beta.125
Node.js
Version(s)v18.13.0
The text was updated successfully, but these errors were encountered: