diff --git a/src/components/Modals/NewFileModal.tsx b/src/components/Modals/NewFileModal.tsx index 105a28050..17a8198ca 100644 --- a/src/components/Modals/NewFileModal.tsx +++ b/src/components/Modals/NewFileModal.tsx @@ -52,6 +52,7 @@ export const NewFileModal = create(() => { const realLifeExamples = examples.filter((template) => template.type === 'real-example'); const templates = examples.filter((template) => template.type === 'protocol-example'); + const tutorials = examples.filter((template) => template.type === 'tutorial-example'); return ( { })} +
+ Tutorials +
+ {tutorials.map(({ title, description, template }) => { + const isSelected = selectedTemplate.title === title; + return setSelectedTemplate({ title, template })} />; + })} +
+
Don't see what you're looking for?
<>An example of an invalid AsyncAPI document. This is only for educational purposes, to learn document validation., + template: invalid, + type: templateTypes.tutorial + }, { title: 'Apache Kafka', description: () => <>A framework implementation of a software bus using stream-processing. Open Source developed by the Apache Software Foundation., diff --git a/src/examples/tutorials/invalid.yml b/src/examples/tutorials/invalid.yml new file mode 100644 index 000000000..173dfe39b --- /dev/null +++ b/src/examples/tutorials/invalid.yml @@ -0,0 +1,33 @@ +asyncapi: '1.0.0' +info: + title: Streetlights API + version: '1.0.0' + license: + name: Apache 2.0 + url: 'https://www.apache.org/licenses/LICENSE-2.0' +servers: + mosquitto: + url: mqtt://test.mosquitto.org + protocol: mqtt +channels: + light/measured: + publish: + summary: Inform about environmental lighting conditions for a particular streetlight. + operationId: onLightMeasured + message: + name: LightMeasured + payload: + type: object + properties: + id: + type: integer + minimum: true + description: Id of the streetlight. + lumens: + type: integer + minimum: 0 + description: Light intensity measured in lumens. + sentAt: + type: integer + format: date-time + description: Date and time when the message was sent.