-
Notifications
You must be signed in to change notification settings - Fork 215
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
[Bug]: Weird behavior for spread model with additional properties #4757
Comments
This is allowed by design, something we explicitly designed a few month ago, i am not sure I see the issue in teh simplified spec, everthing looks correct no? |
if i spread a model A with additional properties to model B, then the model B will have additional properties? what if the spread happen in operation parameter? the problem is showed in the screenshot, the body type of http operation will have a property of api version query parameter. if remove the |
oh I see, yeah seems like we do have a special case that bypass the So 2 things:
op getEmbeddings(@bodyIgnore nested: {@query foo: string}, name: string): void; |
Describe the bug
For this spec which is simplified from a service definition here, there is a usage of spread model with additional properties (though i think it should be banned). Also, the http body is composed from both the spread thing and azure core traits thing, then the weird thing happened, the http body parameter type will have a query parameter from the trait, which will not happen is the spread model has no additional properties.
I'm wondering if it is a bug for body resolving. But I think a good solution is not allow to spread model with additional properties.
Reproduction
Compile with the playground or the spec provided.
Checklist
The text was updated successfully, but these errors were encountered: