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-withXml
|
||||
- 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/jersey2-java8-localdatetime
|
||||
- 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:
|
||||
push:
|
||||
|
@ -12,7 +12,7 @@
|
||||
## customise it to your individual needs - from themes to extensions, you
|
||||
## 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://gitpod.io#' to the source control URL of any project.
|
||||
##
|
||||
|
@ -6,4 +6,4 @@ additionalProperties:
|
||||
packageGuid: '{3C799344-F285-4669-8FD5-7ED9B795D5C5}'
|
||||
aspnetCoreVersion: "6.0"
|
||||
userSecretsGuid: 'cb87e868-8646-48ef-9bb6-344b537d0d37'
|
||||
useSeperateModelProject: true
|
||||
useSeparateModelProject: true
|
||||
|
@ -12,6 +12,6 @@ additionalProperties:
|
||||
library: "spring-boot"
|
||||
withXml: true
|
||||
jackson: true
|
||||
camelUseDefaultValidationtErrorProcessor: true
|
||||
camelUseDefaultValidationErrorProcessor: true
|
||||
camelRestClientRequestValidation: true
|
||||
camelSecurityDefinitions: true
|
||||
|
@ -1,5 +1,5 @@
|
||||
generatorName: java
|
||||
outputDir: samples/client/petstore/java/webclient-nulable-arrays
|
||||
outputDir: samples/client/petstore/java/webclient-nullable-arrays
|
||||
library: webclient
|
||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/schema-with-nullable-arrays.yaml
|
||||
templateDir: modules/openapi-generator/src/main/resources/Java
|
||||
|
@ -1,6 +1,6 @@
|
||||
generatorName: swift5
|
||||
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
|
||||
generateAliasAsModel: true
|
||||
additionalProperties:
|
||||
|
@ -1,9 +1,9 @@
|
||||
---
|
||||
# csharp-netcore test files and image for upload
|
||||
- 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"
|
||||
sha256: dae985015ba461297927d544a78267f2def35e07c3f14ca66468fd61e1fd1c26
|
||||
sha256: ff6a5fccd4c026d85fe7232911cda445f5065dcefd03abe258e19af5b28d05c5
|
||||
- filename: "samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools.Test/linux-logo.png"
|
||||
sha256: 0a67c32728197e942b13bdda064b73793f12f5c795f1e5cf35a3adf69c973230
|
||||
# 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`.
|
||||
* 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 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.
|
||||
* 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.
|
||||
|
||||
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
|
||||
# generate only models
|
||||
@ -397,7 +397,7 @@ or
|
||||
|
||||
## 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
|
||||
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|
|
||||
|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|
|
||||
|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|
|
||||
|
||||
## 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|
|
||||
|camelRestComponent|name of the Camel component to use as the REST consumer| |servlet|
|
||||
|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|
|
||||
|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|
|
||||
|
@ -30,7 +30,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
|soapPath|basepath of the soap services| |null|
|
||||
|sortModelPropertiesByRequiredFlag|Sort model properties 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
|
||||
|
||||
|
@ -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.
|
||||
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`.
|
||||
|
||||
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
|
||||
|
@ -49,7 +49,7 @@ Projects relying on generated code might need to be adapted.
|
||||
==== Validate spec on generation by default
|
||||
|
||||
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:
|
||||
|
||||
|
@ -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.
|
||||
|
||||
> When joining paths, always use `File.seperator`
|
||||
> When joining paths, always use `File.separator`
|
||||
|
||||
```java
|
||||
modelTemplateFiles.put("model.mustache", ".zz");
|
||||
|
@ -125,7 +125,7 @@ curl -H "Content-type: application/json" \
|
||||
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
|
||||
{
|
||||
|
@ -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.
|
||||
|
||||
* 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)
|
||||
** Azure functions (node.js, server)
|
||||
** 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
|
||||
* General
|
||||
* 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
|
||||
* centralize build scripts
|
||||
* 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.
|
||||
|
||||
### 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)
|
||||
* Azure functions (node.js, server)
|
||||
* Finagle HTTP Client (Scala, client)
|
||||
|
@ -845,7 +845,7 @@ The following are vendor extensions supported by OpenAPI Generator. The list may
|
||||
|
||||
#### Enum
|
||||
|
||||
`x-enum-varnames` can be used to have an other enum name for the corresponding value.
|
||||
`x-enum-varnames` can be used to have another enum name for the corresponding value.
|
||||
This is used to define names of the enum items.
|
||||
|
||||
`x-enum-descriptions` can be used to provide an individual description for each value.
|
||||
|
@ -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 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
|
||||
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>
|
||||
<withXml>true</withXml>
|
||||
<jackson>true</jackson>
|
||||
<camelUseDefaultValidationtErrorProcessor>true</camelUseDefaultValidationtErrorProcessor>
|
||||
<camelUseDefaultValidationErrorProcessor>true</camelUseDefaultValidationErrorProcessor>
|
||||
<!--
|
||||
Define bean validation error processor
|
||||
<camelUseDefaultValidationtErrorProcessor>false</camelUseDefaultValidationtErrorProcessor>
|
||||
<camelUseDefaultValidationErrorProcessor>false</camelUseDefaultValidationErrorProcessor>
|
||||
<camelValidationErrorProcessor>errorProcessorBeanName</camelValidationErrorProcessor>
|
||||
-->
|
||||
<camelRestClientRequestValidation>true</camelRestClientRequestValidation>
|
||||
|
@ -335,7 +335,7 @@ paths:
|
||||
- "store"
|
||||
summary: "Find purchase order by ID"
|
||||
description: "For valid response try integer IDs with value <= 5 or > 10. Other\
|
||||
\ values will generated exceptions"
|
||||
\ values will generate exceptions"
|
||||
operationId: "getOrderById"
|
||||
produces:
|
||||
- "application/xml"
|
||||
|
@ -335,7 +335,7 @@ paths:
|
||||
- "store"
|
||||
summary: "Find purchase order by ID"
|
||||
description: "For valid response try integer IDs with value <= 5 or > 10. Other\
|
||||
\ values will generated exceptions"
|
||||
\ values will generate exceptions"
|
||||
operationId: "getOrderById"
|
||||
produces:
|
||||
- "application/xml"
|
||||
|
@ -334,7 +334,7 @@ paths:
|
||||
summary: Find purchase order by ID
|
||||
description: >-
|
||||
For valid response try integer IDs with value <= 5 or > 10. Other values
|
||||
will generated exceptions
|
||||
will generate exceptions
|
||||
operationId: getOrderById
|
||||
parameters:
|
||||
- name: orderId
|
||||
|
@ -334,7 +334,7 @@ paths:
|
||||
summary: Find purchase order by ID
|
||||
description: >-
|
||||
For valid response try integer IDs with value <= 5 or > 10. Other values
|
||||
will generated exceptions
|
||||
will generate exceptions
|
||||
operationId: getOrderById
|
||||
parameters:
|
||||
- name: orderId
|
||||
|
@ -2761,7 +2761,7 @@ public class DefaultCodegen implements CodegenConfig {
|
||||
|
||||
/**
|
||||
* 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
|
||||
* @return the updated test data payload
|
||||
*/
|
||||
|
@ -340,7 +340,7 @@ public class InlineModelResolver {
|
||||
} else {
|
||||
// allOf is just one or more types only so do not generate the inline allOf model
|
||||
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) {
|
||||
LOGGER.warn("allOf schema `{}` containing multiple types (not model) is not supported at the moment.", schema.getName());
|
||||
} else {
|
||||
@ -892,7 +892,7 @@ public class InlineModelResolver {
|
||||
*
|
||||
* @param name name of the inline 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) {
|
||||
//check inlineSchemaNameMapping
|
||||
|
@ -476,7 +476,7 @@ public abstract class AbstractPhpCodegen extends DefaultCodegen implements Codeg
|
||||
|
||||
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 (!StringUtils.isEmpty(modelNamePrefix)) {
|
||||
name = modelNamePrefix + "_" + name;
|
||||
|
@ -44,7 +44,7 @@ public class AspNetCoreServerCodegen extends AbstractCSharpCodegen {
|
||||
|
||||
public static final String USE_SWASHBUCKLE = "useSwashbuckle";
|
||||
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 SWASHBUCKLE_VERSION = "swashbuckleVersion";
|
||||
public static final String CLASS_MODIFIER = "classModifier";
|
||||
@ -73,7 +73,7 @@ public class AspNetCoreServerCodegen extends AbstractCSharpCodegen {
|
||||
|
||||
private boolean useSwashbuckle = true;
|
||||
private boolean pocoModels = false;
|
||||
private boolean useSeperateModelProject = false;
|
||||
private boolean useSeparateModelProject = false;
|
||||
protected int serverPort = 8080;
|
||||
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");
|
||||
@ -247,8 +247,8 @@ public class AspNetCoreServerCodegen extends AbstractCSharpCodegen {
|
||||
pocoModels);
|
||||
|
||||
addSwitch(USE_MODEL_SEPERATEPROJECT,
|
||||
"Create a seperate project for models",
|
||||
useSeperateModelProject);
|
||||
"Create a separate project for models",
|
||||
useSeparateModelProject);
|
||||
|
||||
addSwitch(IS_LIBRARY,
|
||||
"Is the build a library",
|
||||
@ -373,7 +373,7 @@ public class AspNetCoreServerCodegen extends AbstractCSharpCodegen {
|
||||
setOperationModifier();
|
||||
setModelClassModifier();
|
||||
setPocoModels();
|
||||
setUseSeperateModelProject();
|
||||
setUseSeparateModelProject();
|
||||
setUseSwashbuckle();
|
||||
setOperationIsAsync();
|
||||
|
||||
@ -408,7 +408,7 @@ public class AspNetCoreServerCodegen extends AbstractCSharpCodegen {
|
||||
supportingFiles.add(new SupportingFile("gitignore", packageFolder, ".gitignore"));
|
||||
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"));
|
||||
} 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"));
|
||||
}
|
||||
|
||||
if (useSeperateModelProject)
|
||||
if (useSeparateModelProject)
|
||||
{
|
||||
supportingFiles.add(new SupportingFile("ModelsProject.csproj.mustache", sourceFolder + File.separator + modelPackage, modelPackage + ".csproj"));
|
||||
}
|
||||
@ -465,7 +465,7 @@ public class AspNetCoreServerCodegen extends AbstractCSharpCodegen {
|
||||
|
||||
@Override
|
||||
public String modelFileFolder() {
|
||||
if (!useSeperateModelProject)
|
||||
if (!useSeparateModelProject)
|
||||
{
|
||||
return outputFolder + File.separator + sourceFolder + File.separator + packageName + File.separator + "Models";
|
||||
} else {
|
||||
@ -696,15 +696,15 @@ public class AspNetCoreServerCodegen extends AbstractCSharpCodegen {
|
||||
}
|
||||
}
|
||||
|
||||
private void setUseSeperateModelProject() {
|
||||
private void setUseSeparateModelProject() {
|
||||
if (additionalProperties.containsKey(USE_MODEL_SEPERATEPROJECT)) {
|
||||
useSeperateModelProject = convertPropertyToBooleanAndWriteBack(USE_MODEL_SEPERATEPROJECT);
|
||||
if (useSeperateModelProject)
|
||||
useSeparateModelProject = convertPropertyToBooleanAndWriteBack(USE_MODEL_SEPERATEPROJECT);
|
||||
if (useSeparateModelProject)
|
||||
{
|
||||
LOGGER.info("Using seperate model project");
|
||||
LOGGER.info("Using separate model project");
|
||||
}
|
||||
} 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
|
||||
*/
|
||||
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 :(
|
||||
if (Boolean.FALSE.equals(GENERICHOST.equals(getLibrary()))){
|
||||
return;
|
||||
|
@ -500,7 +500,7 @@ public class DartDioClientCodegen extends AbstractDartCodegen {
|
||||
|
||||
// ancestorOnlyProperties are properties defined by all 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<>();
|
||||
|
||||
// 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_BINDING_MODE = "camelRestBindingMode";
|
||||
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_SECURITY_DEFINITIONS = "camelSecurityDefinitions";
|
||||
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 camelRestBindingMode = "auto";
|
||||
private boolean camelRestClientRequestValidation = false;
|
||||
private boolean camelUseDefaultValidationtErrorProcessor = true;
|
||||
private boolean camelUseDefaultValidationErrorProcessor = true;
|
||||
private String camelValidationErrorProcessor = "validationErrorProcessor";
|
||||
private boolean camelSecurityDefinitions = true;
|
||||
private String camelDataformatProperties = "";
|
||||
@ -109,7 +109,7 @@ public class JavaCamelServerCodegen extends SpringCodegen implements BeanValidat
|
||||
"RestConfiguration.java"));
|
||||
if (performBeanValidation) {
|
||||
apiTemplateFiles.put("validation.mustache", "Validator.java");
|
||||
if (camelUseDefaultValidationtErrorProcessor) {
|
||||
if (camelUseDefaultValidationErrorProcessor) {
|
||||
supportingFiles.add(new SupportingFile("errorProcessor.mustache",
|
||||
(sourceFolder + File.separator + basePackage).replace(".", java.io.File.separator),
|
||||
"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_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_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(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));
|
||||
@ -184,7 +184,7 @@ public class JavaCamelServerCodegen extends SpringCodegen implements BeanValidat
|
||||
camelRestComponent = manageAdditionalProperty(CAMEL_REST_COMPONENT, camelRestComponent);
|
||||
camelRestBindingMode = manageAdditionalProperty(CAMEL_REST_BINDING_MODE, camelRestBindingMode);
|
||||
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);
|
||||
camelSecurityDefinitions = manageAdditionalProperty(CAMEL_SECURITY_DEFINITIONS, camelSecurityDefinitions);
|
||||
camelDataformatProperties = manageAdditionalProperty(CAMEL_DATAFORMAT_PROPERTIES, camelDataformatProperties);
|
||||
|
@ -715,7 +715,7 @@ public class JavaClientCodegen extends AbstractJavaCodegen
|
||||
super.postProcessOperationsWithModels(objs, allModels);
|
||||
|
||||
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();
|
||||
if (operations != null) {
|
||||
List<CodegenOperation> ops = operations.getOperation();
|
||||
|
@ -163,8 +163,8 @@ public class KtormSchemaCodegen extends AbstractKotlinCodegen {
|
||||
typeMapping.put("short", "kotlin.Short");
|
||||
typeMapping.put("char", "kotlin.String");
|
||||
typeMapping.put("real", "kotlin.Double");
|
||||
typeMapping.put("UUID", "java.util.UUID"); //be explict
|
||||
typeMapping.put("URI", "java.net.URI"); //be explict
|
||||
typeMapping.put("UUID", "java.util.UUID"); //be explicit
|
||||
typeMapping.put("URI", "java.net.URI"); //be explicit
|
||||
typeMapping.put("decimal", "java.math.BigDecimal");
|
||||
typeMapping.put("BigDecimal", "java.math.BigDecimal");
|
||||
typeMapping.put("AnyType", "kotlin.Any");
|
||||
|
@ -204,7 +204,7 @@ public class PythonClientCodegen extends AbstractPythonCodegen {
|
||||
.defaultValue("1.0.0"));
|
||||
cliOptions.add(new CliOption(PACKAGE_URL, "python package URL."));
|
||||
// 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
|
||||
// optional params which are set to unset as their default for method signatures only
|
||||
// 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
|
||||
* 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
|
||||
*/
|
||||
@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
|
||||
* 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 bodyParameterName body parameter name
|
||||
* @return the resultant CodegenParameter
|
||||
@ -1734,12 +1734,12 @@ public class PythonClientCodegen extends AbstractPythonCodegen {
|
||||
* @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 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
|
||||
* 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'
|
||||
* @param exampleLine this is the current line that we are generatign an example for, starts at 0
|
||||
* we don't indentin the 0th line because using the example value looks like:
|
||||
* @param exampleLine this is the current line that we are generating an example for, starts at 0
|
||||
* we don't indent the 0th line because using the example value looks like:
|
||||
* prop = ModelName( line 0
|
||||
* some_property='some_property_example' line 1
|
||||
* ) line 2
|
||||
@ -2248,9 +2248,9 @@ public class PythonClientCodegen extends AbstractPythonCodegen {
|
||||
/**
|
||||
* Use cases:
|
||||
* additional properties is unset: do nothing
|
||||
* additional properties is true: add definiton to property
|
||||
* additional properties is false: add definiton to property
|
||||
* additional properties is schema: add definiton to property
|
||||
* additional properties is true: add definition to property
|
||||
* additional properties is false: add definition to property
|
||||
* additional properties is schema: add definition to property
|
||||
*
|
||||
* @param schema the schema that may contain an additional property schema
|
||||
* @param property the property for the above schema
|
||||
@ -2488,7 +2488,7 @@ public class PythonClientCodegen extends AbstractPythonCodegen {
|
||||
|
||||
/**
|
||||
* @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) {
|
||||
/*
|
||||
|
@ -177,7 +177,7 @@ public class RClientCodegen extends DefaultCodegen implements CodegenConfig {
|
||||
typeMapping.put("map", "map");
|
||||
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
|
||||
importMapping.clear();
|
||||
|
||||
|
@ -309,12 +309,12 @@ public class ScalaSttpClientCodegen extends AbstractScalaCodegen implements Code
|
||||
return false;
|
||||
}
|
||||
for (ModelsMap objs : enumModels.values()) {
|
||||
List<ModelMap> modles = objs.getModels();
|
||||
if (modles == null || modles.isEmpty()) {
|
||||
List<ModelMap> models = objs.getModels();
|
||||
if (models == null || models.isEmpty()) {
|
||||
continue;
|
||||
}
|
||||
for (final Map<String, Object> modle : modles) {
|
||||
String enumImportPath = (String) modle.get("importPath");
|
||||
for (final Map<String, Object> model : models) {
|
||||
String enumImportPath = (String) model.get("importPath");
|
||||
if (enumImportPath != null && enumImportPath.equals(importPath)) {
|
||||
return true;
|
||||
}
|
||||
|
@ -66,7 +66,7 @@ public class WsdlSchemaCodegen extends DefaultCodegen implements CodegenConfig {
|
||||
cliOptions.add(new CliOption("contentTypeVersion",
|
||||
"generate WSDL with parameters/responses of the specified content-type"));
|
||||
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"));
|
||||
|
||||
additionalProperties.put("hostname", "localhost");
|
||||
|
@ -28,7 +28,7 @@ import java.io.Writer;
|
||||
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:
|
||||
* <pre>
|
||||
|
@ -27,7 +27,7 @@ import java.io.Writer;
|
||||
import static org.openapitools.codegen.utils.StringUtils.camelize;
|
||||
|
||||
/**
|
||||
* Strips trailing ? from a text fragement
|
||||
* Strips trailing ? from a text fragment
|
||||
*
|
||||
* Register:
|
||||
* <pre>
|
||||
|
@ -426,7 +426,7 @@ public class ModelUtils {
|
||||
/**
|
||||
* 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.
|
||||
* - A MapSchema is an object that can be extended with an arbitrary set of properties.
|
||||
* The payload may include dynamic properties.
|
||||
@ -917,7 +917,7 @@ public class ModelUtils {
|
||||
}
|
||||
|
||||
/**
|
||||
* If a RequestBody contains a reference to an other RequestBody with '$ref', returns the referenced RequestBody if it is found or the actual RequestBody in the other cases.
|
||||
* If a RequestBody contains a reference to another RequestBody with '$ref', returns the referenced RequestBody if it is found or the actual RequestBody in the other cases.
|
||||
*
|
||||
* @param openAPI specification being checked
|
||||
* @param requestBody potentially containing a '$ref'
|
||||
@ -946,7 +946,7 @@ public class ModelUtils {
|
||||
}
|
||||
|
||||
/**
|
||||
* If a ApiResponse contains a reference to an other ApiResponse with '$ref', returns the referenced ApiResponse if it is found or the actual ApiResponse in the other cases.
|
||||
* If a ApiResponse contains a reference to another ApiResponse with '$ref', returns the referenced ApiResponse if it is found or the actual ApiResponse in the other cases.
|
||||
*
|
||||
* @param openAPI specification being checked
|
||||
* @param apiResponse potentially containing a '$ref'
|
||||
@ -975,7 +975,7 @@ public class ModelUtils {
|
||||
}
|
||||
|
||||
/**
|
||||
* If a Parameter contains a reference to an other Parameter with '$ref', returns the referenced Parameter if it is found or the actual Parameter in the other cases.
|
||||
* If a Parameter contains a reference to another Parameter with '$ref', returns the referenced Parameter if it is found or the actual Parameter in the other cases.
|
||||
*
|
||||
* @param openAPI specification being checked
|
||||
* @param parameter potentially containing a '$ref'
|
||||
@ -1004,7 +1004,7 @@ public class ModelUtils {
|
||||
}
|
||||
|
||||
/**
|
||||
* If a Callback contains a reference to an other Callback with '$ref', returns the referenced Callback if it is found or the actual Callback in the other cases.
|
||||
* If a Callback contains a reference to another Callback with '$ref', returns the referenced Callback if it is found or the actual Callback in the other cases.
|
||||
*
|
||||
* @param openAPI specification being checked
|
||||
* @param callback potentially containing a '$ref'
|
||||
|
@ -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>
|
||||
* In OpenAPI 3.0.x, the "type" attribute must be a string value.
|
||||
* 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>
|
||||
* 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.
|
||||
@ -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>
|
||||
*
|
||||
* @return <code>true</code> if enabled, <code>false</code> if disabled
|
||||
|
@ -125,7 +125,7 @@ typedef struct internal_hooks
|
||||
} internal_hooks;
|
||||
|
||||
#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)
|
||||
{
|
||||
return malloc(size);
|
||||
|
@ -320,7 +320,7 @@ feature -- HTTP client: call api
|
||||
-- Execute an HTTP request with the given options.
|
||||
-- Relative path `a_path'
|
||||
-- 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 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.
|
||||
|
@ -10,7 +10,7 @@
|
||||
* Set the additional (undeclared) property with the specified name and value.
|
||||
* If the property does not already exist, create it otherwise replace it.
|
||||
* @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
|
||||
*/
|
||||
@JsonAnySetter
|
||||
|
@ -579,7 +579,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens
|
||||
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
|
||||
{{#isAdditionalPropertiesTrue}}
|
||||
obj.remove("additionalProperties");
|
||||
// serialize additonal properties
|
||||
// serialize additional properties
|
||||
if (value.getAdditionalProperties() != null) {
|
||||
for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) {
|
||||
if (entry.getValue() instanceof String)
|
||||
|
@ -69,7 +69,7 @@ public class CXFInterfaceComparator implements ResourceComparator {
|
||||
if (requestVerb.equals(HttpMethod.OPTIONS) && match(pathValue,requestPath)) {
|
||||
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)) {
|
||||
return true;
|
||||
}
|
||||
|
@ -69,7 +69,7 @@ public class CXFInterfaceComparator implements ResourceComparator {
|
||||
if (requestVerb.equals(HttpMethod.OPTIONS) && match(pathValue,requestPath)) {
|
||||
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)) {
|
||||
return true;
|
||||
}
|
||||
|
@ -9,13 +9,13 @@ This example uses the [JAX-RS](https://jax-rs-spec.java.net/) framework.
|
||||
|
||||
{{#interfaceOnly}}
|
||||
This project produces a jar that defines some interfaces.
|
||||
The jar can be used in combination with an other project providing the implementation.
|
||||
The jar can be used in combination with another project providing the implementation.
|
||||
{{/interfaceOnly}}
|
||||
|
||||
{{^interfaceOnly}}
|
||||
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:
|
||||
|
||||
```
|
||||
|
@ -12,7 +12,7 @@ The pom file is configured to use [Helidon](https://helidon.io/) as application
|
||||
|
||||
{{#interfaceOnly}}
|
||||
This project produces a jar that defines some interfaces.
|
||||
The jar can be used in combination with an other project providing the implementation.
|
||||
The jar can be used in combination with another project providing the implementation.
|
||||
{{/interfaceOnly}}
|
||||
|
||||
{{^interfaceOnly}}
|
||||
|
@ -12,7 +12,7 @@ The pom file is configured to use [KumuluzEE](https://ee.kumuluz.com/) as applic
|
||||
|
||||
{{#interfaceOnly}}
|
||||
This project produces a jar that defines some interfaces.
|
||||
The jar can be used in combination with an other project providing the implementation.
|
||||
The jar can be used in combination with another project providing the implementation.
|
||||
{{/interfaceOnly}}
|
||||
|
||||
{{^interfaceOnly}}
|
||||
|
@ -12,7 +12,7 @@ The pom file is configured to use [Open Liberty](https://openliberty.io/) as app
|
||||
|
||||
{{#interfaceOnly}}
|
||||
This project produces a jar that defines some interfaces.
|
||||
The jar can be used in combination with an other project providing the implementation.
|
||||
The jar can be used in combination with another project providing the implementation.
|
||||
{{/interfaceOnly}}
|
||||
|
||||
{{^interfaceOnly}}
|
||||
|
@ -12,7 +12,7 @@ The pom file is configured to use [Quarkus](https://quarkus.io/) as application
|
||||
|
||||
{{#interfaceOnly}}
|
||||
This project produces a jar that defines some interfaces.
|
||||
The jar can be used in combination with an other project providing the implementation.
|
||||
The jar can be used in combination with another project providing the implementation.
|
||||
{{/interfaceOnly}}
|
||||
|
||||
{{^interfaceOnly}}
|
||||
|
@ -12,7 +12,7 @@ The pom file is configured to use [Thorntail](https://thorntail.io) as applicati
|
||||
|
||||
{{#interfaceOnly}}
|
||||
This project produces a jar that defines some interfaces.
|
||||
The jar can be used in combination with an other project providing the implementation.
|
||||
The jar can be used in combination with another project providing the implementation.
|
||||
{{/interfaceOnly}}
|
||||
|
||||
{{^interfaceOnly}}
|
||||
|
@ -15,7 +15,7 @@ Module system
|
||||
|
||||
### 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
|
||||
# The dependency `babel-preset-react-app` requires that you specify `NODE_ENV` or `BABEL_ENV` environment variables
|
||||
|
@ -228,7 +228,7 @@ class {{classname}} {
|
||||
|
||||
{{#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.
|
||||
*/
|
||||
{{/emitJSDoc}}
|
||||
@ -238,7 +238,7 @@ class {{classname}} {
|
||||
|
||||
{{#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.
|
||||
*/
|
||||
{{/emitJSDoc}}
|
||||
@ -248,7 +248,7 @@ class {{classname}} {
|
||||
|
||||
{{#emitJSDoc}}
|
||||
/**
|
||||
* Returns the JSON representation of the actual intance.
|
||||
* Returns the JSON representation of the actual instance.
|
||||
* @return {string}
|
||||
*/
|
||||
{{/emitJSDoc}}
|
||||
|
@ -20,9 +20,9 @@
|
||||
<DockerfileContext>..\..</DockerfileContext>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
{{#useSeperateModelProject}}
|
||||
{{#useSeparateModelProject}}
|
||||
<ProjectReference Include="../{{modelPackage}}/{{modelPackage}}.csproj"/>
|
||||
{{/useSeperateModelProject}}
|
||||
{{/useSeparateModelProject}}
|
||||
{{#useFrameworkReference}}
|
||||
{{#isLibrary}}
|
||||
<FrameworkReference Include="Microsoft.AspNetCore.App" />
|
||||
@ -31,9 +31,9 @@
|
||||
{{^useFrameworkReference}}
|
||||
<PackageReference Include="Microsoft.AspNetCore.App" />
|
||||
{{/useFrameworkReference}}
|
||||
{{^useSeperateModelProject}}
|
||||
{{^useSeparateModelProject}}
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="{{aspnetCoreVersion}}.0"/>
|
||||
{{/useSeperateModelProject}}
|
||||
{{/useSeparateModelProject}}
|
||||
{{#useSwashbuckle}}
|
||||
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.10.8" />
|
||||
{{#useNewtonsoft}}
|
||||
|
@ -5,10 +5,10 @@ VisualStudioVersion = 15.0.27428.2043
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "{{packageName}}", "{{sourceFolder}}\{{packageName}}\{{packageName}}.csproj", "{{packageGuid}}"
|
||||
EndProject
|
||||
{{#useSeperateModelProject}}
|
||||
{{#useSeparateModelProject}}
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "{{modelPackage}}", "{{sourceFolder}}\{{modelPackage}}\{{modelPackage}}.csproj", "{B8D18F25-F379-4B87-ACCC-F8A17E0AED38}"
|
||||
EndProject
|
||||
{{/useSeperateModelProject}}
|
||||
{{/useSeparateModelProject}}
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
@ -19,12 +19,12 @@ Global
|
||||
{{packageGuid}}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{{packageGuid}}.Release|Any CPU.ActiveCfg = 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.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.Build.0 = Release|Any CPU
|
||||
{{/useSeperateModelProject}}
|
||||
{{/useSeparateModelProject}}
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
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... }}
|
||||
const std::string currentValuePath = oldValuePath + "[" + std::to_string(i) + "]";
|
||||
{{#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}}
|
||||
i++;
|
||||
}
|
||||
|
@ -294,7 +294,7 @@ MARKDOWN_SUPPORT = YES
|
||||
|
||||
# When enabled doxygen tries to link words that correspond to documented
|
||||
# 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.
|
||||
# The default value is: YES.
|
||||
|
||||
@ -1397,7 +1397,7 @@ EXT_LINKS_IN_WINDOW = NO
|
||||
|
||||
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
|
||||
# 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.}}
|
||||
/// <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.
|
||||
/// </summary>
|
||||
{{>visibility}} partial class ApiClient : ISynchronousClient{{#supportsAsync}}, IAsynchronousClient{{/supportsAsync}}
|
||||
@ -164,7 +164,7 @@ namespace {{packageName}}.Client
|
||||
|
||||
/// <summary>
|
||||
/// 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>
|
||||
public JsonSerializerSettings SerializerSettings { get; set; } = new JsonSerializerSettings
|
||||
{
|
||||
|
@ -25,7 +25,7 @@ namespace {{packageName}}.Client
|
||||
public static CompareLogic compareLogic;
|
||||
|
||||
/// <summary>
|
||||
/// Static contstructor to initialise compareLogic.
|
||||
/// Static constructor to initialise compareLogic.
|
||||
/// </summary>
|
||||
static ClientUtils()
|
||||
{
|
||||
|
@ -72,7 +72,7 @@ namespace {{packageName}}.Client
|
||||
|
||||
/// <summary>
|
||||
/// 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>
|
||||
/// <value>The API key.</value>
|
||||
private IDictionary<string, string> _apiKey;
|
||||
@ -469,7 +469,7 @@ namespace {{packageName}}.Client
|
||||
}
|
||||
else
|
||||
{
|
||||
// use defualt value
|
||||
// use default value
|
||||
url = url.Replace("{" + variable.Key + "}", (string)serverVariables["default_value"]);
|
||||
}
|
||||
}
|
||||
@ -480,7 +480,7 @@ namespace {{packageName}}.Client
|
||||
{{#hasHttpSignatureMethods}}
|
||||
|
||||
/// <summary>
|
||||
/// Gets and Sets the HttpSigningConfiuration
|
||||
/// Gets and Sets the HttpSigningConfiguration
|
||||
/// </summary>
|
||||
public HttpSigningConfiguration HttpSigningConfiguration
|
||||
{
|
||||
|
@ -18,7 +18,7 @@ namespace {{packageName}}.Client
|
||||
{
|
||||
#region
|
||||
/// <summary>
|
||||
/// Initailize the HashAlgorithm and SigningAlgorithm to default value
|
||||
/// Initialize the HashAlgorithm and SigningAlgorithm to default value
|
||||
/// </summary>
|
||||
public HttpSigningConfiguration()
|
||||
{
|
||||
@ -238,7 +238,7 @@ namespace {{packageName}}.Client
|
||||
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 signatureStringHash = GetStringHash(HashAlgorithm.ToString(), headerValuesString);
|
||||
string headerSignatureStr = null;
|
||||
@ -361,7 +361,7 @@ namespace {{packageName}}.Client
|
||||
private byte[] ConvertToECDSAANS1Format(byte[] signedBytes)
|
||||
{
|
||||
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 sbytesLength = 32; //S length 0x20
|
||||
var rBytes = new List<byte>();
|
||||
@ -399,7 +399,7 @@ namespace {{packageName}}.Client
|
||||
}
|
||||
|
||||
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(rbytesLength); //length of r
|
||||
@ -411,7 +411,7 @@ namespace {{packageName}}.Client
|
||||
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 pempubfooter = "-----END PUBLIC KEY-----";
|
||||
@ -431,7 +431,7 @@ namespace {{packageName}}.Client
|
||||
|
||||
if (isPrivateKeyFile)
|
||||
{
|
||||
pemkey = ConvertPrivateKeyToBytes(pemstr, keyPassPharse);
|
||||
pemkey = ConvertPrivateKeyToBytes(pemstr, keyPassPhrase);
|
||||
if (pemkey == null)
|
||||
{
|
||||
return null;
|
||||
@ -441,7 +441,7 @@ namespace {{packageName}}.Client
|
||||
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 pemprivfooter = "-----END RSA PRIVATE KEY-----";
|
||||
@ -494,11 +494,11 @@ namespace {{packageName}}.Client
|
||||
binkey = Convert.FromBase64String(encryptedstr);
|
||||
}
|
||||
catch (System.FormatException)
|
||||
{ //data is not in base64 fromat
|
||||
{ //data is not in base64 format
|
||||
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)
|
||||
{
|
||||
return null;
|
||||
@ -638,19 +638,19 @@ namespace {{packageName}}.Client
|
||||
{
|
||||
IntPtr unmanagedPswd = IntPtr.Zero;
|
||||
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];
|
||||
unmanagedPswd = Marshal.SecureStringToGlobalAllocAnsi(secpswd);
|
||||
Marshal.Copy(unmanagedPswd, psbytes, 0, psbytes.Length);
|
||||
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];
|
||||
Array.Copy(psbytes, data00, psbytes.Length); //copy the pswd 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();
|
||||
byte[] result = null;
|
||||
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++)
|
||||
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];
|
||||
Array.Copy(keymaterial, deskey, deskey.Length);
|
||||
|
@ -39,7 +39,7 @@ namespace {{packageName}}.Client
|
||||
/// <summary>
|
||||
/// Gets the date time format.
|
||||
/// </summary>
|
||||
/// <value>Date time foramt.</value>
|
||||
/// <value>Date time format.</value>
|
||||
string DateTimeFormat { get; }
|
||||
|
||||
/// <summary>
|
||||
|
@ -25,7 +25,7 @@ namespace {{packageName}}.Client
|
||||
public Multimap<string, string> QueryParameters { get; set; }
|
||||
|
||||
/// <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.
|
||||
/// </summary>
|
||||
public Multimap<string, string> HeaderParameters { get; set; }
|
||||
|
@ -1,7 +1,7 @@
|
||||
#!/bin/sh
|
||||
# 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_repo_id=$2
|
||||
|
@ -159,7 +159,7 @@ namespace {{packageName}}.Client
|
||||
}
|
||||
}
|
||||
/// <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.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
@ -175,7 +175,7 @@ namespace {{packageName}}.Client
|
||||
|
||||
/// <summary>
|
||||
/// 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>
|
||||
public JsonSerializerSettings SerializerSettings { get; set; } = new JsonSerializerSettings
|
||||
{
|
||||
@ -192,8 +192,8 @@ namespace {{packageName}}.Client
|
||||
|
||||
/// <summary>
|
||||
/// 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.
|
||||
/// 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>.
|
||||
/// **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 HttpClientHandler</see>.
|
||||
/// </summary>
|
||||
public ApiClient() :
|
||||
this({{packageName}}.Client.GlobalConfiguration.Instance.BasePath)
|
||||
@ -202,8 +202,8 @@ namespace {{packageName}}.Client
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ApiClient" />.
|
||||
/// **IMPORTANT** This will also create an istance 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>.
|
||||
/// **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 HttpClientHandler</see>.
|
||||
/// </summary>
|
||||
/// <param name="basePath">The target service's base path in URL format.</param>
|
||||
/// <exception cref="ArgumentException"></exception>
|
||||
|
@ -25,7 +25,7 @@ namespace {{packageName}}.Client
|
||||
public Multimap<string, string> QueryParameters { get; set; }
|
||||
|
||||
/// <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.
|
||||
/// </summary>
|
||||
public Multimap<string, string> HeaderParameters { get; set; }
|
||||
|
@ -106,8 +106,8 @@ namespace {{packageName}}.{{apiPackage}}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="{{classname}}"/> class.
|
||||
/// **IMPORTANT** This will also create an istance 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>.
|
||||
/// **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 HttpClientHandler</see>.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public {{classname}}() : this((string)null)
|
||||
@ -116,8 +116,8 @@ namespace {{packageName}}.{{apiPackage}}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="{{classname}}"/> class.
|
||||
/// **IMPORTANT** This will also create an istance 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>.
|
||||
/// **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 HttpClientHandler</see>.
|
||||
/// </summary>
|
||||
/// <param name="basePath">The target service's base path in URL format.</param>
|
||||
/// <exception cref="ArgumentException"></exception>
|
||||
@ -138,8 +138,8 @@ namespace {{packageName}}.{{apiPackage}}
|
||||
|
||||
/// <summary>
|
||||
/// 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.
|
||||
/// 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>.
|
||||
/// **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 HttpClientHandler</see>.
|
||||
/// </summary>
|
||||
/// <param name="configuration">An instance of Configuration.</param>
|
||||
/// <exception cref="ArgumentNullException"></exception>
|
||||
|
@ -34,11 +34,11 @@ using OpenAPIClientUtils = {{packageName}}.Client.ClientUtils;
|
||||
using System.Reflection;
|
||||
{{/-first}}
|
||||
{{/oneOf}}
|
||||
{{#aneOf}}
|
||||
{{#anyOf}}
|
||||
{{#-first}}
|
||||
using System.Reflection;
|
||||
{{/-first}}
|
||||
{{/aneOf}}
|
||||
{{/anyOf}}
|
||||
|
||||
namespace {{packageName}}.{{modelPackage}}
|
||||
{
|
||||
|
@ -59,7 +59,7 @@
|
||||
{{#anyOf}}
|
||||
|
||||
/// <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
|
||||
/// </summary>
|
||||
/// <returns>An instance of {{{.}}}</returns>
|
||||
|
@ -59,7 +59,7 @@
|
||||
{{#oneOf}}
|
||||
|
||||
/// <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
|
||||
/// </summary>
|
||||
/// <returns>An instance of {{{.}}}</returns>
|
||||
|
@ -12,7 +12,7 @@
|
||||
<authors>$author$</authors>
|
||||
|
||||
<!-- 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>
|
||||
<requireLicenseAcceptance>false</requireLicenseAcceptance>
|
||||
<developmentDependency>false</developmentDependency>
|
||||
|
@ -25,7 +25,7 @@ namespace {{packageName}}.Client
|
||||
public Multimap<string, string> QueryParameters { get; set; }
|
||||
|
||||
/// <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.
|
||||
/// </summary>
|
||||
public Multimap<string, string> HeaderParameters { get; set; }
|
||||
|
@ -29,7 +29,7 @@ namespace {{packageName}}.Client
|
||||
public string RawContent { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Construct the ApiException from parts of the reponse
|
||||
/// Construct the ApiException from parts of the response
|
||||
/// </summary>
|
||||
/// <param name="reasonPhrase"></param>
|
||||
/// <param name="statusCode"></param>
|
||||
|
@ -82,7 +82,7 @@ namespace {{packageName}}.Client
|
||||
#endregion Properties
|
||||
|
||||
/// <summary>
|
||||
/// Construct the reponse using an HttpResponseMessage
|
||||
/// Construct the response using an HttpResponseMessage
|
||||
/// </summary>
|
||||
/// <param name="response"></param>
|
||||
/// <param name="rawContent"></param>
|
||||
|
@ -190,7 +190,7 @@ namespace {{packageName}}.Client
|
||||
foreach (var keyVal in httpSignatureHeader)
|
||||
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 signatureStringHash = GetStringHash(HashAlgorithm.ToString(), headerValuesString);
|
||||
string{{nrt?}} headerSignatureStr = null;
|
||||
@ -318,7 +318,7 @@ namespace {{packageName}}.Client
|
||||
private byte[] ConvertToECDSAANS1Format(byte[] signedBytes)
|
||||
{
|
||||
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 sbytesLength = 32; //S length 0x20
|
||||
var rBytes = new List<byte>();
|
||||
@ -353,7 +353,7 @@ namespace {{packageName}}.Client
|
||||
}
|
||||
|
||||
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(rbytesLength); //length of r
|
||||
@ -365,7 +365,7 @@ namespace {{packageName}}.Client
|
||||
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 pempubfooter = "-----END PUBLIC KEY-----";
|
||||
@ -382,7 +382,7 @@ namespace {{packageName}}.Client
|
||||
|
||||
if (isPrivateKeyFile)
|
||||
{
|
||||
pemkey = ConvertPrivateKeyToBytes(pemstr, keyPassPharse);
|
||||
pemkey = ConvertPrivateKeyToBytes(pemstr, keyPassPhrase);
|
||||
|
||||
if (pemkey == null)
|
||||
return null;
|
||||
@ -392,7 +392,7 @@ namespace {{packageName}}.Client
|
||||
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 pemprivfooter = "-----END RSA PRIVATE KEY-----";
|
||||
@ -440,12 +440,12 @@ namespace {{packageName}}.Client
|
||||
binkey = Convert.FromBase64String(encryptedstr);
|
||||
}
|
||||
catch (System.FormatException)
|
||||
{ //data is not in base64 fromat
|
||||
{ //data is not in base64 format
|
||||
return null;
|
||||
}
|
||||
|
||||
// TODO: what do we do here if keyPassPharse is null?
|
||||
byte[] deskey = GetEncryptedKey(salt, keyPassPharse{{nrt!}}, 1, 2); // count=1 (for OpenSSL implementation); 2 iterations to get at least 24 bytes
|
||||
// TODO: what do we do here if keyPassPhrase is null?
|
||||
byte[] deskey = GetEncryptedKey(salt, keyPassPhrase{{nrt!}}, 1, 2); // count=1 (for OpenSSL implementation); 2 iterations to get at least 24 bytes
|
||||
if (deskey == null)
|
||||
return null;
|
||||
|
||||
|
@ -170,7 +170,7 @@ Class | Method | HTTP request | Description
|
||||
- modelTests: {{generateModelTests}}
|
||||
- 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}}
|
||||
- apiName: {{apiName}}
|
||||
- caseInsensitiveResponseHeaders: {{caseInsensitiveResponseHeaders}}
|
||||
|
@ -377,7 +377,7 @@ namespace {{packageName}}.{{apiPackage}}
|
||||
}
|
||||
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)
|
||||
{
|
||||
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;
|
||||
}
|
||||
}{{^-last}}
|
||||
|
@ -49,7 +49,7 @@ Set-StrictMode -Version 3.0
|
||||
if ($Help){
|
||||
Write-Output "
|
||||
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,
|
||||
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; }
|
||||
|
||||
/// <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.
|
||||
/// </summary>
|
||||
public Multimap<string, string> HeaderParameters { get; set; }
|
||||
|
@ -262,7 +262,7 @@ class _${{classname}}Serializer implements PrimitiveSerializer<{{classname}}> {
|
||||
parent classes don't have builder
|
||||
so they must delegate to another serializer using
|
||||
1) discriminator + mapping
|
||||
2) concrete implmentation ($classname)
|
||||
2) concrete implementation ($classname)
|
||||
}}
|
||||
{{#hasDiscriminatorWithNonEmptyMapping}}
|
||||
{{#discriminator}}
|
||||
|
@ -70,8 +70,8 @@ val requestQueue: Lazy<RequestQueue> = lazy(initializer = {
|
||||
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
|
||||
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 overrideable request factory constructor call, or a request factory that can be overridden by a custom template, with
|
||||
- An overridable request queue - which in turn can have a custom http url stack passed to it
|
||||
- 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.
|
||||
|
||||
#### Overriding request generation
|
||||
|
@ -1,5 +1,5 @@
|
||||
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 "")}
|
||||
}
|
||||
|
@ -40,7 +40,7 @@ class RequestFactory(private val headerFactories : List<() -> Map<String, String
|
||||
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
|
||||
// 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()) {
|
||||
queryParams.asSequence().fold("$url?") {acc, param ->
|
||||
"$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
|
||||
*
|
||||
* 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
|
||||
* as one of the parameters expected in the OpenAPI/Swagger document.
|
||||
*
|
||||
|
@ -64,7 +64,7 @@ $config['settings'] = [
|
||||
// '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
|
||||
* cache information on first run.
|
||||
* Set to false to disable the FastRoute cache system.
|
||||
|
@ -436,7 +436,7 @@ class ObjectSerializer
|
||||
}
|
||||
|
||||
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
|
||||
// the current time for empty input which is probably not
|
||||
// what is meant. The invalid empty string is probably to
|
||||
@ -446,7 +446,7 @@ class ObjectSerializer
|
||||
try {
|
||||
return new \DateTime($data);
|
||||
} 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.
|
||||
// With provided regexp 6 digits of microseconds saved
|
||||
return new \DateTime(self::sanitizeTimestamp($data));
|
||||
|
@ -112,7 +112,7 @@ function Get-{{{apiNamePrefix}}}HttpSignedHeader {
|
||||
-HashAlgorithmName $httpSigningConfiguration.HashAlgorithm `
|
||||
-KeyPassPhrase $httpSigningConfiguration.KeyPassPhrase
|
||||
}
|
||||
#Depricated
|
||||
#Deprecated
|
||||
<#$cryptographicScheme = Get-{{{apiNamePrefix}}}CryptographicScheme -SigningAlgorithm $httpSigningConfiguration.SigningAlgorithm `
|
||||
-HashAlgorithm $httpSigningConfiguration.HashAlgorithm
|
||||
#>
|
||||
|
@ -24,9 +24,9 @@ Below are some usage examples for Go and Ruby. For other languages, please refer
|
||||
### Go
|
||||
```
|
||||
# assuming `protoc-gen-go` has been installed with `go get -u github.com/golang/protobuf/protoc-gen-go`
|
||||
mkdir /var/tmp/go/{{{pacakgeName}}}
|
||||
protoc --go_out=/var/tmp/go/{{{pacakgeName}}} services/*
|
||||
protoc --go_out=/var/tmp/go/{{{pacakgeName}}} models/*
|
||||
mkdir /var/tmp/go/{{{packageName}}}
|
||||
protoc --go_out=/var/tmp/go/{{{packageName}}} services/*
|
||||
protoc --go_out=/var/tmp/go/{{{packageName}}} models/*
|
||||
```
|
||||
|
||||
### Ruby
|
||||
|
@ -38,7 +38,7 @@ pytest
|
||||
|
||||
## 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/*
|
||||
test/*
|
||||
|
@ -4,7 +4,7 @@
|
||||
# if you have many models here with many references from one model to another this may
|
||||
# raise a RecursionError
|
||||
# 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:
|
||||
# import sys
|
||||
# sys.setrecursionlimit(n)
|
||||
|
@ -6,7 +6,7 @@
|
||||
# if you have many models here with many references from one model to another this may
|
||||
# raise a RecursionError
|
||||
# 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:
|
||||
# import sys
|
||||
# sys.setrecursionlimit(n)
|
||||
|
@ -1250,9 +1250,9 @@ class ApiClient:
|
||||
# The HTTP signature scheme requires multiple HTTP headers
|
||||
# that are calculated dynamically.
|
||||
signing_info = self.configuration.signing_info
|
||||
querys = tuple()
|
||||
queries = tuple()
|
||||
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():
|
||||
headers.add(key, value)
|
||||
{{/if}}
|
||||
|
@ -134,7 +134,7 @@ conf = {{{packageName}}}.Configuration(
|
||||
'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.
|
||||
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
|
||||
are not going to be modified in transit.
|
||||
|
||||
@ -328,7 +328,7 @@ conf = {{{packageName}}}.Configuration(
|
||||
self._disabled_client_side_validations = s
|
||||
{{#if hasHttpSignatureMethods}}
|
||||
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.
|
||||
value.host = self.host
|
||||
{{/if}}
|
||||
|
@ -1,7 +1,7 @@
|
||||
#!/bin/sh
|
||||
# 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_repo_id=$2
|
||||
|
@ -378,7 +378,7 @@ class Schema:
|
||||
_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
|
||||
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
|
||||
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
|
||||
@ -861,7 +861,7 @@ class ValidatorBase:
|
||||
schema_keyword not in configuration._disabled_client_side_validations)
|
||||
|
||||
@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(
|
||||
"Invalid value `{value}`, {constraint_msg} `{constraint_value}`{additional_txt} at {path_to_item}".format(
|
||||
value=value,
|
||||
@ -956,7 +956,7 @@ class StrBase(ValidatorBase):
|
||||
if (cls._is_json_validation_enabled_oapg('maxLength', validation_metadata.configuration) and
|
||||
hasattr(cls.MetaOapg, 'max_length') and
|
||||
len(arg) > cls.MetaOapg.max_length):
|
||||
cls._raise_validation_errror_message_oapg(
|
||||
cls._raise_validation_error_message_oapg(
|
||||
value=arg,
|
||||
constraint_msg="length must be less than or equal to",
|
||||
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
|
||||
hasattr(cls.MetaOapg, 'min_length') and
|
||||
len(arg) < cls.MetaOapg.min_length):
|
||||
cls._raise_validation_errror_message_oapg(
|
||||
cls._raise_validation_error_message_oapg(
|
||||
value=arg,
|
||||
constraint_msg="length must be greater than or equal to",
|
||||
constraint_value=cls.MetaOapg.min_length,
|
||||
@ -981,14 +981,14 @@ class StrBase(ValidatorBase):
|
||||
if flags != 0:
|
||||
# Don't print the regex flags if the flags are not
|
||||
# specified in the OAS document.
|
||||
cls._raise_validation_errror_message_oapg(
|
||||
cls._raise_validation_error_message_oapg(
|
||||
value=arg,
|
||||
constraint_msg="must match regular expression",
|
||||
constraint_value=regex_dict['pattern'],
|
||||
path_to_item=validation_metadata.path_to_item,
|
||||
additional_txt=" with flags=`{}`".format(flags)
|
||||
)
|
||||
cls._raise_validation_errror_message_oapg(
|
||||
cls._raise_validation_error_message_oapg(
|
||||
value=arg,
|
||||
constraint_msg="must match regular expression",
|
||||
constraint_value=regex_dict['pattern'],
|
||||
@ -1204,7 +1204,7 @@ class NumberBase(ValidatorBase):
|
||||
return self._as_float
|
||||
except AttributeError:
|
||||
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)
|
||||
return self._as_float
|
||||
|
||||
@ -1221,7 +1221,7 @@ class NumberBase(ValidatorBase):
|
||||
multiple_of_value = cls.MetaOapg.multiple_of
|
||||
if (not (float(arg) / multiple_of_value).is_integer()):
|
||||
# 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,
|
||||
constraint_msg="value must be a multiple of",
|
||||
constraint_value=multiple_of_value,
|
||||
@ -1242,7 +1242,7 @@ class NumberBase(ValidatorBase):
|
||||
if (cls._is_json_validation_enabled_oapg('exclusiveMaximum', validation_metadata.configuration) and
|
||||
hasattr(cls.MetaOapg, 'exclusive_maximum') and
|
||||
arg >= cls.MetaOapg.exclusive_maximum):
|
||||
cls._raise_validation_errror_message_oapg(
|
||||
cls._raise_validation_error_message_oapg(
|
||||
value=arg,
|
||||
constraint_msg="must be a value less than",
|
||||
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
|
||||
hasattr(cls.MetaOapg, 'inclusive_maximum') and
|
||||
arg > cls.MetaOapg.inclusive_maximum):
|
||||
cls._raise_validation_errror_message_oapg(
|
||||
cls._raise_validation_error_message_oapg(
|
||||
value=arg,
|
||||
constraint_msg="must be a value less than or equal to",
|
||||
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
|
||||
hasattr(cls.MetaOapg, 'exclusive_minimum') and
|
||||
arg <= cls.MetaOapg.exclusive_minimum):
|
||||
cls._raise_validation_errror_message_oapg(
|
||||
cls._raise_validation_error_message_oapg(
|
||||
value=arg,
|
||||
constraint_msg="must be a value greater than",
|
||||
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
|
||||
hasattr(cls.MetaOapg, 'inclusive_minimum') and
|
||||
arg < cls.MetaOapg.inclusive_minimum):
|
||||
cls._raise_validation_errror_message_oapg(
|
||||
cls._raise_validation_error_message_oapg(
|
||||
value=arg,
|
||||
constraint_msg="must be a value greater than or equal to",
|
||||
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
|
||||
hasattr(cls.MetaOapg, 'max_items') and
|
||||
len(arg) > cls.MetaOapg.max_items):
|
||||
cls._raise_validation_errror_message_oapg(
|
||||
cls._raise_validation_error_message_oapg(
|
||||
value=arg,
|
||||
constraint_msg="number of items must be less than or equal to",
|
||||
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
|
||||
hasattr(cls.MetaOapg, 'min_items') and
|
||||
len(arg) < cls.MetaOapg.min_items):
|
||||
cls._raise_validation_errror_message_oapg(
|
||||
cls._raise_validation_error_message_oapg(
|
||||
value=arg,
|
||||
constraint_msg="number of items must be greater than or equal to",
|
||||
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):
|
||||
unique_items = set(arg)
|
||||
if len(arg) > len(unique_items):
|
||||
cls._raise_validation_errror_message_oapg(
|
||||
cls._raise_validation_error_message_oapg(
|
||||
value=arg,
|
||||
constraint_msg="duplicate items were found, and the tuple must not contain duplicates because",
|
||||
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
|
||||
hasattr(cls.MetaOapg, 'max_properties') and
|
||||
len(arg) > cls.MetaOapg.max_properties):
|
||||
cls._raise_validation_errror_message_oapg(
|
||||
cls._raise_validation_error_message_oapg(
|
||||
value=arg,
|
||||
constraint_msg="number of properties must be less than or equal to",
|
||||
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
|
||||
hasattr(cls.MetaOapg, 'min_properties') and
|
||||
len(arg) < cls.MetaOapg.min_properties):
|
||||
cls._raise_validation_errror_message_oapg(
|
||||
cls._raise_validation_error_message_oapg(
|
||||
value=arg,
|
||||
constraint_msg="number of properties must be greater than or equal to",
|
||||
constraint_value=cls.MetaOapg.min_properties,
|
||||
|
@ -334,7 +334,7 @@ class HttpSigningConfiguration(object):
|
||||
:return: A tuple of (digest, prefix).
|
||||
The digest is a hashing object that contains the cryptographic digest of
|
||||
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.
|
||||
"""
|
||||
if self.hash_algorithm == HASH_SHA512:
|
||||
|
@ -6,7 +6,7 @@
|
||||
#' @field content The deserialized response body.
|
||||
#' @field response The raw response from the endpoint.
|
||||
#' @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.
|
||||
#' @export
|
||||
ApiResponse <- R6::R6Class(
|
||||
|
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