You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to use this library only to generate yaml or json for async api v3, but if I paste the generated yaml or json into asyncpi studio (https://studio.asyncapi.com ) then I will get an error. Does this library generate xml or json according to the official specification?
Here is the generated yaml that I tested in asyncapi studio
asyncapi: '3.0.0'
info:
title: Streetlights API
version: '1.0.0'
description: The **Smartylighting Streetlights API** allows you to remotely manage the city lights.
termsOfService: https://www.websitepolicies.com/blog/sample-terms-service-template
license:
name: Apache 2.0
url: https://www.apache.org/licenses/LICENSE-2.0
tags:
- IsReference: true
$ref: '#/components/tags/kubernetes'
- name: showcase
description: The present document is used to showcase features of the `Neuroglia.AsyncAPI` document generation.
externalDocs:
url: https://fakeurl.com
description: The exhaustive documentation of the described **API**, its purpose, usage scenarios, and detailed specifications. This documentation includes all relevant architectural diagrams, authentication flows, and code samples, offering a comprehensive reference for developers and integrators.
servers:
mosquitto:
host: mqtt://test.mosquitto.org
protocol: mqtt
pathname: /{environment}
description: The **Mosquitto test MQTT server**. Use the `env` variable to point to either `production` or `staging`.
variables:
environment:
enum:
- production
- staging
description: Environment to connect to.
bindings:
mqtt:
qos: StreetLightsAPI:1.0.0
cleanSession: true
bindingVersion: latest
http:
host: http://fake-http-server.com
protocol: http
pathname: /{environment}
description: A sample **HTTP** server declared using attributes
variables:
environment:
enum:
- dev
- stg
- prod
description: The **environment** to use.
bindings:
IsReference: true
$ref: '#/components/serverBindings/http'
defaultContentType: application/json
channels:
lightingMeasuredMQTT:
address: 'streets.{streetName}'
messages:
sendLightMeasurementRequest:
payload:
schemaFormat: application/vnd.aai.asyncapi+json;version=3.0.0
schema:
Keywords:
- Type: Object
- Properties:
id:
Keywords:
- Type: String
- Value:
Key: uuid
- Value: Gets/sets the id of the measured light
BaseUri: https://json-everything.net/783ede9614
type:
Keywords:
- Values:
- LED
- HPS
- Value: Gets/sets the type of the measured light
BaseUri: https://json-everything.net/c75272e37d
lumens:
Keywords:
- Type: Integer
- Value: Gets/sets the specified light's lumens measurement
BaseUri: https://json-everything.net/1c84ae17a4
sentAt:
Keywords:
- Type: String
- Value:
Key: date-time
- Value: Gets/sets the date and time at which the event has been created
BaseUri: https://json-everything.net/b94d3ec36d
metadata:
Keywords:
- Type: Object
- Schema:
Keywords:
- Type: String
BaseUri: https://json-everything.net/e376cfeaa8
- Value: Gets/sets the event's metadata
BaseUri: https://json-everything.net/e44f9f3f51
BaseUri: https://json-everything.net/6a3d5007a5
receiveLightMeasurementRequest:
payload:
schemaFormat: application/vnd.aai.asyncapi+json;version=3.0.0
schema:
Keywords:
- Type: Object
- Properties:
id:
Keywords:
- Type: String
- Value:
Key: uuid
- Value: Gets/sets the id of the measured light
BaseUri: https://json-everything.net/263155f4d8
type:
Keywords:
- Values:
- LED
- HPS
- Value: Gets/sets the type of the measured light
BaseUri: https://json-everything.net/2a502a75e0
lumens:
Keywords:
- Type: Integer
- Value: Gets/sets the specified light's lumens measurement
BaseUri: https://json-everything.net/585b76de17
sentAt:
Keywords:
- Type: String
- Value:
Key: date-time
- Value: Gets/sets the date and time at which the event has been created
BaseUri: https://json-everything.net/ec5d0ae49b
metadata:
Keywords:
- Type: Object
- Schema:
Keywords:
- Type: String
BaseUri: https://json-everything.net/39dc14731d
- Value: Gets/sets the event's metadata
BaseUri: https://json-everything.net/7353e8d699
BaseUri: https://json-everything.net/0c4030adaf
description: 'This channel is used to exchange messages about lightning measurements.'
servers:
- $ref: '#/servers/mosquitto'
bindings:
IsReference: true
$ref: '#/components/channelBindings/mqtt'
operations:
sendLightMeasurement:
action: send
channel:
$ref: '#/channels/lightingMeasuredMQTT'
description: 'Notifies remote **consumers** about environmental lighting conditions for a particular **streetlight**.'
messages:
- $ref: '#/channels/lightingMeasuredMQTT/messages/sendLightMeasurementRequest'
tags:
- name: light
description: A tag for light-related operations
- name: measurement
description: A tag for measurement-related operations
receiveLightMeasurement:
action: receive
channel:
$ref: '#/channels/lightingMeasuredMQTT'
messages:
- $ref: '#/channels/lightingMeasuredMQTT/messages/receiveLightMeasurementRequest'
tags:
- name: light
description: A tag for light-related operations
- name: measurement
description: A tag for measurement-related operations
components:
schemas:
addStreetLightRequest:
schemaFormat: application/vnd.aai.asyncapi+json;version=3.0.0
schema:
Keywords:
- Type: Object
- Properties:
streetId:
Keywords:
- Type: String
- Value: Gets/sets the id of the street to add a new light to
BaseUri: https://json-everything.net/651133b574
latitude:
Keywords:
- Type: Number
- Value: Gets/sets the latitude of the light to add
BaseUri: https://json-everything.net/8b54e620ab
longitude:
Keywords:
- Type: Number
- Value: Gets/sets the longitude of the light to add
BaseUri: https://json-everything.net/c52a9a8f67
BaseUri: https://json-everything.net/0ab7dec901
servers:
http:
host: https://test.com
protocol: http
pathname: /{environment}
description: The **HTTP test server**. Use the `env` variable to point to either `production` or `staging`.
variables:
environment:
enum:
- production
- staging
description: Environment to connect to.
bindings:
IsReference: true
$ref: '#/components/serverBindings/http'
channels:
lightingMeasuredHTTP:
address: 'unknown'
messages:
addStreetLightRequest:
IsReference: true
$ref: '#/components/messages/addStreetLightRequest'
description: 'This channel is used to exchange messages about lightning measurements.'
servers:
- $ref: '#/components/servers/http'
bindings:
IsReference: true
$ref: '#/components/channelBindings/http'
operations:
addStreetLight:
action: receive
channel:
$ref: '#/components/channels/lightingMeasuredHTTP'
traits:
- IsReference: true
$ref: '#/components/operationTraits/commonBindings'
description: 'Adds a new **streetlight** to the API.'
messages:
- $ref: '#/channels/lightingMeasuredHTTP/messages/addStreetLightRequest'
bindings:
IsReference: true
$ref: '#/components/operationBindings/http'
messages:
addStreetLightRequest:
payload:
schemaFormat: application/vnd.aai.asyncapi+json;version=3.0.0
schema:
Keywords:
- Type: Object
- Properties:
streetId:
Keywords:
- Type: String
- Value: Gets/sets the id of the street to add a new light to
BaseUri: https://json-everything.net/2629e7702d
latitude:
Keywords:
- Type: Number
- Value: Gets/sets the latitude of the light to add
BaseUri: https://json-everything.net/129039fcff
longitude:
Keywords:
- Type: Number
- Value: Gets/sets the longitude of the light to add
BaseUri: https://json-everything.net/dd881da454
BaseUri: https://json-everything.net/3e21fad01f
traits:
- IsReference: true
$ref: '#/components/messageTraits/commonHeaders'
bindings:
IsReference: true
$ref: '#/components/messageBindings/http'
measureStreetLightLuminosityReply:
payload:
schemaFormat: application/vnd.aai.asyncapi+json;version=3.0.0
schema:
Keywords:
- Type: Object
- Properties:
lumens:
Keywords:
- Type: Integer
- Value: Gets/sets the street light's lumens
BaseUri: https://json-everything.net/4b31a38ff6
BaseUri: https://json-everything.net/09825a1df9
bindings:
IsReference: true
$ref: '#/components/messageBindings/http'
securitySchemes:
oauth2:
type: oauth2
description: The security scheme used to authenticate using **OAUTH2**.
scheme: Bearer
flows:
implicit:
tokenUrl: https://fake.com/auth/streetlights/token
scopes:
- api
serverVariables:
environment:
enum:
- dev
- staging
- production
default: dev
description: The variable used to define the **hosting environment**.
examples:
- dev
- staging
- production
parameters:
environment:
enum:
- dev
- staging
- production
default: 'dev'
description: 'The variable used to define the **hosting environment**.'
examples:
- dev
- staging
- production
correlationIds:
streetId:
location: $message.header#/MQMD/CorrelId
description: The parameter used to correlate the **street** a **light** is located in.
replies:
measureStreetLightLuminosityReply:
address:
IsReference: true
$ref: '#/components/replyAddresses/measureStreetLightLuminosityReplyAddress'
messages:
- $ref: '#/components/messages/measureStreetLightLuminosityReply'
replyAddresses:
measureStreetLightLuminosityReplyAddress:
description: 'Represents the **address** to reply to after a **measureStreetLightLuminosityRequest**.'
location: '$message.header#/replyTo'
externalDocs:
kubernetesTag:
url: https://fake.com/tags/kubernetes
description: The **external documentation** used to document the `kubernetes` **tag**.
tags:
kubernetes:
name: kubernetes
description: The **tag** used to mark a **server** deployed in `Kubernetes`.
externalDocs:
IsReference: true
$ref: '#/components/externalDocs/kubernetesTag'
operationTraits:
commonBindings:
description: 'The **operation trait** used to define the bindings common to all operations defined by the application.'
bindings:
http:
bindingVersion: latest
messageTraits:
commonHeaders:
headers:
schemaFormat: application/vnd.aai.asyncapi+json;version=3.0.0
schema:
Keywords:
- Type: Object
- Properties:
eTag:
Keywords:
- Type: String
- Value: 1
- Value: Gets/sets the value of the header that the application's ETag
BaseUri: https://json-everything.net/9e613ddf32
- Properties:
- eTag
BaseUri: https://json-everything.net/75b7c7d70c
name: Common Headers
description: The **message trait** used to define the common headers used by all the messages exchanged by the application.
serverBindings:
http:
http:
bindingVersion: latest
channelBindings:
http:
http:
bindingVersion: latest
mqtt:
mqtt:
bindingVersion: latest
operationBindings:
http:
http:
method: POST
bindingVersion: latest
messageBindings:
http:
http:
bindingVersion: latest
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
I want to use this library only to generate yaml or json for async api v3, but if I paste the generated yaml or json into asyncpi studio (https://studio.asyncapi.com ) then I will get an error. Does this library generate xml or json according to the official specification?
Here is the generated yaml that I tested in asyncapi studio
Beta Was this translation helpful? Give feedback.
All reactions