Skip to content

Instantly share code, notes, and snippets.

@ponelat
Created June 20, 2022 11:19
Show Gist options
  • Save ponelat/416ade67807373e2de9044e37d3eac67 to your computer and use it in GitHub Desktop.
Save ponelat/416ade67807373e2de9044e37d3eac67 to your computer and use it in GitHub Desktop.
AsyncAPI blows up validation panel
asyncapi: '2.4.0'
info:
title: Petstore Kafka - Pets
version: '1.0.0'
description: |
A simple demo API based on a real implementation.
There are
license:
name: Apache 2.0
url: https://www.apache.org/licenses/LICENSE-2.0
servers:
test:
url: kafka.swagger.io:9092
protocol: kafka
description: Single demo Broker
defaultContentType: application/json
channels:
pets.added:
description: Pets that are added
publish:
$ref: '#/components/channels/pets.added/publish'
pets.statusChanged:
description: The status of the Pet has changed.
subscribe:
summary: Listening for status changes
components:
channels:
pets.added:
description: The topic for newly added Pets.
publish:
summary: New Pet added.
operationId: addPet
traits:
- $ref: '#/components/operationTraits/kafka'
message:
description: New Pets
payload:
$ref: '#/components/schemas/NewPet'
pets.statusChanged:
description: The topic for newly added Pets.
publish:
summary: New Pet added.
operationId: changePetStatus
traits:
- $ref: '#/components/operationTraits/kafka'
message:
description: New Pets
payload:
$ref: '#/components/schemas/NewPet'
schemas:
NewPet:
type: object
required: [name, id, location]
properties:
name:
type: string
example: Fido
id:
type: string
pattern: '^[0-9a-fA-F\-]{36}$'
example: 96aa8c2d-ad64-4d90-b4a4-3689e303cd55
location:
type: string
example: Plett
PetStatusChange:
type: object
required: [name, id, location]
properties:
name:
type: string
example: Fido
id:
type: string
pattern: '^[0-9a-fA-F\-]{36}$'
example: 96aa8c2d-ad64-4d90-b4a4-3689e303cd55
status:
type: string
enum:
- pending
- available
operationTraits:
kafka:
bindings:
kafka:
clientId: pets
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment