azure-search-documents

Diagnose and fix build errors after regenerating the azure-search-documents Java SDK from TypeSpec.

2.6k|2.2k|Updated Dec 6, 2011
One-click install
npx skills add https://github.com/Azure/azure-sdk-for-java --skill azure-search-documents
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: azure-search-documents
Source: https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/search/azure-search-documents/.github/skills/azure-search-documents
Command: npx skills add https://github.com/Azure/azure-sdk-for-java --skill azure-search-documents

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Regenerating the azure-search-documents SDK with tsp-client often produces compilation errors because JavaParser-based customizations in SearchCustomizations.java break against changed generated code, and hand-written wrapper methods fall out of sync with regenerated signatures. This Skill provides search-specific diagnosis and repair guidance that generic generation tools cannot handle.

Core Features & Use Cases

  • Error Diagnosis After Regeneration: Categorizes compilation errors by location (generated @Generated methods, hand-written wrappers, or hand-written files) and routes each to the correct fix location.
  • Customization Maintenance: Documents all five customization methods in SearchCustomizations.java, including the fragile hideWithResponseBinaryDataApis rewiring and duplicate enum constant risks in includeOldApiVersions.
  • Service Version Verification: Guides validation of SearchServiceVersion.getLatest() and old API version lists when a new API version is released.
  • Use Case: After running tsp-client update for a new Azure Search API version, the build fails with duplicate enum constants and cross-package import errors. Use this Skill to identify that the generator now produces a version still listed in includeOldApiVersions() and that hideWithResponseBinaryDataApis created mismatched imports, then apply the documented fixes.

Quick Start

Regenerate the azure-search-documents SDK and help me diagnose and fix the resulting build errors in SearchCustomizations.java.

Frequently Asked Questions about azure-search-documents

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I fix build errors after regenerating azure-search-documents with tsp-client?

Categorize each compilation error by location. Errors in @Generated methods mean SearchCustomizations.java produced broken output and its AST queries need updating. Errors in non-@Generated methods or hand-written files require fixing those files to match changed generated signatures.

How do I update the API version in the azure-search-documents Java SDK?

Regenerate with tsp-client, then verify SearchServiceVersion.getLatest() returns the new version. Add the previous latest version to includeOldApiVersions() in SearchCustomizations.java, but remove any version the generator now produces to avoid duplicate enum constants.

Why does SearchCustomizations.java silently do nothing after regeneration?

A method or class name changed upstream in the generated code, so getMethodsByName() returns empty with no error or warning. Verify the string literals in the customization match the current generated code structure.

Can I edit generated files directly in azure-search-documents?

No. Files with the TypeSpec Code Generator header are overwritten on every tsp-client update. All modifications must go through SearchCustomizations.java, except methods without @Generated annotations, which are hand-written wrappers you update manually.

Why do cross-package import errors appear after hideWithResponseBinaryDataApis runs?

This customization rewires method bodies via string replacement across packages, which creates import mismatches when operations are added or removed in the spec and type numbering changes. Check whether the spec changed and update the customization accordingly.