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

[REQ] Add support for excluding paths/operations from code generation (online generator module) #18677

Open
GeorgeFkd opened this issue May 15, 2024 · 5 comments

Comments

@GeorgeFkd
Copy link

I have started working on it and will soon create a PR(some refactor is still needed, testing and some more effort).

For the module openapi-generator-online it would be useful if the user could only choose a few of the operations included in an openapi specification and generate the code for those only.

@wing328
Copy link
Member

wing328 commented May 15, 2024

in openapi normalizer, there's a rule called FILTER: https://github.com/openapitools/openapi-generator/blob/master/docs/customization.md#openapi-normalizer

is that what you're looking for?

@GeorgeFkd
Copy link
Author

Yes that is the feature, let the user select what he wants generated, but in the online version not on the CLI.

@wing328
Copy link
Member

wing328 commented May 16, 2024

i think the normalizer is also available to the online service if i'm not mistaken

@GeorgeFkd
Copy link
Author

It is probably somewhere buried in the options object, im reading up on the docs and the sourcecode to find it.

@GeorgeFkd
Copy link
Author

GeorgeFkd commented May 23, 2024

@wing328
Having tried it by setting in the options object "FILTER":"operationId:addPet|getPetById and read lots of the source code it is improbable that it is actually available in the online service.

This is where the options:Map<String,String> is being processed in Generator.class in org/openapitools/codegen/online/service/Generator.java

if (opts.getOptions() != null) {
            codegenConfig.additionalProperties().putAll(opts.getOptions());
            codegenConfig.additionalProperties().put("openAPI", openapi);
}

Its implementation is not difficult,it involves adding an openapi-normalizer:List<String> property in the GeneratorInput.class, i could work on it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants