forked from loafle/openapi-generator-original
Fix another batch of spelling typos (#13915)
* Fix typos * Remove repeated words * Minor grammar fixes
This commit is contained in:
parent
3dc8403e10
commit
9f1fa0e440
@ -36,7 +36,7 @@ jobs:
|
|||||||
- samples/client/petstore/java/resttemplate
|
- samples/client/petstore/java/resttemplate
|
||||||
- samples/client/petstore/java/resttemplate-withXml
|
- samples/client/petstore/java/resttemplate-withXml
|
||||||
- samples/client/petstore/java/webclient
|
- samples/client/petstore/java/webclient
|
||||||
- samples/client/petstore/java/webclient-nulable-arrays
|
- samples/client/petstore/java/webclient-nullable-arrays
|
||||||
- samples/client/petstore/java/vertx
|
- samples/client/petstore/java/vertx
|
||||||
- samples/client/petstore/java/jersey2-java8-localdatetime
|
- samples/client/petstore/java/jersey2-java8-localdatetime
|
||||||
- samples/client/petstore/java/resteasy
|
- samples/client/petstore/java/resteasy
|
||||||
|
2
.github/workflows/samples-kotlin-client.yaml
vendored
2
.github/workflows/samples-kotlin-client.yaml
vendored
@ -1,4 +1,4 @@
|
|||||||
name: Samples Kotlin cilent
|
name: Samples Kotlin client
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
## customise it to your individual needs - from themes to extensions, you
|
## customise it to your individual needs - from themes to extensions, you
|
||||||
## have full control.
|
## have full control.
|
||||||
##
|
##
|
||||||
## The easiest way to try out Gitpod is install the browser extenion:
|
## The easiest way to try out Gitpod is install the browser extension:
|
||||||
## 'https://www.gitpod.io/docs/browser-extension' or by prefixing
|
## 'https://www.gitpod.io/docs/browser-extension' or by prefixing
|
||||||
## 'https://gitpod.io#' to the source control URL of any project.
|
## 'https://gitpod.io#' to the source control URL of any project.
|
||||||
##
|
##
|
||||||
|
@ -6,4 +6,4 @@ additionalProperties:
|
|||||||
packageGuid: '{3C799344-F285-4669-8FD5-7ED9B795D5C5}'
|
packageGuid: '{3C799344-F285-4669-8FD5-7ED9B795D5C5}'
|
||||||
aspnetCoreVersion: "6.0"
|
aspnetCoreVersion: "6.0"
|
||||||
userSecretsGuid: 'cb87e868-8646-48ef-9bb6-344b537d0d37'
|
userSecretsGuid: 'cb87e868-8646-48ef-9bb6-344b537d0d37'
|
||||||
useSeperateModelProject: true
|
useSeparateModelProject: true
|
||||||
|
@ -12,6 +12,6 @@ additionalProperties:
|
|||||||
library: "spring-boot"
|
library: "spring-boot"
|
||||||
withXml: true
|
withXml: true
|
||||||
jackson: true
|
jackson: true
|
||||||
camelUseDefaultValidationtErrorProcessor: true
|
camelUseDefaultValidationErrorProcessor: true
|
||||||
camelRestClientRequestValidation: true
|
camelRestClientRequestValidation: true
|
||||||
camelSecurityDefinitions: true
|
camelSecurityDefinitions: true
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
generatorName: java
|
generatorName: java
|
||||||
outputDir: samples/client/petstore/java/webclient-nulable-arrays
|
outputDir: samples/client/petstore/java/webclient-nullable-arrays
|
||||||
library: webclient
|
library: webclient
|
||||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/schema-with-nullable-arrays.yaml
|
inputSpec: modules/openapi-generator/src/test/resources/3_0/schema-with-nullable-arrays.yaml
|
||||||
templateDir: modules/openapi-generator/src/main/resources/Java
|
templateDir: modules/openapi-generator/src/main/resources/Java
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
generatorName: swift5
|
generatorName: swift5
|
||||||
outputDir: samples/client/petstore/swift5/deprecated
|
outputDir: samples/client/petstore/swift5/deprecated
|
||||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-depreacted-fields.yaml
|
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-deprecated-fields.yaml
|
||||||
templateDir: modules/openapi-generator/src/main/resources/swift5
|
templateDir: modules/openapi-generator/src/main/resources/swift5
|
||||||
generateAliasAsModel: true
|
generateAliasAsModel: true
|
||||||
additionalProperties:
|
additionalProperties:
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
---
|
---
|
||||||
# csharp-netcore test files and image for upload
|
# csharp-netcore test files and image for upload
|
||||||
- filename: "samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools.Test/JSONComposedSchemaTests.cs"
|
- filename: "samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools.Test/JSONComposedSchemaTests.cs"
|
||||||
sha256: aaa596db60531417994533b0e7962eca21dcaf8fa3aea1e2e3cb8b1b216cb89f
|
sha256: 054adb6efaff70f492e471cb3e4d628d22cda814906808fd3fcce36ce710b7ee
|
||||||
- filename: "samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools.Test/Api/PetApiTests.cs"
|
- filename: "samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools.Test/Api/PetApiTests.cs"
|
||||||
sha256: dae985015ba461297927d544a78267f2def35e07c3f14ca66468fd61e1fd1c26
|
sha256: ff6a5fccd4c026d85fe7232911cda445f5065dcefd03abe258e19af5b28d05c5
|
||||||
- filename: "samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools.Test/linux-logo.png"
|
- filename: "samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools.Test/linux-logo.png"
|
||||||
sha256: 0a67c32728197e942b13bdda064b73793f12f5c795f1e5cf35a3adf69c973230
|
sha256: 0a67c32728197e942b13bdda064b73793f12f5c795f1e5cf35a3adf69c973230
|
||||||
# java okhttp gson test files
|
# java okhttp gson test files
|
||||||
|
@ -56,7 +56,7 @@ The above configuration will do the following:
|
|||||||
* Compile a user-provided `my_custom_templates/api_interfaces.mustache` following our usual API template compilation logic. That is, one file will be created per API; APIs are generated defined according to tags in your spec documentation. The destination filename of `Interface.kt` will act as a suffix for the filename. So, a tag of `Equipment` will output a corresponding `EquipmentInterface.kt`.
|
* Compile a user-provided `my_custom_templates/api_interfaces.mustache` following our usual API template compilation logic. That is, one file will be created per API; APIs are generated defined according to tags in your spec documentation. The destination filename of `Interface.kt` will act as a suffix for the filename. So, a tag of `Equipment` will output a corresponding `EquipmentInterface.kt`.
|
||||||
* Because `api.mustache` is the same mustache filename as used in your target generator (`kotlin` in this example), we support the following:
|
* Because `api.mustache` is the same mustache filename as used in your target generator (`kotlin` in this example), we support the following:
|
||||||
- The destination filename provides a suffix for the generated output. APIs generate per tag in your specification. So, a tag of `Equipment` will output a corresponding `EquipmentImpl.kt`. This option will be used whether `api.mustache` targets a user customized template or a built-in template.
|
- The destination filename provides a suffix for the generated output. APIs generate per tag in your specification. So, a tag of `Equipment` will output a corresponding `EquipmentImpl.kt`. This option will be used whether `api.mustache` targets a user customized template or a built-in template.
|
||||||
- The built-in template will be used if you haven't provided an customized template. The kotlin generator defines the suffix as simply `.kt`, so this scenario would modify only the generated file suffixes according to the previous bullet point.
|
- The built-in template will be used if you haven't provided a customized template. The kotlin generator defines the suffix as simply `.kt`, so this scenario would modify only the generated file suffixes according to the previous bullet point.
|
||||||
- Your `api.mustache` will be used if it exists in your custom template directory. For generators with library options, such as `jvm-okhttp3` in the kotlin generator, your file must exist in the same relative location as the embedded template. For kotlin using the `jvm-okhttp3` library option, this file would need to be located at `my_custom_templates/libraries/jvm-okhttp/api.mustache`. See [templating](./templating.md) for more details.
|
- Your `api.mustache` will be used if it exists in your custom template directory. For generators with library options, such as `jvm-okhttp3` in the kotlin generator, your file must exist in the same relative location as the embedded template. For kotlin using the `jvm-okhttp3` library option, this file would need to be located at `my_custom_templates/libraries/jvm-okhttp/api.mustache`. See [templating](./templating.md) for more details.
|
||||||
* Compile `my_custom_templates/other/check.mustache` with the supporting files bundle, and output to `scripts/check.sh` in your output directory. Note that we don't currently support setting file flags on output, so scripts such as these will either have to be sourced rather than executed, or have file flags set separately after generation (external to our tooling).
|
* Compile `my_custom_templates/other/check.mustache` with the supporting files bundle, and output to `scripts/check.sh` in your output directory. Note that we don't currently support setting file flags on output, so scripts such as these will either have to be sourced rather than executed, or have file flags set separately after generation (external to our tooling).
|
||||||
|
|
||||||
@ -169,7 +169,7 @@ If you publish your artifact to a distant maven repository, do not forget to add
|
|||||||
|
|
||||||
You may not want to generate *all* models in your project. Likewise, you may want just one or two apis to be written. If that's the case, you can use system properties or [global properties](./global-properties.md) to control the output.
|
You may not want to generate *all* models in your project. Likewise, you may want just one or two apis to be written. If that's the case, you can use system properties or [global properties](./global-properties.md) to control the output.
|
||||||
|
|
||||||
The default is generate *everything* supported by the specific library. Once you enable a feature, it will restrict the contents generated:
|
The default is to generate *everything* supported by the specific library. Once you enable a feature, it will restrict the contents generated:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
# generate only models
|
# generate only models
|
||||||
@ -397,7 +397,7 @@ or
|
|||||||
|
|
||||||
## Schema Mapping
|
## Schema Mapping
|
||||||
|
|
||||||
One can map the schema to someting else (e.g. external objects/models outside of the package) using the `schemaMappings` option, e.g. in CLI
|
One can map the schema to something else (e.g. external objects/models outside of the package) using the `schemaMappings` option, e.g. in CLI
|
||||||
```sh
|
```sh
|
||||||
java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar generate -g java -i modules/openapi-generator/src/test/resources/3_0/type-alias.yaml -o /tmp/java2/ --schema-mapping TypeAlias=foo.bar.TypeAlias
|
java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar generate -g java -i modules/openapi-generator/src/test/resources/3_0/type-alias.yaml -o /tmp/java2/ --schema-mapping TypeAlias=foo.bar.TypeAlias
|
||||||
```
|
```
|
||||||
|
@ -51,7 +51,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
|||||||
|useDefaultRouting|Use default routing for the ASP.NET Core version.| |true|
|
|useDefaultRouting|Use default routing for the ASP.NET Core version.| |true|
|
||||||
|useFrameworkReference|Use frameworkReference for ASP.NET Core 3.0+ and PackageReference ASP.NET Core 2.2 or earlier.| |false|
|
|useFrameworkReference|Use frameworkReference for ASP.NET Core 3.0+ and PackageReference ASP.NET Core 2.2 or earlier.| |false|
|
||||||
|useNewtonsoft|Uses the Newtonsoft JSON library.| |true|
|
|useNewtonsoft|Uses the Newtonsoft JSON library.| |true|
|
||||||
|useSeperateModelProject|Create a seperate project for models| |false|
|
|useSeparateModelProject|Create a separate project for models| |false|
|
||||||
|useSwashbuckle|Uses the Swashbuckle.AspNetCore NuGet package for documentation.| |true|
|
|useSwashbuckle|Uses the Swashbuckle.AspNetCore NuGet package for documentation.| |true|
|
||||||
|
|
||||||
## IMPORT MAPPING
|
## IMPORT MAPPING
|
||||||
|
@ -38,7 +38,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
|||||||
|camelRestClientRequestValidation|enable validation of the client request to check whether the Content-Type and Accept headers from the client is supported by the Rest-DSL configuration| |false|
|
|camelRestClientRequestValidation|enable validation of the client request to check whether the Content-Type and Accept headers from the client is supported by the Rest-DSL configuration| |false|
|
||||||
|camelRestComponent|name of the Camel component to use as the REST consumer| |servlet|
|
|camelRestComponent|name of the Camel component to use as the REST consumer| |servlet|
|
||||||
|camelSecurityDefinitions|generate camel security definitions| |true|
|
|camelSecurityDefinitions|generate camel security definitions| |true|
|
||||||
|camelUseDefaultValidationtErrorProcessor|generate default validation error processor| |true|
|
|camelUseDefaultValidationErrorProcessor|generate default validation error processor| |true|
|
||||||
|camelValidationErrorProcessor|validation error processor bean name| |validationErrorProcessor|
|
|camelValidationErrorProcessor|validation error processor bean name| |validationErrorProcessor|
|
||||||
|configPackage|configuration package for generated code| |org.openapitools.configuration|
|
|configPackage|configuration package for generated code| |org.openapitools.configuration|
|
||||||
|dateLibrary|Option. Date library to use|<dl><dt>**joda**</dt><dd>Joda (for legacy app only)</dd><dt>**legacy**</dt><dd>Legacy java.util.Date</dd><dt>**java8-localdatetime**</dt><dd>Java 8 using LocalDateTime (for legacy app only)</dd><dt>**java8**</dt><dd>Java 8 native JSR310 (preferred for jdk 1.8+)</dd></dl>|java8|
|
|dateLibrary|Option. Date library to use|<dl><dt>**joda**</dt><dd>Joda (for legacy app only)</dd><dt>**legacy**</dt><dd>Legacy java.util.Date</dd><dt>**java8-localdatetime**</dt><dd>Java 8 using LocalDateTime (for legacy app only)</dd><dt>**java8**</dt><dd>Java 8 native JSR310 (preferred for jdk 1.8+)</dd></dl>|java8|
|
||||||
|
@ -30,7 +30,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
|||||||
|soapPath|basepath of the soap services| |null|
|
|soapPath|basepath of the soap services| |null|
|
||||||
|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true|
|
|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true|
|
||||||
|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true|
|
|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true|
|
||||||
|useSpecifiedOperationId|wheather to use autogenerated operationId's (default) or those specified in openapi spec| |null|
|
|useSpecifiedOperationId|whether to use autogenerated operationId's (default) or those specified in openapi spec| |null|
|
||||||
|
|
||||||
## IMPORT MAPPING
|
## IMPORT MAPPING
|
||||||
|
|
||||||
|
@ -173,10 +173,10 @@ The metadata folder (to store the `VERSION` file for example) is now called `.op
|
|||||||
|
|
||||||
If you use a generator without specifying each parameter, you might see some differences in the generated code.
|
If you use a generator without specifying each parameter, you might see some differences in the generated code.
|
||||||
As example the default package name used in the generated code has changed.
|
As example the default package name used in the generated code has changed.
|
||||||
You need to have a look at the specific value, depending of your target language, but often `Swagger` îs replaced by `OpenAPITools` and `io.swagger` is replaced by `org.openapitools`.
|
You need to have a look at the specific value, depending on your target language, but often `Swagger` îs replaced by `OpenAPITools` and `io.swagger` is replaced by `org.openapitools`.
|
||||||
Concretely if you did not specify anything when you are generating java code, a file `org/openapitools/api/PetApi.java` might be generated instead of `io/swagger/api/PetApi.java`.
|
Concretely if you did not specify anything when you are generating java code, a file `org/openapitools/api/PetApi.java` might be generated instead of `io/swagger/api/PetApi.java`.
|
||||||
|
|
||||||
If this is a problem for you, you need to explicitly set the the parameter value in order to match with the `swagger-codgen` default value (`apiPackage` == `io.swagger` in the previous example with the java generator).
|
If this is a problem for you, you need to explicitly set the parameter value in order to match with the `swagger-codegen` default value (`apiPackage` == `io.swagger` in the previous example with the java generator).
|
||||||
|
|
||||||
|
|
||||||
## New fully qualified name for the classes
|
## New fully qualified name for the classes
|
||||||
|
@ -49,7 +49,7 @@ Projects relying on generated code might need to be adapted.
|
|||||||
==== Validate spec on generation by default
|
==== Validate spec on generation by default
|
||||||
|
|
||||||
The default is to validate the spec during generation. If the spec has errors,
|
The default is to validate the spec during generation. If the spec has errors,
|
||||||
they will appear as errors or warnings to the user. This prevent generation of the project.
|
they will appear as errors or warnings to the user. This prevents generation of the project.
|
||||||
|
|
||||||
If you want to switch back to the `3.1.x` behavior you can use:
|
If you want to switch back to the `3.1.x` behavior you can use:
|
||||||
|
|
||||||
|
@ -119,7 +119,7 @@ outputFolder = "generated-code" + File.separator + "common-mark";
|
|||||||
|
|
||||||
This is the default output location. This will be `generated-code/common-mark` on non-Windows machines and `generated-code\common-mark` on Windows. You may change this to any value you'd like, but a user will almost always provide an output directory.
|
This is the default output location. This will be `generated-code/common-mark` on non-Windows machines and `generated-code\common-mark` on Windows. You may change this to any value you'd like, but a user will almost always provide an output directory.
|
||||||
|
|
||||||
> When joining paths, always use `File.seperator`
|
> When joining paths, always use `File.separator`
|
||||||
|
|
||||||
```java
|
```java
|
||||||
modelTemplateFiles.put("model.mustache", ".zz");
|
modelTemplateFiles.put("model.mustache", ".zz");
|
||||||
|
@ -125,7 +125,7 @@ curl -H "Content-type: application/json" \
|
|||||||
http://localhost:8080/api/gen/clients/python
|
http://localhost:8080/api/gen/clients/python
|
||||||
```
|
```
|
||||||
|
|
||||||
Instead of using `openAPIUrl` with an URL to the OpenAPI spec, one can include the spec in the JSON payload with `spec`:
|
Instead of using `openAPIUrl` with a URL to the OpenAPI spec, one can include the spec in the JSON payload with `spec`:
|
||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
|
@ -37,7 +37,7 @@ Short term are focused on improving contributor and user productivity (part of t
|
|||||||
> Feature set, well-defined API (code and templates), and extensibility improvements.
|
> Feature set, well-defined API (code and templates), and extensibility improvements.
|
||||||
|
|
||||||
* API
|
* API
|
||||||
** Typed representation of the model bound to our templates. As it is, everything is treated an an Object, and this can lead to changes in the interface which might be unexpected from the template perspective.
|
** Typed representation of the model bound to our templates. As it is, everything is treated as an Object, and this can lead to changes in the interface which might be unexpected from the template perspective.
|
||||||
* Feature set (potential generators to add; not an exhaustive list)
|
* Feature set (potential generators to add; not an exhaustive list)
|
||||||
** Azure functions (node.js, server)
|
** Azure functions (node.js, server)
|
||||||
** Finagle HTTP Client (Scala, client)
|
** Finagle HTTP Client (Scala, client)
|
||||||
|
@ -27,7 +27,7 @@ Short term are focused on improving contributor and user productivity (part of t
|
|||||||
* Automated release stability
|
* Automated release stability
|
||||||
* General
|
* General
|
||||||
* OAS3.0 features support: anyOf, oneOf, callbacks, etc
|
* OAS3.0 features support: anyOf, oneOf, callbacks, etc
|
||||||
* Consider opt-in telemetry about generators being used, limited to a counter of invocations by generator name). This would allow us to make prioritization decisions based on statistics.
|
* Consider opt-in telemetry about generators being used, limited to a counter of invocations by generator name. This would allow us to make prioritization decisions based on statistics.
|
||||||
* Code clean up
|
* Code clean up
|
||||||
* centralize build scripts
|
* centralize build scripts
|
||||||
* organize samples/bin scripts according to new generator names
|
* organize samples/bin scripts according to new generator names
|
||||||
@ -43,7 +43,7 @@ Short term are focused on improving contributor and user productivity (part of t
|
|||||||
> Feature set, well-defined API (code and templates), and extensibility improvements.
|
> Feature set, well-defined API (code and templates), and extensibility improvements.
|
||||||
|
|
||||||
### API
|
### API
|
||||||
* Typed representation of the model bound to our templates. As it is, everything is treated an an Object, and this can lead to changes in the interface which might be unexpected from the template perspective.
|
* Typed representation of the model bound to our templates. As it is, everything is treated as an Object, and this can lead to changes in the interface which might be unexpected from the template perspective.
|
||||||
* Feature set (potential generators to add; not an exhaustive list)
|
* Feature set (potential generators to add; not an exhaustive list)
|
||||||
* Azure functions (node.js, server)
|
* Azure functions (node.js, server)
|
||||||
* Finagle HTTP Client (Scala, client)
|
* Finagle HTTP Client (Scala, client)
|
||||||
|
@ -629,7 +629,7 @@ supportsES6: true
|
|||||||
```
|
```
|
||||||
|
|
||||||
The settings are passed exactly the same as for `config.json`. The most important part is the file extension. Supported values are `yml` or `yaml`.
|
The settings are passed exactly the same as for `config.json`. The most important part is the file extension. Supported values are `yml` or `yaml`.
|
||||||
The name of the file should be `config.yml` or `config.yaml` (in our example it will be `config.yaml`.
|
The name of the file should be `config.yml` or `config.yaml` (in our example it will be `config.yaml`).
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
openapi-generator-cli generate -i petstore.yaml -g typescript-fetch -o out \
|
openapi-generator-cli generate -i petstore.yaml -g typescript-fetch -o out \
|
||||||
|
@ -42,10 +42,10 @@
|
|||||||
<camelDataformatProperties>json.out.disableFeatures=WRITE_DATES_AS_TIMESTAMPS</camelDataformatProperties>
|
<camelDataformatProperties>json.out.disableFeatures=WRITE_DATES_AS_TIMESTAMPS</camelDataformatProperties>
|
||||||
<withXml>true</withXml>
|
<withXml>true</withXml>
|
||||||
<jackson>true</jackson>
|
<jackson>true</jackson>
|
||||||
<camelUseDefaultValidationtErrorProcessor>true</camelUseDefaultValidationtErrorProcessor>
|
<camelUseDefaultValidationErrorProcessor>true</camelUseDefaultValidationErrorProcessor>
|
||||||
<!--
|
<!--
|
||||||
Define bean validation error processor
|
Define bean validation error processor
|
||||||
<camelUseDefaultValidationtErrorProcessor>false</camelUseDefaultValidationtErrorProcessor>
|
<camelUseDefaultValidationErrorProcessor>false</camelUseDefaultValidationErrorProcessor>
|
||||||
<camelValidationErrorProcessor>errorProcessorBeanName</camelValidationErrorProcessor>
|
<camelValidationErrorProcessor>errorProcessorBeanName</camelValidationErrorProcessor>
|
||||||
-->
|
-->
|
||||||
<camelRestClientRequestValidation>true</camelRestClientRequestValidation>
|
<camelRestClientRequestValidation>true</camelRestClientRequestValidation>
|
||||||
|
@ -335,7 +335,7 @@ paths:
|
|||||||
- "store"
|
- "store"
|
||||||
summary: "Find purchase order by ID"
|
summary: "Find purchase order by ID"
|
||||||
description: "For valid response try integer IDs with value <= 5 or > 10. Other\
|
description: "For valid response try integer IDs with value <= 5 or > 10. Other\
|
||||||
\ values will generated exceptions"
|
\ values will generate exceptions"
|
||||||
operationId: "getOrderById"
|
operationId: "getOrderById"
|
||||||
produces:
|
produces:
|
||||||
- "application/xml"
|
- "application/xml"
|
||||||
|
@ -335,7 +335,7 @@ paths:
|
|||||||
- "store"
|
- "store"
|
||||||
summary: "Find purchase order by ID"
|
summary: "Find purchase order by ID"
|
||||||
description: "For valid response try integer IDs with value <= 5 or > 10. Other\
|
description: "For valid response try integer IDs with value <= 5 or > 10. Other\
|
||||||
\ values will generated exceptions"
|
\ values will generate exceptions"
|
||||||
operationId: "getOrderById"
|
operationId: "getOrderById"
|
||||||
produces:
|
produces:
|
||||||
- "application/xml"
|
- "application/xml"
|
||||||
|
@ -334,7 +334,7 @@ paths:
|
|||||||
summary: Find purchase order by ID
|
summary: Find purchase order by ID
|
||||||
description: >-
|
description: >-
|
||||||
For valid response try integer IDs with value <= 5 or > 10. Other values
|
For valid response try integer IDs with value <= 5 or > 10. Other values
|
||||||
will generated exceptions
|
will generate exceptions
|
||||||
operationId: getOrderById
|
operationId: getOrderById
|
||||||
parameters:
|
parameters:
|
||||||
- name: orderId
|
- name: orderId
|
||||||
|
@ -334,7 +334,7 @@ paths:
|
|||||||
summary: Find purchase order by ID
|
summary: Find purchase order by ID
|
||||||
description: >-
|
description: >-
|
||||||
For valid response try integer IDs with value <= 5 or > 10. Other values
|
For valid response try integer IDs with value <= 5 or > 10. Other values
|
||||||
will generated exceptions
|
will generate exceptions
|
||||||
operationId: getOrderById
|
operationId: getOrderById
|
||||||
parameters:
|
parameters:
|
||||||
- name: orderId
|
- name: orderId
|
||||||
|
@ -2761,7 +2761,7 @@ public class DefaultCodegen implements CodegenConfig {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* A method that allows generators to pre-process test example payloads
|
* A method that allows generators to pre-process test example payloads
|
||||||
* This can be useful if one needs to change how values like null in string are represnted
|
* This can be useful if one needs to change how values like null in string are represented
|
||||||
* @param data the test data payload
|
* @param data the test data payload
|
||||||
* @return the updated test data payload
|
* @return the updated test data payload
|
||||||
*/
|
*/
|
||||||
|
@ -340,7 +340,7 @@ public class InlineModelResolver {
|
|||||||
} else {
|
} else {
|
||||||
// allOf is just one or more types only so do not generate the inline allOf model
|
// allOf is just one or more types only so do not generate the inline allOf model
|
||||||
if (m.getAllOf().size() == 1) {
|
if (m.getAllOf().size() == 1) {
|
||||||
// handle earlier in this function when looping through properites
|
// handle earlier in this function when looping through properties
|
||||||
} else if (m.getAllOf().size() > 1) {
|
} else if (m.getAllOf().size() > 1) {
|
||||||
LOGGER.warn("allOf schema `{}` containing multiple types (not model) is not supported at the moment.", schema.getName());
|
LOGGER.warn("allOf schema `{}` containing multiple types (not model) is not supported at the moment.", schema.getName());
|
||||||
} else {
|
} else {
|
||||||
@ -892,7 +892,7 @@ public class InlineModelResolver {
|
|||||||
*
|
*
|
||||||
* @param name name of the inline schema
|
* @param name name of the inline schema
|
||||||
* @param schema inilne schema
|
* @param schema inilne schema
|
||||||
* @return the actual model name (based on inlineSchemaNameMapping if provied)
|
* @return the actual model name (based on inlineSchemaNameMapping if provided)
|
||||||
*/
|
*/
|
||||||
private String addSchemas(String name, Schema schema) {
|
private String addSchemas(String name, Schema schema) {
|
||||||
//check inlineSchemaNameMapping
|
//check inlineSchemaNameMapping
|
||||||
|
@ -476,7 +476,7 @@ public abstract class AbstractPhpCodegen extends DefaultCodegen implements Codeg
|
|||||||
|
|
||||||
name = toGenericName(name);
|
name = toGenericName(name);
|
||||||
|
|
||||||
// add prefix and/or suffix only if name does not start wth \ (e.g. \DateTime)
|
// add prefix and/or suffix only if name does not start with \ (e.g. \DateTime)
|
||||||
if (!name.matches("^\\\\.*")) {
|
if (!name.matches("^\\\\.*")) {
|
||||||
if (!StringUtils.isEmpty(modelNamePrefix)) {
|
if (!StringUtils.isEmpty(modelNamePrefix)) {
|
||||||
name = modelNamePrefix + "_" + name;
|
name = modelNamePrefix + "_" + name;
|
||||||
|
@ -44,7 +44,7 @@ public class AspNetCoreServerCodegen extends AbstractCSharpCodegen {
|
|||||||
|
|
||||||
public static final String USE_SWASHBUCKLE = "useSwashbuckle";
|
public static final String USE_SWASHBUCKLE = "useSwashbuckle";
|
||||||
public static final String MODEL_POCOMODE = "pocoModels";
|
public static final String MODEL_POCOMODE = "pocoModels";
|
||||||
public static final String USE_MODEL_SEPERATEPROJECT = "useSeperateModelProject";
|
public static final String USE_MODEL_SEPERATEPROJECT = "useSeparateModelProject";
|
||||||
public static final String ASPNET_CORE_VERSION = "aspnetCoreVersion";
|
public static final String ASPNET_CORE_VERSION = "aspnetCoreVersion";
|
||||||
public static final String SWASHBUCKLE_VERSION = "swashbuckleVersion";
|
public static final String SWASHBUCKLE_VERSION = "swashbuckleVersion";
|
||||||
public static final String CLASS_MODIFIER = "classModifier";
|
public static final String CLASS_MODIFIER = "classModifier";
|
||||||
@ -73,7 +73,7 @@ public class AspNetCoreServerCodegen extends AbstractCSharpCodegen {
|
|||||||
|
|
||||||
private boolean useSwashbuckle = true;
|
private boolean useSwashbuckle = true;
|
||||||
private boolean pocoModels = false;
|
private boolean pocoModels = false;
|
||||||
private boolean useSeperateModelProject = false;
|
private boolean useSeparateModelProject = false;
|
||||||
protected int serverPort = 8080;
|
protected int serverPort = 8080;
|
||||||
protected String serverHost = "0.0.0.0";
|
protected String serverHost = "0.0.0.0";
|
||||||
protected CliOption swashbuckleVersion = new CliOption(SWASHBUCKLE_VERSION, "Swashbuckle version: 3.0.0 (deprecated), 4.0.0 (deprecated), 5.0.0 (deprecated), 6.4.0");
|
protected CliOption swashbuckleVersion = new CliOption(SWASHBUCKLE_VERSION, "Swashbuckle version: 3.0.0 (deprecated), 4.0.0 (deprecated), 5.0.0 (deprecated), 6.4.0");
|
||||||
@ -247,8 +247,8 @@ public class AspNetCoreServerCodegen extends AbstractCSharpCodegen {
|
|||||||
pocoModels);
|
pocoModels);
|
||||||
|
|
||||||
addSwitch(USE_MODEL_SEPERATEPROJECT,
|
addSwitch(USE_MODEL_SEPERATEPROJECT,
|
||||||
"Create a seperate project for models",
|
"Create a separate project for models",
|
||||||
useSeperateModelProject);
|
useSeparateModelProject);
|
||||||
|
|
||||||
addSwitch(IS_LIBRARY,
|
addSwitch(IS_LIBRARY,
|
||||||
"Is the build a library",
|
"Is the build a library",
|
||||||
@ -373,7 +373,7 @@ public class AspNetCoreServerCodegen extends AbstractCSharpCodegen {
|
|||||||
setOperationModifier();
|
setOperationModifier();
|
||||||
setModelClassModifier();
|
setModelClassModifier();
|
||||||
setPocoModels();
|
setPocoModels();
|
||||||
setUseSeperateModelProject();
|
setUseSeparateModelProject();
|
||||||
setUseSwashbuckle();
|
setUseSwashbuckle();
|
||||||
setOperationIsAsync();
|
setOperationIsAsync();
|
||||||
|
|
||||||
@ -408,7 +408,7 @@ public class AspNetCoreServerCodegen extends AbstractCSharpCodegen {
|
|||||||
supportingFiles.add(new SupportingFile("gitignore", packageFolder, ".gitignore"));
|
supportingFiles.add(new SupportingFile("gitignore", packageFolder, ".gitignore"));
|
||||||
supportingFiles.add(new SupportingFile("validateModel.mustache", packageFolder + File.separator + "Attributes", "ValidateModelStateAttribute.cs"));
|
supportingFiles.add(new SupportingFile("validateModel.mustache", packageFolder + File.separator + "Attributes", "ValidateModelStateAttribute.cs"));
|
||||||
|
|
||||||
if (useSeperateModelProject)
|
if (useSeparateModelProject)
|
||||||
{
|
{
|
||||||
supportingFiles.add(new SupportingFile("typeConverter.mustache", sourceFolder + File.separator + modelPackage + File.separator + "Converters", "CustomEnumConverter.cs"));
|
supportingFiles.add(new SupportingFile("typeConverter.mustache", sourceFolder + File.separator + modelPackage + File.separator + "Converters", "CustomEnumConverter.cs"));
|
||||||
} else {
|
} else {
|
||||||
@ -419,7 +419,7 @@ public class AspNetCoreServerCodegen extends AbstractCSharpCodegen {
|
|||||||
supportingFiles.add(new SupportingFile("OpenApi" + File.separator + "TypeExtensions.mustache", packageFolder + File.separator + "OpenApi", "TypeExtensions.cs"));
|
supportingFiles.add(new SupportingFile("OpenApi" + File.separator + "TypeExtensions.mustache", packageFolder + File.separator + "OpenApi", "TypeExtensions.cs"));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (useSeperateModelProject)
|
if (useSeparateModelProject)
|
||||||
{
|
{
|
||||||
supportingFiles.add(new SupportingFile("ModelsProject.csproj.mustache", sourceFolder + File.separator + modelPackage, modelPackage + ".csproj"));
|
supportingFiles.add(new SupportingFile("ModelsProject.csproj.mustache", sourceFolder + File.separator + modelPackage, modelPackage + ".csproj"));
|
||||||
}
|
}
|
||||||
@ -465,7 +465,7 @@ public class AspNetCoreServerCodegen extends AbstractCSharpCodegen {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String modelFileFolder() {
|
public String modelFileFolder() {
|
||||||
if (!useSeperateModelProject)
|
if (!useSeparateModelProject)
|
||||||
{
|
{
|
||||||
return outputFolder + File.separator + sourceFolder + File.separator + packageName + File.separator + "Models";
|
return outputFolder + File.separator + sourceFolder + File.separator + packageName + File.separator + "Models";
|
||||||
} else {
|
} else {
|
||||||
@ -696,15 +696,15 @@ public class AspNetCoreServerCodegen extends AbstractCSharpCodegen {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setUseSeperateModelProject() {
|
private void setUseSeparateModelProject() {
|
||||||
if (additionalProperties.containsKey(USE_MODEL_SEPERATEPROJECT)) {
|
if (additionalProperties.containsKey(USE_MODEL_SEPERATEPROJECT)) {
|
||||||
useSeperateModelProject = convertPropertyToBooleanAndWriteBack(USE_MODEL_SEPERATEPROJECT);
|
useSeparateModelProject = convertPropertyToBooleanAndWriteBack(USE_MODEL_SEPERATEPROJECT);
|
||||||
if (useSeperateModelProject)
|
if (useSeparateModelProject)
|
||||||
{
|
{
|
||||||
LOGGER.info("Using seperate model project");
|
LOGGER.info("Using separate model project");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
additionalProperties.put(USE_MODEL_SEPERATEPROJECT, useSeperateModelProject);
|
additionalProperties.put(USE_MODEL_SEPERATEPROJECT, useSeparateModelProject);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1411,7 +1411,7 @@ public class CSharpNetCoreClientCodegen extends AbstractCSharpCodegen {
|
|||||||
* Without this method, property petType in GrandparentAnimal will not make it through ParentPet and into ChildCat
|
* Without this method, property petType in GrandparentAnimal will not make it through ParentPet and into ChildCat
|
||||||
*/
|
*/
|
||||||
private void EnsureInheritedPropertiesArePresent(CodegenModel derivedModel) {
|
private void EnsureInheritedPropertiesArePresent(CodegenModel derivedModel) {
|
||||||
// every c# generator should definetly want this, or we should fix the issue
|
// every c# generator should definitely want this, or we should fix the issue
|
||||||
// still, lets avoid breaking changes :(
|
// still, lets avoid breaking changes :(
|
||||||
if (Boolean.FALSE.equals(GENERICHOST.equals(getLibrary()))){
|
if (Boolean.FALSE.equals(GENERICHOST.equals(getLibrary()))){
|
||||||
return;
|
return;
|
||||||
|
@ -500,7 +500,7 @@ public class DartDioClientCodegen extends AbstractDartCodegen {
|
|||||||
|
|
||||||
// ancestorOnlyProperties are properties defined by all ancestors
|
// ancestorOnlyProperties are properties defined by all ancestors
|
||||||
// NOTE: oneOf,anyOf are NOT considered ancestors
|
// NOTE: oneOf,anyOf are NOT considered ancestors
|
||||||
// since a child in dart must implment ALL OF the parent (using implements)
|
// since a child in dart must implement ALL OF the parent (using implements)
|
||||||
Map<String, CodegenProperty> ancestorOnlyProperties = new HashMap<>();
|
Map<String, CodegenProperty> ancestorOnlyProperties = new HashMap<>();
|
||||||
|
|
||||||
// combines both selfOnlyProperties and ancestorOnlyProperties
|
// combines both selfOnlyProperties and ancestorOnlyProperties
|
||||||
|
@ -43,7 +43,7 @@ public class JavaCamelServerCodegen extends SpringCodegen implements BeanValidat
|
|||||||
public static final String CAMEL_REST_COMPONENT = "camelRestComponent";
|
public static final String CAMEL_REST_COMPONENT = "camelRestComponent";
|
||||||
public static final String CAMEL_REST_BINDING_MODE = "camelRestBindingMode";
|
public static final String CAMEL_REST_BINDING_MODE = "camelRestBindingMode";
|
||||||
public static final String CAMEL_REST_CLIENT_REQUEST_VALIDATION = "camelRestClientRequestValidation";
|
public static final String CAMEL_REST_CLIENT_REQUEST_VALIDATION = "camelRestClientRequestValidation";
|
||||||
public static final String CAMEL_USE_DEFAULT_VALIDATION_ERROR_PROCESSOR = "camelUseDefaultValidationtErrorProcessor";
|
public static final String CAMEL_USE_DEFAULT_VALIDATION_ERROR_PROCESSOR = "camelUseDefaultValidationErrorProcessor";
|
||||||
public static final String CAMEL_VALIDATION_ERROR_PROCESSOR = "camelValidationErrorProcessor";
|
public static final String CAMEL_VALIDATION_ERROR_PROCESSOR = "camelValidationErrorProcessor";
|
||||||
public static final String CAMEL_SECURITY_DEFINITIONS = "camelSecurityDefinitions";
|
public static final String CAMEL_SECURITY_DEFINITIONS = "camelSecurityDefinitions";
|
||||||
public static final String CAMEL_DATAFORMAT_PROPERTIES = "camelDataformatProperties";
|
public static final String CAMEL_DATAFORMAT_PROPERTIES = "camelDataformatProperties";
|
||||||
@ -51,7 +51,7 @@ public class JavaCamelServerCodegen extends SpringCodegen implements BeanValidat
|
|||||||
private String camelRestComponent = "servlet";
|
private String camelRestComponent = "servlet";
|
||||||
private String camelRestBindingMode = "auto";
|
private String camelRestBindingMode = "auto";
|
||||||
private boolean camelRestClientRequestValidation = false;
|
private boolean camelRestClientRequestValidation = false;
|
||||||
private boolean camelUseDefaultValidationtErrorProcessor = true;
|
private boolean camelUseDefaultValidationErrorProcessor = true;
|
||||||
private String camelValidationErrorProcessor = "validationErrorProcessor";
|
private String camelValidationErrorProcessor = "validationErrorProcessor";
|
||||||
private boolean camelSecurityDefinitions = true;
|
private boolean camelSecurityDefinitions = true;
|
||||||
private String camelDataformatProperties = "";
|
private String camelDataformatProperties = "";
|
||||||
@ -109,7 +109,7 @@ public class JavaCamelServerCodegen extends SpringCodegen implements BeanValidat
|
|||||||
"RestConfiguration.java"));
|
"RestConfiguration.java"));
|
||||||
if (performBeanValidation) {
|
if (performBeanValidation) {
|
||||||
apiTemplateFiles.put("validation.mustache", "Validator.java");
|
apiTemplateFiles.put("validation.mustache", "Validator.java");
|
||||||
if (camelUseDefaultValidationtErrorProcessor) {
|
if (camelUseDefaultValidationErrorProcessor) {
|
||||||
supportingFiles.add(new SupportingFile("errorProcessor.mustache",
|
supportingFiles.add(new SupportingFile("errorProcessor.mustache",
|
||||||
(sourceFolder + File.separator + basePackage).replace(".", java.io.File.separator),
|
(sourceFolder + File.separator + basePackage).replace(".", java.io.File.separator),
|
||||||
"ValidationErrorProcessor.java"));
|
"ValidationErrorProcessor.java"));
|
||||||
@ -174,7 +174,7 @@ public class JavaCamelServerCodegen extends SpringCodegen implements BeanValidat
|
|||||||
cliOptions.add(new CliOption(CAMEL_REST_COMPONENT, "name of the Camel component to use as the REST consumer").defaultValue(camelRestComponent));
|
cliOptions.add(new CliOption(CAMEL_REST_COMPONENT, "name of the Camel component to use as the REST consumer").defaultValue(camelRestComponent));
|
||||||
cliOptions.add(new CliOption(CAMEL_REST_BINDING_MODE, "binding mode to be used by the REST consumer").defaultValue(camelRestBindingMode));
|
cliOptions.add(new CliOption(CAMEL_REST_BINDING_MODE, "binding mode to be used by the REST consumer").defaultValue(camelRestBindingMode));
|
||||||
cliOptions.add(CliOption.newBoolean(CAMEL_REST_CLIENT_REQUEST_VALIDATION, "enable validation of the client request to check whether the Content-Type and Accept headers from the client is supported by the Rest-DSL configuration", camelRestClientRequestValidation));
|
cliOptions.add(CliOption.newBoolean(CAMEL_REST_CLIENT_REQUEST_VALIDATION, "enable validation of the client request to check whether the Content-Type and Accept headers from the client is supported by the Rest-DSL configuration", camelRestClientRequestValidation));
|
||||||
cliOptions.add(CliOption.newBoolean(CAMEL_USE_DEFAULT_VALIDATION_ERROR_PROCESSOR, "generate default validation error processor", camelUseDefaultValidationtErrorProcessor));
|
cliOptions.add(CliOption.newBoolean(CAMEL_USE_DEFAULT_VALIDATION_ERROR_PROCESSOR, "generate default validation error processor", camelUseDefaultValidationErrorProcessor));
|
||||||
cliOptions.add(new CliOption(CAMEL_VALIDATION_ERROR_PROCESSOR, "validation error processor bean name").defaultValue(camelValidationErrorProcessor));
|
cliOptions.add(new CliOption(CAMEL_VALIDATION_ERROR_PROCESSOR, "validation error processor bean name").defaultValue(camelValidationErrorProcessor));
|
||||||
cliOptions.add(CliOption.newBoolean(CAMEL_SECURITY_DEFINITIONS, "generate camel security definitions", camelSecurityDefinitions));
|
cliOptions.add(CliOption.newBoolean(CAMEL_SECURITY_DEFINITIONS, "generate camel security definitions", camelSecurityDefinitions));
|
||||||
cliOptions.add(new CliOption(CAMEL_DATAFORMAT_PROPERTIES, "list of dataformat properties separated by comma (propertyName1=propertyValue2,...").defaultValue(camelDataformatProperties));
|
cliOptions.add(new CliOption(CAMEL_DATAFORMAT_PROPERTIES, "list of dataformat properties separated by comma (propertyName1=propertyValue2,...").defaultValue(camelDataformatProperties));
|
||||||
@ -184,7 +184,7 @@ public class JavaCamelServerCodegen extends SpringCodegen implements BeanValidat
|
|||||||
camelRestComponent = manageAdditionalProperty(CAMEL_REST_COMPONENT, camelRestComponent);
|
camelRestComponent = manageAdditionalProperty(CAMEL_REST_COMPONENT, camelRestComponent);
|
||||||
camelRestBindingMode = manageAdditionalProperty(CAMEL_REST_BINDING_MODE, camelRestBindingMode);
|
camelRestBindingMode = manageAdditionalProperty(CAMEL_REST_BINDING_MODE, camelRestBindingMode);
|
||||||
camelRestClientRequestValidation = manageAdditionalProperty(CAMEL_REST_CLIENT_REQUEST_VALIDATION, camelRestClientRequestValidation);
|
camelRestClientRequestValidation = manageAdditionalProperty(CAMEL_REST_CLIENT_REQUEST_VALIDATION, camelRestClientRequestValidation);
|
||||||
camelUseDefaultValidationtErrorProcessor = manageAdditionalProperty(CAMEL_USE_DEFAULT_VALIDATION_ERROR_PROCESSOR, camelUseDefaultValidationtErrorProcessor);
|
camelUseDefaultValidationErrorProcessor = manageAdditionalProperty(CAMEL_USE_DEFAULT_VALIDATION_ERROR_PROCESSOR, camelUseDefaultValidationErrorProcessor);
|
||||||
camelValidationErrorProcessor = manageAdditionalProperty(CAMEL_VALIDATION_ERROR_PROCESSOR, camelValidationErrorProcessor);
|
camelValidationErrorProcessor = manageAdditionalProperty(CAMEL_VALIDATION_ERROR_PROCESSOR, camelValidationErrorProcessor);
|
||||||
camelSecurityDefinitions = manageAdditionalProperty(CAMEL_SECURITY_DEFINITIONS, camelSecurityDefinitions);
|
camelSecurityDefinitions = manageAdditionalProperty(CAMEL_SECURITY_DEFINITIONS, camelSecurityDefinitions);
|
||||||
camelDataformatProperties = manageAdditionalProperty(CAMEL_DATAFORMAT_PROPERTIES, camelDataformatProperties);
|
camelDataformatProperties = manageAdditionalProperty(CAMEL_DATAFORMAT_PROPERTIES, camelDataformatProperties);
|
||||||
|
@ -715,7 +715,7 @@ public class JavaClientCodegen extends AbstractJavaCodegen
|
|||||||
super.postProcessOperationsWithModels(objs, allModels);
|
super.postProcessOperationsWithModels(objs, allModels);
|
||||||
|
|
||||||
if (useSingleRequestParameter && (JERSEY2.equals(getLibrary()) || JERSEY3.equals(getLibrary()) || OKHTTP_GSON.equals(getLibrary()))) {
|
if (useSingleRequestParameter && (JERSEY2.equals(getLibrary()) || JERSEY3.equals(getLibrary()) || OKHTTP_GSON.equals(getLibrary()))) {
|
||||||
// loop through operations to set x-group-parameters extenion to true if useSingleRequestParameter option is enabled
|
// loop through operations to set x-group-parameters extension to true if useSingleRequestParameter option is enabled
|
||||||
OperationMap operations = objs.getOperations();
|
OperationMap operations = objs.getOperations();
|
||||||
if (operations != null) {
|
if (operations != null) {
|
||||||
List<CodegenOperation> ops = operations.getOperation();
|
List<CodegenOperation> ops = operations.getOperation();
|
||||||
|
@ -163,8 +163,8 @@ public class KtormSchemaCodegen extends AbstractKotlinCodegen {
|
|||||||
typeMapping.put("short", "kotlin.Short");
|
typeMapping.put("short", "kotlin.Short");
|
||||||
typeMapping.put("char", "kotlin.String");
|
typeMapping.put("char", "kotlin.String");
|
||||||
typeMapping.put("real", "kotlin.Double");
|
typeMapping.put("real", "kotlin.Double");
|
||||||
typeMapping.put("UUID", "java.util.UUID"); //be explict
|
typeMapping.put("UUID", "java.util.UUID"); //be explicit
|
||||||
typeMapping.put("URI", "java.net.URI"); //be explict
|
typeMapping.put("URI", "java.net.URI"); //be explicit
|
||||||
typeMapping.put("decimal", "java.math.BigDecimal");
|
typeMapping.put("decimal", "java.math.BigDecimal");
|
||||||
typeMapping.put("BigDecimal", "java.math.BigDecimal");
|
typeMapping.put("BigDecimal", "java.math.BigDecimal");
|
||||||
typeMapping.put("AnyType", "kotlin.Any");
|
typeMapping.put("AnyType", "kotlin.Any");
|
||||||
|
@ -204,7 +204,7 @@ public class PythonClientCodegen extends AbstractPythonCodegen {
|
|||||||
.defaultValue("1.0.0"));
|
.defaultValue("1.0.0"));
|
||||||
cliOptions.add(new CliOption(PACKAGE_URL, "python package URL."));
|
cliOptions.add(new CliOption(PACKAGE_URL, "python package URL."));
|
||||||
// this generator does not use SORT_PARAMS_BY_REQUIRED_FLAG
|
// this generator does not use SORT_PARAMS_BY_REQUIRED_FLAG
|
||||||
// this generator uses the following order for endpoint paramters and model properties
|
// this generator uses the following order for endpoint parameters and model properties
|
||||||
// required params
|
// required params
|
||||||
// optional params which are set to unset as their default for method signatures only
|
// optional params which are set to unset as their default for method signatures only
|
||||||
// optional params as **kwargs
|
// optional params as **kwargs
|
||||||
@ -925,7 +925,7 @@ public class PythonClientCodegen extends AbstractPythonCodegen {
|
|||||||
* - fix the model imports, go from model name to the full import string with toModelImport + globalImportFixer
|
* - fix the model imports, go from model name to the full import string with toModelImport + globalImportFixer
|
||||||
* Also cleans the test folder if test cases exist and the testFolder is set because the tests are autogenerated
|
* Also cleans the test folder if test cases exist and the testFolder is set because the tests are autogenerated
|
||||||
*
|
*
|
||||||
* @param objs a map going from the model name to a object hoding the model info
|
* @param objs a map going from the model name to a object holding the model info
|
||||||
* @return the updated objs
|
* @return the updated objs
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
@ -1134,7 +1134,7 @@ public class PythonClientCodegen extends AbstractPythonCodegen {
|
|||||||
* We have a custom version of this method to produce links to models when they are
|
* We have a custom version of this method to produce links to models when they are
|
||||||
* primitive type (not map, not array, not object) and include validations or are enums
|
* primitive type (not map, not array, not object) and include validations or are enums
|
||||||
*
|
*
|
||||||
* @param body requesst body
|
* @param body request body
|
||||||
* @param imports import collection
|
* @param imports import collection
|
||||||
* @param bodyParameterName body parameter name
|
* @param bodyParameterName body parameter name
|
||||||
* @return the resultant CodegenParameter
|
* @return the resultant CodegenParameter
|
||||||
@ -1734,12 +1734,12 @@ public class PythonClientCodegen extends AbstractPythonCodegen {
|
|||||||
* @param schema the schema that we need an example for
|
* @param schema the schema that we need an example for
|
||||||
* @param objExample the example that applies to this schema, for now only string example are used
|
* @param objExample the example that applies to this schema, for now only string example are used
|
||||||
* @param indentationLevel integer indentation level that we are currently at
|
* @param indentationLevel integer indentation level that we are currently at
|
||||||
* we assume the indentaion amount is 4 spaces times this integer
|
* we assume the indentation amount is 4 spaces times this integer
|
||||||
* @param prefix the string prefix that we will use when assigning an example for this line
|
* @param prefix the string prefix that we will use when assigning an example for this line
|
||||||
* this is used when setting key: value, pairs "key: " is the prefix
|
* this is used when setting key: value, pairs "key: " is the prefix
|
||||||
* and this is used when setting properties like some_property='some_property_example'
|
* and this is used when setting properties like some_property='some_property_example'
|
||||||
* @param exampleLine this is the current line that we are generatign an example for, starts at 0
|
* @param exampleLine this is the current line that we are generating an example for, starts at 0
|
||||||
* we don't indentin the 0th line because using the example value looks like:
|
* we don't indent the 0th line because using the example value looks like:
|
||||||
* prop = ModelName( line 0
|
* prop = ModelName( line 0
|
||||||
* some_property='some_property_example' line 1
|
* some_property='some_property_example' line 1
|
||||||
* ) line 2
|
* ) line 2
|
||||||
@ -2248,9 +2248,9 @@ public class PythonClientCodegen extends AbstractPythonCodegen {
|
|||||||
/**
|
/**
|
||||||
* Use cases:
|
* Use cases:
|
||||||
* additional properties is unset: do nothing
|
* additional properties is unset: do nothing
|
||||||
* additional properties is true: add definiton to property
|
* additional properties is true: add definition to property
|
||||||
* additional properties is false: add definiton to property
|
* additional properties is false: add definition to property
|
||||||
* additional properties is schema: add definiton to property
|
* additional properties is schema: add definition to property
|
||||||
*
|
*
|
||||||
* @param schema the schema that may contain an additional property schema
|
* @param schema the schema that may contain an additional property schema
|
||||||
* @param property the property for the above schema
|
* @param property the property for the above schema
|
||||||
@ -2488,7 +2488,7 @@ public class PythonClientCodegen extends AbstractPythonCodegen {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param pattern the regex pattern
|
* @param pattern the regex pattern
|
||||||
* @return List<String pattern, List<String modifer>>
|
* @return List<String pattern, List<String modifier>>
|
||||||
*/
|
*/
|
||||||
private List<Object> getPatternAndModifiers(String pattern) {
|
private List<Object> getPatternAndModifiers(String pattern) {
|
||||||
/*
|
/*
|
||||||
|
@ -177,7 +177,7 @@ public class RClientCodegen extends DefaultCodegen implements CodegenConfig {
|
|||||||
typeMapping.put("map", "map");
|
typeMapping.put("map", "map");
|
||||||
typeMapping.put("object", "object");
|
typeMapping.put("object", "object");
|
||||||
|
|
||||||
// no need for import mapping as R doesn't reqiure api,model import
|
// no need for import mapping as R doesn't require api,model import
|
||||||
// https://github.com/OpenAPITools/openapi-generator/issues/2217
|
// https://github.com/OpenAPITools/openapi-generator/issues/2217
|
||||||
importMapping.clear();
|
importMapping.clear();
|
||||||
|
|
||||||
|
@ -309,12 +309,12 @@ public class ScalaSttpClientCodegen extends AbstractScalaCodegen implements Code
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
for (ModelsMap objs : enumModels.values()) {
|
for (ModelsMap objs : enumModels.values()) {
|
||||||
List<ModelMap> modles = objs.getModels();
|
List<ModelMap> models = objs.getModels();
|
||||||
if (modles == null || modles.isEmpty()) {
|
if (models == null || models.isEmpty()) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
for (final Map<String, Object> modle : modles) {
|
for (final Map<String, Object> model : models) {
|
||||||
String enumImportPath = (String) modle.get("importPath");
|
String enumImportPath = (String) model.get("importPath");
|
||||||
if (enumImportPath != null && enumImportPath.equals(importPath)) {
|
if (enumImportPath != null && enumImportPath.equals(importPath)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -66,7 +66,7 @@ public class WsdlSchemaCodegen extends DefaultCodegen implements CodegenConfig {
|
|||||||
cliOptions.add(new CliOption("contentTypeVersion",
|
cliOptions.add(new CliOption("contentTypeVersion",
|
||||||
"generate WSDL with parameters/responses of the specified content-type"));
|
"generate WSDL with parameters/responses of the specified content-type"));
|
||||||
cliOptions.add(new CliOption("useSpecifiedOperationId",
|
cliOptions.add(new CliOption("useSpecifiedOperationId",
|
||||||
"wheather to use autogenerated operationId's (default) "
|
"whether to use autogenerated operationId's (default) "
|
||||||
+ "or those specified in openapi spec"));
|
+ "or those specified in openapi spec"));
|
||||||
|
|
||||||
additionalProperties.put("hostname", "localhost");
|
additionalProperties.put("hostname", "localhost");
|
||||||
|
@ -28,7 +28,7 @@ import java.io.Writer;
|
|||||||
import static org.openapitools.codegen.utils.StringUtils.camelize;
|
import static org.openapitools.codegen.utils.StringUtils.camelize;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Appends trailing ? to a text fragement if not already present
|
* Appends trailing ? to a text fragment if not already present
|
||||||
*
|
*
|
||||||
* Register:
|
* Register:
|
||||||
* <pre>
|
* <pre>
|
||||||
|
@ -27,7 +27,7 @@ import java.io.Writer;
|
|||||||
import static org.openapitools.codegen.utils.StringUtils.camelize;
|
import static org.openapitools.codegen.utils.StringUtils.camelize;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Strips trailing ? from a text fragement
|
* Strips trailing ? from a text fragment
|
||||||
*
|
*
|
||||||
* Register:
|
* Register:
|
||||||
* <pre>
|
* <pre>
|
||||||
|
@ -426,7 +426,7 @@ public class ModelUtils {
|
|||||||
/**
|
/**
|
||||||
* Return true if the specified schema is an object with a fixed number of properties.
|
* Return true if the specified schema is an object with a fixed number of properties.
|
||||||
*
|
*
|
||||||
* A ObjectSchema differs from an MapSchema in the following way:
|
* A ObjectSchema differs from a MapSchema in the following way:
|
||||||
* - An ObjectSchema is not extensible, i.e. it has a fixed number of properties.
|
* - An ObjectSchema is not extensible, i.e. it has a fixed number of properties.
|
||||||
* - A MapSchema is an object that can be extended with an arbitrary set of properties.
|
* - A MapSchema is an object that can be extended with an arbitrary set of properties.
|
||||||
* The payload may include dynamic properties.
|
* The payload may include dynamic properties.
|
||||||
|
@ -107,7 +107,7 @@ public class RuleConfiguration {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets whether the recommendation check for for schemas containing type definitions.
|
* Gets whether the recommendation check for schemas containing type definitions.
|
||||||
* <p>
|
* <p>
|
||||||
* In OpenAPI 3.0.x, the "type" attribute must be a string value.
|
* In OpenAPI 3.0.x, the "type" attribute must be a string value.
|
||||||
* In OpenAPI 3.1, the type attribute may be:
|
* In OpenAPI 3.1, the type attribute may be:
|
||||||
@ -134,7 +134,7 @@ public class RuleConfiguration {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets whether the recommendation check for for schemas containing the 'nullable' attribute.
|
* Gets whether the recommendation check for schemas containing the 'nullable' attribute.
|
||||||
* <p>
|
* <p>
|
||||||
* In OpenAPI 3.0.x, the "nullable" attribute is supported. However, because it is deprecated in 3.1
|
* In OpenAPI 3.0.x, the "nullable" attribute is supported. However, because it is deprecated in 3.1
|
||||||
* and above, a warning is logged to prepare for OpenAPI 3.1 recommendations.
|
* and above, a warning is logged to prepare for OpenAPI 3.1 recommendations.
|
||||||
@ -160,7 +160,7 @@ public class RuleConfiguration {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets whether the recommendation check for for schemas containing invalid values for the 'type' attribute.
|
* Gets whether the recommendation check for schemas containing invalid values for the 'type' attribute.
|
||||||
* <p>
|
* <p>
|
||||||
*
|
*
|
||||||
* @return <code>true</code> if enabled, <code>false</code> if disabled
|
* @return <code>true</code> if enabled, <code>false</code> if disabled
|
||||||
|
@ -125,7 +125,7 @@ typedef struct internal_hooks
|
|||||||
} internal_hooks;
|
} internal_hooks;
|
||||||
|
|
||||||
#if defined(_MSC_VER)
|
#if defined(_MSC_VER)
|
||||||
/* work around MSVC error C2322: '...' address of dillimport '...' is not static */
|
/* work around MSVC error C2322: '...' address of dllimport '...' is not static */
|
||||||
static void *internal_malloc(size_t size)
|
static void *internal_malloc(size_t size)
|
||||||
{
|
{
|
||||||
return malloc(size);
|
return malloc(size);
|
||||||
|
@ -320,7 +320,7 @@ feature -- HTTP client: call api
|
|||||||
-- Execute an HTTP request with the given options.
|
-- Execute an HTTP request with the given options.
|
||||||
-- Relative path `a_path'
|
-- Relative path `a_path'
|
||||||
-- Method `a_method' "GET", "HEAD", "OPTIONS", "POST", "PUT", "PATCH" and "DELETE"
|
-- Method `a_method' "GET", "HEAD", "OPTIONS", "POST", "PUT", "PATCH" and "DELETE"
|
||||||
-- A request `a_request' wth
|
-- A request `a_request' with
|
||||||
-- The query parameters: `query_params'.
|
-- The query parameters: `query_params'.
|
||||||
-- The Header parameters: `header_params'.
|
-- The Header parameters: `header_params'.
|
||||||
-- The Request Body: `body' could be Void, object to be serialized using the serializer function `a_serializer' with a given content_type.
|
-- The Request Body: `body' could be Void, object to be serialized using the serializer function `a_serializer' with a given content_type.
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
* Set the additional (undeclared) property with the specified name and value.
|
* Set the additional (undeclared) property with the specified name and value.
|
||||||
* If the property does not already exist, create it otherwise replace it.
|
* If the property does not already exist, create it otherwise replace it.
|
||||||
* @param key the name of the property
|
* @param key the name of the property
|
||||||
* @param value the value value of the property
|
* @param value the value of the property
|
||||||
* @return self reference
|
* @return self reference
|
||||||
*/
|
*/
|
||||||
@JsonAnySetter
|
@JsonAnySetter
|
||||||
|
@ -579,7 +579,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens
|
|||||||
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
|
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
|
||||||
{{#isAdditionalPropertiesTrue}}
|
{{#isAdditionalPropertiesTrue}}
|
||||||
obj.remove("additionalProperties");
|
obj.remove("additionalProperties");
|
||||||
// serialize additonal properties
|
// serialize additional properties
|
||||||
if (value.getAdditionalProperties() != null) {
|
if (value.getAdditionalProperties() != null) {
|
||||||
for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) {
|
for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) {
|
||||||
if (entry.getValue() instanceof String)
|
if (entry.getValue() instanceof String)
|
||||||
|
@ -69,7 +69,7 @@ public class CXFInterfaceComparator implements ResourceComparator {
|
|||||||
if (requestVerb.equals(HttpMethod.OPTIONS) && match(pathValue,requestPath)) {
|
if (requestVerb.equals(HttpMethod.OPTIONS) && match(pathValue,requestPath)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
// Also check the HTTP verb since a single path can be match do multiple request, depending of the HTTP request verb.
|
// Also check the HTTP verb since a single path can be match do multiple request, depending on the HTTP request verb.
|
||||||
if (requestVerb.equals(methodHttpVerb) && match(pathValue, requestPath)) {
|
if (requestVerb.equals(methodHttpVerb) && match(pathValue, requestPath)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -69,7 +69,7 @@ public class CXFInterfaceComparator implements ResourceComparator {
|
|||||||
if (requestVerb.equals(HttpMethod.OPTIONS) && match(pathValue,requestPath)) {
|
if (requestVerb.equals(HttpMethod.OPTIONS) && match(pathValue,requestPath)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
// Also check the HTTP verb since a single path can be match do multiple request, depending of the HTTP request verb.
|
// Also check the HTTP verb since a single path can be match do multiple request, depending on the HTTP request verb.
|
||||||
if (requestVerb.equals(methodHttpVerb) && match(pathValue, requestPath)) {
|
if (requestVerb.equals(methodHttpVerb) && match(pathValue, requestPath)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -15,7 +15,7 @@ The jar can be used in combination with an other project providing the implement
|
|||||||
{{^interfaceOnly}}
|
{{^interfaceOnly}}
|
||||||
The JAX-RS implementation needs to be provided by the application server you are deploying on.
|
The JAX-RS implementation needs to be provided by the application server you are deploying on.
|
||||||
|
|
||||||
To run the server from the command line, you can use maven to provision an start a TomEE Server.
|
To run the server from the command line, you can use maven to provision and start a TomEE Server.
|
||||||
Please execute the following:
|
Please execute the following:
|
||||||
|
|
||||||
```
|
```
|
||||||
|
@ -15,7 +15,7 @@ Module system
|
|||||||
|
|
||||||
### Building
|
### Building
|
||||||
|
|
||||||
To build an compile the flow typed sources to javascript use:
|
To build and compile the flow typed sources to javascript use:
|
||||||
```
|
```
|
||||||
npm install
|
npm install
|
||||||
# The dependency `babel-preset-react-app` requires that you specify `NODE_ENV` or `BABEL_ENV` environment variables
|
# The dependency `babel-preset-react-app` requires that you specify `NODE_ENV` or `BABEL_ENV` environment variables
|
||||||
|
@ -228,7 +228,7 @@ class {{classname}} {
|
|||||||
|
|
||||||
{{#emitJSDoc}}
|
{{#emitJSDoc}}
|
||||||
/**
|
/**
|
||||||
* Gets the actaul instance, which can be {{#oneOf}}<code>{{{.}}}</code>{{^-last}}, {{/-last}}{{/oneOf}}.
|
* Gets the actual instance, which can be {{#oneOf}}<code>{{{.}}}</code>{{^-last}}, {{/-last}}{{/oneOf}}.
|
||||||
* @return {{=< >=}}{(<#oneOf>module:<#invokerPackage><invokerPackage>/</invokerPackage><#modelPackage><modelPackage>/</modelPackage><&.><^-last>|</-last></oneOf>)}<={{ }}=> The actual instance.
|
* @return {{=< >=}}{(<#oneOf>module:<#invokerPackage><invokerPackage>/</invokerPackage><#modelPackage><modelPackage>/</modelPackage><&.><^-last>|</-last></oneOf>)}<={{ }}=> The actual instance.
|
||||||
*/
|
*/
|
||||||
{{/emitJSDoc}}
|
{{/emitJSDoc}}
|
||||||
@ -238,7 +238,7 @@ class {{classname}} {
|
|||||||
|
|
||||||
{{#emitJSDoc}}
|
{{#emitJSDoc}}
|
||||||
/**
|
/**
|
||||||
* Sets the actaul instance, which can be {{#oneOf}}<code>{{{.}}}</code>{{^-last}}, {{/-last}}{{/oneOf}}.
|
* Sets the actual instance, which can be {{#oneOf}}<code>{{{.}}}</code>{{^-last}}, {{/-last}}{{/oneOf}}.
|
||||||
* @param {{=< >=}}{(<#oneOf>module:<#invokerPackage><invokerPackage>/</invokerPackage><#modelPackage><modelPackage>/</modelPackage><&.><^-last>|</-last></oneOf>)}<={{ }}=> obj The actual instance.
|
* @param {{=< >=}}{(<#oneOf>module:<#invokerPackage><invokerPackage>/</invokerPackage><#modelPackage><modelPackage>/</modelPackage><&.><^-last>|</-last></oneOf>)}<={{ }}=> obj The actual instance.
|
||||||
*/
|
*/
|
||||||
{{/emitJSDoc}}
|
{{/emitJSDoc}}
|
||||||
@ -248,7 +248,7 @@ class {{classname}} {
|
|||||||
|
|
||||||
{{#emitJSDoc}}
|
{{#emitJSDoc}}
|
||||||
/**
|
/**
|
||||||
* Returns the JSON representation of the actual intance.
|
* Returns the JSON representation of the actual instance.
|
||||||
* @return {string}
|
* @return {string}
|
||||||
*/
|
*/
|
||||||
{{/emitJSDoc}}
|
{{/emitJSDoc}}
|
||||||
|
@ -20,9 +20,9 @@
|
|||||||
<DockerfileContext>..\..</DockerfileContext>
|
<DockerfileContext>..\..</DockerfileContext>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
{{#useSeperateModelProject}}
|
{{#useSeparateModelProject}}
|
||||||
<ProjectReference Include="../{{modelPackage}}/{{modelPackage}}.csproj"/>
|
<ProjectReference Include="../{{modelPackage}}/{{modelPackage}}.csproj"/>
|
||||||
{{/useSeperateModelProject}}
|
{{/useSeparateModelProject}}
|
||||||
{{#useFrameworkReference}}
|
{{#useFrameworkReference}}
|
||||||
{{#isLibrary}}
|
{{#isLibrary}}
|
||||||
<FrameworkReference Include="Microsoft.AspNetCore.App" />
|
<FrameworkReference Include="Microsoft.AspNetCore.App" />
|
||||||
@ -31,9 +31,9 @@
|
|||||||
{{^useFrameworkReference}}
|
{{^useFrameworkReference}}
|
||||||
<PackageReference Include="Microsoft.AspNetCore.App" />
|
<PackageReference Include="Microsoft.AspNetCore.App" />
|
||||||
{{/useFrameworkReference}}
|
{{/useFrameworkReference}}
|
||||||
{{^useSeperateModelProject}}
|
{{^useSeparateModelProject}}
|
||||||
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="{{aspnetCoreVersion}}.0"/>
|
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="{{aspnetCoreVersion}}.0"/>
|
||||||
{{/useSeperateModelProject}}
|
{{/useSeparateModelProject}}
|
||||||
{{#useSwashbuckle}}
|
{{#useSwashbuckle}}
|
||||||
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.10.8" />
|
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.10.8" />
|
||||||
{{#useNewtonsoft}}
|
{{#useNewtonsoft}}
|
||||||
|
@ -5,10 +5,10 @@ VisualStudioVersion = 15.0.27428.2043
|
|||||||
MinimumVisualStudioVersion = 10.0.40219.1
|
MinimumVisualStudioVersion = 10.0.40219.1
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "{{packageName}}", "{{sourceFolder}}\{{packageName}}\{{packageName}}.csproj", "{{packageGuid}}"
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "{{packageName}}", "{{sourceFolder}}\{{packageName}}\{{packageName}}.csproj", "{{packageGuid}}"
|
||||||
EndProject
|
EndProject
|
||||||
{{#useSeperateModelProject}}
|
{{#useSeparateModelProject}}
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "{{modelPackage}}", "{{sourceFolder}}\{{modelPackage}}\{{modelPackage}}.csproj", "{B8D18F25-F379-4B87-ACCC-F8A17E0AED38}"
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "{{modelPackage}}", "{{sourceFolder}}\{{modelPackage}}\{{modelPackage}}.csproj", "{B8D18F25-F379-4B87-ACCC-F8A17E0AED38}"
|
||||||
EndProject
|
EndProject
|
||||||
{{/useSeperateModelProject}}
|
{{/useSeparateModelProject}}
|
||||||
Global
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
Debug|Any CPU = Debug|Any CPU
|
Debug|Any CPU = Debug|Any CPU
|
||||||
@ -19,12 +19,12 @@ Global
|
|||||||
{{packageGuid}}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{{packageGuid}}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{{packageGuid}}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{{packageGuid}}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
{{packageGuid}}.Release|Any CPU.Build.0 = Release|Any CPU
|
{{packageGuid}}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
{{#useSeperateModelProject}}
|
{{#useSeparateModelProject}}
|
||||||
{B8D18F25-F379-4B87-ACCC-F8A17E0AED38}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
{B8D18F25-F379-4B87-ACCC-F8A17E0AED38}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
{B8D18F25-F379-4B87-ACCC-F8A17E0AED38}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{B8D18F25-F379-4B87-ACCC-F8A17E0AED38}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{B8D18F25-F379-4B87-ACCC-F8A17E0AED38}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{B8D18F25-F379-4B87-ACCC-F8A17E0AED38}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
{B8D18F25-F379-4B87-ACCC-F8A17E0AED38}.Release|Any CPU.Build.0 = Release|Any CPU
|
{B8D18F25-F379-4B87-ACCC-F8A17E0AED38}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
{{/useSeperateModelProject}}
|
{{/useSeparateModelProject}}
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(SolutionProperties) = preSolution
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
HideSolutionNode = FALSE
|
HideSolutionNode = FALSE
|
||||||
|
@ -116,7 +116,7 @@ TODO validate regex of string using pattern variable. This has two challenges
|
|||||||
{ {{! and I do a similar hack with currentValuePath... }}
|
{ {{! and I do a similar hack with currentValuePath... }}
|
||||||
const std::string currentValuePath = oldValuePath + "[" + std::to_string(i) + "]";
|
const std::string currentValuePath = oldValuePath + "[" + std::to_string(i) + "]";
|
||||||
{{#items}}
|
{{#items}}
|
||||||
{{> model-validation-body }} {{! Recursively apply template to array - this is where things will probbaly go wrong }}
|
{{> model-validation-body }} {{! Recursively apply template to array - this is where things will probably go wrong }}
|
||||||
{{/items}}
|
{{/items}}
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
@ -294,7 +294,7 @@ MARKDOWN_SUPPORT = YES
|
|||||||
|
|
||||||
# When enabled doxygen tries to link words that correspond to documented
|
# When enabled doxygen tries to link words that correspond to documented
|
||||||
# classes, or namespaces to their corresponding documentation. Such a link can
|
# classes, or namespaces to their corresponding documentation. Such a link can
|
||||||
# be prevented in individual cases by by putting a % sign in front of the word
|
# be prevented in individual cases by putting a % sign in front of the word
|
||||||
# or globally by setting AUTOLINK_SUPPORT to NO.
|
# or globally by setting AUTOLINK_SUPPORT to NO.
|
||||||
# The default value is: YES.
|
# The default value is: YES.
|
||||||
|
|
||||||
@ -1397,7 +1397,7 @@ EXT_LINKS_IN_WINDOW = NO
|
|||||||
|
|
||||||
FORMULA_FONTSIZE = 10
|
FORMULA_FONTSIZE = 10
|
||||||
|
|
||||||
# Use the FORMULA_TRANPARENT tag to determine whether or not the images
|
# Use the FORMULA_TRANSPARENT tag to determine whether or not the images
|
||||||
# generated for formulas are transparent PNGs. Transparent PNGs are not
|
# generated for formulas are transparent PNGs. Transparent PNGs are not
|
||||||
# supported properly for IE 6.0, but are supported on all modern browsers.
|
# supported properly for IE 6.0, but are supported on all modern browsers.
|
||||||
#
|
#
|
||||||
|
@ -155,7 +155,7 @@ namespace {{packageName}}.Client
|
|||||||
}
|
}
|
||||||
{{! NOTE: Any changes related to RestSharp should be done in this class. All other client classes are for extensibility by consumers.}}
|
{{! NOTE: Any changes related to RestSharp should be done in this class. All other client classes are for extensibility by consumers.}}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Provides a default implementation of an Api client (both synchronous and asynchronous implementatios),
|
/// Provides a default implementation of an Api client (both synchronous and asynchronous implementations),
|
||||||
/// encapsulating general REST accessor use cases.
|
/// encapsulating general REST accessor use cases.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
{{>visibility}} partial class ApiClient : ISynchronousClient{{#supportsAsync}}, IAsynchronousClient{{/supportsAsync}}
|
{{>visibility}} partial class ApiClient : ISynchronousClient{{#supportsAsync}}, IAsynchronousClient{{/supportsAsync}}
|
||||||
@ -164,7 +164,7 @@ namespace {{packageName}}.Client
|
|||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Specifies the settings on a <see cref="JsonSerializer" /> object.
|
/// Specifies the settings on a <see cref="JsonSerializer" /> object.
|
||||||
/// These settings can be adjusted to accomodate custom serialization rules.
|
/// These settings can be adjusted to accommodate custom serialization rules.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public JsonSerializerSettings SerializerSettings { get; set; } = new JsonSerializerSettings
|
public JsonSerializerSettings SerializerSettings { get; set; } = new JsonSerializerSettings
|
||||||
{
|
{
|
||||||
|
@ -25,7 +25,7 @@ namespace {{packageName}}.Client
|
|||||||
public static CompareLogic compareLogic;
|
public static CompareLogic compareLogic;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Static contstructor to initialise compareLogic.
|
/// Static constructor to initialise compareLogic.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
static ClientUtils()
|
static ClientUtils()
|
||||||
{
|
{
|
||||||
|
@ -72,7 +72,7 @@ namespace {{packageName}}.Client
|
|||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the API key based on the authentication name.
|
/// Gets or sets the API key based on the authentication name.
|
||||||
/// This is the key and value comprising the "secret" for acessing an API.
|
/// This is the key and value comprising the "secret" for accessing an API.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <value>The API key.</value>
|
/// <value>The API key.</value>
|
||||||
private IDictionary<string, string> _apiKey;
|
private IDictionary<string, string> _apiKey;
|
||||||
@ -469,7 +469,7 @@ namespace {{packageName}}.Client
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// use defualt value
|
// use default value
|
||||||
url = url.Replace("{" + variable.Key + "}", (string)serverVariables["default_value"]);
|
url = url.Replace("{" + variable.Key + "}", (string)serverVariables["default_value"]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -480,7 +480,7 @@ namespace {{packageName}}.Client
|
|||||||
{{#hasHttpSignatureMethods}}
|
{{#hasHttpSignatureMethods}}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets and Sets the HttpSigningConfiuration
|
/// Gets and Sets the HttpSigningConfiguration
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public HttpSigningConfiguration HttpSigningConfiguration
|
public HttpSigningConfiguration HttpSigningConfiguration
|
||||||
{
|
{
|
||||||
|
@ -18,7 +18,7 @@ namespace {{packageName}}.Client
|
|||||||
{
|
{
|
||||||
#region
|
#region
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Initailize the HashAlgorithm and SigningAlgorithm to default value
|
/// Initialize the HashAlgorithm and SigningAlgorithm to default value
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public HttpSigningConfiguration()
|
public HttpSigningConfiguration()
|
||||||
{
|
{
|
||||||
@ -238,7 +238,7 @@ namespace {{packageName}}.Client
|
|||||||
headerValuesList.Add(string.Format("{0}: {1}", keyVal.Key, keyVal.Value));
|
headerValuesList.Add(string.Format("{0}: {1}", keyVal.Key, keyVal.Value));
|
||||||
|
|
||||||
}
|
}
|
||||||
//Concatinate headers value separated by new line
|
//Concatenate headers value separated by new line
|
||||||
var headerValuesString = string.Join("\n", headerValuesList);
|
var headerValuesString = string.Join("\n", headerValuesList);
|
||||||
var signatureStringHash = GetStringHash(HashAlgorithm.ToString(), headerValuesString);
|
var signatureStringHash = GetStringHash(HashAlgorithm.ToString(), headerValuesString);
|
||||||
string headerSignatureStr = null;
|
string headerSignatureStr = null;
|
||||||
@ -361,7 +361,7 @@ namespace {{packageName}}.Client
|
|||||||
private byte[] ConvertToECDSAANS1Format(byte[] signedBytes)
|
private byte[] ConvertToECDSAANS1Format(byte[] signedBytes)
|
||||||
{
|
{
|
||||||
var derBytes = new List<byte>();
|
var derBytes = new List<byte>();
|
||||||
byte derLength = 68; //default lenght for ECDSA code signinged bit 0x44
|
byte derLength = 68; //default length for ECDSA code signing bit 0x44
|
||||||
byte rbytesLength = 32; //R length 0x20
|
byte rbytesLength = 32; //R length 0x20
|
||||||
byte sbytesLength = 32; //S length 0x20
|
byte sbytesLength = 32; //S length 0x20
|
||||||
var rBytes = new List<byte>();
|
var rBytes = new List<byte>();
|
||||||
@ -399,7 +399,7 @@ namespace {{packageName}}.Client
|
|||||||
}
|
}
|
||||||
|
|
||||||
derBytes.Add(48); //start of the sequence 0x30
|
derBytes.Add(48); //start of the sequence 0x30
|
||||||
derBytes.Add(derLength); //total length r lenth, type and r bytes
|
derBytes.Add(derLength); //total length r length, type and r bytes
|
||||||
|
|
||||||
derBytes.Add(2); //tag for integer
|
derBytes.Add(2); //tag for integer
|
||||||
derBytes.Add(rbytesLength); //length of r
|
derBytes.Add(rbytesLength); //length of r
|
||||||
@ -411,7 +411,7 @@ namespace {{packageName}}.Client
|
|||||||
return derBytes.ToArray();
|
return derBytes.ToArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
private RSACryptoServiceProvider GetRSAProviderFromPemFile(string pemfile, SecureString keyPassPharse = null)
|
private RSACryptoServiceProvider GetRSAProviderFromPemFile(string pemfile, SecureString keyPassPhrase = null)
|
||||||
{
|
{
|
||||||
const string pempubheader = "-----BEGIN PUBLIC KEY-----";
|
const string pempubheader = "-----BEGIN PUBLIC KEY-----";
|
||||||
const string pempubfooter = "-----END PUBLIC KEY-----";
|
const string pempubfooter = "-----END PUBLIC KEY-----";
|
||||||
@ -431,7 +431,7 @@ namespace {{packageName}}.Client
|
|||||||
|
|
||||||
if (isPrivateKeyFile)
|
if (isPrivateKeyFile)
|
||||||
{
|
{
|
||||||
pemkey = ConvertPrivateKeyToBytes(pemstr, keyPassPharse);
|
pemkey = ConvertPrivateKeyToBytes(pemstr, keyPassPhrase);
|
||||||
if (pemkey == null)
|
if (pemkey == null)
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
@ -441,7 +441,7 @@ namespace {{packageName}}.Client
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
private byte[] ConvertPrivateKeyToBytes(string instr, SecureString keyPassPharse = null)
|
private byte[] ConvertPrivateKeyToBytes(string instr, SecureString keyPassPhrase = null)
|
||||||
{
|
{
|
||||||
const string pemprivheader = "-----BEGIN RSA PRIVATE KEY-----";
|
const string pemprivheader = "-----BEGIN RSA PRIVATE KEY-----";
|
||||||
const string pemprivfooter = "-----END RSA PRIVATE KEY-----";
|
const string pemprivfooter = "-----END RSA PRIVATE KEY-----";
|
||||||
@ -494,11 +494,11 @@ namespace {{packageName}}.Client
|
|||||||
binkey = Convert.FromBase64String(encryptedstr);
|
binkey = Convert.FromBase64String(encryptedstr);
|
||||||
}
|
}
|
||||||
catch (System.FormatException)
|
catch (System.FormatException)
|
||||||
{ //data is not in base64 fromat
|
{ //data is not in base64 format
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
byte[] deskey = GetEncryptedKey(salt, keyPassPharse, 1, 2); // count=1 (for OpenSSL implementation); 2 iterations to get at least 24 bytes
|
byte[] deskey = GetEncryptedKey(salt, keyPassPhrase, 1, 2); // count=1 (for OpenSSL implementation); 2 iterations to get at least 24 bytes
|
||||||
if (deskey == null)
|
if (deskey == null)
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
@ -638,19 +638,19 @@ namespace {{packageName}}.Client
|
|||||||
{
|
{
|
||||||
IntPtr unmanagedPswd = IntPtr.Zero;
|
IntPtr unmanagedPswd = IntPtr.Zero;
|
||||||
int HASHLENGTH = 16; //MD5 bytes
|
int HASHLENGTH = 16; //MD5 bytes
|
||||||
byte[] keymaterial = new byte[HASHLENGTH * miter]; //to store contatenated Mi hashed results
|
byte[] keymaterial = new byte[HASHLENGTH * miter]; //to store concatenated Mi hashed results
|
||||||
|
|
||||||
byte[] psbytes = new byte[secpswd.Length];
|
byte[] psbytes = new byte[secpswd.Length];
|
||||||
unmanagedPswd = Marshal.SecureStringToGlobalAllocAnsi(secpswd);
|
unmanagedPswd = Marshal.SecureStringToGlobalAllocAnsi(secpswd);
|
||||||
Marshal.Copy(unmanagedPswd, psbytes, 0, psbytes.Length);
|
Marshal.Copy(unmanagedPswd, psbytes, 0, psbytes.Length);
|
||||||
Marshal.ZeroFreeGlobalAllocAnsi(unmanagedPswd);
|
Marshal.ZeroFreeGlobalAllocAnsi(unmanagedPswd);
|
||||||
|
|
||||||
// --- contatenate salt and pswd bytes into fixed data array ---
|
// --- concatenate salt and pswd bytes into fixed data array ---
|
||||||
byte[] data00 = new byte[psbytes.Length + salt.Length];
|
byte[] data00 = new byte[psbytes.Length + salt.Length];
|
||||||
Array.Copy(psbytes, data00, psbytes.Length); //copy the pswd bytes
|
Array.Copy(psbytes, data00, psbytes.Length); //copy the pswd bytes
|
||||||
Array.Copy(salt, 0, data00, psbytes.Length, salt.Length); //concatenate the salt bytes
|
Array.Copy(salt, 0, data00, psbytes.Length, salt.Length); //concatenate the salt bytes
|
||||||
|
|
||||||
// ---- do multi-hashing and contatenate results D1, D2 ... into keymaterial bytes ----
|
// ---- do multi-hashing and concatenate results D1, D2 ... into keymaterial bytes ----
|
||||||
MD5 md5 = new MD5CryptoServiceProvider();
|
MD5 md5 = new MD5CryptoServiceProvider();
|
||||||
byte[] result = null;
|
byte[] result = null;
|
||||||
byte[] hashtarget = new byte[HASHLENGTH + data00.Length]; //fixed length initial hashtarget
|
byte[] hashtarget = new byte[HASHLENGTH + data00.Length]; //fixed length initial hashtarget
|
||||||
@ -671,7 +671,7 @@ namespace {{packageName}}.Client
|
|||||||
|
|
||||||
for (int i = 0; i < count; i++)
|
for (int i = 0; i < count; i++)
|
||||||
result = md5.ComputeHash(result);
|
result = md5.ComputeHash(result);
|
||||||
Array.Copy(result, 0, keymaterial, j * HASHLENGTH, result.Length); //contatenate to keymaterial
|
Array.Copy(result, 0, keymaterial, j * HASHLENGTH, result.Length); //concatenate to keymaterial
|
||||||
}
|
}
|
||||||
byte[] deskey = new byte[24];
|
byte[] deskey = new byte[24];
|
||||||
Array.Copy(keymaterial, deskey, deskey.Length);
|
Array.Copy(keymaterial, deskey, deskey.Length);
|
||||||
|
@ -39,7 +39,7 @@ namespace {{packageName}}.Client
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the date time format.
|
/// Gets the date time format.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <value>Date time foramt.</value>
|
/// <value>Date time format.</value>
|
||||||
string DateTimeFormat { get; }
|
string DateTimeFormat { get; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -25,7 +25,7 @@ namespace {{packageName}}.Client
|
|||||||
public Multimap<string, string> QueryParameters { get; set; }
|
public Multimap<string, string> QueryParameters { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Header parameters to be applied to to the request.
|
/// Header parameters to be applied to the request.
|
||||||
/// Keys may have 1 or more values associated.
|
/// Keys may have 1 or more values associated.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Multimap<string, string> HeaderParameters { get; set; }
|
public Multimap<string, string> HeaderParameters { get; set; }
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
|
# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
|
||||||
#
|
#
|
||||||
# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" "gitlab.com"
|
# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com"
|
||||||
|
|
||||||
git_user_id=$1
|
git_user_id=$1
|
||||||
git_repo_id=$2
|
git_repo_id=$2
|
||||||
|
@ -159,7 +159,7 @@ namespace {{packageName}}.Client
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Provides a default implementation of an Api client (both synchronous and asynchronous implementatios),
|
/// Provides a default implementation of an Api client (both synchronous and asynchronous implementations),
|
||||||
/// encapsulating general REST accessor use cases.
|
/// encapsulating general REST accessor use cases.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <remarks>
|
/// <remarks>
|
||||||
@ -175,7 +175,7 @@ namespace {{packageName}}.Client
|
|||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Specifies the settings on a <see cref="JsonSerializer" /> object.
|
/// Specifies the settings on a <see cref="JsonSerializer" /> object.
|
||||||
/// These settings can be adjusted to accomodate custom serialization rules.
|
/// These settings can be adjusted to accommodate custom serialization rules.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public JsonSerializerSettings SerializerSettings { get; set; } = new JsonSerializerSettings
|
public JsonSerializerSettings SerializerSettings { get; set; } = new JsonSerializerSettings
|
||||||
{
|
{
|
||||||
@ -192,8 +192,8 @@ namespace {{packageName}}.Client
|
|||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Initializes a new instance of the <see cref="ApiClient" />, defaulting to the global configurations' base url.
|
/// Initializes a new instance of the <see cref="ApiClient" />, defaulting to the global configurations' base url.
|
||||||
/// **IMPORTANT** This will also create an istance of HttpClient, which is less than ideal.
|
/// **IMPORTANT** This will also create an instance of HttpClient, which is less than ideal.
|
||||||
/// It's better to reuse the <see href="https://docs.microsoft.com/en-us/dotnet/architecture/microservices/implement-resilient-applications/use-httpclientfactory-to-implement-resilient-http-requests#issues-with-the-original-httpclient-class-available-in-net">HttpClient and HttpClientHander</see>.
|
/// It's better to reuse the <see href="https://docs.microsoft.com/en-us/dotnet/architecture/microservices/implement-resilient-applications/use-httpclientfactory-to-implement-resilient-http-requests#issues-with-the-original-httpclient-class-available-in-net">HttpClient and HttpClientHandler</see>.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public ApiClient() :
|
public ApiClient() :
|
||||||
this({{packageName}}.Client.GlobalConfiguration.Instance.BasePath)
|
this({{packageName}}.Client.GlobalConfiguration.Instance.BasePath)
|
||||||
@ -202,8 +202,8 @@ namespace {{packageName}}.Client
|
|||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Initializes a new instance of the <see cref="ApiClient" />.
|
/// Initializes a new instance of the <see cref="ApiClient" />.
|
||||||
/// **IMPORTANT** This will also create an istance of HttpClient, which is less than ideal.
|
/// **IMPORTANT** This will also create an instance of HttpClient, which is less than ideal.
|
||||||
/// It's better to reuse the <see href="https://docs.microsoft.com/en-us/dotnet/architecture/microservices/implement-resilient-applications/use-httpclientfactory-to-implement-resilient-http-requests#issues-with-the-original-httpclient-class-available-in-net">HttpClient and HttpClientHander</see>.
|
/// It's better to reuse the <see href="https://docs.microsoft.com/en-us/dotnet/architecture/microservices/implement-resilient-applications/use-httpclientfactory-to-implement-resilient-http-requests#issues-with-the-original-httpclient-class-available-in-net">HttpClient and HttpClientHandler</see>.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="basePath">The target service's base path in URL format.</param>
|
/// <param name="basePath">The target service's base path in URL format.</param>
|
||||||
/// <exception cref="ArgumentException"></exception>
|
/// <exception cref="ArgumentException"></exception>
|
||||||
|
@ -25,7 +25,7 @@ namespace {{packageName}}.Client
|
|||||||
public Multimap<string, string> QueryParameters { get; set; }
|
public Multimap<string, string> QueryParameters { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Header parameters to be applied to to the request.
|
/// Header parameters to be applied to the request.
|
||||||
/// Keys may have 1 or more values associated.
|
/// Keys may have 1 or more values associated.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Multimap<string, string> HeaderParameters { get; set; }
|
public Multimap<string, string> HeaderParameters { get; set; }
|
||||||
|
@ -106,8 +106,8 @@ namespace {{packageName}}.{{apiPackage}}
|
|||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Initializes a new instance of the <see cref="{{classname}}"/> class.
|
/// Initializes a new instance of the <see cref="{{classname}}"/> class.
|
||||||
/// **IMPORTANT** This will also create an istance of HttpClient, which is less than ideal.
|
/// **IMPORTANT** This will also create an instance of HttpClient, which is less than ideal.
|
||||||
/// It's better to reuse the <see href="https://docs.microsoft.com/en-us/dotnet/architecture/microservices/implement-resilient-applications/use-httpclientfactory-to-implement-resilient-http-requests#issues-with-the-original-httpclient-class-available-in-net">HttpClient and HttpClientHander</see>.
|
/// It's better to reuse the <see href="https://docs.microsoft.com/en-us/dotnet/architecture/microservices/implement-resilient-applications/use-httpclientfactory-to-implement-resilient-http-requests#issues-with-the-original-httpclient-class-available-in-net">HttpClient and HttpClientHandler</see>.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public {{classname}}() : this((string)null)
|
public {{classname}}() : this((string)null)
|
||||||
@ -116,8 +116,8 @@ namespace {{packageName}}.{{apiPackage}}
|
|||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Initializes a new instance of the <see cref="{{classname}}"/> class.
|
/// Initializes a new instance of the <see cref="{{classname}}"/> class.
|
||||||
/// **IMPORTANT** This will also create an istance of HttpClient, which is less than ideal.
|
/// **IMPORTANT** This will also create an instance of HttpClient, which is less than ideal.
|
||||||
/// It's better to reuse the <see href="https://docs.microsoft.com/en-us/dotnet/architecture/microservices/implement-resilient-applications/use-httpclientfactory-to-implement-resilient-http-requests#issues-with-the-original-httpclient-class-available-in-net">HttpClient and HttpClientHander</see>.
|
/// It's better to reuse the <see href="https://docs.microsoft.com/en-us/dotnet/architecture/microservices/implement-resilient-applications/use-httpclientfactory-to-implement-resilient-http-requests#issues-with-the-original-httpclient-class-available-in-net">HttpClient and HttpClientHandler</see>.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="basePath">The target service's base path in URL format.</param>
|
/// <param name="basePath">The target service's base path in URL format.</param>
|
||||||
/// <exception cref="ArgumentException"></exception>
|
/// <exception cref="ArgumentException"></exception>
|
||||||
@ -138,8 +138,8 @@ namespace {{packageName}}.{{apiPackage}}
|
|||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Initializes a new instance of the <see cref="{{classname}}"/> class using Configuration object.
|
/// Initializes a new instance of the <see cref="{{classname}}"/> class using Configuration object.
|
||||||
/// **IMPORTANT** This will also create an istance of HttpClient, which is less than ideal.
|
/// **IMPORTANT** This will also create an instance of HttpClient, which is less than ideal.
|
||||||
/// It's better to reuse the <see href="https://docs.microsoft.com/en-us/dotnet/architecture/microservices/implement-resilient-applications/use-httpclientfactory-to-implement-resilient-http-requests#issues-with-the-original-httpclient-class-available-in-net">HttpClient and HttpClientHander</see>.
|
/// It's better to reuse the <see href="https://docs.microsoft.com/en-us/dotnet/architecture/microservices/implement-resilient-applications/use-httpclientfactory-to-implement-resilient-http-requests#issues-with-the-original-httpclient-class-available-in-net">HttpClient and HttpClientHandler</see>.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="configuration">An instance of Configuration.</param>
|
/// <param name="configuration">An instance of Configuration.</param>
|
||||||
/// <exception cref="ArgumentNullException"></exception>
|
/// <exception cref="ArgumentNullException"></exception>
|
||||||
|
@ -34,11 +34,11 @@ using OpenAPIClientUtils = {{packageName}}.Client.ClientUtils;
|
|||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
{{/-first}}
|
{{/-first}}
|
||||||
{{/oneOf}}
|
{{/oneOf}}
|
||||||
{{#aneOf}}
|
{{#anyOf}}
|
||||||
{{#-first}}
|
{{#-first}}
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
{{/-first}}
|
{{/-first}}
|
||||||
{{/aneOf}}
|
{{/anyOf}}
|
||||||
|
|
||||||
namespace {{packageName}}.{{modelPackage}}
|
namespace {{packageName}}.{{modelPackage}}
|
||||||
{
|
{
|
||||||
|
@ -59,7 +59,7 @@
|
|||||||
{{#anyOf}}
|
{{#anyOf}}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Get the actual instance of `{{{.}}}`. If the actual instanct is not `{{{.}}}`,
|
/// Get the actual instance of `{{{.}}}`. If the actual instance is not `{{{.}}}`,
|
||||||
/// the InvalidClassException will be thrown
|
/// the InvalidClassException will be thrown
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns>An instance of {{{.}}}</returns>
|
/// <returns>An instance of {{{.}}}</returns>
|
||||||
|
@ -59,7 +59,7 @@
|
|||||||
{{#oneOf}}
|
{{#oneOf}}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Get the actual instance of `{{{.}}}`. If the actual instanct is not `{{{.}}}`,
|
/// Get the actual instance of `{{{.}}}`. If the actual instance is not `{{{.}}}`,
|
||||||
/// the InvalidClassException will be thrown
|
/// the InvalidClassException will be thrown
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns>An instance of {{{.}}}</returns>
|
/// <returns>An instance of {{{.}}}</returns>
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
<authors>$author$</authors>
|
<authors>$author$</authors>
|
||||||
|
|
||||||
<!-- Owners are typically nuget.org identities that allow gallery
|
<!-- Owners are typically nuget.org identities that allow gallery
|
||||||
users to earily find other packages by the same owners. -->
|
users to easily find other packages by the same owners. -->
|
||||||
<owners>$author$</owners>
|
<owners>$author$</owners>
|
||||||
<requireLicenseAcceptance>false</requireLicenseAcceptance>
|
<requireLicenseAcceptance>false</requireLicenseAcceptance>
|
||||||
<developmentDependency>false</developmentDependency>
|
<developmentDependency>false</developmentDependency>
|
||||||
|
@ -25,7 +25,7 @@ namespace {{packageName}}.Client
|
|||||||
public Multimap<string, string> QueryParameters { get; set; }
|
public Multimap<string, string> QueryParameters { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Header parameters to be applied to to the request.
|
/// Header parameters to be applied to the request.
|
||||||
/// Keys may have 1 or more values associated.
|
/// Keys may have 1 or more values associated.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Multimap<string, string> HeaderParameters { get; set; }
|
public Multimap<string, string> HeaderParameters { get; set; }
|
||||||
|
@ -29,7 +29,7 @@ namespace {{packageName}}.Client
|
|||||||
public string RawContent { get; }
|
public string RawContent { get; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Construct the ApiException from parts of the reponse
|
/// Construct the ApiException from parts of the response
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="reasonPhrase"></param>
|
/// <param name="reasonPhrase"></param>
|
||||||
/// <param name="statusCode"></param>
|
/// <param name="statusCode"></param>
|
||||||
|
@ -82,7 +82,7 @@ namespace {{packageName}}.Client
|
|||||||
#endregion Properties
|
#endregion Properties
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Construct the reponse using an HttpResponseMessage
|
/// Construct the response using an HttpResponseMessage
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="response"></param>
|
/// <param name="response"></param>
|
||||||
/// <param name="rawContent"></param>
|
/// <param name="rawContent"></param>
|
||||||
|
@ -190,7 +190,7 @@ namespace {{packageName}}.Client
|
|||||||
foreach (var keyVal in httpSignatureHeader)
|
foreach (var keyVal in httpSignatureHeader)
|
||||||
headerValuesList.Add(string.Format("{0}: {1}", keyVal.Key, keyVal.Value));
|
headerValuesList.Add(string.Format("{0}: {1}", keyVal.Key, keyVal.Value));
|
||||||
|
|
||||||
//Concatinate headers value separated by new line
|
//Concatenate headers value separated by new line
|
||||||
var headerValuesString = string.Join("\n", headerValuesList);
|
var headerValuesString = string.Join("\n", headerValuesList);
|
||||||
var signatureStringHash = GetStringHash(HashAlgorithm.ToString(), headerValuesString);
|
var signatureStringHash = GetStringHash(HashAlgorithm.ToString(), headerValuesString);
|
||||||
string{{nrt?}} headerSignatureStr = null;
|
string{{nrt?}} headerSignatureStr = null;
|
||||||
@ -318,7 +318,7 @@ namespace {{packageName}}.Client
|
|||||||
private byte[] ConvertToECDSAANS1Format(byte[] signedBytes)
|
private byte[] ConvertToECDSAANS1Format(byte[] signedBytes)
|
||||||
{
|
{
|
||||||
var derBytes = new List<byte>();
|
var derBytes = new List<byte>();
|
||||||
byte derLength = 68; //default lenght for ECDSA code signinged bit 0x44
|
byte derLength = 68; //default length for ECDSA code signing bit 0x44
|
||||||
byte rbytesLength = 32; //R length 0x20
|
byte rbytesLength = 32; //R length 0x20
|
||||||
byte sbytesLength = 32; //S length 0x20
|
byte sbytesLength = 32; //S length 0x20
|
||||||
var rBytes = new List<byte>();
|
var rBytes = new List<byte>();
|
||||||
@ -353,7 +353,7 @@ namespace {{packageName}}.Client
|
|||||||
}
|
}
|
||||||
|
|
||||||
derBytes.Add(48); //start of the sequence 0x30
|
derBytes.Add(48); //start of the sequence 0x30
|
||||||
derBytes.Add(derLength); //total length r lenth, type and r bytes
|
derBytes.Add(derLength); //total length r length, type and r bytes
|
||||||
|
|
||||||
derBytes.Add(2); //tag for integer
|
derBytes.Add(2); //tag for integer
|
||||||
derBytes.Add(rbytesLength); //length of r
|
derBytes.Add(rbytesLength); //length of r
|
||||||
@ -365,7 +365,7 @@ namespace {{packageName}}.Client
|
|||||||
return derBytes.ToArray();
|
return derBytes.ToArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
private RSACryptoServiceProvider{{nrt?}} GetRSAProviderFromPemFile(String pemfile, SecureString{{nrt?}} keyPassPharse = null)
|
private RSACryptoServiceProvider{{nrt?}} GetRSAProviderFromPemFile(String pemfile, SecureString{{nrt?}} keyPassPhrase = null)
|
||||||
{
|
{
|
||||||
const String pempubheader = "-----BEGIN PUBLIC KEY-----";
|
const String pempubheader = "-----BEGIN PUBLIC KEY-----";
|
||||||
const String pempubfooter = "-----END PUBLIC KEY-----";
|
const String pempubfooter = "-----END PUBLIC KEY-----";
|
||||||
@ -382,7 +382,7 @@ namespace {{packageName}}.Client
|
|||||||
|
|
||||||
if (isPrivateKeyFile)
|
if (isPrivateKeyFile)
|
||||||
{
|
{
|
||||||
pemkey = ConvertPrivateKeyToBytes(pemstr, keyPassPharse);
|
pemkey = ConvertPrivateKeyToBytes(pemstr, keyPassPhrase);
|
||||||
|
|
||||||
if (pemkey == null)
|
if (pemkey == null)
|
||||||
return null;
|
return null;
|
||||||
@ -392,7 +392,7 @@ namespace {{packageName}}.Client
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
private byte[]{{nrt?}} ConvertPrivateKeyToBytes(String instr, SecureString{{nrt?}} keyPassPharse = null)
|
private byte[]{{nrt?}} ConvertPrivateKeyToBytes(String instr, SecureString{{nrt?}} keyPassPhrase = null)
|
||||||
{
|
{
|
||||||
const String pemprivheader = "-----BEGIN RSA PRIVATE KEY-----";
|
const String pemprivheader = "-----BEGIN RSA PRIVATE KEY-----";
|
||||||
const String pemprivfooter = "-----END RSA PRIVATE KEY-----";
|
const String pemprivfooter = "-----END RSA PRIVATE KEY-----";
|
||||||
@ -440,12 +440,12 @@ namespace {{packageName}}.Client
|
|||||||
binkey = Convert.FromBase64String(encryptedstr);
|
binkey = Convert.FromBase64String(encryptedstr);
|
||||||
}
|
}
|
||||||
catch (System.FormatException)
|
catch (System.FormatException)
|
||||||
{ //data is not in base64 fromat
|
{ //data is not in base64 format
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: what do we do here if keyPassPharse is null?
|
// TODO: what do we do here if keyPassPhrase is null?
|
||||||
byte[] deskey = GetEncryptedKey(salt, keyPassPharse{{nrt!}}, 1, 2); // count=1 (for OpenSSL implementation); 2 iterations to get at least 24 bytes
|
byte[] deskey = GetEncryptedKey(salt, keyPassPhrase{{nrt!}}, 1, 2); // count=1 (for OpenSSL implementation); 2 iterations to get at least 24 bytes
|
||||||
if (deskey == null)
|
if (deskey == null)
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
|
@ -170,7 +170,7 @@ Class | Method | HTTP request | Description
|
|||||||
- modelTests: {{generateModelTests}}
|
- modelTests: {{generateModelTests}}
|
||||||
- withXml: {{withXml}}
|
- withXml: {{withXml}}
|
||||||
|
|
||||||
## [OpenApi Generator Parameteres](https://openapi-generator.tech/docs/generators/csharp-netcore)
|
## [OpenApi Generator Parameters](https://openapi-generator.tech/docs/generators/csharp-netcore)
|
||||||
- allowUnicodeIdentifiers: {{allowUnicodeIdentifiers}}
|
- allowUnicodeIdentifiers: {{allowUnicodeIdentifiers}}
|
||||||
- apiName: {{apiName}}
|
- apiName: {{apiName}}
|
||||||
- caseInsensitiveResponseHeaders: {{caseInsensitiveResponseHeaders}}
|
- caseInsensitiveResponseHeaders: {{caseInsensitiveResponseHeaders}}
|
||||||
|
@ -377,7 +377,7 @@ namespace {{packageName}}.{{apiPackage}}
|
|||||||
}
|
}
|
||||||
catch(Exception e)
|
catch(Exception e)
|
||||||
{
|
{
|
||||||
Logger.LogError(e, "An error occured while invoking ApiResponded.");
|
Logger.LogError(e, "An error occurred while invoking ApiResponded.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -395,7 +395,7 @@ namespace {{packageName}}.{{apiPackage}}
|
|||||||
}
|
}
|
||||||
catch(Exception e)
|
catch(Exception e)
|
||||||
{
|
{
|
||||||
Logger.LogError(e, "An error occured while sending the request to the server.");
|
Logger.LogError(e, "An error occurred while sending the request to the server.");
|
||||||
throw;
|
throw;
|
||||||
}
|
}
|
||||||
}{{^-last}}
|
}{{^-last}}
|
||||||
|
@ -49,7 +49,7 @@ Set-StrictMode -Version 3.0
|
|||||||
if ($Help){
|
if ($Help){
|
||||||
Write-Output "
|
Write-Output "
|
||||||
This script will initialize a git repository, then add and commit all files.
|
This script will initialize a git repository, then add and commit all files.
|
||||||
The local repository will then be pushed to your prefered git provider.
|
The local repository will then be pushed to your preferred git provider.
|
||||||
If the remote repository does not exist yet and you are using GitHub,
|
If the remote repository does not exist yet and you are using GitHub,
|
||||||
the repository will be created for you provided you have the GitHub CLI installed.
|
the repository will be created for you provided you have the GitHub CLI installed.
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@ namespace {{packageName}}.Client
|
|||||||
public Multimap<string, string> QueryParameters { get; set; }
|
public Multimap<string, string> QueryParameters { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Header parameters to be applied to to the request.
|
/// Header parameters to be applied to the request.
|
||||||
/// Keys may have 1 or more values associated.
|
/// Keys may have 1 or more values associated.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Multimap<string, string> HeaderParameters { get; set; }
|
public Multimap<string, string> HeaderParameters { get; set; }
|
||||||
|
@ -262,7 +262,7 @@ class _${{classname}}Serializer implements PrimitiveSerializer<{{classname}}> {
|
|||||||
parent classes don't have builder
|
parent classes don't have builder
|
||||||
so they must delegate to another serializer using
|
so they must delegate to another serializer using
|
||||||
1) discriminator + mapping
|
1) discriminator + mapping
|
||||||
2) concrete implmentation ($classname)
|
2) concrete implementation ($classname)
|
||||||
}}
|
}}
|
||||||
{{#hasDiscriminatorWithNonEmptyMapping}}
|
{{#hasDiscriminatorWithNonEmptyMapping}}
|
||||||
{{#discriminator}}
|
{{#discriminator}}
|
||||||
|
@ -70,8 +70,8 @@ val requestQueue: Lazy<RequestQueue> = lazy(initializer = {
|
|||||||
The above constructor for each api allows the following to be customized
|
The above constructor for each api allows the following to be customized
|
||||||
- A custom context, so either a singleton request queue or different scope can be created - see
|
- A custom context, so either a singleton request queue or different scope can be created - see
|
||||||
https://developer.android.com/training/volley/requestqueue#singleton
|
https://developer.android.com/training/volley/requestqueue#singleton
|
||||||
- An overrideable request queue - which in turn can have a custom http url stack passed to it
|
- An overridable request queue - which in turn can have a custom http url stack passed to it
|
||||||
- An overrideable request factory constructor call, or a request factory that can be overridden by a custom template, with
|
- An overridable request factory constructor call, or a request factory that can be overridden by a custom template, with
|
||||||
custom header factory, request post processors and custom gson adapters injected.
|
custom header factory, request post processors and custom gson adapters injected.
|
||||||
|
|
||||||
#### Overriding request generation
|
#### Overriding request generation
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
val basicAuthHeaderFactoryBuilder = { username: String?, password: String? ->
|
val basicAuthHeaderFactoryBuilder = { username: String?, password: String? ->
|
||||||
{
|
{
|
||||||
throw NotImplementedError("OAuth security scheme header factory not impemented yet - see open api generator auth/oauth.mustache")
|
throw NotImplementedError("OAuth security scheme header factory not implemented yet - see open api generator auth/oauth.mustache")
|
||||||
mapOf("" to "")}
|
mapOf("" to "")}
|
||||||
}
|
}
|
||||||
|
@ -40,7 +40,7 @@ class RequestFactory(private val headerFactories : List<() -> Map<String, String
|
|||||||
val allHeaders = headerFactories.fold(afterMarketHeaders) { acc, factory -> (acc + factory.invoke()).toMutableMap() }
|
val allHeaders = headerFactories.fold(afterMarketHeaders) { acc, factory -> (acc + factory.invoke()).toMutableMap() }
|
||||||
|
|
||||||
// If we decide to support auth parameters in the url, then you will reference them by supplying a url string
|
// If we decide to support auth parameters in the url, then you will reference them by supplying a url string
|
||||||
// with known variable name refernces in the string. We will then apply
|
// with known variable name references in the string. We will then apply
|
||||||
val updatedUrl = if (!queryParams.isNullOrEmpty()) {
|
val updatedUrl = if (!queryParams.isNullOrEmpty()) {
|
||||||
queryParams.asSequence().fold("$url?") {acc, param ->
|
queryParams.asSequence().fold("$url?") {acc, param ->
|
||||||
"$acc${escapeString(param.key)}=${escapeString(param.value)}&"
|
"$acc${escapeString(param.key)}=${escapeString(param.value)}&"
|
||||||
|
@ -19,7 +19,7 @@ function handleError(err, request, response, next) {
|
|||||||
* middleware. All parameters are collected in the request.swagger.values key-value object
|
* middleware. All parameters are collected in the request.swagger.values key-value object
|
||||||
*
|
*
|
||||||
* The assumption is that security handlers have already verified and allowed access
|
* The assumption is that security handlers have already verified and allowed access
|
||||||
* to this path. If the business-logic of a particular path is dependant on authentication
|
* to this path. If the business-logic of a particular path is dependent on authentication
|
||||||
* parameters (e.g. scope checking) - it is recommended to define the authentication header
|
* parameters (e.g. scope checking) - it is recommended to define the authentication header
|
||||||
* as one of the parameters expected in the OpenAPI/Swagger document.
|
* as one of the parameters expected in the OpenAPI/Swagger document.
|
||||||
*
|
*
|
||||||
|
@ -64,7 +64,7 @@ $config['settings'] = [
|
|||||||
// 'addContentLengthHeader' => true,
|
// 'addContentLengthHeader' => true,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Filename for caching the FastRoute routes. Must be set to to a valid filename within
|
* Filename for caching the FastRoute routes. Must be set to a valid filename within
|
||||||
* a writeable directory. If the file does not exist, then it is created with the correct
|
* a writeable directory. If the file does not exist, then it is created with the correct
|
||||||
* cache information on first run.
|
* cache information on first run.
|
||||||
* Set to false to disable the FastRoute cache system.
|
* Set to false to disable the FastRoute cache system.
|
||||||
|
@ -436,7 +436,7 @@ class ObjectSerializer
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($class === '\DateTime') {
|
if ($class === '\DateTime') {
|
||||||
// Some API's return an invalid, empty string as a
|
// Some APIs return an invalid, empty string as a
|
||||||
// date-time property. DateTime::__construct() will return
|
// date-time property. DateTime::__construct() will return
|
||||||
// the current time for empty input which is probably not
|
// the current time for empty input which is probably not
|
||||||
// what is meant. The invalid empty string is probably to
|
// what is meant. The invalid empty string is probably to
|
||||||
@ -446,7 +446,7 @@ class ObjectSerializer
|
|||||||
try {
|
try {
|
||||||
return new \DateTime($data);
|
return new \DateTime($data);
|
||||||
} catch (\Exception $exception) {
|
} catch (\Exception $exception) {
|
||||||
// Some API's return a date-time with too high nanosecond
|
// Some APIs return a date-time with too high nanosecond
|
||||||
// precision for php's DateTime to handle.
|
// precision for php's DateTime to handle.
|
||||||
// With provided regexp 6 digits of microseconds saved
|
// With provided regexp 6 digits of microseconds saved
|
||||||
return new \DateTime(self::sanitizeTimestamp($data));
|
return new \DateTime(self::sanitizeTimestamp($data));
|
||||||
|
@ -112,7 +112,7 @@ function Get-{{{apiNamePrefix}}}HttpSignedHeader {
|
|||||||
-HashAlgorithmName $httpSigningConfiguration.HashAlgorithm `
|
-HashAlgorithmName $httpSigningConfiguration.HashAlgorithm `
|
||||||
-KeyPassPhrase $httpSigningConfiguration.KeyPassPhrase
|
-KeyPassPhrase $httpSigningConfiguration.KeyPassPhrase
|
||||||
}
|
}
|
||||||
#Depricated
|
#Deprecated
|
||||||
<#$cryptographicScheme = Get-{{{apiNamePrefix}}}CryptographicScheme -SigningAlgorithm $httpSigningConfiguration.SigningAlgorithm `
|
<#$cryptographicScheme = Get-{{{apiNamePrefix}}}CryptographicScheme -SigningAlgorithm $httpSigningConfiguration.SigningAlgorithm `
|
||||||
-HashAlgorithm $httpSigningConfiguration.HashAlgorithm
|
-HashAlgorithm $httpSigningConfiguration.HashAlgorithm
|
||||||
#>
|
#>
|
||||||
|
@ -24,9 +24,9 @@ Below are some usage examples for Go and Ruby. For other languages, please refer
|
|||||||
### Go
|
### Go
|
||||||
```
|
```
|
||||||
# assuming `protoc-gen-go` has been installed with `go get -u github.com/golang/protobuf/protoc-gen-go`
|
# assuming `protoc-gen-go` has been installed with `go get -u github.com/golang/protobuf/protoc-gen-go`
|
||||||
mkdir /var/tmp/go/{{{pacakgeName}}}
|
mkdir /var/tmp/go/{{{packageName}}}
|
||||||
protoc --go_out=/var/tmp/go/{{{pacakgeName}}} services/*
|
protoc --go_out=/var/tmp/go/{{{packageName}}} services/*
|
||||||
protoc --go_out=/var/tmp/go/{{{pacakgeName}}} models/*
|
protoc --go_out=/var/tmp/go/{{{packageName}}} models/*
|
||||||
```
|
```
|
||||||
|
|
||||||
### Ruby
|
### Ruby
|
||||||
|
@ -38,7 +38,7 @@ pytest
|
|||||||
|
|
||||||
## Prevent file overriding
|
## Prevent file overriding
|
||||||
|
|
||||||
After first generation, add edited files to _.openapi-generator-ignore_ to prevent generator to overwrite them. Typically:
|
After first generation, add edited files to _.openapi-generator-ignore_ to prevent generator from overwriting them. Typically:
|
||||||
```
|
```
|
||||||
server/controllers/*
|
server/controllers/*
|
||||||
test/*
|
test/*
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
# if you have many models here with many references from one model to another this may
|
# if you have many models here with many references from one model to another this may
|
||||||
# raise a RecursionError
|
# raise a RecursionError
|
||||||
# to avoid this, import only the models that you directly need like:
|
# to avoid this, import only the models that you directly need like:
|
||||||
# from from {{modelPackage}}.pet import Pet
|
# from {{modelPackage}}.pet import Pet
|
||||||
# or import this package, but before doing it, use:
|
# or import this package, but before doing it, use:
|
||||||
# import sys
|
# import sys
|
||||||
# sys.setrecursionlimit(n)
|
# sys.setrecursionlimit(n)
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
# if you have many models here with many references from one model to another this may
|
# if you have many models here with many references from one model to another this may
|
||||||
# raise a RecursionError
|
# raise a RecursionError
|
||||||
# to avoid this, import only the models that you directly need like:
|
# to avoid this, import only the models that you directly need like:
|
||||||
# from from {{packageName}}.{{modelPackage}}.pet import Pet
|
# from {{packageName}}.{{modelPackage}}.pet import Pet
|
||||||
# or import this package, but before doing it, use:
|
# or import this package, but before doing it, use:
|
||||||
# import sys
|
# import sys
|
||||||
# sys.setrecursionlimit(n)
|
# sys.setrecursionlimit(n)
|
||||||
|
@ -1250,9 +1250,9 @@ class ApiClient:
|
|||||||
# The HTTP signature scheme requires multiple HTTP headers
|
# The HTTP signature scheme requires multiple HTTP headers
|
||||||
# that are calculated dynamically.
|
# that are calculated dynamically.
|
||||||
signing_info = self.configuration.signing_info
|
signing_info = self.configuration.signing_info
|
||||||
querys = tuple()
|
queries = tuple()
|
||||||
auth_headers = signing_info.get_http_signature_headers(
|
auth_headers = signing_info.get_http_signature_headers(
|
||||||
resource_path, method, headers, body, querys)
|
resource_path, method, headers, body, queries)
|
||||||
for key, value in auth_headers.items():
|
for key, value in auth_headers.items():
|
||||||
headers.add(key, value)
|
headers.add(key, value)
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
@ -134,7 +134,7 @@ conf = {{{packageName}}}.Configuration(
|
|||||||
'Authorization' header, which is used to carry the signature.
|
'Authorization' header, which is used to carry the signature.
|
||||||
|
|
||||||
One may be tempted to sign all headers by default, but in practice it rarely works.
|
One may be tempted to sign all headers by default, but in practice it rarely works.
|
||||||
This is beccause explicit proxies, transparent proxies, TLS termination endpoints or
|
This is because explicit proxies, transparent proxies, TLS termination endpoints or
|
||||||
load balancers may add/modify/remove headers. Include the HTTP headers that you know
|
load balancers may add/modify/remove headers. Include the HTTP headers that you know
|
||||||
are not going to be modified in transit.
|
are not going to be modified in transit.
|
||||||
|
|
||||||
@ -328,7 +328,7 @@ conf = {{{packageName}}}.Configuration(
|
|||||||
self._disabled_client_side_validations = s
|
self._disabled_client_side_validations = s
|
||||||
{{#if hasHttpSignatureMethods}}
|
{{#if hasHttpSignatureMethods}}
|
||||||
if name == "signing_info" and value is not None:
|
if name == "signing_info" and value is not None:
|
||||||
# Ensure the host paramater from signing info is the same as
|
# Ensure the host parameter from signing info is the same as
|
||||||
# Configuration.host.
|
# Configuration.host.
|
||||||
value.host = self.host
|
value.host = self.host
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
|
# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
|
||||||
#
|
#
|
||||||
# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" "gitlab.com"
|
# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com"
|
||||||
|
|
||||||
git_user_id=$1
|
git_user_id=$1
|
||||||
git_repo_id=$2
|
git_repo_id=$2
|
||||||
|
@ -378,7 +378,7 @@ class Schema:
|
|||||||
_validate_oapg returns a key value pair
|
_validate_oapg returns a key value pair
|
||||||
where the key is the path to the item, and the value will be the required manufactured class
|
where the key is the path to the item, and the value will be the required manufactured class
|
||||||
made out of the matching schemas
|
made out of the matching schemas
|
||||||
2. value is an instance of the the correct schema type
|
2. value is an instance of the correct schema type
|
||||||
the value is NOT validated by _validate_oapg, _validate_oapg only checks that the instance is of the correct schema type
|
the value is NOT validated by _validate_oapg, _validate_oapg only checks that the instance is of the correct schema type
|
||||||
for this value, _validate_oapg does NOT return an entry for it in _path_to_schemas
|
for this value, _validate_oapg does NOT return an entry for it in _path_to_schemas
|
||||||
and in list/dict _get_items_oapg,_get_properties_oapg the value will be directly assigned
|
and in list/dict _get_items_oapg,_get_properties_oapg the value will be directly assigned
|
||||||
@ -861,7 +861,7 @@ class ValidatorBase:
|
|||||||
schema_keyword not in configuration._disabled_client_side_validations)
|
schema_keyword not in configuration._disabled_client_side_validations)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def _raise_validation_errror_message_oapg(value, constraint_msg, constraint_value, path_to_item, additional_txt=""):
|
def _raise_validation_error_message_oapg(value, constraint_msg, constraint_value, path_to_item, additional_txt=""):
|
||||||
raise ApiValueError(
|
raise ApiValueError(
|
||||||
"Invalid value `{value}`, {constraint_msg} `{constraint_value}`{additional_txt} at {path_to_item}".format(
|
"Invalid value `{value}`, {constraint_msg} `{constraint_value}`{additional_txt} at {path_to_item}".format(
|
||||||
value=value,
|
value=value,
|
||||||
@ -956,7 +956,7 @@ class StrBase(ValidatorBase):
|
|||||||
if (cls._is_json_validation_enabled_oapg('maxLength', validation_metadata.configuration) and
|
if (cls._is_json_validation_enabled_oapg('maxLength', validation_metadata.configuration) and
|
||||||
hasattr(cls.MetaOapg, 'max_length') and
|
hasattr(cls.MetaOapg, 'max_length') and
|
||||||
len(arg) > cls.MetaOapg.max_length):
|
len(arg) > cls.MetaOapg.max_length):
|
||||||
cls._raise_validation_errror_message_oapg(
|
cls._raise_validation_error_message_oapg(
|
||||||
value=arg,
|
value=arg,
|
||||||
constraint_msg="length must be less than or equal to",
|
constraint_msg="length must be less than or equal to",
|
||||||
constraint_value=cls.MetaOapg.max_length,
|
constraint_value=cls.MetaOapg.max_length,
|
||||||
@ -966,7 +966,7 @@ class StrBase(ValidatorBase):
|
|||||||
if (cls._is_json_validation_enabled_oapg('minLength', validation_metadata.configuration) and
|
if (cls._is_json_validation_enabled_oapg('minLength', validation_metadata.configuration) and
|
||||||
hasattr(cls.MetaOapg, 'min_length') and
|
hasattr(cls.MetaOapg, 'min_length') and
|
||||||
len(arg) < cls.MetaOapg.min_length):
|
len(arg) < cls.MetaOapg.min_length):
|
||||||
cls._raise_validation_errror_message_oapg(
|
cls._raise_validation_error_message_oapg(
|
||||||
value=arg,
|
value=arg,
|
||||||
constraint_msg="length must be greater than or equal to",
|
constraint_msg="length must be greater than or equal to",
|
||||||
constraint_value=cls.MetaOapg.min_length,
|
constraint_value=cls.MetaOapg.min_length,
|
||||||
@ -981,14 +981,14 @@ class StrBase(ValidatorBase):
|
|||||||
if flags != 0:
|
if flags != 0:
|
||||||
# Don't print the regex flags if the flags are not
|
# Don't print the regex flags if the flags are not
|
||||||
# specified in the OAS document.
|
# specified in the OAS document.
|
||||||
cls._raise_validation_errror_message_oapg(
|
cls._raise_validation_error_message_oapg(
|
||||||
value=arg,
|
value=arg,
|
||||||
constraint_msg="must match regular expression",
|
constraint_msg="must match regular expression",
|
||||||
constraint_value=regex_dict['pattern'],
|
constraint_value=regex_dict['pattern'],
|
||||||
path_to_item=validation_metadata.path_to_item,
|
path_to_item=validation_metadata.path_to_item,
|
||||||
additional_txt=" with flags=`{}`".format(flags)
|
additional_txt=" with flags=`{}`".format(flags)
|
||||||
)
|
)
|
||||||
cls._raise_validation_errror_message_oapg(
|
cls._raise_validation_error_message_oapg(
|
||||||
value=arg,
|
value=arg,
|
||||||
constraint_msg="must match regular expression",
|
constraint_msg="must match regular expression",
|
||||||
constraint_value=regex_dict['pattern'],
|
constraint_value=regex_dict['pattern'],
|
||||||
@ -1204,7 +1204,7 @@ class NumberBase(ValidatorBase):
|
|||||||
return self._as_float
|
return self._as_float
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
if self.as_tuple().exponent >= 0:
|
if self.as_tuple().exponent >= 0:
|
||||||
raise ApiValueError(f'{self} is not an float')
|
raise ApiValueError(f'{self} is not a float')
|
||||||
self._as_float = float(self)
|
self._as_float = float(self)
|
||||||
return self._as_float
|
return self._as_float
|
||||||
|
|
||||||
@ -1221,7 +1221,7 @@ class NumberBase(ValidatorBase):
|
|||||||
multiple_of_value = cls.MetaOapg.multiple_of
|
multiple_of_value = cls.MetaOapg.multiple_of
|
||||||
if (not (float(arg) / multiple_of_value).is_integer()):
|
if (not (float(arg) / multiple_of_value).is_integer()):
|
||||||
# Note 'multipleOf' will be as good as the floating point arithmetic.
|
# Note 'multipleOf' will be as good as the floating point arithmetic.
|
||||||
cls._raise_validation_errror_message_oapg(
|
cls._raise_validation_error_message_oapg(
|
||||||
value=arg,
|
value=arg,
|
||||||
constraint_msg="value must be a multiple of",
|
constraint_msg="value must be a multiple of",
|
||||||
constraint_value=multiple_of_value,
|
constraint_value=multiple_of_value,
|
||||||
@ -1242,7 +1242,7 @@ class NumberBase(ValidatorBase):
|
|||||||
if (cls._is_json_validation_enabled_oapg('exclusiveMaximum', validation_metadata.configuration) and
|
if (cls._is_json_validation_enabled_oapg('exclusiveMaximum', validation_metadata.configuration) and
|
||||||
hasattr(cls.MetaOapg, 'exclusive_maximum') and
|
hasattr(cls.MetaOapg, 'exclusive_maximum') and
|
||||||
arg >= cls.MetaOapg.exclusive_maximum):
|
arg >= cls.MetaOapg.exclusive_maximum):
|
||||||
cls._raise_validation_errror_message_oapg(
|
cls._raise_validation_error_message_oapg(
|
||||||
value=arg,
|
value=arg,
|
||||||
constraint_msg="must be a value less than",
|
constraint_msg="must be a value less than",
|
||||||
constraint_value=cls.MetaOapg.exclusive_maximum,
|
constraint_value=cls.MetaOapg.exclusive_maximum,
|
||||||
@ -1252,7 +1252,7 @@ class NumberBase(ValidatorBase):
|
|||||||
if (cls._is_json_validation_enabled_oapg('maximum', validation_metadata.configuration) and
|
if (cls._is_json_validation_enabled_oapg('maximum', validation_metadata.configuration) and
|
||||||
hasattr(cls.MetaOapg, 'inclusive_maximum') and
|
hasattr(cls.MetaOapg, 'inclusive_maximum') and
|
||||||
arg > cls.MetaOapg.inclusive_maximum):
|
arg > cls.MetaOapg.inclusive_maximum):
|
||||||
cls._raise_validation_errror_message_oapg(
|
cls._raise_validation_error_message_oapg(
|
||||||
value=arg,
|
value=arg,
|
||||||
constraint_msg="must be a value less than or equal to",
|
constraint_msg="must be a value less than or equal to",
|
||||||
constraint_value=cls.MetaOapg.inclusive_maximum,
|
constraint_value=cls.MetaOapg.inclusive_maximum,
|
||||||
@ -1262,7 +1262,7 @@ class NumberBase(ValidatorBase):
|
|||||||
if (cls._is_json_validation_enabled_oapg('exclusiveMinimum', validation_metadata.configuration) and
|
if (cls._is_json_validation_enabled_oapg('exclusiveMinimum', validation_metadata.configuration) and
|
||||||
hasattr(cls.MetaOapg, 'exclusive_minimum') and
|
hasattr(cls.MetaOapg, 'exclusive_minimum') and
|
||||||
arg <= cls.MetaOapg.exclusive_minimum):
|
arg <= cls.MetaOapg.exclusive_minimum):
|
||||||
cls._raise_validation_errror_message_oapg(
|
cls._raise_validation_error_message_oapg(
|
||||||
value=arg,
|
value=arg,
|
||||||
constraint_msg="must be a value greater than",
|
constraint_msg="must be a value greater than",
|
||||||
constraint_value=cls.MetaOapg.exclusive_maximum,
|
constraint_value=cls.MetaOapg.exclusive_maximum,
|
||||||
@ -1272,7 +1272,7 @@ class NumberBase(ValidatorBase):
|
|||||||
if (cls._is_json_validation_enabled_oapg('minimum', validation_metadata.configuration) and
|
if (cls._is_json_validation_enabled_oapg('minimum', validation_metadata.configuration) and
|
||||||
hasattr(cls.MetaOapg, 'inclusive_minimum') and
|
hasattr(cls.MetaOapg, 'inclusive_minimum') and
|
||||||
arg < cls.MetaOapg.inclusive_minimum):
|
arg < cls.MetaOapg.inclusive_minimum):
|
||||||
cls._raise_validation_errror_message_oapg(
|
cls._raise_validation_error_message_oapg(
|
||||||
value=arg,
|
value=arg,
|
||||||
constraint_msg="must be a value greater than or equal to",
|
constraint_msg="must be a value greater than or equal to",
|
||||||
constraint_value=cls.MetaOapg.inclusive_minimum,
|
constraint_value=cls.MetaOapg.inclusive_minimum,
|
||||||
@ -1340,7 +1340,7 @@ class ListBase(ValidatorBase):
|
|||||||
if (cls._is_json_validation_enabled_oapg('maxItems', validation_metadata.configuration) and
|
if (cls._is_json_validation_enabled_oapg('maxItems', validation_metadata.configuration) and
|
||||||
hasattr(cls.MetaOapg, 'max_items') and
|
hasattr(cls.MetaOapg, 'max_items') and
|
||||||
len(arg) > cls.MetaOapg.max_items):
|
len(arg) > cls.MetaOapg.max_items):
|
||||||
cls._raise_validation_errror_message_oapg(
|
cls._raise_validation_error_message_oapg(
|
||||||
value=arg,
|
value=arg,
|
||||||
constraint_msg="number of items must be less than or equal to",
|
constraint_msg="number of items must be less than or equal to",
|
||||||
constraint_value=cls.MetaOapg.max_items,
|
constraint_value=cls.MetaOapg.max_items,
|
||||||
@ -1350,7 +1350,7 @@ class ListBase(ValidatorBase):
|
|||||||
if (cls._is_json_validation_enabled_oapg('minItems', validation_metadata.configuration) and
|
if (cls._is_json_validation_enabled_oapg('minItems', validation_metadata.configuration) and
|
||||||
hasattr(cls.MetaOapg, 'min_items') and
|
hasattr(cls.MetaOapg, 'min_items') and
|
||||||
len(arg) < cls.MetaOapg.min_items):
|
len(arg) < cls.MetaOapg.min_items):
|
||||||
cls._raise_validation_errror_message_oapg(
|
cls._raise_validation_error_message_oapg(
|
||||||
value=arg,
|
value=arg,
|
||||||
constraint_msg="number of items must be greater than or equal to",
|
constraint_msg="number of items must be greater than or equal to",
|
||||||
constraint_value=cls.MetaOapg.min_items,
|
constraint_value=cls.MetaOapg.min_items,
|
||||||
@ -1361,7 +1361,7 @@ class ListBase(ValidatorBase):
|
|||||||
hasattr(cls.MetaOapg, 'unique_items') and cls.MetaOapg.unique_items and arg):
|
hasattr(cls.MetaOapg, 'unique_items') and cls.MetaOapg.unique_items and arg):
|
||||||
unique_items = set(arg)
|
unique_items = set(arg)
|
||||||
if len(arg) > len(unique_items):
|
if len(arg) > len(unique_items):
|
||||||
cls._raise_validation_errror_message_oapg(
|
cls._raise_validation_error_message_oapg(
|
||||||
value=arg,
|
value=arg,
|
||||||
constraint_msg="duplicate items were found, and the tuple must not contain duplicates because",
|
constraint_msg="duplicate items were found, and the tuple must not contain duplicates because",
|
||||||
constraint_value='unique_items==True',
|
constraint_value='unique_items==True',
|
||||||
@ -1604,7 +1604,7 @@ class DictBase(Discriminable, ValidatorBase):
|
|||||||
if (cls._is_json_validation_enabled_oapg('maxProperties', validation_metadata.configuration) and
|
if (cls._is_json_validation_enabled_oapg('maxProperties', validation_metadata.configuration) and
|
||||||
hasattr(cls.MetaOapg, 'max_properties') and
|
hasattr(cls.MetaOapg, 'max_properties') and
|
||||||
len(arg) > cls.MetaOapg.max_properties):
|
len(arg) > cls.MetaOapg.max_properties):
|
||||||
cls._raise_validation_errror_message_oapg(
|
cls._raise_validation_error_message_oapg(
|
||||||
value=arg,
|
value=arg,
|
||||||
constraint_msg="number of properties must be less than or equal to",
|
constraint_msg="number of properties must be less than or equal to",
|
||||||
constraint_value=cls.MetaOapg.max_properties,
|
constraint_value=cls.MetaOapg.max_properties,
|
||||||
@ -1614,7 +1614,7 @@ class DictBase(Discriminable, ValidatorBase):
|
|||||||
if (cls._is_json_validation_enabled_oapg('minProperties', validation_metadata.configuration) and
|
if (cls._is_json_validation_enabled_oapg('minProperties', validation_metadata.configuration) and
|
||||||
hasattr(cls.MetaOapg, 'min_properties') and
|
hasattr(cls.MetaOapg, 'min_properties') and
|
||||||
len(arg) < cls.MetaOapg.min_properties):
|
len(arg) < cls.MetaOapg.min_properties):
|
||||||
cls._raise_validation_errror_message_oapg(
|
cls._raise_validation_error_message_oapg(
|
||||||
value=arg,
|
value=arg,
|
||||||
constraint_msg="number of properties must be greater than or equal to",
|
constraint_msg="number of properties must be greater than or equal to",
|
||||||
constraint_value=cls.MetaOapg.min_properties,
|
constraint_value=cls.MetaOapg.min_properties,
|
||||||
|
@ -334,7 +334,7 @@ class HttpSigningConfiguration(object):
|
|||||||
:return: A tuple of (digest, prefix).
|
:return: A tuple of (digest, prefix).
|
||||||
The digest is a hashing object that contains the cryptographic digest of
|
The digest is a hashing object that contains the cryptographic digest of
|
||||||
the HTTP request.
|
the HTTP request.
|
||||||
The prefix is a string that identifies the cryptographc hash. It is used
|
The prefix is a string that identifies the cryptographic hash. It is used
|
||||||
to generate the 'Digest' header as specified in RFC 3230.
|
to generate the 'Digest' header as specified in RFC 3230.
|
||||||
"""
|
"""
|
||||||
if self.hash_algorithm == HASH_SHA512:
|
if self.hash_algorithm == HASH_SHA512:
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
#' @field content The deserialized response body.
|
#' @field content The deserialized response body.
|
||||||
#' @field response The raw response from the endpoint.
|
#' @field response The raw response from the endpoint.
|
||||||
#' @field status_code The HTTP response status code.
|
#' @field status_code The HTTP response status code.
|
||||||
#' @field status_code_desc The brief descriptoin of the HTTP response status code.
|
#' @field status_code_desc The brief description of the HTTP response status code.
|
||||||
#' @field headers The HTTP response headers.
|
#' @field headers The HTTP response headers.
|
||||||
#' @export
|
#' @export
|
||||||
ApiResponse <- R6::R6Class(
|
ApiResponse <- R6::R6Class(
|
||||||
|
@ -386,7 +386,7 @@
|
|||||||
# check if items are unique
|
# check if items are unique
|
||||||
if (!identical(`{{{paramName}}}`, unique(`{{{paramName}}}`))) {
|
if (!identical(`{{{paramName}}}`, unique(`{{{paramName}}}`))) {
|
||||||
{{#useDefaultExceptionHandling}}
|
{{#useDefaultExceptionHandling}}
|
||||||
stop("Invalid value for {{{paramName}}} when calling {{classname}}${{operationId}}. Items must be unqiue.")
|
stop("Invalid value for {{{paramName}}} when calling {{classname}}${{operationId}}. Items must be unique.")
|
||||||
{{/useDefaultExceptionHandling}}
|
{{/useDefaultExceptionHandling}}
|
||||||
{{#useRlangExceptionHandling}}
|
{{#useRlangExceptionHandling}}
|
||||||
rlang::abort(message = "Invalid value for `{{paramName}}` when calling {{classname}}${{operationId}}. Items must be unique.",
|
rlang::abort(message = "Invalid value for `{{paramName}}` when calling {{classname}}${{operationId}}. Items must be unique.",
|
||||||
|
@ -411,10 +411,10 @@ ApiClient <- R6::R6Class(
|
|||||||
}
|
}
|
||||||
return_obj
|
return_obj
|
||||||
},
|
},
|
||||||
#' Return a propery header (for accept or content-type).
|
#' Return a property header (for accept or content-type).
|
||||||
#'
|
#'
|
||||||
#' @description
|
#' @description
|
||||||
#' Return a propery header (for accept or content-type). If JSON-related MIME is found,
|
#' Return a property header (for accept or content-type). If JSON-related MIME is found,
|
||||||
#' return it. Otherwise, return the first one, if any.
|
#' return it. Otherwise, return the first one, if any.
|
||||||
#'
|
#'
|
||||||
#' @param headers A list of headers
|
#' @param headers A list of headers
|
||||||
|
@ -171,7 +171,7 @@ ApiClient <- R6::R6Class(
|
|||||||
#' @param header_params The header parameters.
|
#' @param header_params The header parameters.
|
||||||
#' @param form_params The form parameters.
|
#' @param form_params The form parameters.
|
||||||
#' @param file_params The form parameters to upload files.
|
#' @param file_params The form parameters to upload files.
|
||||||
#' @param accepts The HTTP accpet headers.
|
#' @param accepts The HTTP accept headers.
|
||||||
#' @param content_types The HTTP content-type headers.
|
#' @param content_types The HTTP content-type headers.
|
||||||
#' @param body The HTTP request body.
|
#' @param body The HTTP request body.
|
||||||
#' @param is_oauth True if the endpoints required OAuth authentication.
|
#' @param is_oauth True if the endpoints required OAuth authentication.
|
||||||
@ -202,7 +202,7 @@ ApiClient <- R6::R6Class(
|
|||||||
#' @param header_params The header parameters.
|
#' @param header_params The header parameters.
|
||||||
#' @param form_params The form parameters.
|
#' @param form_params The form parameters.
|
||||||
#' @param file_params The form parameters for uploading files.
|
#' @param file_params The form parameters for uploading files.
|
||||||
#' @param accepts The HTTP accpet headers.
|
#' @param accepts The HTTP accept headers.
|
||||||
#' @param content_types The HTTP content-type headers.
|
#' @param content_types The HTTP content-type headers.
|
||||||
#' @param body The HTTP request body.
|
#' @param body The HTTP request body.
|
||||||
#' @param is_oauth True if the endpoints required OAuth authentication.
|
#' @param is_oauth True if the endpoints required OAuth authentication.
|
||||||
@ -416,10 +416,10 @@ ApiClient <- R6::R6Class(
|
|||||||
}
|
}
|
||||||
return_obj
|
return_obj
|
||||||
},
|
},
|
||||||
#' Return a propery header (for accept or content-type).
|
#' Return a property header (for accept or content-type).
|
||||||
#'
|
#'
|
||||||
#' @description
|
#' @description
|
||||||
#' Return a propery header (for accept or content-type). If JSON-related MIME is found,
|
#' Return a property header (for accept or content-type). If JSON-related MIME is found,
|
||||||
#' return it. Otherwise, return the first one, if any.
|
#' return it. Otherwise, return the first one, if any.
|
||||||
#'
|
#'
|
||||||
#' @param headers A list of headers
|
#' @param headers A list of headers
|
||||||
|
@ -169,7 +169,7 @@
|
|||||||
## Uncomment below to unlock the class to allow modifications of the method or field
|
## Uncomment below to unlock the class to allow modifications of the method or field
|
||||||
#{{classname}}$unlock()
|
#{{classname}}$unlock()
|
||||||
#
|
#
|
||||||
## Below is an example to define the print fnuction
|
## Below is an example to define the print function
|
||||||
#{{classname}}$set("public", "print", function(...) {
|
#{{classname}}$set("public", "print", function(...) {
|
||||||
# print(jsonlite::prettify(self$toJSONString()))
|
# print(jsonlite::prettify(self$toJSONString()))
|
||||||
# invisible(self)
|
# invisible(self)
|
||||||
|
@ -46,7 +46,7 @@
|
|||||||
#' @param {{name}} {{#lambdaRdocEscape}}{{{description}}}{{/lambdaRdocEscape}}{{^description}}{{{name}}}{{/description}}{{#defaultValue}}. Default to {{{.}}}.{{/defaultValue}}
|
#' @param {{name}} {{#lambdaRdocEscape}}{{{description}}}{{/lambdaRdocEscape}}{{^description}}{{{name}}}{{/description}}{{#defaultValue}}. Default to {{{.}}}.{{/defaultValue}}
|
||||||
{{/optionalVars}}
|
{{/optionalVars}}
|
||||||
{{#isAdditionalPropertiesTrue}}
|
{{#isAdditionalPropertiesTrue}}
|
||||||
#' @param additional_properties additonal properties (optional)
|
#' @param additional_properties additional properties (optional)
|
||||||
{{/isAdditionalPropertiesTrue}}
|
{{/isAdditionalPropertiesTrue}}
|
||||||
#' @param ... Other optional arguments.
|
#' @param ... Other optional arguments.
|
||||||
#' @export
|
#' @export
|
||||||
@ -673,7 +673,7 @@
|
|||||||
## Uncomment below to unlock the class to allow modifications of the method or field
|
## Uncomment below to unlock the class to allow modifications of the method or field
|
||||||
# {{classname}}$unlock()
|
# {{classname}}$unlock()
|
||||||
#
|
#
|
||||||
## Below is an example to define the print fnuction
|
## Below is an example to define the print function
|
||||||
# {{classname}}$set("public", "print", function(...) {
|
# {{classname}}$set("public", "print", function(...) {
|
||||||
# print(jsonlite::prettify(self$toJSONString()))
|
# print(jsonlite::prettify(self$toJSONString()))
|
||||||
# invisible(self)
|
# invisible(self)
|
||||||
|
@ -221,7 +221,7 @@
|
|||||||
## Uncomment below to unlock the class to allow modifications of the method or field
|
## Uncomment below to unlock the class to allow modifications of the method or field
|
||||||
#{{classname}}$unlock()
|
#{{classname}}$unlock()
|
||||||
#
|
#
|
||||||
## Below is an example to define the print fnuction
|
## Below is an example to define the print function
|
||||||
#{{classname}}$set("public", "print", function(...) {
|
#{{classname}}$set("public", "print", function(...) {
|
||||||
# print(jsonlite::prettify(self$toJSONString()))
|
# print(jsonlite::prettify(self$toJSONString()))
|
||||||
# invisible(self)
|
# invisible(self)
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user