Closed jonaslagoni closed 2 years ago
@jonaslagoni I would like to work on this issue.
@Samridhi-98 feel free to ping me if you need starting points 👍
@Samridhi-98 feel free to ping me if you need starting points 👍
export interface TypeScriptCommonPresetOptions {
marshalling: boolean;
example: boolean;
}
Like typescript, do I need to add an interface or class for JS?
I have implemented the part un/marshaling for JS and I ran the npm run test
, it passed all test suits.
Let me know if I need some other command to test the implementation?
Hey @Samridhi-98 do you mind adding a draft PR? 🙂 That way it is easier to see what has been done.
However, a test such as this one would be necessary: https://github.com/asyncapi/modelina/blob/5622923731bab2f45c4ede416761227bd4557ce3/test/generators/typescript/preset/MarshallingPreset.spec.ts#L27
Yeah, sure I will draft a PR.
:tada: This issue has been resolved in version 0.45.0 :tada:
The release is available on:
Your semantic-release bot :package::rocket:
:tada: This issue has been resolved in version 1.0.0-next.23 :tada:
The release is available on:
Your semantic-release bot :package::rocket:
Reason/Context
We need some helper functions to be able to marshal the data model instances to JSON and unmarshal JSON to instances of the data model.
Description
The reason we need to write this our self is that we add properties to data models which are technically not properties directly, an example here is
additionalProperties
, as it is rendered as a property in the data model, but when you want to convert an instance of the data model to bytes or JSON for a payload, it should not be used as is but unwrapped.