Comments (4)
But I want to clarify validation behavior when users didn't provide any schemaFormat so it must be interpreted as AAS schema
The behaviour should be to fail. The examples you mentioned are not valid AsyncAPI schemas. Just because they're similar it doesn't mean we have to behave differently.
Roger that.
Looks like I have implemented strict validation correctly. Now it's time to dive into #957 to actualize specifications validation and bring new version to studio to reject specification which I was using as example, above
from spec.
@Pakisan if they're using OpenAPI Schemas, they should specify so in the schemaFormat field, i.e., it should be application/vnd.oai.openapi;version=3.0.0
.
Example with v3:
asyncapi: 3.0.0
info:
title: Account Service
version: 1.0.0
description: This service is in charge of processing user signups
channels:
userSignedup:
address: user/signedup
messages:
UserSignedUp:
$ref: '#/components/messages/UserSignedUp'
operations:
sendUserSignedup:
action: send
channel:
$ref: '#/channels/userSignedup'
messages:
- $ref: '#/channels/userSignedup/messages/UserSignedUp'
components:
messages:
UserSignedUp:
payload:
schemaFormat: application/vnd.oai.openapi;version=3.0.0
schema:
type: object
properties:
displayName:
type: string
description: Name of the user
email:
type: string
format: email
description: Email of the user
This is the schema parser in charge of interpreting it for the JS/TS parser: https://github.com/asyncapi/openapi-schema-parser.
from spec.
@Pakisan if they're using OpenAPI Schemas, they should specify so in the schemaFormat field, i.e., it should be
application/vnd.oai.openapi;version=3.0.0
.Example with v3:
asyncapi: 3.0.0 info: title: Account Service version: 1.0.0 description: This service is in charge of processing user signups channels: userSignedup: address: user/signedup messages: UserSignedUp: $ref: '#/components/messages/UserSignedUp' operations: sendUserSignedup: action: send channel: $ref: '#/channels/userSignedup' messages: - $ref: '#/channels/userSignedup/messages/UserSignedUp' components: messages: UserSignedUp: payload: schemaFormat: application/vnd.oai.openapi;version=3.0.0 schema: type: object properties: displayName: type: string description: Name of the user email: type: string format: email description: Email of the userThis is the schema parser in charge of interpreting it for the JS/TS parser: https://github.com/asyncapi/openapi-schema-parser.
Hi, Fran. Thanks for schemaFormat
example.
Where I can find all supported formats? I found - multiFormatSchemaFormatTable
I agree with you, that in case of provided schemaFormat we can interpret is as Avro, OAS, ...
But I want to clarify validation behavior when users didn't provide any schemaFormat
so it must be interpreted as AAS schema
asyncapi: 3.0.0
info:
title: Account Service
version: 1.0.0
description: This service is in charge of processing user signups
channels:
userSignedup:
address: user/signedup
messages:
UserSignedUp:
$ref: '#/components/messages/UserSignedUp'
operations:
sendUserSignedup:
action: send
channel:
$ref: '#/channels/userSignedup'
messages:
- $ref: '#/channels/userSignedup/messages/UserSignedUp'
components:
messages:
UserSignedUp:
payload:
schema:
type: object
properties:
displayName:
type: string
description: Name of the user
example: Pavel
nullable: true
readOnly: true
examples:
- Pavel
- Peter
email:
type: string
format: email
description: Email of the user
example: [email protected]
readOnly: true
examples:
- [email protected]
from spec.
But I want to clarify validation behavior when users didn't provide any schemaFormat so it must be interpreted as AAS schema
The behaviour should be to fail. The examples you mentioned are not valid AsyncAPI schemas. Just because they're similar it doesn't mean we have to behave differently.
from spec.
Related Issues (20)
- Confusing Operation Object Example HOT 2
- Invite Heiko Henning to join as code owner HOT 11
- Should the Reply Object extend from the Operation Object? HOT 5
- Channel parameter type HOT 2
- Send/Receive again confusion HOT 3
- AsyncAPI v3 retrospective HOT 1
- Undefined description when using `OneOf`, `AllOf` or `AnyOf` HOT 2
- Undefined behaviour of "messageId" for Message Traits and Messages defined in components. HOT 3
- Avro specification inside AsycnApi file HOT 4
- Server Object host field compatibility with protocols
- testing -input command not found HOT 1
- Possible bug with example - adeo-kafka-request-reply-asyncapi HOT 17
- Allow plain `string` in Message Example Object field payload for non-json payloads (like xml, yaml) HOT 6
- when to finish amqp serverBindings HOT 1
- Divide "Maintainer" role into two categories: Triager and Committer HOT 7
- How to define MQTT User Properties in an AsyncAPI document? HOT 1
- Extend Avro and OpenAPI schema versions HOT 13
- Multiple reply addresses HOT 2
- Fix description of Operation Trait object HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from spec.