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

Parameter --external-ref-resolution seems to be failing #332

Open
Aschraf opened this issue Nov 21, 2024 · 2 comments
Open

Parameter --external-ref-resolution seems to be failing #332

Aschraf opened this issue Nov 21, 2024 · 2 comments

Comments

@Aschraf
Copy link

Aschraf commented Nov 21, 2024

Hello,
I'm trying to generate models from a multi-file api and was experimenting with --external-ref-resolution but it gives:

Exception in thread "main" com.beust.jcommander.ParameterException: Was passed main parameter '--external-ref-resolution' but no main parameter was defined in your arg class
        at com.beust.jcommander.JCommander.initMainParameterValue(JCommander.java:961)
        at com.beust.jcommander.JCommander.parseValues(JCommander.java:762)
        at com.beust.jcommander.JCommander.parse(JCommander.java:363)
        at com.beust.jcommander.JCommander.parse(JCommander.java:342)
        at com.cjbooms.fabrikt.cli.CodeGenArgs$Companion.parse(CodeGenArgs.kt:29)
        at com.cjbooms.fabrikt.cli.CodeGen.main(CodeGen.kt:17)

for info, here are all my args:

 args = listOf(
            "--output-directory", generationDir,
            "--base-package", "com.example",
            "--api-file", apiFile,
            "--targets", "http_models",
            "--http-model-opts", "SEALED_INTERFACES_FOR_ONE_OF",
            "--validation-library", "JAKARTA_VALIDATION",
            "--external-ref-resolution", "TARGETED"
        )

Is this parameter actually supported?
Thanks

@cjbooms
Copy link
Owner

cjbooms commented Nov 21, 2024

Seems to work as expected
#333
https://github.com/cjbooms/fabrikt/actions/runs/11951031296/job/33313792959

@Aschraf
Copy link
Author

Aschraf commented Nov 21, 2024

Thanks, @cjbooms, for checking. It's indeed working for version 18.0.0 once fixed. I was using
fabrikt("com.cjbooms:fabrikt:+")
as in the example and that fails.

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

No branches or pull requests

2 participants