Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update examples to v3 #947

Merged
merged 10 commits into from
Aug 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 32 additions & 31 deletions examples/adeo-kafka-request-reply.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,40 +7,41 @@ info:
contact:
name: AsyncAPI team
email: [email protected]
tags:
- name: costing
description: "Costing channels, used by Costing clients."
servers:
production:
url: "prod.url:9092"
host: "prod.url:9092"
protocol: kafka-secure
description: Kafka PRODUCTION cluster
security:
- sasl-ssl: []
- $ref: '#/components/securitySchemes/sasl-ssl'
bindings:
kafka:
schemaRegistryUrl: >-
https://schema-registry.prod.url/
staging:
url: "staging.url:9092"
host: "staging.url:9092"
protocol: kafka-secure
description: Kafka STAGING cluster for `uat` and `preprod` environments
security:
- sasl-ssl: []
- $ref: '#/components/securitySchemes/sasl-ssl'
bindings:
kafka:
schemaRegistryUrl: >-
https://schema-registry.staging.url/
dev:
url: "dev.url:9092"
host: "dev.url:9092"
protocol: kafka-secure
description: Kafka DEV cluster for `dev` and `sit` environments
security:
- sasl-ssl: []
- $ref: '#/components/securitySchemes/sasl-ssl'
bindings:
kafka:
schemaRegistryUrl: >-
https://schema-registry.dev.url/
tags:
- name: costing
description: "Costing channels, used by Costing clients."

channels:
costingRequest:
address: "adeo-{env}-case-study-COSTING-REQUEST-{version}"
Expand All @@ -64,9 +65,9 @@ channels:
kafka:
replicas: 3
partitions: 3
topicConfiguration
cleanup.policy: delete
retention.ms: 7 days
topicConfiguration:
cleanup.policy: [ "delete" ]
retention.ms: 604800000
messages:
costingRequest:
$ref: "#/components/messages/costingRequestV1"
Expand Down Expand Up @@ -98,12 +99,6 @@ channels:
$ref: "#/components/parameters/Version"
bindings:
kafka:
groupId:
type: string
description: >
The groupId must be prefixed by your `svc` account, deliver by the
Adeo Kafka team.
This `svc` must have the read access to the topic.
x-key.subject.name.strategy:
type: string
description: >
Expand All @@ -125,7 +120,6 @@ channels:




operations:
requestCosting:
action: receive
Expand All @@ -135,7 +129,7 @@ operations:
channel:
$ref: '#/channels/costingResponse'
address:
locaton: '$message.header#/REPLY_TOPIC'
location: '$message.header#/REPLY_TOPIC'
summary: |
[COSTING] Request one or more Costing calculation for any product
description: >
Expand Down Expand Up @@ -165,6 +159,14 @@ operations:
summary: >
[COSTING] Get the costing responses matching an initial Costing
Request.
bindings:
kafka:
groupId:
type: string
description: >
The groupId must be prefixed by your `svc` account, deliver by the
Adeo Kafka team.
This `svc` must have the read access to the topic.
tags:
- name: costing

Expand All @@ -188,7 +190,6 @@ components:
summary: Costing Request V1 inputs.
tags:
- name: costing
schemaFormat: application/vnd.apache.avro;version=1.9.0
correlationId:
$ref: "#/components/correlationIds/costingCorrelationId"
headers:
Expand All @@ -208,7 +209,9 @@ components:
REQUESTER_CODE:
$ref: "#/components/schemas/RequesterCode"
payload:
$ref: "https://deploy-preview-921--asyncapi-website.netlify.app/resources/casestudies/adeo/CostingRequestPayload.avsc"
schemaFormat: application/vnd.apache.avro;version=1.9.0
schema:
$ref: "https://www.asyncapi.com/resources/casestudies/adeo/CostingRequestPayload.avsc"
costingResponse:
name: CostingResponse
title: Costing Response
Expand All @@ -219,7 +222,6 @@ components:
Please refer to the `CostingResponseKey.avsc` schema, available on [our
github
project](https://github.url/).
schemaFormat: application/vnd.apache.avro;version=1.9.0
correlationId:
$ref: "#/components/correlationIds/costingCorrelationId"
headers:
Expand All @@ -242,7 +244,9 @@ components:
key:
$ref: "https://deploy-preview-921--asyncapi-website.netlify.app/resources/casestudies/adeo/CostingResponseKey.avsc"
payload:
$ref: "https://deploy-preview-921--asyncapi-website.netlify.app/resources/casestudies/adeo/CostingResponsePayload.avsc"
schemaFormat: application/vnd.apache.avro;version=1.9.0
schema:
$ref: "https://deploy-preview-921--asyncapi-website.netlify.app/resources/casestudies/adeo/CostingResponsePayload.avsc"
schemas:
RequesterId:
type: string
Expand Down Expand Up @@ -303,20 +307,17 @@ components:
parameters:
Env:
description: Adeo Kafka Environement for messages publications.
schema:
type: string
enum:
enum:
- dev
- sit
- uat1
- preprod
- prod
Version:
description: the topic version you want to use
schema:
type: string
example: V1
default: V1
examples:
- V1
default: V1
securitySchemes:
sasl-ssl:
type: plain
Expand Down
25 changes: 15 additions & 10 deletions examples/anyof.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,27 @@
asyncapi: '2.5.0'
asyncapi: 3.0.0
info:
title: AnyOf example
version: '1.0.0'

version: 1.0.0
channels:
test:
publish:
message:
address: test
messages:
publish.message:
$ref: '#/components/messages/testMessages'

operations:
test.publish:
action: receive
channel:
$ref: '#/channels/test'
messages:
- $ref: '#/components/messages/testMessages'
components:
messages:
testMessages:
payload:
anyOf: # anyOf in payload schema
- $ref: "#/components/schemas/objectWithKey"
- $ref: "#/components/schemas/objectWithKey2"

anyOf:
- $ref: '#/components/schemas/objectWithKey'
- $ref: '#/components/schemas/objectWithKey2'
schemas:
objectWithKey:
type: object
Expand Down
54 changes: 29 additions & 25 deletions examples/application-headers.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
asyncapi: '2.5.0'
asyncapi: 3.0.0
info:
title: Application Headers example
version: '1.0.0'
description: A cut of the Streetlights API to test application header changes supporting #112
version: 1.0.0
description: A cut of the Streetlights API to test application header changes supporting
license:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jonaslagoni #112 is missing here, otherwise the meaning is not correct.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, it's a bug with the converter 🤔

Mind adding a bug issue?

name: Apache 2.0
url: https://www.apache.org/licenses/LICENSE-2.0

url: 'https://www.apache.org/licenses/LICENSE-2.0'
defaultContentType: application/json
servers:
production:
url: test.mosquitto.org:{port}
host: 'test.mosquitto.org:{port}'
protocol: mqtt
description: Test broker
variables:
Expand All @@ -19,28 +19,36 @@ servers:
enum:
- '1883'
- '8883'

defaultContentType: application/json

channels:
smartylighting/streetlights/1/0/event/{streetlightId}/lighting/measured:
'smartylighting/streetlights/1/0/event/{streetlightId}/lighting/measured':
address: 'smartylighting/streetlights/1/0/event/{streetlightId}/lighting/measured'
messages:
receiveLightMeasurement.message:
$ref: '#/components/messages/lightMeasured'
parameters:
streetlightId:
$ref: '#/components/parameters/streetlightId'
publish:
summary: Inform about environmental lighting conditions of a particular streetlight.
operationId: receiveLightMeasurement
message:
$ref: '#/components/messages/lightMeasured'

operations:
receiveLightMeasurement:
action: receive
channel:
$ref: >-
#/channels/smartylighting~1streetlights~11~10~1event~1{streetlightId}~1lighting~1measured
summary: >-
Inform about environmental lighting conditions of a particular
streetlight.
messages:
- $ref: '#/components/messages/lightMeasured'
components:
messages:
lightMeasured:
name: lightMeasured
title: Light measured
summary: Inform about environmental lighting conditions of a particular streetlight.
summary: >-
Inform about environmental lighting conditions of a particular
streetlight.
correlationId:
location: "$message.header#/MQMD/CorrelId"
location: $message.header#/MQMD/CorrelId
contentType: application/json
headers:
type: object
Expand All @@ -54,10 +62,9 @@ components:
maxLength: 24
format: binary
applicationInstanceId:
$ref: "#/components/schemas/applicationInstanceId"
$ref: '#/components/schemas/applicationInstanceId'
payload:
$ref: "#/components/schemas/lightMeasuredPayload"

$ref: '#/components/schemas/lightMeasuredPayload'
schemas:
lightMeasuredPayload:
type: object
Expand All @@ -67,17 +74,14 @@ components:
minimum: 0
description: Light intensity measured in lumens.
sentAt:
$ref: "#/components/schemas/sentAt"
$ref: '#/components/schemas/sentAt'
sentAt:
type: string
format: date-time
description: Date and time when the message was sent.
applicationInstanceId:
description: Unique identifier for a given instance of the publishing application
type: string

parameters:
streetlightId:
description: The ID of the streetlight.
schema:
type: string
Loading
Loading