Skip to content

Add operation and tag filtering with transitive OpenAPI schema pruning #385

Description

@HavenDV

Summary

AutoSDK can filter component models, but it cannot select API surface by path, operation ID, or tag. Large first-class specifications therefore require an external OpenAPI preprocessor even when a consumer intentionally wants a focused profile.

Apple's official App Store Connect specification is a useful reproduction:

  • 966 paths / 1,263 operations / 1,393 schemas.
  • Full output: 24,895 generated files, 177 MB of source, 113 MB Release assembly.
  • An externally selected Advantage profile of 24 paths / 39 operations still produced 2,438 files, 15 MB of source, and an 11 MB assembly when the source document retained broad components.

The full SDK remains valuable and should stay the default. This feature is for constrained deployments, purpose-specific packages, regression fixtures, and incremental migration.

Requested CLI surface

Support repeatable selectors such as:

  • --include-path / --exclude-path
  • --include-operation-id / --exclude-operation-id
  • --include-tag / --exclude-tag

Names are illustrative; a single expression-based selector is also reasonable.

After operation selection, AutoSDK should compute the transitive closure of reachable:

  • parameters and request bodies;
  • success and error responses;
  • component schemas, discriminators, and composed-schema variants;
  • security schemes used by selected operations;
  • referenced headers and callbacks when present.

Unreachable operations and components should not be generated. Diagnostics should identify selectors that match nothing and references that cannot be resolved.

Acceptance criteria

  • Add a large multi-tag OpenAPI fixture.
  • Generate a selected tag/path/operation profile without external Redocly/jq preprocessing.
  • Verify unrelated clients and schemas are absent while shared transitive dependencies remain.
  • Build, trim, and runtime-smoke the selected output.
  • Keep unfiltered generation behavior unchanged.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions