-
Notifications
You must be signed in to change notification settings - Fork 169
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
Autorest not generating a model class in c# #198
Comments
When I generate the client using autorest the models are not getting generated. I don't get any error and the client code is getting generated though. |
Any update on this? |
I think we'll need more context to understand the issue. Which service are you working with and what version of autorest are you using to generate the client? It would be great if you could give the specific command you are using to generate so that we can understand which options are used, etc. |
Thanks Shivangi for linking the issue above. After adding the switch |
Thanks @ShivangiReja and @abmis-mi, I was also stuck finding an answer to this question. |
Where did you find |
We have two different API using same model object as explained below,
Case 1:
AddressValidationOutput class has AddressValidationProperties as its property with "x-ms-client-flatten" extension enabled. So as expected AddressValidationProperties is flattened.
Case 2:
ValidationInputResponse has AddressValidationProperties as its knowntype/derivedtype to be used as response. In this case we want AddressValidationProperties class to be generated.
Currently, case 1 is executed first and definition for "AddressValidationProperties " not generated.
"AddressValidationOutput": {
"description": "Output of the address validation api.",
"type": "object",
"properties": {
"properties": {
"$ref": "#/definitions/AddressValidationProperties",
"description": "The address validation properties.",
"readOnly": true,
"x-ms-client-flatten": true
}
}
},
"AddressValidationProperties": {
"description": "The address validation output.",
"required": [
"validationType"
],
"type": "object",
"allOf": [
{
"$ref": "#/definitions/ValidationInputResponse"
}
],
"properties": {
"validationStatus": {
"description": "The address validation status.",
"enum": [
"Valid",
"Invalid",
"Ambiguous"
],
"type": "string",
"readOnly": true,
"x-ms-enum": {
"name": "AddressValidationStatus",
"modelAsExtensible": true,
"values": [
{
"value": "Valid",
"description": "Address provided is valid."
},
{
"value": "Invalid",
"description": "Address provided is invalid or not supported."
},
{
"value": "Ambiguous",
"description": "Address provided is ambiguous, please choose one of the alternate addresses returned."
}
]
}
}
"x-ms-discriminator-value": "ValidateAddress"
},
The text was updated successfully, but these errors were encountered: