OpenAPITools / OpenAPITools/openapi-generator

[BUG] Using a path with a $ sign in it results in an error

Open
#7,162 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Issue: Bug
Dominant language
Java
Stars
26.8k
Forks
7.7k
PR merge metrics
PR metrics pending

Description

Bug Report Checklist
  • [x ] Have you provided a full/minimal spec to reproduce the issue?
  • Have you validated the input using an OpenAPI validator (example)?
  • [x ] What's the version of OpenAPI Generator used?
  • [x ] Have you search for related issues/PRs?
  • What's the actual output vs expected output?
  • [Optional] Bounty to sponsor the fix (example)
Description

In an openapi file I want to specifiy a path with a $ symbol. eg:
/ActivityDefinition/{id}/$apply:
This is to define a FHIR-server like api.

openapi-generator version

4.3.1 and 5.0.0-snapshot using the docker images at: https://hub.docker.com/r/openapitools/openapi-generator-cli/

OpenAPI declaration file content or url

Use as a path:
/ActivityDefinition/{id}/$apply:

Generation Details

I used Docker image from https://hub.docker.com/r/openapitools/openapi-generator-cli/

docker run --rm -v ${PWD}:/local openapitools/openapi-generator-cli:v4.3.1 generate -i /local/myFile.yaml -g openapi-yaml -o /local/output

or (latest is currently 5.0.0-snapshot

docker run --rm -v ${PWD}:/local openapitools/openapi-generator-cli generate -i /local/myFile.yaml -g openapi-yaml -o /local/output

Steps to reproduce

Take an yaml file with a path like : /ActivityDefinition/{id}/$apply:

Related issues/PRs

Not found

Suggest a fix

This path is accepted in online editors like:
https://mermade.github.io/openapi-gui/
https://editor.swagger.io/

This should be accepted may be when quoting to complete path

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the reported /ActivityDefinition/{id}/$apply: path in myFile.yaml and run the provided openapitools/openapi-generator-cli Docker command using generator version 4.3.1 or the 5.0.0 snapshot. Confirm the failure and compare it with a path without the $ sign. Done means the path is accepted and generation completes successfully.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, java, openapi, yaml
Domain
api, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.