Skip to content

tsp - add support for anonymous object/dicts#1517

Merged
dolauli merged 2 commits into
Azure:mainfrom
dolauli:tsp-brown
Sep 11, 2025
Merged

tsp - add support for anonymous object/dicts#1517
dolauli merged 2 commits into
Azure:mainfrom
dolauli:tsp-brown

Conversation

@dolauli

@dolauli dolauli commented Sep 11, 2025

Copy link
Copy Markdown
Contributor

This pull request introduces improvements to the handling of dictionary and record model schemas in the TypeSpec Powershell converter. The changes focus on correctly managing anonymous dictionary schemas, enhancing property naming conventions, and ensuring proper schema creation for record models.

Schema handling improvements:

  • Skipped processing of anonymous dictionary schemas by adding a check for the absence of the language property in dictionary schemas within convertor.ts.
  • For record model types named Record, ensured a distinct schema is created and cached, improving the handling of anonymous records in modelUtils.ts.
  • In getSchemaForRecordModel, added logic to only set the default property for named record types, ensuring anonymous dictionaries are treated correctly.

Property naming and description enhancements:

  • Updated property schema naming to concatenate the model name and property name, resulting in more descriptive property names.
  • Improved property description assignment by falling back to the schema's default description when documentation is missing.

@dolauli
dolauli merged commit e39ad19 into Azure:main Sep 11, 2025
103 checks passed
@dolauli
dolauli deleted the tsp-brown branch September 11, 2025 10:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant