OpenAPITools / OpenAPITools/openapi-generator
[BUG, Spring, JAVA]: $ref to external components is not generating code
Open
Nobody has claimed this yet.
Issue: Bug
- Dominant language
- Java
- Stars
- 26.8k
- Forks
- 7.7k
- PR merge metrics
- PR metrics pending
Description
Description
I cannot generate my code when the specification is referencing to external components.
openapi-generator version
7.5.0
OpenAPI declaration file content or url
SubscriptionDetail:
description: The detail of the requested event subscription
type: object
required:
- type
- device
properties:
device:
$ref: "https://raw.githubusercontent.com/maxl2287/<project>/draft/test-referencing-common-yaml/artifacts/common.yaml#/components/schemas/Device"
Generation Details
Errors:
-Unable to load URL ref: https://github.com/maxl2287/<project>/blob/draft/test-referencing-common-yaml/artifacts/CAMARA_common.yaml
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the OpenAPI declaration in the issue and reproduce generation using openapi-generator 7.5.0 with the external $ref to common.yaml. Trace the reported URL-loading error for the external component; done means the Spring/Java generator resolves that reference and generates code successfully.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, openapi, spring
- Domain
- api, tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100