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
Whenever a model has a property of type dictionary, with unwrap serialization type the following code is generated:
if(this.additionalProperties !== undefined) {
for (const [key, value] of this.additionalProperties.entries()) {
//Only unwrap those who are not already a property in the JSON object
if(Object.keys(this).includes(String(key))) continue;
json += `"${key}": ${typeof value === 'number' || typeof value === 'boolean' ? value : JSON.stringify(value)},`;
}
}
This means that if a property unconstrained is called meta-location and constrained metaMinusLocation, and the function is called, and the dictionary prop contains meta-location, it adds the value double because Object.keys(this) does not contain the unconstrained properties.
The correct generated code should be:
if(this.additionalProperties !== undefined) {
for (const [key, value] of this.additionalProperties.entries()) {
//Only unwrap those who are not already a property in the JSON object
if(["repo", "branch", "meta-location"].includes(String(key))) continue;
json += `"${key}": ${typeof value === 'number' || typeof value === 'boolean' ? value : JSON.stringify(value)},`;
}
}
The text was updated successfully, but these errors were encountered:
This issue has been automatically marked as stale because it has not had recent activity 😴
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.
This issue has been automatically marked as stale because it has not had recent activity 😴
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.
Describe the bug
Whenever a model has a property of type dictionary, with unwrap serialization type the following code is generated:
This means that if a property unconstrained is called
meta-location
and constrainedmetaMinusLocation
, and the function is called, and the dictionary prop containsmeta-location
, it adds the value double becauseObject.keys(this)
does not contain the unconstrained properties.The correct generated code should be:
The text was updated successfully, but these errors were encountered: