Skip to content

Commit

Permalink
Merge branch 'OpenAPITools:master' into kotlin_spring-bigdecimal_default
Browse files Browse the repository at this point in the history
  • Loading branch information
irasychan committed Feb 28, 2024
2 parents a72cc4d + 275ed92 commit 0669f31
Show file tree
Hide file tree
Showing 368 changed files with 9,552 additions and 442 deletions.
27 changes: 22 additions & 5 deletions .github/workflows/samples-dotnet-standard.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,24 @@
name: Samples C# .Net Standard
name: Samples C# .Net Standard Client

on:
push:
paths:
- 'samples/client/petstore/csharp/**netstandard**/'
# build C# API client (netstandard)
- samples/client/petstore/csharp/OpenAPIClient/**
- samples/client/petstore/csharp/*netstandard*/**
# build C# API client (netstandard with ConditionalSerialization)
- samples/client/petstore/csharp/OpenAPIClient-ConditionalSerialization/**
# build C# API client (netstandard httpclient)
- samples/client/petstore/csharp/OpenAPIClient-httpclient/**
pull_request:
paths:
- 'samples/client/petstore/csharp/**netstandard**/'
# build C# API client (netstandard)
- samples/client/petstore/csharp/OpenAPIClient/**
- samples/client/petstore/csharp/*netstandard*/**
# build C# API client (netstandard with ConditionalSerialization)
- samples/client/petstore/csharp/OpenAPIClient-ConditionalSerialization/**
# build C# API client (netstandard httpclient)
- samples/client/petstore/csharp/OpenAPIClient-httpclient/**
jobs:
build:
name: Build .Net projects
Expand All @@ -15,8 +27,13 @@ jobs:
fail-fast: false
matrix:
sample:
# clients
- samples/client/petstore/csharp/OpenAPIClient-generichost-netstandard2.0
# build C# API client (netstandard)
- samples/client/petstore/csharp/OpenAPIClient/
- samples/client/petstore/csharp/OpenAPIClient-generichost-netstandard2.0/
# build C# API client (netstandard with ConditionalSerialization)
- samples/client/petstore/csharp/OpenAPIClient-ConditionalSerialization/
# build C# API client (netstandard httpclient)
- samples/client/petstore/csharp/OpenAPIClient-httpclient/
steps:
- uses: actions/checkout@v4
- uses: actions/[email protected]
Expand Down
40 changes: 13 additions & 27 deletions .github/workflows/samples-dotnet.yaml
Original file line number Diff line number Diff line change
@@ -1,27 +1,18 @@
name: Samples C# .Net 7
name: Samples C# .Net 8 Clients

on:
push:
paths:
- 'samples/client/petstore/csharp/**net6.0**/'
- 'samples/client/petstore/csharp/**net7.0**/'
- 'samples/client/petstore/csharp/OpenAPIClient-generichost-netcore**/'
- 'samples/client/petstore/csharp/OpenAPIClient-generichost-manual-tests/**'
- 'samples/server/petstore/aspnetcore-6.0/**'
- 'samples/server/petstore/aspnetcore-6.0-pocoModels/**'
- 'samples/server/petstore/aspnetcore-6.0-useSwashBuckle/**'
- samples/client/petstore/csharp/OpenAPIClient-generichost-manual-tests/**
- samples/client/petstore/csharp/*net6.0*/**
- samples/client/petstore/csharp/*net7.0*/**
- samples/client/petstore/csharp/OpenAPIClient-*latest*/**
pull_request:
paths:
- 'samples/client/petstore/csharp/**net6.0**/'
- 'samples/client/petstore/csharp/**net7.0**/'
- 'samples/client/petstore/csharp/OpenAPIClient-generichost-netcore**/'
- 'samples/client/petstore/csharp/OpenAPIClient-generichost-manual-tests/**'
- 'samples/server/petstore/aspnetcore-6.0/**'
- 'samples/server/petstore/aspnetcore-6.0-pocoModels/**'
- 'samples/server/petstore/aspnetcore-6.0-project4Models/**'
- 'samples/server/petstore/aspnetcore-6.0-useSwashBuckle/**'
- 'samples/server/petstore/aspnetcore-6.0-NewtonsoftFalse/**'
- 'samples/server/petstore/aspnetcore-6.0-nullableReferenceTypes/**'
- samples/client/petstore/csharp/OpenAPIClient-generichost-manual-tests/**
- samples/client/petstore/csharp/*net6.0*/**
- samples/client/petstore/csharp/*net7.0*/**
- samples/client/petstore/csharp/OpenAPIClient-*latest*/**
jobs:
build:
name: Build .Net projects
Expand All @@ -31,20 +22,15 @@ jobs:
matrix:
sample:
# clients
- samples/client/petstore/csharp/OpenAPIClient-generichost-manual-tests
- samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0
- samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0-nrt
- samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0-useSourceGeneration
- samples/client/petstore/csharp/OpenAPIClient-generichost-net7.0-useDateTimeForDate
- samples/client/petstore/csharp/OpenAPIClient-generichost-netcore-latest-allOf
- samples/client/petstore/csharp/OpenAPIClient-generichost-netcore-latest-oneOf
- samples/client/petstore/csharp/OpenAPIClient-generichost-netcore-latest-anyOf
- samples/client/petstore/csharp/OpenAPIClient-generichost-manual-tests
- samples/client/petstore/csharp/OpenAPIClient-generichost-net7.0-useDateTimeForDate
- samples/client/petstore/csharp/OpenAPIClient-generichost-netcore-latest-oneOf
- samples/client/petstore/csharp/OpenAPIClient-net7.0-useDateTimeForDate
- samples/server/petstore/aspnetcore-6.0
- samples/server/petstore/aspnetcore-6.0-pocoModels
- samples/server/petstore/aspnetcore-6.0-project4Models
- samples/server/petstore/aspnetcore-6.0-useSwashBuckle
- samples/server/petstore/aspnetcore-6.0-NewtonsoftFalse
- samples/server/petstore/aspnetcore-6.0-nullableReferenceTypes
steps:
- uses: actions/checkout@v4
- uses: actions/[email protected]
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/samples-dotnet6-client-echo-api.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Samples C# .Net 6
name: Samples C# .Net 6 Client Echo API

on:
push:
Expand Down
48 changes: 10 additions & 38 deletions .github/workflows/samples-dotnet6-client.yaml
Original file line number Diff line number Diff line change
@@ -1,48 +1,30 @@
name: Samples C# .Net 6
name: Samples C# .Net 6 Client

on:
push:
paths:
# build C# API client (multiple frameworks)
- samples/client/petstore/csharp/OpenAPIClientCoreAndNet47/**
# build C# API client (httpclient)
- samples/client/petstore/csharp/OpenAPIClient-httpclient/**
# build C# API client (generichost)
- samples/client/petstore/csharp/OpenAPIClient-generichost-netstandard2.0/**
# build C# API client (netcore)
- samples/client/petstore/csharp/OpenAPIClient/**
- samples/client/petstore/csharp/OpenAPIClientCore/**
# build C# API client (.net framework 4.7)
- samples/client/petstore/csharp/OpenAPIClient-net47/**
# build C# API client (.net framework 4.8)
- samples/client/petstore/csharp/OpenAPIClient-net48/**
# build C# API client (.net 5.0)
- samples/client/petstore/csharp/OpenAPIClient-net5.0/**
# build C# API client (.net 5.0 with ConditionalSerialization)
- samples/client/petstore/csharp/OpenAPIClient-ConditionalSerialization/**
# build C# API client (property, parameter name mappings)
- samples/client/petstore/csharp-restsharp-name-parameter-mappings/**
pull_request:
paths:
- samples/client/petstore/csharp/OpenAPIClient-restsharp-name-parameter-mappings/**
# build C# API client (multiple frameworks)
- samples/client/petstore/csharp/OpenAPIClientCoreAndNet47/**
pull_request:
paths:
# build C# API client (httpclient)
- samples/client/petstore/csharp/OpenAPIClient-httpclient/**
# build C# API client (generichost)
- samples/client/petstore/csharp/OpenAPIClient-generichost-netstandard2.0/**
# build C# API client (netcore)
- samples/client/petstore/csharp/OpenAPIClient/**
- samples/client/petstore/csharp/OpenAPIClientCore/**
# build C# API client (.net framework 4.7)
- samples/client/petstore/csharp/OpenAPIClient-net47/**
# build C# API client (.net framework 4.8)
- samples/client/petstore/csharp/OpenAPIClient-net48/**
# build C# API client (.net 5.0)
- samples/client/petstore/csharp/OpenAPIClient-net5.0/**
# build C# API client (.net 5.0 with ConditionalSerialization)
- samples/client/petstore/csharp/OpenAPIClient-ConditionalSerialization/**
# build C# API client (property, parameter name mappings)
- samples/client/petstore/csharp-restsharp-name-parameter-mappings/**
- samples/client/petstore/csharp/OpenAPIClient-restsharp-name-parameter-mappings/**
# build C# API client (multiple frameworks)
- samples/client/petstore/csharp/OpenAPIClientCoreAndNet47/**
jobs:
build:
name: Build .Net clients
Expand All @@ -51,26 +33,16 @@ jobs:
fail-fast: false
matrix:
sample:
# clients
# build C# API client (multiple frameworks)
- samples/client/petstore/csharp/OpenAPIClientCoreAndNet47/
# build C# API client (httpclient)
- samples/client/petstore/csharp/OpenAPIClient-httpclient/
# build C# API client (generichost)
- samples/client/petstore/csharp/OpenAPIClient-generichost-netstandard2.0/
# build C# API client (netcore)
- samples/client/petstore/csharp/OpenAPIClient/
- samples/client/petstore/csharp/OpenAPIClientCore/
# build C# API client (.net framework 4.7)
- samples/client/petstore/csharp/OpenAPIClient-net47/
# build C# API client (.net framework 4.8)
- samples/client/petstore/csharp/OpenAPIClient-net48/
# build C# API client (.net 5.0)
- samples/client/petstore/csharp/OpenAPIClient-net5.0/
# build C# API client (.net 5.0 with ConditionalSerialization)
- samples/client/petstore/csharp/OpenAPIClient-ConditionalSerialization/
# build C# API client (property, parameter name mappings)
- samples/client/petstore/csharp-restsharp-name-parameter-mappings
- samples/client/petstore/csharp/OpenAPIClient-restsharp-name-parameter-mappings/
# build C# API client (multiple frameworks)
- samples/client/petstore/csharp/OpenAPIClientCoreAndNet47/
steps:
- uses: actions/checkout@v4
- uses: actions/[email protected]
Expand Down
21 changes: 8 additions & 13 deletions .github/workflows/samples-dotnet6-server.yaml
Original file line number Diff line number Diff line change
@@ -1,33 +1,28 @@
name: Samples C# .Net 6
name: Samples C# .Net 6 Server

on:
push:
paths:
- 'samples/server/petstore/aspnetcore-6.0/**'
- 'samples/server/petstore/aspnetcore-6.0-pocoModels/**'
- 'samples/server/petstore/aspnetcore-6.0-useSwashBuckle/**'
- samples/server/petstore/aspnetcore-6.0/**
- samples/server/petstore/aspnetcore-6.0-*/**
pull_request:
paths:
- 'samples/server/petstore/aspnetcore-6.0/**'
- 'samples/server/petstore/aspnetcore-6.0-pocoModels/**'
- 'samples/server/petstore/aspnetcore-6.0-project4Models/**'
- 'samples/server/petstore/aspnetcore-6.0-useSwashBuckle/**'
- 'samples/server/petstore/aspnetcore-6.0-NewtonsoftFalse/**'
- 'samples/server/petstore/aspnetcore-6.0-nullableReferenceTypes/**'
- samples/server/petstore/aspnetcore-6.0/**
- samples/server/petstore/aspnetcore-6.0-*/**
jobs:
build:
name: Build .Net servers
name: Build .Net 6 servers
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
sample:
- samples/server/petstore/aspnetcore-6.0
- samples/server/petstore/aspnetcore-6.0-NewtonsoftFalse
- samples/server/petstore/aspnetcore-6.0-nullableReferenceTypes
- samples/server/petstore/aspnetcore-6.0-pocoModels
- samples/server/petstore/aspnetcore-6.0-project4Models
- samples/server/petstore/aspnetcore-6.0-useSwashBuckle
- samples/server/petstore/aspnetcore-6.0-NewtonsoftFalse
- samples/server/petstore/aspnetcore-6.0-nullableReferenceTypes
steps:
- uses: actions/checkout@v4
- uses: actions/[email protected]
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/samples-kotlin-client.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ jobs:
- samples/client/petstore/kotlin-jvm-vertx-moshi
- samples/client/petstore/kotlin-jvm-spring-2-webclient
- samples/client/petstore/kotlin-jvm-spring-3-webclient
- samples/client/echo_api/kotlin-jvm-spring-3-webclient
- samples/client/petstore/kotlin-jvm-spring-3-restclient
- samples/client/echo_api/kotlin-jvm-spring-3-restclient
- samples/client/petstore/kotlin-spring-cloud
Expand Down
2 changes: 1 addition & 1 deletion bin/configs/csharp-restsharp-net6.0-name-mappings.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
generatorName: csharp
outputDir: samples/client/petstore/csharp-restsharp-name-parameter-mappings
outputDir: samples/client/petstore/csharp/OpenAPIClient-restsharp-name-parameter-mappings
inputSpec: modules/openapi-generator/src/test/resources/3_0/name-parameter-mappings.yaml
templateDir: modules/openapi-generator/src/main/resources/csharp
nameMappings:
Expand Down
9 changes: 9 additions & 0 deletions bin/configs/kotlin-jvm-spring-3-webclient-echo-api.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
generatorName: kotlin
outputDir: samples/client/echo_api/kotlin-jvm-spring-3-webclient
library: jvm-spring-restclient
inputSpec: modules/openapi-generator/src/test/resources/3_0/kotlin/echo_api.yaml
templateDir: modules/openapi-generator/src/main/resources/kotlin-client
additionalProperties:
enumUnknownDefaultCase: true
serializationLibrary: jackson
useSpringBoot3: true
9 changes: 9 additions & 0 deletions bin/configs/rust-hyper-api-with-ref-param.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
generatorName: rust
outputDir: samples/client/others/rust/hyper/api-with-ref-param
library: hyper
inputSpec: modules/openapi-generator/src/test/resources/3_0/rust/api-with-ref-param.yaml
templateDir: modules/openapi-generator/src/main/resources/rust
additionalProperties:
supportAsync: true
packageName: api-ref-param-hyper

2 changes: 1 addition & 1 deletion bin/configs/rust-hyper-oneOf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ library: hyper
inputSpec: modules/openapi-generator/src/test/resources/3_0/oneof_polymorphism_and_inheritance.yaml
templateDir: modules/openapi-generator/src/main/resources/rust
additionalProperties:
supportAsync: "false"
supportAsync: false
packageName: oneof-hyper
9 changes: 9 additions & 0 deletions bin/configs/rust-reqwest-api-with-ref-param.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
generatorName: rust
outputDir: samples/client/others/rust/reqwest/api-with-ref-param
library: reqwest
inputSpec: modules/openapi-generator/src/test/resources/3_0/rust/api-with-ref-param.yaml
templateDir: modules/openapi-generator/src/main/resources/rust
additionalProperties:
supportAsync: true
packageName: api-ref-param-reqwest

11 changes: 11 additions & 0 deletions bin/configs/rust-reqwest-petstore-avoid-box.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
generatorName: rust
outputDir: samples/client/petstore/rust/reqwest/petstore-avoid-box
library: reqwest
inputSpec: modules/openapi-generator/src/test/resources/3_0/rust/petstore.yaml
templateDir: modules/openapi-generator/src/main/resources/rust
additionalProperties:
supportAsync: true
supportMultipleResponses: true
avoidBoxedModels: true
packageName: petstore-reqwest-avoid-box
useSingleRequestParameter: true
1 change: 1 addition & 0 deletions docs/generators/rust.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl

| Option | Description | Values | Default |
| ------ | ----------- | ------ | ------- |
|avoidBoxedModels|If set, `Box<T>` will not be used for models| |false|
|bestFitInt|Use best fitting integer type where minimum or maximum is set| |false|
|enumNameSuffix|Suffix that will be appended to all enum names.| ||
|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |true|
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,14 @@ public class CodegenModel implements IJsonSchemaValidationProperties {
* Indicates the OAS schema specifies "deprecated: true".
*/
public boolean isDeprecated;
public boolean hasOnlyReadOnly = true; // true if all properties are read-only
/**
* Indicates the type has at least one read-only property.
*/
public boolean hasReadOnly;
/**
* Indicates the all properties of the type are read-only.
*/
public boolean hasOnlyReadOnly = true;
public ExternalDocumentation externalDocumentation;

public Map<String, Object> vendorExtensions = new HashMap<>();
Expand Down Expand Up @@ -1122,6 +1129,7 @@ public boolean equals(Object o) {
hasChildren == that.hasChildren &&
isMap == that.isMap &&
isDeprecated == that.isDeprecated &&
hasReadOnly == that.hasReadOnly &&
hasOnlyReadOnly == that.hasOnlyReadOnly &&
isNull == that.isNull &&
hasValidation == that.hasValidation &&
Expand Down Expand Up @@ -1213,7 +1221,7 @@ public int hashCode() {
getVars(), getAllVars(), getNonNullableVars(), getRequiredVars(), getOptionalVars(), getReadOnlyVars(), getReadWriteVars(),
getParentVars(), getAllowableValues(), getMandatory(), getAllMandatory(), getImports(), hasVars,
isEmptyVars(), hasMoreModels, hasEnums, isEnum, isNullable, hasRequired, hasOptional, isArray,
hasChildren, isMap, isDeprecated, hasOnlyReadOnly, getExternalDocumentation(), getVendorExtensions(),
hasChildren, isMap, isDeprecated, hasReadOnly, hasOnlyReadOnly, getExternalDocumentation(), getVendorExtensions(),
getAdditionalPropertiesType(), getMaxProperties(), getMinProperties(), getUniqueItems(), getMaxItems(),
getMinItems(), getMaxLength(), getMinLength(), getExclusiveMinimum(), getExclusiveMaximum(), getMinimum(),
getMaximum(), getPattern(), getMultipleOf(), getItems(), getAdditionalProperties(), getIsModel(),
Expand Down Expand Up @@ -1289,6 +1297,7 @@ public String toString() {
sb.append(", hasChildren=").append(hasChildren);
sb.append(", isMap=").append(isMap);
sb.append(", isDeprecated=").append(isDeprecated);
sb.append(", hasReadOnly=").append(hasReadOnly);
sb.append(", hasOnlyReadOnly=").append(hasOnlyReadOnly);
sb.append(", externalDocumentation=").append(externalDocumentation);
sb.append(", vendorExtensions=").append(vendorExtensions);
Expand Down
Loading

0 comments on commit 0669f31

Please sign in to comment.