-
-
Notifications
You must be signed in to change notification settings - Fork 7.3k
typescript-angular: Feature/model suffix #418
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
Merged
Merged
Changes from 1 commit
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
ab8844d
Added serviceSuffix and serviceFileSuffix parameters to control the s…
tomvangreen 1dcf460
Updated TypeScriptAngularClientOptionsProvider to include the new ser…
tomvangreen 057ba69
Fixed part in generator where hardcoded 'Service' suffix was used.
tomvangreen f3d23db
Made the . in the service file name part of the config setting
tomvangreen 6db1c3d
Updated cli message
tomvangreen 4df1b01
Merge remote-tracking branch 'upstream/master'
tomvangreen 94bf5a0
Making model and model file suffix configurable for lang typescript-a…
tomvangreen 48facf0
Added validation for service and model suffixes (for class and files)
tomvangreen c795fb3
Made regex patterns static
tomvangreen 6d0870e
Added javadoc to validate methods
tomvangreen File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev
Previous commit
Added javadoc to validate methods
- Loading branch information
commit 6d0870e90b019a9d4459ed6d6d18e8a147b56268
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -36,7 +36,7 @@ public class TypeScriptAngularClientCodegen extends AbstractTypeScriptClientCode | |
| private static final String X_DISCRIMINATOR_TYPE = "x-discriminator-value"; | ||
| private static String CLASS_NAME_SUFFIX_PATTERN = "^[a-zA-Z0-9]*$"; | ||
| private static String FILE_NAME_SUFFIX_PATTERN = "^[a-zA-Z0-9.-]*$"; | ||
|
|
||
| public static final String NPM_NAME = "npmName"; | ||
| public static final String NPM_VERSION = "npmVersion"; | ||
| public static final String NPM_REPOSITORY = "npmRepository"; | ||
|
|
@@ -530,6 +530,12 @@ private String removeModelSuffixIfNecessary(String name) { | |
| return name.substring(0, name.length() - modelSuffix.length()); | ||
| } | ||
|
|
||
| /** | ||
| * Validates that the given string value only contains '-', '.' and alpha numeric characters. | ||
| * Throws an IllegalArgumentException, if the string contains any other characters. | ||
| * @param argument The name of the argument being validated. This is only used for displaying an error message. | ||
| * @param value The value that is being validated. | ||
| */ | ||
| private void validateFileSuffixArgument(String argument, String value) { | ||
| if (!value.matches(FILE_NAME_SUFFIX_PATTERN)) { | ||
| throw new IllegalArgumentException( | ||
|
|
@@ -538,6 +544,12 @@ private void validateFileSuffixArgument(String argument, String value) { | |
| } | ||
| } | ||
|
|
||
| /** | ||
| * Validates that the given string value only contains alpha numeric characters. | ||
| * Throws an IllegalArgumentException, if the string contains any other characters. | ||
| * @param argument The name of the argument being validated. This is only used for displaying an error message. | ||
| * @param value The value that is being validated. | ||
| */ | ||
| private void validateClassSuffixArgument(String argument, String value) { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same here |
||
| if (!value.matches(CLASS_NAME_SUFFIX_PATTERN)) { | ||
| throw new IllegalArgumentException( | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
please add a method description. describe what
argumentandvalueare or rename them to better understand their meaning