Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restriction of subsets of swagger-files used for generation #86

Open
paveltobias opened this issue Feb 6, 2020 · 1 comment
Open

Restriction of subsets of swagger-files used for generation #86

paveltobias opened this issue Feb 6, 2020 · 1 comment
Labels
discussion Enhancement or issue should be discussed and validated feature request Proposal for a new feature question Further information is requested

Comments

@paveltobias
Copy link
Contributor

paveltobias commented Feb 6, 2020

A single swagger-file might:

  • be shared between several front-ends, each of which use different parts of it;
  • contain endpoints not meant to be consumed by any front-end, but rather used for web hooks etc.

Currently there is no way to restrict which definitions and paths/endpoints will be used for model+service generation, i.e. some of them might be superfluous for a given front-end. It would be nice to have (at least) one of the following features:

  • A program option allowing to specify a pattern (PCRE?) that has to be matched by an endpoint's path -- otherwise the path is not generated into a service method. Definitions unused by any of the matching paths should not be generated into models either.
  • Recognition of a custom non-standard flag (e.g. something like x-acg-omit: true) used to tag an endpoint (= [path, HTTP-method]). The result would, again, be the omission of the given endpoint and consequently unused definitions.

Does it sound reasonable?

@paveltobias paveltobias added the feature request Proposal for a new feature label Feb 6, 2020
@vmasek vmasek added question Further information is requested discussion Enhancement or issue should be discussed and validated labels Dec 2, 2020
@vmasek
Copy link
Member

vmasek commented Dec 2, 2020

As of right now, the tags might be able to solve this.
With each endpoint, you can specify a tags string array in to distinguish the endpoints used for "user-consumption" and for "other-purposes" and then generate only certain tags. But this would group all the endpoints under one tag to the same service.

ad x-acg-omit: true
I can see the benefit of being able to specify it manually, but I'm not sure if such a feature is needed as auto-gen tools will not support it and you'd always have to manually edit the swagger file, which is close to manually deleting such methods from API service or ignoring them.

ad PCRE
this could be more useful as you could use the "path based filter" on more use-cases than just this one.


It would be nice to see if there are similar needs coming from more users.

@vmasek vmasek moved this to To do in Main board Aug 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion Enhancement or issue should be discussed and validated feature request Proposal for a new feature question Further information is requested
Projects
Status: To do
Development

No branches or pull requests

2 participants