Skip to content

refactor(spec): extract OpenAPI version conversion helpers - #842

Merged
yeongseon merged 1 commit into
mainfrom
refactor/spec-isolate-version-conversion-819
Oct 26, 2026
Merged

yeongseon merged 1 commit into
mainfrom
refactor/spec-isolate-version-conversion-819

Conversation

@yeongseon

@yeongseon yeongseon commented Oct 25, 2026 •

Copy link
Copy Markdown
Owner

Summary

Move OpenAPI schema-version conversion into a private module to separate conversion logic from specification assembly.

Changes

  • Move nullable-reference handling, inline and component schema conversion, and the OpenAPI 3.0 compatibility check into _schema_version_conversion.py.
  • Keep compatibility re-exports in spec.py and preserve the existing conversion algorithms, warnings, exceptions, and public behavior.
  • Preserve distinct inline/component conversion passes, recursion handling, and final-document validation.
  • Update DESIGN.md. Existing tests and assertions remain unchanged.

Validation

  • make test: 1,633 passed, 30 skipped, 22 deselected; coverage was 95.22% before and 95.25% after the extraction.
  • make format-check, make lint, make typecheck, make build, make perf, make lint-workflows, and make security passed.
  • make check-all was not run as a single command; its constituent checks were run individually. Cloud validation was not run.
  • Local performance budgets passed before and after. Median results (10/50/200/500 operations) were 79.93/418.49/1598.60/4454.99 ms before and 82.07/407.62/1645.02/3435.57 ms after; these measurements do not establish a performance improvement.
  • Editor LSP could not resolve Hatch imports; strict repository mypy passed. Maintainer review of the final stacked changes remains pending.

Related Issues

Refs #819

Final PR of the five-part series. Stacked on #841 → #840 → #838; #839 is an independent cleanup. Merge prerequisites first and close #819 after the entire series is merged.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Current-head maintainer authorization for the policy-bearing design update remains outstanding, and the merge checklist is incomplete.

No open issues 🎉

What changed in this PR

This final extraction PR for #819 separates schema version conversion from document compilation, preserving existing conversion behavior and diagnostic ordering.

Changes:

  • Move recursive conversion, inline-schema traversal, and residual OpenAPI 3.0 compatibility checks into one private module.
  • Retain compatibility re-exports in spec.py, leaving existing tests and assertions unchanged.
  • Document the final compilation sequence and why each conversion pass remains necessary.
File Description
src/​azure_functions_openapi/​spec.py Replace conversion implementations with compatibility re-exports.
src/​azure_functions_openapi/​_schema_version_conversion.py Isolate the existing conversion family without registry or CLI dependencies.
DESIGN.md Explain the conversion boundary, pass ordering, and retained work.

Review effort: Balanced

@yeongseon yeongseon changed the title refactor(spec): isolate schema version conversion in a private module refactor(spec): extract OpenAPI version conversion helpers Oct 25, 2026
@yeongseon
yeongseon force-pushed the refactor/spec-report-cli-local-diagnostics-819 branch from 273ef5b to 3603b5f Compare October 26, 2026 10:59
Base automatically changed from refactor/spec-report-cli-local-diagnostics-819 to main October 26, 2026 11:01
@yeongseon
yeongseon force-pushed the refactor/spec-isolate-version-conversion-819 branch from 9bb349f to bf51f0b Compare October 26, 2026 11:02
@yeongseon
yeongseon merged commit d347e60 into main Oct 26, 2026
29 checks passed
@yeongseon
yeongseon deleted the refactor/spec-isolate-version-conversion-819 branch October 26, 2026 11:04
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.

refactor(spec): narrow bidirectional OpenAPI schema conversion and generation diagnostics

2 participants