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
This mean that if I pass in
nifty_module/src/main/java/NiftyClass.java
as value for path, the final URL will be
/rest/api/1.0/projects/nifty_project/repos/nifty_repo/raw/nifty_module%2Fsrc%2Fmain%2Fjava%2FNiftyClass.java
instead of
/rest/api/1.0/projects/nifty_project/repos/nifty_repo/raw/nifty_module/src/main/java/NiftyClass.java
and in the end a 404.
Now I am the first to admit that I am not a super, duper swagger coder so maybe there is some setting or parameter that I can set to get me out of the problem. I have however not found any such information so for now I consider it a problem in the generated code.
openapi-generator version
7.3.0 and 7.5.0
OpenAPI declaration file content or url
"/api/1.0/projects/{projectKey}/repos/{repositorySlug}/raw/{path}":
parameters:
- description: the parent project keyin: pathname: projectKeyrequired: truetype: string
- description: the repository slugin: pathname: repositorySlugrequired: truetype: string
- description: the file path to retrieve content fromin: pathname: pathrequired: truetype: stringget:
operationId: retrieveRawContentdescription: |- Retrieve the raw content for a file path at a specified revision. <p> The authenticated user must have <strong>REPO_READ</strong> permission for the specified repository to call this resource.parameters:
- description: the commit ID or ref to retrieve the content for.in: queryname: atrequired: falsetype: string
- description: |- if present or <code>"true"</code>, triggers the raw content to be markup-rendered and returned as HTML; otherwise, if not specified, or any value other than <code>"true"</code>, the content is streamed without markup in: query name: markup required: false type: string
- description: |- (Optional) Whether the markup implementation should convert newlines to breaks. If not specified, {@link MarkupService} will use the value of the <code>markup.render.hardwrap</code> property, which is <code>true</code> by default in: query name: hardwrap required: false type: boolean
- description: |- (Optional) true if HTML should be escaped in the input markup, false otherwise. If not specified, {@link MarkupService} will use the value of the <code>markup.render.html.escape</code> property, which is <code>true</code> by default in: query name: htmlEscape required: false type: booleanresponses:
"200":
description: Successful Response
Bug Report Checklist
Description
When declaring /api/1.0/projects/{projectKey}/repos/{repositorySlug}/raw/{path},
{path} is URL encoded.
Generated code is
This mean that if I pass in
nifty_module/src/main/java/NiftyClass.java
as value for path, the final URL will be
/rest/api/1.0/projects/nifty_project/repos/nifty_repo/raw/nifty_module%2Fsrc%2Fmain%2Fjava%2FNiftyClass.java
instead of
/rest/api/1.0/projects/nifty_project/repos/nifty_repo/raw/nifty_module/src/main/java/NiftyClass.java
and in the end a 404.
Now I am the first to admit that I am not a super, duper swagger coder so maybe there is some setting or parameter that I can set to get me out of the problem. I have however not found any such information so for now I consider it a problem in the generated code.
openapi-generator version
7.3.0 and 7.5.0
OpenAPI declaration file content or url
Generation Details
The example is an extract of the REST API for BitBucket, version 1.0
Full files can be found at
https://github.com/TwoStone/bitbucket-server-api/blob/master/bitbucket-server-api.yaml
and
https://github.com/gfleury/go-bitbucket-v1/blob/master/docs/bitbucketV1-rest-swagger.yaml
Note that one file is swagger 2.0 and one is openapi 3.0; both result in the same generation.
Steps to reproduce
Run the example files using the standard maven plugin and inspect the generated code.
Just look for any operation with {path} as the a parameter.
Related issues/PRs
Suggest a fix
The text was updated successfully, but these errors were encountered: