Skip to content

Instantly share code, notes, and snippets.

@JFCote
Created November 28, 2023 13:06
Show Gist options
  • Save JFCote/f8b647d64e2fc07f7e71b0c62d4d44e3 to your computer and use it in GitHub Desktop.
Save JFCote/f8b647d64e2fc07f7e71b0c62d4d44e3 to your computer and use it in GitHub Desktop.
spec1.yaml
asyncapi: 2.6.0
defaultContentType: application/json
info:
title: OCPP Server 1.6
version: '1.0.0'
description: |
Control and manage charging stations by abstracting the OCPP protocol.
license:
name: Commercial
url: http://www.flo.com
channels:
whatever:
subscribe:
operationId: emitWhatever
message:
$ref: '#/components/messages/Whatever'
components:
messages:
Whatever:
name: Whatever
title: Received whatever message.
summary: Inform about something
messageId: whateverMessage
contentType: application/json
payload:
$ref: '#/components/schemas/WhateverEvent'
Whatever2:
name: Whatever2
title: Received whatever2 message.
summary: Inform about something
messageId: whatever2Message
contentType: application/json
payload:
$ref: '#/components/schemas/WhateverEvent2'
schemas:
CommonIdentifier:
$id: CommonIdentifier
type: object
required:
- fieldA
- fieldB
properties:
fieldA:
type: string
description: fieldA
maxLength: 50
fieldB:
type: string
description: fieldB
maxLength: 500
WhateverEvent:
$id: WhateverEvent
allOf:
- $ref: '#/components/schemas/CommonIdentifier'
- type: object
required:
- somethingInteresting
- somethingElse
additionalProperties: false
properties:
somethingInteresting:
type: string
description: something interesting
maxLength: 50
somethingElse:
type: string
description: something else
maxLength: 500
WhateverEvent2:
$id: WhateverEvent2
type: object
required:
- blablabla1
- blablabla2
additionalProperties: false
properties:
blablabla1:
type: string
description: blablabla1
maxLength: 50
blablabla2:
type: string
description: blablabla2
maxLength: 500
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment