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

Resolve external value #95

Closed
wants to merge 2 commits into from
Closed

Conversation

rv1971
Copy link
Contributor

@rv1971 rv1971 commented Jan 5, 2021

When resolving references, relative URIs in externalValue properties are adjusted just the same way as in $ref properties.

rve added 2 commits January 5, 2021 18:55
When resolving references, relative URIs in `externalValue` properties are
adjusted just the same way as in `$ref` properties.
@cebe
Copy link
Owner

cebe commented Jan 5, 2021

thanks for the suggestion, however external values should not be included like references, see:

http://spec.openapis.org/oas/v3.0.3#fixed-fields-15

[...]
externalValue string A URL that points to the literal example. This provides the capability to reference examples that cannot easily be included in JSON or YAML documents. The value field and externalValue field are mutually exclusive.

@cebe cebe closed this Jan 5, 2021
@rv1971
Copy link
Contributor Author

rv1971 commented Jan 6, 2021

I'm afraid you misunderstood the point.

Example: you have a path item p which is a reference to an external file p.json in a subdirectory s. The file p.json contains an externalValue whose value is a relative URI pointing to an external example file, say example.xml. When resolving the reference in p, the URI in externalValue must be adjusted to s/example.xml. It is a bug not to adjust it.

Fortunately you have already solved exactly the same problem for references. Any reference in p.json which is a relative URI is correctly adjusted. It is sufficient to do exactly the same for externalValue properties.

Pls let me know if anything is unclear.

@cebe cebe reopened this Feb 16, 2021
@cebe cebe added this to the 1.6.0 milestone Feb 16, 2021
@cebe cebe self-assigned this Feb 16, 2021
@cebe
Copy link
Owner

cebe commented Feb 16, 2021

thanks for the explanation, will check it again.

@cebe cebe modified the milestones: 1.6.0, 1.5.2 May 24, 2021
@cebe cebe added the bug Something isn't working label May 24, 2021
@cebe cebe closed this in 4257bc6 May 24, 2021
@cebe
Copy link
Owner

cebe commented May 24, 2021

FIxed, thanks for reporting!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants