-
-
Notifications
You must be signed in to change notification settings - Fork 104
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
Simplify uses of resolve-refs
partial
#1773
Conversation
layouts/shortcodes/http-api.html
Outdated
@@ -23,4 +23,7 @@ | |||
{{ $base_url := (index $api_data.servers 0).variables.basePath.default }} | |||
{{ $path := delimit (slice "api" $spec $api) "/" }} | |||
|
|||
{{ partial "openapi/render-api" (dict "api_data" $api_data "base_url" $base_url "path" $path) }} | |||
{{ $api_data = partial "json-schema/resolve-refs" (dict "schema" $api_data "path" $path) }} | |||
{{ $api_data := partial "json-schema/resolve-allof" $api_data }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do we need to call resolve-allof
here now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, it must be a leftover of when I was trying stuff.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed it.
Call it right after accessing the site.Data, since it is recursing it will solve all references in the tree. That way we don't need to wonder where to call it, we trust the validators that the refs will be used in the right place. Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
278446d
to
dcc33eb
Compare
Rebased on main to pass CI |
Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
could you merge rather than rebase next time, please. Rebasing makes it hard to see what has changed since an earlier review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
As discussed in #1749 (comment).
http-api
shortcode was not doing that already.$ref
where it is supposed to be. It depends on Fix security schemes in OpenAPI definitions #1772 for the lint to pass.$ref
inside examples to allow to compose them from other examples, although it is not supported by the OpenAPI and JSON Schema specs.resolve-refs
, even if it doesn't seem to actually be needed because calls to this shortcode point to schemas without$ref
(which is why the bug was unnoticed).Preview: https://pr1773--matrix-spec-previews.netlify.app