forked from OpenAPITools/openapi-generator
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use model as body param for generateAliasAsModel (OpenAPITools#4569)
* generateAliasAsModel: Use model name as body param * Update samples
- Loading branch information
1 parent
7a3326e
commit c4d04bf
Showing
9 changed files
with
202 additions
and
166 deletions.
There are no files selected for viewing
288 changes: 149 additions & 139 deletions
288
modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java
Large diffs are not rendered by default.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
samples/client/petstore/dart2/openapi/.openapi-generator/VERSION
This file contains 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 |
---|---|---|
@@ -1 +1 @@ | ||
4.3.1-SNAPSHOT | ||
4.3.1-SNAPSHOT |
This file contains 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
25 changes: 25 additions & 0 deletions
25
samples/client/petstore/dart2/openapi/lib/auth/http_bearer_auth.dart
This file contains 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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
part of openapi.api; | ||
|
||
class HttpBearerAuth implements Authentication { | ||
dynamic _accessToken; | ||
|
||
HttpBearerAuth() { } | ||
|
||
@override | ||
void applyToParams(List<QueryParam> queryParams, Map<String, String> headerParams) { | ||
if (_accessToken is String) { | ||
headerParams["Authorization"] = "Bearer " + _accessToken; | ||
} else if (_accessToken is String Function()){ | ||
headerParams["Authorization"] = "Bearer " + _accessToken(); | ||
} else { | ||
throw ArgumentError('Type of Bearer accessToken should be String or String Function().'); | ||
} | ||
} | ||
|
||
void setAccessToken(dynamic accessToken) { | ||
if (!((accessToken is String) | (accessToken is String Function()))){ | ||
throw ArgumentError('Type of Bearer accessToken should be String or String Function().'); | ||
} | ||
this._accessToken = accessToken; | ||
} | ||
} |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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