-
-
Notifications
You must be signed in to change notification settings - Fork 182
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
feat: adding support to change the collection type for arrays in Java models #2029
Conversation
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.
Welcome to AsyncAPI. Thanks a lot for creating your first pull request. Please check out our contributors guide useful for opening a pull request.
Keep in mind there are also other channels you can use to interact with AsyncAPI community. For more details check out this issue.
✅ Deploy Preview for modelina canceled.
|
Quality Gate failedFailed conditions |
Created this PR to implement the same as in asyncapi/cli#1437 to address asyncapi/cli#1436 , but being blocked by Sonar due to duplications on test file. Am I missing something here? |
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.
Just one comment ✌️
javaArrayType: Flags.string({ | ||
type: 'option', | ||
description: 'Java specific, define which type of array needs to be generated.', | ||
options: ['Array', 'List'], |
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.
options: ['Array', 'List'], | |
options: ['array', 'list'], |
Lets keep it to all lower case or all upper case options for now ✌️
description: 'Java specific, define which type of array needs to be generated.', | ||
options: ['Array', 'List'], | ||
required: false, | ||
default: 'Array' |
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.
default: 'Array' | |
default: 'array' |
const fileGenerator = new JavaFileGenerator({ presets }); | ||
const fileGenerator = new JavaFileGenerator({ | ||
presets, | ||
collectionType: javaArrayType as 'Array' | 'List' |
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.
collectionType: javaArrayType as 'Array' | 'List' | |
collectionType: javaArrayType as 'array' | 'list' |
test | ||
.stderr() | ||
.stdout() | ||
.command([...generalOptions, 'java', ASYNCAPI_V2_DOCUMENT, `-o=${ path.resolve(outputDir, './java')}`, '--packageName', 'test.pkg', '--javaArrayType=List']) |
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.
.command([...generalOptions, 'java', ASYNCAPI_V2_DOCUMENT, `-o=${ path.resolve(outputDir, './java')}`, '--packageName', 'test.pkg', '--javaArrayType=List']) | |
.command([...generalOptions, 'java', ASYNCAPI_V2_DOCUMENT, `-o=${ path.resolve(outputDir, './java')}`, '--packageName', 'test.pkg', '--javaArrayType=list']) |
Just ignore it 🙂 |
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.
C# already use first upper case, so lets stick to it until we get uniform options ✌️
🎉 This PR is included in version 4.0.0-next.49 🎉 The release is available on: Your semantic-release bot 📦🚀 |
@all-contributors please add @borrull for code, test |
I've put up a pull request to add @borrull! 🎉 |
Description
This PR adds support to change the collection type in Java models by introducing a new parameter "javaArrayType" to the generate models command.
Checklist
npm run lint
).npm run test
).