[C#] Fixes array TypeDeclaration parsing order to fix deep aliases (#21600)

* Adjust array TypeDeclaration parsing order to fix deep inline aliases

* Update samples
This commit is contained in:
Mattias Sehlstedt 2025-09-03 18:58:13 +02:00 committed by GitHub
parent 5daef3e901
commit fde017150e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
34 changed files with 367 additions and 122 deletions

View File

@ -47,6 +47,7 @@ import java.util.regex.Pattern;
import java.util.stream.Collectors;
import static org.openapitools.codegen.utils.CamelizeOption.LOWERCASE_FIRST_LETTER;
import static org.openapitools.codegen.utils.ModelUtils.getSchemaItems;
import static org.openapitools.codegen.utils.StringUtils.camelize;
import static org.openapitools.codegen.utils.StringUtils.underscore;
@ -1602,33 +1603,28 @@ public abstract class AbstractCSharpCodegen extends DefaultCodegen {
/**
* Provides C# strongly typed declaration for simple arrays of some type and arrays of arrays of some type.
*
* @param arr The input array property
* @param items The input array property
* @return The type declaration when the type is an array of arrays.
*/
private String getArrayTypeDeclaration(Schema arr) {
// TODO: collection type here should be fully qualified namespace to avoid model conflicts
// This supports arrays of arrays.
String arrayType = typeMapping.get("array");
StringBuilder instantiationType = new StringBuilder(arrayType);
Schema<?> items = ModelUtils.getSchemaItems(arr);
String nestedType = getTypeDeclaration(items);
// TODO: We may want to differentiate here between generics and primitive arrays.
instantiationType.append("<").append(nestedType).append(">");
return instantiationType.toString();
private String getTypeDeclarationForArray(Schema<?> items) {
return getTypeDeclaration(items);
}
@Override
public String toInstantiationType(Schema p) {
if (ModelUtils.isArraySchema(p)) {
return getArrayTypeDeclaration(p);
return getTypeDeclarationForArray(p);
}
return super.toInstantiationType(p);
}
@Override
public String getTypeDeclaration(Schema p) {
if (ModelUtils.isArraySchema(p)) {
return getArrayTypeDeclaration(p);
Schema<?> schema = unaliasSchema(p);
Schema<?> target = ModelUtils.isGenerateAliasAsModel() ? p : schema;
if (ModelUtils.isArraySchema(target)) {
Schema<?> items = getSchemaItems(schema);
return getSchemaType(target) + "<" + getTypeDeclarationForArray(items) + ">";
} else if (ModelUtils.isMapSchema(p)) {
// Should we also support maps of maps?
Schema<?> inner = ModelUtils.getAdditionalProperties(p);

View File

@ -1748,7 +1748,7 @@ public class CSharpClientCodegen extends AbstractCSharpCodegen {
@Override
protected void updateModelForObject(CodegenModel m, Schema schema) {
/**
/*
* we have a custom version of this function so we only set isMap to true if
* ModelUtils.isMapSchema
* In other generators, isMap is true for all type object schemas

View File

@ -1058,7 +1058,7 @@ public class CSharpReducedClientCodegen extends AbstractCSharpCodegen {
@Override
public String toInstantiationType(Schema schema) {
if (ModelUtils.isMapSchema(schema)) {
Schema additionalProperties = ModelUtils.getAdditionalProperties(schema);
Schema<?> additionalProperties = ModelUtils.getAdditionalProperties(schema);
String inner = getSchemaType(additionalProperties);
if (ModelUtils.isMapSchema(additionalProperties)) {
inner = toInstantiationType(additionalProperties);

View File

@ -1826,15 +1826,6 @@ public class DefaultCodegenTest {
assertEquals(getRequiredVars(personForUpdateModel), Collections.emptyList());
}
private List<String> getRequiredVars(CodegenModel model) {
return getNames(model.getRequiredVars());
}
private List<String> getNames(List<CodegenProperty> props) {
if (props == null) return null;
return props.stream().map(v -> v.name).collect(Collectors.toList());
}
@Test
public void testCallbacks() {
final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/callbacks.yaml");
@ -5044,4 +5035,13 @@ public class DefaultCodegenTest {
assertTrue(codegenOperation.queryParams.stream().allMatch(p -> p.queryIsJsonMimeType));
}
private List<String> getRequiredVars(CodegenModel model) {
return getNames(model.getRequiredVars());
}
private List<String> getNames(List<CodegenProperty> props) {
if (props == null) return null;
return props.stream().map(v -> v.name).collect(Collectors.toList());
}
}

View File

@ -775,36 +775,6 @@ public class DefaultGeneratorTest {
// all fine, we have passed
}
private DefaultGenerator generatorGenerateRecursiveDependentModelsBackwardCompatibility(String recursively) throws IOException {
DefaultGenerator generator = new DefaultGenerator(false);
generator.setGeneratorPropertyDefault(CodegenConstants.MODELS, "true");
generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_TESTS, "true");
generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_DOCS, "false");
generator.setGeneratorPropertyDefault(CodegenConstants.APIS, "true");
generator.setGeneratorPropertyDefault(CodegenConstants.SUPPORTING_FILES, "true");
generator.setGeneratorPropertyDefault(CodegenConstants.API_DOCS, "false");
generator.setGeneratorPropertyDefault(CodegenConstants.API_TESTS, "false");
generator.setGeneratorPropertyDefault(CodegenConstants.GENERATE_RECURSIVE_DEPENDENT_MODELS, recursively);
return generator;
}
private ClientOptInput createOptInputIssue19220(Path target) {
return createOptInputIssue("19220", target);
}
private ClientOptInput createOptInputIssue18444(Path target) {
return createOptInputIssue("18444", target);
}
private ClientOptInput createOptInputIssue(String issueNumber, Path target) {
final CodegenConfigurator configurator = new CodegenConfigurator()
.setGeneratorName("spring")
.setInputSpec("src/test/resources/bugs/issue_" + issueNumber + ".json")
.setOutputDir(target.toAbsolutePath().toString());
return configurator.toClientOptInput();
}
@Test
public void testGenerateRecursiveDependentModelsBackwardCompatibilityIssue18444() throws IOException {
Path target = Files.createTempDirectory("test");
@ -1041,6 +1011,34 @@ public class DefaultGeneratorTest {
GlobalSettings.reset();
output.deleteOnExit();
}
}
private DefaultGenerator generatorGenerateRecursiveDependentModelsBackwardCompatibility(String recursively) throws IOException {
DefaultGenerator generator = new DefaultGenerator(false);
generator.setGeneratorPropertyDefault(CodegenConstants.MODELS, "true");
generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_TESTS, "true");
generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_DOCS, "false");
generator.setGeneratorPropertyDefault(CodegenConstants.APIS, "true");
generator.setGeneratorPropertyDefault(CodegenConstants.SUPPORTING_FILES, "true");
generator.setGeneratorPropertyDefault(CodegenConstants.API_DOCS, "false");
generator.setGeneratorPropertyDefault(CodegenConstants.API_TESTS, "false");
generator.setGeneratorPropertyDefault(CodegenConstants.GENERATE_RECURSIVE_DEPENDENT_MODELS, recursively);
return generator;
}
private ClientOptInput createOptInputIssue19220(Path target) {
return createOptInputIssue("19220", target);
}
private ClientOptInput createOptInputIssue18444(Path target) {
return createOptInputIssue("18444", target);
}
private ClientOptInput createOptInputIssue(String issueNumber, Path target) {
final CodegenConfigurator configurator = new CodegenConfigurator()
.setGeneratorName("spring")
.setInputSpec("src/test/resources/bugs/issue_" + issueNumber + ".json")
.setOutputDir(target.toAbsolutePath().toString());
return configurator.toClientOptInput();
}
}

View File

@ -20,6 +20,7 @@ import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.media.Schema;
import org.openapitools.codegen.*;
import org.openapitools.codegen.languages.CSharpClientCodegen;
import org.openapitools.codegen.utils.ModelUtils;
import org.testng.Assert;
import org.testng.annotations.Test;
@ -27,10 +28,12 @@ import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.List;
import java.util.Map;
import java.util.function.Function;
import java.util.stream.Collectors;
import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.openapitools.codegen.TestUtils.assertFileContains;
import static org.openapitools.codegen.TestUtils.assertFileNotContains;
@ -38,7 +41,7 @@ import static org.openapitools.codegen.TestUtils.assertFileNotContains;
public class CSharpClientCodegenTest {
@Test
public void testToEnumVarName() throws Exception {
public void testToEnumVarName() {
final CSharpClientCodegen codegen = new CSharpClientCodegen();
codegen.setLibrary("restsharp");
codegen.processOpts();
@ -211,4 +214,50 @@ public class CSharpClientCodegenTest {
// Should not contain this as the constructor will have two parameters instead of one
assertFileNotContains(file.toPath(), "return new FruitAnyOfDisc(appleAnyOfDisc);");
}
@Test
public void testDoubleDepthArrayAliasCSharp() {
final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/bugs/issue_21585.yaml");
String schemaName = "GeoJSON_MultiLineString";
String modelName = "GeoJSONMultiLineString";
Schema schema = ModelUtils.getSchema(openAPI, schemaName);
CSharpClientCodegen codegen = new CSharpClientCodegen();
codegen.setOpenAPI(openAPI);
CodegenModel concreteModel = codegen.fromModel(modelName, schema);
assertThat(getNames(concreteModel.vars)).isEqualTo(List.of("Type", "Coordinates", "Bbox"));
assertThat(concreteModel.vars.get(1).getDataType()).isEqualTo("List<List<List<BigDecimal>>>");
}
@Test
public void testDeepArrayAlias() throws IOException {
File output = Files.createTempDirectory("test").toFile().getCanonicalFile();
output.deleteOnExit();
final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/bugs/issue_21585.yaml");
final DefaultGenerator defaultGenerator = new DefaultGenerator();
final ClientOptInput clientOptInput = new ClientOptInput();
clientOptInput.openAPI(openAPI);
CSharpClientCodegen cSharpClientCodegen = new CSharpClientCodegen();
cSharpClientCodegen.setLibrary("httpclient");
cSharpClientCodegen.setOutputDir(output.getAbsolutePath());
cSharpClientCodegen.setAutosetConstants(true);
clientOptInput.config(cSharpClientCodegen);
defaultGenerator.opts(clientOptInput);
Map<String, File> files = defaultGenerator.generate().stream()
.collect(Collectors.toMap(File::getPath, Function.identity()));
String modelName = "GeoJSONMultiLineString";
File file = files.get(Paths
.get(output.getAbsolutePath(), "src", "Org.OpenAPITools", "Model", modelName + ".cs")
.toString()
);
assertNotNull(file, "Could not find file for model: " + modelName);
assertFileContains(file.toPath(), "public List<List<List<decimal>>> Coordinates { get; set; }");
}
private List<String> getNames(List<CodegenProperty> props) {
if (props == null) return null;
return props.stream().map(v -> v.name).collect(Collectors.toList());
}
}

View File

@ -398,7 +398,7 @@ public class CSharpModelTest {
final CodegenProperty property2 = cm.vars.get(1);
Assert.assertEquals(property2.baseName, "urls");
Assert.assertEquals(property2.dataType, "List<string>");
Assert.assertEquals(property2.dataType, "List?<string>");
Assert.assertEquals(property2.name, "Urls");
Assert.assertNull(property2.defaultValue);
Assert.assertEquals(property2.baseType, "List?");

View File

@ -0,0 +1,202 @@
openapi: 3.0.3
info:
title: weather.gov API
description: weather.gov API
version: 2.5.1
servers:
- url: https://api.weather.gov
description: Production server
paths:
/alerts/active/zone/{zoneId}:
get:
description: Returns active alerts for the given NWS public zone or county
operationId: alerts_active_zone
responses:
'200':
$ref: '#/components/responses/AlertCollection'
parameters: []
parameters:
- $ref: '#/components/parameters/NWSZoneId'
components:
schemas:
GeoJsonBoundingBox:
minItems: 4
type: array
items:
type: number
description: A GeoJSON bounding box. Please refer to IETF RFC 7946 for information on the GeoJSON format.
GeoJsonCoordinate:
minItems: 2
type: array
items:
type: number
description: A GeoJSON coordinate. Please refer to IETF RFC 7946 for information on the GeoJSON format.
GeoJsonGeometry:
oneOf:
- title: GeoJSON Point
required:
- type
- coordinates
type: object
properties:
type:
enum:
- Point
type: string
coordinates:
$ref: '#/components/schemas/GeoJsonCoordinate'
bbox:
$ref: '#/components/schemas/GeoJsonBoundingBox'
- title: GeoJSON LineString
required:
- type
- coordinates
type: object
properties:
type:
enum:
- LineString
type: string
coordinates:
$ref: '#/components/schemas/GeoJsonLineString'
bbox:
$ref: '#/components/schemas/GeoJsonBoundingBox'
- title: GeoJSON Polygon
required:
- type
- coordinates
type: object
properties:
type:
enum:
- Polygon
type: string
coordinates:
$ref: '#/components/schemas/GeoJsonPolygon'
bbox:
$ref: '#/components/schemas/GeoJsonBoundingBox'
- title: GeoJSON MultiPoint
required:
- type
- coordinates
type: object
properties:
type:
enum:
- MultiPoint
type: string
coordinates:
type: array
items:
$ref: '#/components/schemas/GeoJsonCoordinate'
bbox:
$ref: '#/components/schemas/GeoJsonBoundingBox'
- title: GeoJSON MultiLineString
required:
- type
- coordinates
type: object
properties:
type:
enum:
- MultiLineString
type: string
coordinates:
type: array
items:
$ref: '#/components/schemas/GeoJsonLineString'
description: "A GeoJSON MultiLineString"
bbox:
$ref: '#/components/schemas/GeoJsonBoundingBox'
- title: GeoJSON MultiPolygon
required:
- type
- coordinates
type: object
properties:
type:
enum:
- MultiPolygon
type: string
coordinates:
type: array
items:
$ref: '#/components/schemas/GeoJsonPolygon'
bbox:
$ref: '#/components/schemas/GeoJsonBoundingBox'
description: A GeoJSON geometry object. Please refer to IETF RFC 7946 for information on the GeoJSON format.
nullable: true
GeoJsonFeature:
required:
- type
- geometry
- properties
type: object
properties:
type:
enum:
- Feature
type: string
geometry:
$ref: '#/components/schemas/GeoJsonGeometry'
properties:
type: object
description: A GeoJSON feature. Please refer to IETF RFC 7946 for information on the GeoJSON format.
additionalProperties: false
GeoJsonFeatureCollection:
required:
- type
- features
type: object
properties:
type:
enum:
- FeatureCollection
type: string
features:
type: array
items:
$ref: '#/components/schemas/GeoJsonFeature'
description: A GeoJSON feature collection. Please refer to IETF RFC 7946 for information on the GeoJSON format.
GeoJsonLineString:
minItems: 2
type: array
items:
$ref: '#/components/schemas/GeoJsonCoordinate'
description: A GeoJSON line string. Please refer to IETF RFC 7946 for information on the GeoJSON format.
GeoJsonPolygon:
type: array
items:
minItems: 4
type: array
items:
$ref: '#/components/schemas/GeoJsonCoordinate'
description: A GeoJSON polygon. Please refer to IETF RFC 7946 for information on the GeoJSON format.
NWSZoneID:
pattern: ^(A[KLMNRSZ]|C[AOT]|D[CE]|F[LM]|G[AMU]|I[ADLN]|K[SY]|L[ACEHMOS]|M[ADEHINOPST]|N[CDEHJMVY]|O[HKR]|P[AHKMRSWZ]|S[CDL]|T[NX]|UT|V[AIT]|W[AIVY]|[HR]I)[CZ]\d{3}$
type: string
description: |
UGC identifier for a NWS forecast zone or county.
The first two letters will correspond to either a state code or marine area code (see #/components/schemas/StateTerritoryCode and #/components/schemas/MarineAreaCode for lists of valid letter combinations).
The third letter will be Z for public/fire zone or C for county.
responses:
AlertCollection:
description: A collection of alerts.
content:
application/geo+json:
schema:
$ref: '#/components/schemas/GeoJsonFeatureCollection'
x-url-content-negotiation-extensions:
json: application/geo+json
atom: application/atom+xml
parameters:
NWSZoneId:
name: zoneId
in: path
description: NWS public zone/county identifier
required: true
schema:
$ref: '#/components/schemas/NWSZoneID'
externalDocs:
description: Full API documentation
url: https://www.weather.gov/documentation/services-web-api

View File

@ -99,7 +99,7 @@ namespace Org.OpenAPITools.Test.Api
{
var response = await _instance.RolesReportGetAsync();
var model = response.Ok();
Assert.IsType<List<List>>(model);
Assert.IsType<List<List<RolesReportsHash>>>(model);
}
/// <summary>

View File

@ -219,7 +219,7 @@ namespace Org.OpenAPITools.Api
/// <summary>
/// The <see cref="IRolesReportGetApiResponse"/>
/// </summary>
public interface IRolesReportGetApiResponse : Org.OpenAPITools.Client.IApiResponse, IOk<List<List>>
public interface IRolesReportGetApiResponse : Org.OpenAPITools.Client.IApiResponse, IOk<List<List<RolesReportsHash>>>
{
/// <summary>
/// Returns true if the response is 200 Ok
@ -1495,11 +1495,11 @@ namespace Org.OpenAPITools.Api
/// Deserializes the response if the response is 200 Ok
/// </summary>
/// <returns></returns>
public List<List> Ok()
public List<List<RolesReportsHash>> Ok()
{
// This logic may be modified with the AsModel.mustache template
return IsOk
? System.Text.Json.JsonSerializer.Deserialize<List<List>>(RawContent, _jsonSerializerOptions)
? System.Text.Json.JsonSerializer.Deserialize<List<List<RolesReportsHash>>>(RawContent, _jsonSerializerOptions)
: default;
}
@ -1508,7 +1508,7 @@ namespace Org.OpenAPITools.Api
/// </summary>
/// <param name="result"></param>
/// <returns></returns>
public bool TryOk(out List<List> result)
public bool TryOk(out List<List<RolesReportsHash>> result)
{
result = null;

View File

@ -99,7 +99,7 @@ namespace Org.OpenAPITools.Test.Api
{
var response = await _instance.RolesReportGetAsync();
var model = response.Ok();
Assert.IsType<List<List>>(model);
Assert.IsType<List<List<RolesReportsHash>>>(model);
}
/// <summary>

View File

@ -219,7 +219,7 @@ namespace Org.OpenAPITools.Api
/// <summary>
/// The <see cref="IRolesReportGetApiResponse"/>
/// </summary>
public interface IRolesReportGetApiResponse : Org.OpenAPITools.Client.IApiResponse, IOk<List<List>>
public interface IRolesReportGetApiResponse : Org.OpenAPITools.Client.IApiResponse, IOk<List<List<RolesReportsHash>>>
{
/// <summary>
/// Returns true if the response is 200 Ok
@ -1495,11 +1495,11 @@ namespace Org.OpenAPITools.Api
/// Deserializes the response if the response is 200 Ok
/// </summary>
/// <returns></returns>
public List<List> Ok()
public List<List<RolesReportsHash>> Ok()
{
// This logic may be modified with the AsModel.mustache template
return IsOk
? System.Text.Json.JsonSerializer.Deserialize<List<List>>(RawContent, _jsonSerializerOptions)
? System.Text.Json.JsonSerializer.Deserialize<List<List<RolesReportsHash>>>(RawContent, _jsonSerializerOptions)
: default;
}
@ -1508,7 +1508,7 @@ namespace Org.OpenAPITools.Api
/// </summary>
/// <param name="result"></param>
/// <returns></returns>
public bool TryOk(out List<List> result)
public bool TryOk(out List<List<RolesReportsHash>> result)
{
result = null;

View File

@ -99,7 +99,7 @@ namespace Org.OpenAPITools.Test.Api
{
var response = await _instance.RolesReportGetAsync();
var model = response.Ok();
Assert.IsType<List<List>>(model);
Assert.IsType<List<List<RolesReportsHash>>>(model);
}
/// <summary>

View File

@ -219,7 +219,7 @@ namespace Org.OpenAPITools.Api
/// <summary>
/// The <see cref="IRolesReportGetApiResponse"/>
/// </summary>
public interface IRolesReportGetApiResponse : Org.OpenAPITools.Client.IApiResponse, IOk<List<List>>
public interface IRolesReportGetApiResponse : Org.OpenAPITools.Client.IApiResponse, IOk<List<List<RolesReportsHash>>>
{
/// <summary>
/// Returns true if the response is 200 Ok
@ -1495,11 +1495,11 @@ namespace Org.OpenAPITools.Api
/// Deserializes the response if the response is 200 Ok
/// </summary>
/// <returns></returns>
public List<List> Ok()
public List<List<RolesReportsHash>> Ok()
{
// This logic may be modified with the AsModel.mustache template
return IsOk
? System.Text.Json.JsonSerializer.Deserialize<List<List>>(RawContent, _jsonSerializerOptions)
? System.Text.Json.JsonSerializer.Deserialize<List<List<RolesReportsHash>>>(RawContent, _jsonSerializerOptions)
: default;
}
@ -1508,7 +1508,7 @@ namespace Org.OpenAPITools.Api
/// </summary>
/// <param name="result"></param>
/// <returns></returns>
public bool TryOk(out List<List> result)
public bool TryOk(out List<List<RolesReportsHash>> result)
{
result = null;

View File

@ -99,7 +99,7 @@ namespace Org.OpenAPITools.Test.Api
{
var response = await _instance.RolesReportGetAsync();
var model = response.Ok();
Assert.IsType<List<List>>(model);
Assert.IsType<List<List<RolesReportsHash>>>(model);
}
/// <summary>

View File

@ -219,7 +219,7 @@ namespace Org.OpenAPITools.Api
/// <summary>
/// The <see cref="IRolesReportGetApiResponse"/>
/// </summary>
public interface IRolesReportGetApiResponse : Org.OpenAPITools.Client.IApiResponse, IOk<List<List>>
public interface IRolesReportGetApiResponse : Org.OpenAPITools.Client.IApiResponse, IOk<List<List<RolesReportsHash>>>
{
/// <summary>
/// Returns true if the response is 200 Ok
@ -1495,11 +1495,11 @@ namespace Org.OpenAPITools.Api
/// Deserializes the response if the response is 200 Ok
/// </summary>
/// <returns></returns>
public List<List> Ok()
public List<List<RolesReportsHash>> Ok()
{
// This logic may be modified with the AsModel.mustache template
return IsOk
? System.Text.Json.JsonSerializer.Deserialize<List<List>>(RawContent, _jsonSerializerOptions)
? System.Text.Json.JsonSerializer.Deserialize<List<List<RolesReportsHash>>>(RawContent, _jsonSerializerOptions)
: default;
}
@ -1508,7 +1508,7 @@ namespace Org.OpenAPITools.Api
/// </summary>
/// <param name="result"></param>
/// <returns></returns>
public bool TryOk(out List<List> result)
public bool TryOk(out List<List<RolesReportsHash>> result)
{
result = null;

View File

@ -99,7 +99,7 @@ namespace Org.OpenAPITools.Test.Api
{
var response = await _instance.RolesReportGetAsync();
var model = response.Ok();
Assert.IsType<List<List>>(model);
Assert.IsType<List<List<RolesReportsHash>>>(model);
}
/// <summary>

View File

@ -219,7 +219,7 @@ namespace Org.OpenAPITools.Api
/// <summary>
/// The <see cref="IRolesReportGetApiResponse"/>
/// </summary>
public interface IRolesReportGetApiResponse : Org.OpenAPITools.Client.IApiResponse, IOk<List<List>>
public interface IRolesReportGetApiResponse : Org.OpenAPITools.Client.IApiResponse, IOk<List<List<RolesReportsHash>>>
{
/// <summary>
/// Returns true if the response is 200 Ok
@ -1499,11 +1499,11 @@ namespace Org.OpenAPITools.Api
/// Deserializes the response if the response is 200 Ok
/// </summary>
/// <returns></returns>
public List<List> Ok()
public List<List<RolesReportsHash>> Ok()
{
// This logic may be modified with the AsModel.mustache template
return IsOk
? System.Text.Json.JsonSerializer.Deserialize<List<List>>(RawContent, _jsonSerializerOptions)
? System.Text.Json.JsonSerializer.Deserialize<List<List<RolesReportsHash>>>(RawContent, _jsonSerializerOptions)
: null;
}
@ -1512,7 +1512,7 @@ namespace Org.OpenAPITools.Api
/// </summary>
/// <param name="result"></param>
/// <returns></returns>
public bool TryOk([NotNullWhen(true)]out List<List> result)
public bool TryOk([NotNullWhen(true)]out List<List<RolesReportsHash>> result)
{
result = null;

View File

@ -99,7 +99,7 @@ namespace Org.OpenAPITools.Test.Api
{
var response = await _instance.RolesReportGetAsync();
var model = response.Ok();
Assert.IsType<List<List>>(model);
Assert.IsType<List<List<RolesReportsHash>>>(model);
}
/// <summary>

View File

@ -221,7 +221,7 @@ namespace Org.OpenAPITools.Api
/// <summary>
/// The <see cref="IRolesReportGetApiResponse"/>
/// </summary>
public interface IRolesReportGetApiResponse : Org.OpenAPITools.Client.IApiResponse, IOk<List<List>?>
public interface IRolesReportGetApiResponse : Org.OpenAPITools.Client.IApiResponse, IOk<List<List<RolesReportsHash>>?>
{
/// <summary>
/// Returns true if the response is 200 Ok
@ -1501,11 +1501,11 @@ namespace Org.OpenAPITools.Api
/// Deserializes the response if the response is 200 Ok
/// </summary>
/// <returns></returns>
public List<List>? Ok()
public List<List<RolesReportsHash>>? Ok()
{
// This logic may be modified with the AsModel.mustache template
return IsOk
? System.Text.Json.JsonSerializer.Deserialize<List<List>>(RawContent, _jsonSerializerOptions)
? System.Text.Json.JsonSerializer.Deserialize<List<List<RolesReportsHash>>>(RawContent, _jsonSerializerOptions)
: null;
}
@ -1514,7 +1514,7 @@ namespace Org.OpenAPITools.Api
/// </summary>
/// <param name="result"></param>
/// <returns></returns>
public bool TryOk([NotNullWhen(true)]out List<List>? result)
public bool TryOk([NotNullWhen(true)]out List<List<RolesReportsHash>>? result)
{
result = null;

View File

@ -99,7 +99,7 @@ namespace Org.OpenAPITools.Test.Api
{
var response = await _instance.RolesReportGetAsync();
var model = response.Ok();
Assert.IsType<List<List>>(model);
Assert.IsType<List<List<RolesReportsHash>>>(model);
}
/// <summary>

View File

@ -219,7 +219,7 @@ namespace Org.OpenAPITools.Api
/// <summary>
/// The <see cref="IRolesReportGetApiResponse"/>
/// </summary>
public interface IRolesReportGetApiResponse : Org.OpenAPITools.Client.IApiResponse, IOk<List<List>>
public interface IRolesReportGetApiResponse : Org.OpenAPITools.Client.IApiResponse, IOk<List<List<RolesReportsHash>>>
{
/// <summary>
/// Returns true if the response is 200 Ok
@ -1499,11 +1499,11 @@ namespace Org.OpenAPITools.Api
/// Deserializes the response if the response is 200 Ok
/// </summary>
/// <returns></returns>
public List<List> Ok()
public List<List<RolesReportsHash>> Ok()
{
// This logic may be modified with the AsModel.mustache template
return IsOk
? System.Text.Json.JsonSerializer.Deserialize<List<List>>(RawContent, _jsonSerializerOptions)
? System.Text.Json.JsonSerializer.Deserialize<List<List<RolesReportsHash>>>(RawContent, _jsonSerializerOptions)
: null;
}
@ -1512,7 +1512,7 @@ namespace Org.OpenAPITools.Api
/// </summary>
/// <param name="result"></param>
/// <returns></returns>
public bool TryOk([NotNullWhen(true)]out List<List> result)
public bool TryOk([NotNullWhen(true)]out List<List<RolesReportsHash>> result)
{
result = null;

View File

@ -99,7 +99,7 @@ namespace Org.OpenAPITools.Test.Api
{
var response = await _instance.RolesReportGetAsync();
var model = response.Ok();
Assert.IsType<List<List>>(model);
Assert.IsType<List<List<RolesReportsHash>>>(model);
}
/// <summary>

View File

@ -221,7 +221,7 @@ namespace Org.OpenAPITools.Api
/// <summary>
/// The <see cref="IRolesReportGetApiResponse"/>
/// </summary>
public interface IRolesReportGetApiResponse : Org.OpenAPITools.Client.IApiResponse, IOk<List<List>?>
public interface IRolesReportGetApiResponse : Org.OpenAPITools.Client.IApiResponse, IOk<List<List<RolesReportsHash>>?>
{
/// <summary>
/// Returns true if the response is 200 Ok
@ -1501,11 +1501,11 @@ namespace Org.OpenAPITools.Api
/// Deserializes the response if the response is 200 Ok
/// </summary>
/// <returns></returns>
public List<List>? Ok()
public List<List<RolesReportsHash>>? Ok()
{
// This logic may be modified with the AsModel.mustache template
return IsOk
? System.Text.Json.JsonSerializer.Deserialize<List<List>>(RawContent, _jsonSerializerOptions)
? System.Text.Json.JsonSerializer.Deserialize<List<List<RolesReportsHash>>>(RawContent, _jsonSerializerOptions)
: null;
}
@ -1514,7 +1514,7 @@ namespace Org.OpenAPITools.Api
/// </summary>
/// <param name="result"></param>
/// <returns></returns>
public bool TryOk([NotNullWhen(true)]out List<List>? result)
public bool TryOk([NotNullWhen(true)]out List<List<RolesReportsHash>>? result)
{
result = null;

View File

@ -99,7 +99,7 @@ namespace Org.OpenAPITools.Test.Api
{
var response = await _instance.RolesReportGetAsync();
var model = response.Ok();
Assert.IsType<List<List>>(model);
Assert.IsType<List<List<RolesReportsHash>>>(model);
}
/// <summary>

View File

@ -219,7 +219,7 @@ namespace Org.OpenAPITools.Api
/// <summary>
/// The <see cref="IRolesReportGetApiResponse"/>
/// </summary>
public interface IRolesReportGetApiResponse : Org.OpenAPITools.Client.IApiResponse, IOk<List<List>>
public interface IRolesReportGetApiResponse : Org.OpenAPITools.Client.IApiResponse, IOk<List<List<RolesReportsHash>>>
{
/// <summary>
/// Returns true if the response is 200 Ok
@ -1499,11 +1499,11 @@ namespace Org.OpenAPITools.Api
/// Deserializes the response if the response is 200 Ok
/// </summary>
/// <returns></returns>
public List<List> Ok()
public List<List<RolesReportsHash>> Ok()
{
// This logic may be modified with the AsModel.mustache template
return IsOk
? System.Text.Json.JsonSerializer.Deserialize<List<List>>(RawContent, _jsonSerializerOptions)
? System.Text.Json.JsonSerializer.Deserialize<List<List<RolesReportsHash>>>(RawContent, _jsonSerializerOptions)
: null;
}
@ -1512,7 +1512,7 @@ namespace Org.OpenAPITools.Api
/// </summary>
/// <param name="result"></param>
/// <returns></returns>
public bool TryOk([NotNullWhen(true)]out List<List> result)
public bool TryOk([NotNullWhen(true)]out List<List<RolesReportsHash>> result)
{
result = null;

View File

@ -99,7 +99,7 @@ namespace Org.OpenAPITools.Test.Api
{
var response = await _instance.RolesReportGetAsync();
var model = response.Ok();
Assert.IsType<List<List>>(model);
Assert.IsType<List<List<RolesReportsHash>>>(model);
}
/// <summary>

View File

@ -221,7 +221,7 @@ namespace Org.OpenAPITools.Api
/// <summary>
/// The <see cref="IRolesReportGetApiResponse"/>
/// </summary>
public interface IRolesReportGetApiResponse : Org.OpenAPITools.Client.IApiResponse, IOk<List<List>?>
public interface IRolesReportGetApiResponse : Org.OpenAPITools.Client.IApiResponse, IOk<List<List<RolesReportsHash>>?>
{
/// <summary>
/// Returns true if the response is 200 Ok
@ -1501,11 +1501,11 @@ namespace Org.OpenAPITools.Api
/// Deserializes the response if the response is 200 Ok
/// </summary>
/// <returns></returns>
public List<List>? Ok()
public List<List<RolesReportsHash>>? Ok()
{
// This logic may be modified with the AsModel.mustache template
return IsOk
? System.Text.Json.JsonSerializer.Deserialize<List<List>>(RawContent, _jsonSerializerOptions)
? System.Text.Json.JsonSerializer.Deserialize<List<List<RolesReportsHash>>>(RawContent, _jsonSerializerOptions)
: null;
}
@ -1514,7 +1514,7 @@ namespace Org.OpenAPITools.Api
/// </summary>
/// <param name="result"></param>
/// <returns></returns>
public bool TryOk([NotNullWhen(true)]out List<List>? result)
public bool TryOk([NotNullWhen(true)]out List<List<RolesReportsHash>>? result)
{
result = null;

View File

@ -99,7 +99,7 @@ namespace Org.OpenAPITools.Test.Api
{
var response = await _instance.RolesReportGetAsync();
var model = response.Ok();
Assert.IsType<List<List>>(model);
Assert.IsType<List<List<RolesReportsHash>>>(model);
}
/// <summary>

View File

@ -219,7 +219,7 @@ namespace Org.OpenAPITools.Api
/// <summary>
/// The <see cref="IRolesReportGetApiResponse"/>
/// </summary>
public interface IRolesReportGetApiResponse : Org.OpenAPITools.Client.IApiResponse, IOk<List<List>>
public interface IRolesReportGetApiResponse : Org.OpenAPITools.Client.IApiResponse, IOk<List<List<RolesReportsHash>>>
{
/// <summary>
/// Returns true if the response is 200 Ok
@ -1499,11 +1499,11 @@ namespace Org.OpenAPITools.Api
/// Deserializes the response if the response is 200 Ok
/// </summary>
/// <returns></returns>
public List<List> Ok()
public List<List<RolesReportsHash>> Ok()
{
// This logic may be modified with the AsModel.mustache template
return IsOk
? System.Text.Json.JsonSerializer.Deserialize<List<List>>(RawContent, _jsonSerializerOptions)
? System.Text.Json.JsonSerializer.Deserialize<List<List<RolesReportsHash>>>(RawContent, _jsonSerializerOptions)
: null;
}
@ -1512,7 +1512,7 @@ namespace Org.OpenAPITools.Api
/// </summary>
/// <param name="result"></param>
/// <returns></returns>
public bool TryOk([NotNullWhen(true)]out List<List> result)
public bool TryOk([NotNullWhen(true)]out List<List<RolesReportsHash>> result)
{
result = null;

View File

@ -99,7 +99,7 @@ namespace Org.OpenAPITools.Test.Api
{
var response = await _instance.RolesReportGetAsync();
var model = response.Ok();
Assert.IsType<List<List>>(model);
Assert.IsType<List<List<RolesReportsHash>>>(model);
}
/// <summary>

View File

@ -221,7 +221,7 @@ namespace Org.OpenAPITools.Api
/// <summary>
/// The <see cref="IRolesReportGetApiResponse"/>
/// </summary>
public interface IRolesReportGetApiResponse : Org.OpenAPITools.Client.IApiResponse, IOk<List<List>?>
public interface IRolesReportGetApiResponse : Org.OpenAPITools.Client.IApiResponse, IOk<List<List<RolesReportsHash>>?>
{
/// <summary>
/// Returns true if the response is 200 Ok
@ -1501,11 +1501,11 @@ namespace Org.OpenAPITools.Api
/// Deserializes the response if the response is 200 Ok
/// </summary>
/// <returns></returns>
public List<List>? Ok()
public List<List<RolesReportsHash>>? Ok()
{
// This logic may be modified with the AsModel.mustache template
return IsOk
? System.Text.Json.JsonSerializer.Deserialize<List<List>>(RawContent, _jsonSerializerOptions)
? System.Text.Json.JsonSerializer.Deserialize<List<List<RolesReportsHash>>>(RawContent, _jsonSerializerOptions)
: null;
}
@ -1514,7 +1514,7 @@ namespace Org.OpenAPITools.Api
/// </summary>
/// <param name="result"></param>
/// <returns></returns>
public bool TryOk([NotNullWhen(true)]out List<List>? result)
public bool TryOk([NotNullWhen(true)]out List<List<RolesReportsHash>>? result)
{
result = null;

View File

@ -99,7 +99,7 @@ namespace Org.OpenAPITools.Test.Api
{
var response = await _instance.RolesReportGetAsync();
var model = response.Ok();
Assert.IsType<List<List>>(model);
Assert.IsType<List<List<RolesReportsHash>>>(model);
}
/// <summary>

View File

@ -218,7 +218,7 @@ namespace Org.OpenAPITools.Api
/// <summary>
/// The <see cref="IRolesReportGetApiResponse"/>
/// </summary>
public interface IRolesReportGetApiResponse : Org.OpenAPITools.Client.IApiResponse, IOk<List<List>>
public interface IRolesReportGetApiResponse : Org.OpenAPITools.Client.IApiResponse, IOk<List<List<RolesReportsHash>>>
{
/// <summary>
/// Returns true if the response is 200 Ok
@ -1494,11 +1494,11 @@ namespace Org.OpenAPITools.Api
/// Deserializes the response if the response is 200 Ok
/// </summary>
/// <returns></returns>
public List<List> Ok()
public List<List<RolesReportsHash>> Ok()
{
// This logic may be modified with the AsModel.mustache template
return IsOk
? System.Text.Json.JsonSerializer.Deserialize<List<List>>(RawContent, _jsonSerializerOptions)
? System.Text.Json.JsonSerializer.Deserialize<List<List<RolesReportsHash>>>(RawContent, _jsonSerializerOptions)
: default;
}
@ -1507,7 +1507,7 @@ namespace Org.OpenAPITools.Api
/// </summary>
/// <param name="result"></param>
/// <returns></returns>
public bool TryOk(out List<List> result)
public bool TryOk(out List<List<RolesReportsHash>> result)
{
result = null;