Open Tenischev opened 10 months ago
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.
@magicmatatjahu @jonaslagoni @kennethaasan ask for comments
@Tenischev yep Modelina only generate payloads right now.
What would you like the class for the message object to contain? Can you give an expected input with expected output?
@jonaslagoni Message Object contain a lot of information. First of all it's payload
which should be a ref to Schema object already generated by Modelina.
Then it's contentType
constant which should be used to correct serialization-deserialization object.
Also it's headers
which is an object, implementation could vary here from map to dedicated object.
The title
, summary
and description
could be used in a comment.
Finally bindings
which are protocol specific.
Example input:
turnOnOff:
name: turnOnOff
title: Turn on/off
summary: Command a particular streetlight to turn the lights on or off.
schemaFormat: application/json
headers:
type: object
properties:
correlationId:
description: Correlation ID set by application
type: string
applicationInstanceId:
description: Unique identifier for a given instance of the publishing application
type: string
payload:
$ref: "#/components/schemas/turnOnOffPayload"
Example Java out with Map for headers:
/**
* Turn on/off
* Command a particular streetlight to turn the lights on or off
*/
public class TurnOnOff {
public static final String SCHEMA_FORMAT = "application/json";
private TurnOnOffPayload payload;
private Map<String, String> headers;
// getter, hashCode, equals, toString here
}
Having somewhat similar issue but with headers
Would be amazing if all schemas which are present in .components.schemas
would be converted, not only ones from payloads
This issue has been automatically marked as stale because it has not had recent activity :sleeping:
It will be closed in 120 days if no further activity occurs. To unstale this issue, add a comment with a detailed explanation.
There can be many reasons why some specific issue has no activity. The most probable cause is lack of time, not lack of interest. AsyncAPI Initiative is a Linux Foundation project not owned by a single for-profit company. It is a community-driven initiative ruled under open governance model.
Let us figure out together how to push this issue forward. Connect with us through one of many communication channels we established here.
Thank you for your patience :heart:
would be still nice that is is added, since header is an essential part of the message
Describe the bug
Modelina generates only
components.schemas
elements, thecomponents.messages
elements are not generated. Issue found during exploration of possibility to use Modelina for model generation in Java spring template, see #asyncapi/java-spring-template/pull/342 Issue is valid for bothJavaFileGenerator
andJavaGenerator
generators.How to Reproduce
module.exports = { 'generate:before': generator => { const javaGenerator = new modelina.JavaFileGenerator();
};