-
Notifications
You must be signed in to change notification settings - Fork 283
Add OmitMetadata
, StripMetadata
and pass metadata properties through in MergePatch
#7551
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
base: main
Are you sure you want to change the base?
Conversation
All changed packages have been documented.
Show changes
|
You can try these changes here
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, just a couple of questions
* ``` | ||
*/ | ||
@Private.omitMetadata(T, NameTemplate) | ||
model OmitMetadata<T extends Reflection.Model, NameTemplate extends valueof string = ""> {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel like we should have a filtering mechanism here, where the choices are, at least 'requestMetadata' 'responseMetadata' and 'all'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Although, I think 'all' is the right default, so maybe we can leave this until additional flexibility is asked for
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah just not sure what exactly we should allow to filter. I think it for example make sense to filter per type as well "query"
@@ -67,6 +87,8 @@ export type TypeSpecHttpPrivateDecorators = { | |||
httpFile: HttpFileDecorator; | |||
httpPart: HttpPartDecorator; | |||
applyMergePatch: ApplyMergePatchDecorator; | |||
omitMetadata: OmitMetadataDecorator; | |||
stripMetadata: StripMetadataDecorator; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, not sure about 'stripMetadata' I wonder if we should be more explicit, as in 'RemoveMetadataProperties' and 'RemoveMetadataDecorators'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that it would also be nice to have a PickMetadataProperties or the like that returns only the metadata properties, but this is not as important as the other two.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that one I think is a bit more tricky with nested metadata. Does it flatten it or keep the structure and then what does that mean for the envelope does it need to add @bodyIgnore
on it?
Progress for #7279