docusaurus-openapi-docs icon indicating copy to clipboard operation
docusaurus-openapi-docs copied to clipboard

When adding a ":" symbol in the URL, an error occurs during the request

Open LGodzilla opened this issue 2 years ago • 6 comments

Documentation link

buildPostmanRequest Github Docs

//buildPostmanRequest.ts


function setPathParams(postman: sdk.Request, queryParams: Param[]) {
  const source = queryParams.map((param) => {
    return new sdk.Variable({
      key: param.name,
      value: param.value || `:${param.name}`,
    });
  });
  postman.url.variables.assimilate(source, false);
}


yaml

paths:
  /User/{id}/page:get:
    parameters:
      - name: id
        in: path
        description: 
        required: true
        schema:
          type: string
          format: 9527

baseUrl: https://api.user.server ↗ path: /User/{id}/page:get Compiled path: /User/:id/page:get The variable {id} has been transformed to ":id" and the constant ":get" to a similar format, where "id" is a variable and ":get" is a fixed parameter. Assuming the id is 9527, When clicking "Send API Request", The desired outcome is: https://api.user.server/User/:9527/page:get

However, the current result is: https://api.user.server/

The path content is missing. I would like to add ":" in the path to support filling without the need for "/" and ensure normal request functionality.

LGodzilla avatar Sep 06 '23 12:09 LGodzilla

:tada: Thanks for opening your first issue here! Welcome to the community!

Is there any news about this bug? we are encountering the same issue with generating open API documentation as well as the request is also broken with an invalid link

ovidiukiss avatar Nov 28 '23 15:11 ovidiukiss

Hi @ovidiukiss, could this be related to #663? If so, can you try the latest canary release to see if that resolves the issue? Thanks.

sserrata avatar Nov 28 '23 15:11 sserrata

@sserrata will take a look, thanks!

ovidiukiss avatar Nov 28 '23 15:11 ovidiukiss

Canary release 0.0.0-689 still have the issue.

openapu server url: //locahost:8080 openapi path: /records/{record_id}:publish generated code path: //localhost:8080 expected path: /records/abc:publish

20231222162003 20231222162015

livelxw avatar Dec 22 '23 08:12 livelxw

@blindaa121 any updates?

sserrata avatar Jun 28 '24 19:06 sserrata