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

feat: generate schema from example message #191

Merged
merged 1 commit into from
Mar 12, 2024

Conversation

dalelane
Copy link
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>
Copy link

sonarcloud 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
Collaborator Author

dalelane commented Mar 9, 2024

/au

@dalelane
Copy link
Collaborator Author

/rtm

@asyncapi-bot asyncapi-bot merged commit 1e2c5e4 into asyncapi:master Mar 12, 2024
20 checks passed
@dalelane dalelane deleted the generate-schema branch March 12, 2024 09:51
@asyncapi-bot
Copy link
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