We used to only look for examples in a few (sometimes arbitrary) places, and we didn't support showing several examples in most cases. This is intended to fix this. In the process we try to deduplicate code to make sure that we use the same logic everywhere. Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
16 lines
452 B
HTML
16 lines
452 B
HTML
{{/*
|
|
|
|
Renders an event example. Resolves `$ref`s, serializes as JSON, and ensures
|
|
that it can be included in HTML.
|
|
|
|
Parameters:
|
|
|
|
* `schema`: the schema of the example
|
|
* `name`: the name of the example
|
|
|
|
*/}}
|
|
|
|
{{ $path := delimit (slice "event-schemas/examples" .name) "/" }}
|
|
|
|
{{ $example_content := partial "json-schema/resolve-refs" (dict "schema" .schema "path" $path) }}
|
|
{{ partial "render-example" (dict "example" $example_content) }}
|