Skip to content

codegen: Support declaration deduplication (WIP)#5344

Draft
hughsimpson wants to merge 6 commits into
softwaremill:masterfrom
hughsimpson:support_inheritance_weirdness
Draft

codegen: Support declaration deduplication (WIP)#5344
hughsimpson wants to merge 6 commits into
softwaremill:masterfrom
hughsimpson:support_inheritance_weirdness

Conversation

@hughsimpson

Copy link
Copy Markdown
Contributor

Would address #4719

The idea for this was prompted by a somewhat idiosyncratic methodology for versioning that I'm using, where each versioned api is fully declared as a separate openapi. I don't want the compilation overhead of re-generating schemas and serdes for each version where there are no changes to a particular schema, and I do want to be able to reuse security logic without fiddling about with conversions between otherwise-identical types in different namespaces.

I genuinely think this could also be useful for other use-cases, such as sharing common types (e.g. errors) between different APIs.

Currently done:

  • model dedup
  • tapir schema dedup
  • security schema dedup
  • annotation dedup
  • serde dedup (kinda still in progress, has bugs)
  • parse openapi dir structures (probably has bugs, not really tested this yet)

To do:

  • validator dedup
  • endpoint dedup
  • more than one 'inherited' openapi
  • lotsa tests

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