Skip to content

Resolve external value#95

Closed
rv1971 wants to merge 2 commits intocebe:masterfrom
rv1971:resolve-external-value
Closed

Resolve external value#95
rv1971 wants to merge 2 commits intocebe:masterfrom
rv1971:resolve-external-value

Conversation

@rv1971
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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.

2 participants