Skip to content
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

Add support for external references #9

Closed
lscalese opened this issue Sep 28, 2023 · 1 comment
Closed

Add support for external references #9

lscalese opened this issue Sep 28, 2023 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@lscalese
Copy link
Owner

Some specifications contain external reference like ref: ../common
Add a support using validator.swagger.io tools.

@lscalese lscalese added the enhancement New feature or request label Sep 28, 2023
@lscalese lscalese self-assigned this Sep 28, 2023
@lscalese lscalese changed the title Add support for external reference Add support for external references Sep 28, 2023
lscalese added a commit that referenced this issue Sep 28, 2023
lscalese added a commit to lscalese/openapi-common-lib that referenced this issue Sep 28, 2023
@lscalese
Copy link
Owner Author

lscalese commented Sep 28, 2023

The service https://validator.swagger.io/ allows resolving a specification with external references.
It just needs parameters resolveFully=true and validateExternalRefs=true

The class SpecificationLoader.cls has been updated to use these parameters if a URL is used to generate the code.

Resolving external references won't be possible if we specify a file instead of a URL.

I also fixed code generation problems with special characters with property names.
Some properties contain _-@

A fix version has been pushed on OEX OpenAPI-suite 1.0.1.

I tested with 3 code generation modes the DID Manager, It looks good, no compile error with the generated code:

Set link = "https://nuts-node.readthedocs.io/en/stable/_static/didman/v1.yaml"
Set sc = ##class(dc.openapi.server.ServerAppGenerator).Generate("dc.Theo.srv",link)
Set features("simpleHttpClientOnly") = 1
Set sc = ##class(dc.openapi.client.Spec).generateApp("dc.Theo.cli", link, .features)
Set sc = ##class(dc.openapi.client.Spec).generateApp("dc.Theo.prd",link)

gen-output.txt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant