-
Notifications
You must be signed in to change notification settings - Fork 91
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
Add validation when the input-base-dir is not present #928
base: main
Are you sure you want to change the base?
Conversation
a700976
to
b9a8d5e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @mcruzdev.
Looks good. I just left a few nits.
@@ -60,4 +61,14 @@ public void testInputDir() throws CodeGenException { | |||
Path.of("target/generated-test-sources/inputDir/io/petstore/PetResource.java"))); | |||
} | |||
|
|||
@Test | |||
public void shouldGenerateAnErrorWhenInputDirIsNotExist() throws CodeGenException { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
public void shouldGenerateAnErrorWhenInputDirIsNotExist() throws CodeGenException { | |
public void shouldGenerateAnErrorWhenInputDirIsNotExist() { |
private static void validateOpenApiDir(CodeGenContext context, Path openApiDir) throws CodeGenException { | ||
if (!Files.exists(openApiDir)) { | ||
throw new CodeGenException( | ||
"The OpenAPI input base directory does not exist, please, create the directory on " + context.inputDir()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"The OpenAPI input base directory does not exist, please, create the directory on " + context.inputDir()); | |
"The OpenAPI input base directory does not exist. Please create the directory at " + context.inputDir()); |
|
||
if (!Files.isDirectory(openApiDir)) { | ||
throw new CodeGenException( | ||
"The OpenAPI input base directory is not a directory, please, create the directory on " |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"The OpenAPI input base directory is not a directory, please, create the directory on " | |
"The OpenAPI input base directory is not a directory. Please create the directory at " |
Many thanks for submitting your Pull Request ❤️!
Fixes #871
Please make sure that your PR meets the following requirements:
[0.9.x] Subject
I am not sure if this pull request solves the issue, but I think that shows a better message.
How to backport a pull request to a different branch?
In order to automatically create a backporting pull request please add one or more labels having the following format
backport-<branch-name>
, where<branch-name>
is the name of the branch where the pull request must be backported to (e.g.,backport-quarkus2
to backport the original PR to thequarkus2
branch).Once the original pull request is successfully merged, the automated action will create one backporting pull request per each label (with the previous format) that has been added.
If something goes wrong, the author will be notified and at this point a manual backporting is needed.