Skip to content

Decorator to include only public items #2464

@sanscontext

Description

@sanscontext

Is your feature request related to a problem? Please describe.

I'm working on an OAS file for a repo with a lot of private routes. In probably about 30% or less of these routes are actually exposed to the "public" partners, and the rest are used internally.

I got this working "well enough" by tagging all the routes with x-internal and then bundling with the remove-x-internal decorator. But then I had a (totally reasonable) request from one of the engineers to make this "fail closed", which is to say only include routes that are explicitly tagged, rather than relying on a dev knowing they need to tag new work and any imported routes with x-internal.

Describe the solution you'd like

I would love a built-in decorator that's something like include-only-x-public that would do sort of the inverse of remove-x-internal and keep ONLY the items explicitly tagged.

Describe alternatives you've considered

I did try to get this working with filter-in, but that can't filter on the absence of a tag, so having to have my devs remember to tag everything with x-public: false isn't any better than having them need to tag them as x-internal: true.

Additional context

From a WritetheDocs slack thread. :)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions