Skip to content

feat: generate schema from example message#191

Merged
asyncapi-bot merged 1 commit intoasyncapi:masterfrom
dalelane:generate-schema
Mar 12, 2024
Merged

feat: generate schema from example message#191
asyncapi-bot merged 1 commit intoasyncapi:masterfrom
dalelane:generate-schema

Conversation

@dalelane
Copy link
Copy Markdown
Collaborator

@dalelane dalelane commented Mar 9, 2024

The generator has been implemented assuming that all message objects include a payload with properties. This is used when generating Java classes to be able to create attributes that matching the expected message properties.

This causes the generator to fail with AsyncAPI documents that don't include payload properties. Some such documents will provide a sample message instead. For these documents, we can attempt to derive a schema from the sample, and use that schema to generate a usable set of properties.

The generator has been implemented assuming that all message objects
include a payload with properties. This is used when generating Java
classes to be able to create attributes that matching the expected
message properties.

This causes the generator to fail with AsyncAPI documents that don't
include payload properties. Some such documents will provide a
sample message instead. For these documents, we can attempt to
derive a schema from the sample, and use that schema to generate a
usable set of properties.

Signed-off-by: Dale Lane <dale.lane@uk.ibm.com>
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud bot commented Mar 9, 2024

Quality Gate Passed Quality Gate passed

Issues
1 New issue
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
2.7% Duplication on New Code

See analysis details on SonarCloud

@dalelane
Copy link
Copy Markdown
Collaborator Author

dalelane commented Mar 9, 2024

/au

@dalelane
Copy link
Copy Markdown
Collaborator Author

/rtm

@asyncapi-bot asyncapi-bot merged commit 1e2c5e4 into asyncapi:master Mar 12, 2024
@dalelane dalelane deleted the generate-schema branch March 12, 2024 09:51
@asyncapi-bot
Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 0.3.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants