You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Modelina is creating nested properties for patternProperties.
Example scheme, I have tried to made it as small as possible to isolate the bug
{
"type": "object",
"patternProperties": {
"^[\\w\\d\\.\\-_]+$": {
"oneOf": [
{
"$ref": "#/definitions/Reference"
},
{
"$ref": "#/definitions/messageObject"
}
]
}
},
"definitions": {
"Reference": {
"type": "object",
"description": "A simple object to allow referencing other components in the specification, internally and externally.",
"required": ["$ref"],
"properties": {
"$ref": {
"description": "The reference string.",
"$ref": "#/definitions/ReferenceObject"
}
},
"examples": [
{
"$ref": "#/components/schemas/Pet"
}
]
},
"ReferenceObject": {
"type": "string",
"format": "uri-reference"
},
"messageObject": {
"type": "object",
"description": "Describes a message received on a given channel and operation.",
"additionalProperties": false,
"properties": {
"contentType": {
"type": "string",
"description": "The content type to use when encoding/decoding a message's payload. The value MUST be a specific media type (e.g. application/json). When omitted, the value MUST be the one specified on the defaultContentType field."
}
}
}
}
}
Souvikns
changed the title
[BUG] Modelina is creating nested models for patern properties
[BUG] Modelina is creating nested models for pattern properties
Jun 13, 2024
Describe the bug.
Modelina is creating nested properties for
patternProperties
.Example scheme, I have tried to made it as small as possible to isolate the bug
This scheme is generating this root object
Expected behavior
Should not have
ModelinaAnyType interface{}
in the root object and usepattern_property_0
in root itsef.Screenshots
I have pushed my code on github, if anyone wanna check it out https://github.com/Souvikns/modelina-bug
How to Reproduce
To reproduce this we have install
"@asyncapi/modelina": "v4.0.0-next.45"
and create a script to usego
file generator to useGO_COMMON_PRESET
.installed
🥦 Browser
Mozilla Firefox
👀 Have you checked for similar open issues?
🏢 Have you read the Contributing Guidelines?
Are you willing to work on this issue ?
Yes I am willing to submit a PR!
The text was updated successfully, but these errors were encountered: