Simplify uses of resolve-refs partial#1773
Merged
richvdh merged 6 commits intomatrix-org:mainfrom Apr 9, 2024
Merged
Conversation
richvdh
reviewed
Apr 9, 2024
layouts/shortcodes/http-api.html
Outdated
|
|
||
| {{ 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 }} |
Member
There was a problem hiding this comment.
why do we need to call resolve-allof here now?
Contributor
Author
There was a problem hiding this comment.
Sorry, it must be a leftover of when I was trying stuff.
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
Contributor
Author
|
Rebased on main to pass CI |
Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
Member
could you merge rather than rebase next time, please. Rebasing makes it hard to see what has changed since an earlier review. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
As discussed in #1749 (comment).
http-apishortcode was not doing that already.$refwhere it is supposed to be. It depends on Fix security schemes in OpenAPI definitions #1772 for the lint to pass.$refinside 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