-
Notifications
You must be signed in to change notification settings - Fork 57
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
additional_properties is not generated in TCGC #2788
Comments
@xiangyan99 Could you elaborate your scenario with your actual behavior and expected behavior? Are you generating TypeSpec from swagger? BTW, the additionalProperties should be written in this way with a type. https://swagger.io/docs/specification/data-models/dictionaries/ |
Yes. We are migrating swagger to TypeSpec. Today we already GAed several SDKs with addition_properties field. User can get that information using IndexAction.additional_properties. As I showed in the description, additionalProperties is a dict and the values of the dict are not required to be string. |
I see. I tried locally. It successfully generates a field
That's how TypeSpec represents additional properties. Could you check again? |
Yes. The TypeSpec is correct. But when I use TCGC to generate Python code from the TypeSpec, additional_properties is not generated. And my request is to generate additional_properties field in TCGC. |
I don't see the typespec link. Could you share it? @xiangyan99 |
It can be found at https://github.com/Azure/azure-rest-api-specs/tree/search_tsp/specification/search/Azure.Search |
We utilize the additionalProperties feature in our search service to store various properties, as seen in this example: https://github.com/Azure/azure-rest-api-specs/edit/main/specification/search/data-plane/Azure.Search/stable/2024-07-01/searchindex.json#L1268.
These additional properties do not have a fixed schema, meaning they can include a variety of fields such as:
"hotelId": "1000"
"rating": 5
"rooms": []
"hotelName": "Azure Inn"
Without the auto-generated additional_properties field, users would have to manually enumerate all the keys within the IndexAction object to retrieve the full set of information.
It will be helpful for the users to have the additional_properties field generated.
The text was updated successfully, but these errors were encountered: