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

[FormRecognizer] Update DocumentAnalysisModelFactory to autogenerate models #35348

Open
kinelski opened this issue Apr 4, 2023 · 0 comments
Open
Assignees
Labels
Client This issue points to a problem in the data-plane of the library. Cognitive - Form Recognizer
Milestone

Comments

@kinelski
Copy link
Member

kinelski commented Apr 4, 2023

Currently both old (v2) and new (v3) Form Recognizer APIs have their model factory generation disabled in the autorest configuration file.

Ideally, we should be able to:

  • Reenable model factory generation for the new API.
  • Add the CodeGenModel("FormRecognizerModelFactory") attribute to the DocumentAnalysisModelFactory class. This will make all generated models to be put into the new factory.
  • Remove as many duplicates as we can from the manually written side of the DocumentAnalysisModelFactory class. We want to maximize the amount of generated code.

There's one issue with the approach above: the old FormRecognizerModelFactory already has a CodeGenType("FormRecognizerModelFactory") attribute. If we add the attribute to the new factory, autorest fails due to the duplicated keys. If we remove the attribute from the old factory, ApiCompat fails.

Removing this internal attribute from the old factory is not considered a breaking change, so we need to suppress this error somehow.

@kinelski kinelski added Client This issue points to a problem in the data-plane of the library. Cognitive - Form Recognizer labels Apr 4, 2023
@kinelski kinelski added this to the Backlog milestone Apr 4, 2023
@kinelski kinelski self-assigned this Apr 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Client This issue points to a problem in the data-plane of the library. Cognitive - Form Recognizer
Projects
None yet
Development

No branches or pull requests

1 participant