Skip to content

Commit eae766a

Browse files
authored
Fall back to schema name if we don't have a title
When rendering the petstore example the schemas in the toc are blank because of missing title attributes, falling back to the schema name works in this case. ``` * [Servers](#servers) * [Paths](#paths) - [`GET` /pets](#op-get-pets) - [`POST` /pets](#op-post-pets) - [`GET` /pets/{petId}](#op-get-pets-petid) * [Schemas](#schemas) - - - ```
1 parent 37231cf commit eae766a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

templates/markdown/openapi.md.hbs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,10 @@
2525
{{#each openapi.components.schemas as |schema schemaName|}}
2626
{{#if schema.slug}}
2727
- [{{schema.title}}](#{{schema.slug}})
28-
{{else}}
28+
{{else if schema.title}}
2929
- {{schema.title}}
30+
{{else}}
31+
- {{schemaName}}
3032
{{/if}}
3133
{{/each}}
3234
{{/if}}

0 commit comments

Comments
 (0)