Remove the IncludeDeserializer constraint in model factory#3574
Remove the IncludeDeserializer constraint in model factory#3574ArcturusZhang wants to merge 13 commits intoAzure:feature/v3from
IncludeDeserializer constraint in model factory#3574Conversation
…ry when it is not output, we will need the unknown schema when it does not have output
|
Still need to resolve the issue that postprocess will remove the Unknown if it is only used in model factory. |
| //Since the unknown type is used for deserialization only we don't need to create if its an input only model | ||
| var hasXCsharpUsageOutput = !actualBaseSchema.Extensions?.Usage?.Contains("output", StringComparison.OrdinalIgnoreCase); | ||
| if (!actualBaseSchema.Usage.Contains(SchemaContext.Output) && | ||
| !actualBaseSchema.Usage.Contains(SchemaContext.Exception) && | ||
| (!hasXCsharpUsageOutput.HasValue || | ||
| hasXCsharpUsageOutput.Value)) | ||
| return; |
There was a problem hiding this comment.
This is removed because since now we will generate model factory entries for the models without output usage, when this model is the base model with a discriminator and is abstract, we will need the unknown to construct the instance.
If this unknown is generated and never used anywhere (for instance, it does not meet the criteria of model factory), the post process will take care of it and remove it as well
There was a problem hiding this comment.
But now we have a bug on the post process that it is removed anyway.
|
@m-nash |
Looks good but lets get the ci cleaned up and green first. |
This is a bit out-of-date now because my recent focus is on the confident level PR. I will fix this and CIs in the corresponding regen PR as well. I will let you know when this ready for review again. |
|
Close this in favor of #3434 because it contains everything in this PR |
Fixes #3181
Fixes #3406
Description
Superseded by #3434
Now in HLC/mgmt, all models will have an internal ctor if it is different from the initialization ctor.
Removes the constraint in model factory that a model must have deserializer to be included in model factory.
There should be two kind of changes included in the regen:
Checklist
To ensure a quick review and merge, please ensure:
Ready to Land?