Skip to content
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

Initial Support for ARM in OpenAPI to TypeSpec Conversion #4777

Merged
merged 83 commits into from
Dec 22, 2023

Conversation

joheredi
Copy link
Member

@joheredi joheredi commented Oct 2, 2023

This PR represents the initial effort to integrate ARM (Azure Resource Manager) support into the OpenAPI to TypeSpec plugin. Utilizing the @typespec/azure-resource-manager library, we now generate TypeSpec representations of Azure resources. A subsequent PR will address the definition of Resource operations.

Overview:

  1. Consuming Resource Metadata (resources.json):

    • Originates from C# codegen efforts, reusing their discovery and metadata extraction processes.
    • A parallel project is ongoing to enhance C# codegen, aiming to output all necessary metadata for this feature.
    • Currently, the metadata is read from a JSON file located at the project root. Integration into the pipeline will be a focus of future work.
  2. Per-Resource tsp File Generation:

    • Files generated will contain model declarations for both the Resources and their subsequent operations.
    • This is achieved using templates and decorators from @typespec/azure-resource-manager.
  3. Reutilizing Data Plane Conversion Logic:

    • Efforts have been made to reuse existing components, including model generation, decorator logic, interfaces, and more.

Upcoming Work:

  • Inclusion of Resource operations within the Resource file, utilizing templates from @typespec/azure-resource-manager.
  • Removal of extraneous generated models.
  • For ARM spec conversions, there won't be a need for the routes.tsp file, as operations are defined alongside the resources. However, this file remains relevant and necessary for data plane spec conversions.

@lirenhe
Copy link
Member

lirenhe commented Dec 21, 2023

As people are already using the converter for Swagger to TypeSpec conversion, let's try to merge this PR to avoid its growing larger and become more difficult to maintain. Thanks

@tadelesh tadelesh requested a review from lirenhe December 21, 2023 09:50
@tadelesh tadelesh merged commit faf5c11 into Azure:main Dec 22, 2023
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.

5 participants