Comments (7)
Welcome to AsyncAPI. Thanks a lot for reporting your first issue. Please check out our contributors guide and the instructions about a basic recommended setup useful for opening a pull request.
Keep in mind there are also other channels you can use to interact with AsyncAPI community. For more details check out this issue.
from spec.
Please have a look at the multi format schema object:
https://www.asyncapi.com/docs/reference/specification/v3.0.0#multiFormatSchemaObject
This makes your api a little bit more valid.
But xml is still no valid and official supported schema type.
There are a lot of discussion why not. But in short, xml knows attributes and childs. This can not be handled by tooling.
from spec.
Thank you @GreenRover for the reference link.
Specifying a complete schema for xml is probably a bit overkill for us, but we will discuss.
(Based on a java class, we only want to generate an xml example
)
But in short, xml knows attributes and childs
So true, we came across the same issue with the xml attributes.
I tested a bit more, and changing the SchemaObject
s field type
value to string
(instead of object
) does the trick so that AsyncApi Studio does validate (through asyncapi/parser) positively.
"io.github.springwolf.examples.kafka.dtos.XmlPayloadDto": {
"type": "string",
"properties": {
"someEnum": {
"type": "string",
"enum": [
"FOO1",
"FOO2",
"FOO3"
]
},
"someLong": {
"type": "integer",
"format": "int64"
},
"someString": {
"type": "string"
}
},
"examples": [
"<io.github.springwolf.examples.kafka.dtos.XmlPayloadDto><someEnum>FOO1</someEnum><someLong>0</someLong><someString>string</someString></io.github.springwolf.examples.kafka.dtos.XmlPayloadDto>"
]
}
from spec.
Can you please provide the full schema. Because what you provide looks more like a bug in studio.
from spec.
Sure, here it is:
{
"asyncapi": "3.0.0",
"info": {
"title": "Springwolf example project - Kafka",
"version": "1.0.0",
"description": "Springwolf example project to demonstrate springwolfs abilities, including **markdown** support for descriptions.",
"contact": {
"name": "springwolf",
"url": "https://github.com/springwolf/springwolf-core",
"email": "[email protected]"
},
"license": {
"name": "Apache License 2.0"
},
"x-generator": "springwolf"
},
"defaultContentType": "application/json",
"servers": {
"kafka": {
"host": "kafka:29092",
"protocol": "kafka"
}
},
"channels": {
"xml-topic": {
"messages": {
"io.github.springwolf.examples.kafka.dtos.XmlPayloadDto": {
"$ref": "#/components/messages/io.github.springwolf.examples.kafka.dtos.XmlPayloadDto"
}
}
}
},
"components": {
"schemas": {
"HeadersNotDocumented": {
"type": "object",
"properties": { },
"examples": [
{ }
],
"x-json-schema": {
"$schema": "https://json-schema.org/draft-04/schema#",
"type": "object"
}
},
"io.github.springwolf.examples.kafka.dtos.XmlPayloadDto": {
"type": "object",
"properties": {
"someEnum": {
"type": "string",
"enum": [
"FOO1",
"FOO2",
"FOO3"
]
},
"someLong": {
"type": "integer",
"format": "int64"
},
"someString": {
"type": "string"
}
},
"examples": [
"<io.github.springwolf.examples.kafka.dtos.XmlPayloadDto><someEnum>FOO1</someEnum><someLong>0</someLong><someString>string</someString></io.github.springwolf.examples.kafka.dtos.XmlPayloadDto>"
],
"x-json-schema": {
"$schema": "https://json-schema.org/draft-04/schema#",
"properties": {
"someEnum": {
"enum": [
"FOO1",
"FOO2",
"FOO3"
],
"type": "string"
},
"someLong": {
"format": "int64",
"type": "integer"
},
"someString": {
"type": "string"
}
},
"type": "object"
}
}
},
"messages": {
"io.github.springwolf.examples.kafka.dtos.XmlPayloadDto": {
"headers": {
"$ref": "#/components/schemas/HeadersNotDocumented"
},
"payload": {
"schemaFormat": "application/vnd.aai.asyncapi+json;version=3.0.0",
"schema": {
"$ref": "#/components/schemas/io.github.springwolf.examples.kafka.dtos.XmlPayloadDto"
}
},
"contentType": "text/xml",
"name": "io.github.springwolf.examples.kafka.dtos.XmlPayloadDto",
"title": "XmlPayloadDto",
"bindings": {
"kafka": {
"bindingVersion": "0.4.0"
}
}
}
}
},
"operations": {
"xml-topic_receive_receiveExamplePayload": {
"action": "receive",
"channel": {
"$ref": "#/channels/xml-topic"
},
"title": "xml-topic_receive",
"description": "Showcases a xml based message",
"bindings": {
"kafka": {
"bindingVersion": "0.4.0"
}
},
"messages": [
{
"$ref": "#/channels/xml-topic/messages/io.github.springwolf.examples.kafka.dtos.XmlPayloadDto"
}
]
}
}
}
from spec.
Any update on this?
Should I duplicate the issue in studio?
from spec.
Update: the related PR has been merged in parser-js: asyncapi/parser-js#1007
EDIT: actually, it was only updated, not merged yet
from spec.
Related Issues (20)
- 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 3
- Undefined behaviour of "messageId" for Message Traits and Messages defined in components. HOT 4
- Avro specification inside AsycnApi file HOT 4
- Server Object host field compatibility with protocols HOT 3
- testing -input command not found HOT 2
- Possible bug with example - adeo-kafka-request-reply-asyncapi HOT 18
- Decide what to do with OAS schema properties HOT 5
- when to finish amqp serverBindings HOT 2
- Divide "Maintainer" role into two categories: Triager and Committer HOT 7
- How to define MQTT User Properties in an AsyncAPI document? HOT 2
- Extend Avro and OpenAPI schema versions HOT 13
- Multiple reply addresses HOT 3
- Can i document an endpoint for a cron job? HOT 2
- trait vs. allOf ref vs. component ref - CloudEvents HOT 4
- Use asyncapi for sunc api with redis transport HOT 2
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.