Hi,
I am facing an issue while generating autotest for custom modules. When I generated autorest it generates extra random classes.
Platform version - 3.253.3
autorest command -
autorest VirtoCommerce.Storefront\AutoRestClients\array-in-query-fix.yml --version=3.0.6274 --v3 --debug --input-file=path to file/swagger.json --output-folder=.\VirtoCommerce.Storefront\AutoRestClients --output-file=ModuleApi.cs --namespace=VirtoCommerce.Storefront.AutoRestClients.
ModuleApi --override-client-name=ModuleClient --add-credentials --csharp --generate-empty-classes=true
In this search method parameter .it should have proper classes but its generating some random classes.
JSON file for auto rest-
{
"openapi": "3.0.1",
"info": {
"title": "Dh.DaivsModule",
"version": "v1"
},
"paths": {
"/api/daivs/drawing/validate": {
"post": {
"tags": [
"De Havilland Engg Drawing Daivs Module"
],
"operationId": "ApiDaivsService_ValidateDrawings",
"requestBody": {
"content": {
"application/json-patch+json": {
"schema": {
"type": "array",
"items": {
"type": "string"
},
"nullable": true
}
},
"application/json": {
"schema": {
"type": "array",
"items": {
"type": "string"
},
"nullable": true
}
},
"text/json": {
"schema": {
"type": "array",
"items": {
"type": "string"
},
"nullable": true
}
}
}
},
"responses": {
"200": {
"description": "Success",
"content": {
"text/plain": {
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"application/json": {
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"text/json": {
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
},
"401": {
"description": "Unauthorized"
},
"403": {
"description": "Forbidden"
}
},
"security": [
{
"oauth2": [
"DaivsModule:access"
]
}
]
}
},
"/api/daivs": {
"post": {
"tags": [
"De Havilland Engg Drawing Daivs Module"
],
"operationId": "DaivsModule_Update",
"requestBody": {
"content": {
"application/json-patch+json": {
"schema": {
"allOf": [
{
"$ref": "#/components/schemas/DrawingAccessRequest"
}
],
"nullable": true
}
},
"application/json": {
"schema": {
"allOf": [
{
"$ref": "#/components/schemas/DrawingAccessRequest"
}
],
"nullable": true
}
},
"text/json": {
"schema": {
"allOf": [
{
"$ref": "#/components/schemas/DrawingAccessRequest"
}
],
"nullable": true
}
}
}
},
"responses": {
"200": {
"description": "Success",
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/DrawingAccessRequest"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/DrawingAccessRequest"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/DrawingAccessRequest"
}
}
}
},
"401": {
"description": "Unauthorized"
},
"403": {
"description": "Forbidden"
}
},
"security": [
{
"oauth2": [
"DaivsModule:update"
]
}
]
}
},
"/api/daivs/bulk": {
"post": {
"tags": [
"De Havilland Engg Drawing Daivs Module"
],
"operationId": "DaivsModule_CreateUpdateRequestInBulk",
"requestBody": {
"content": {
"application/json-patch+json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/DrawingAccessRequest"
},
"nullable": true
}
},
"application/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/DrawingAccessRequest"
},
"nullable": true
}
},
"text/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/DrawingAccessRequest"
},
"nullable": true
}
}
}
},
"responses": {
"200": {
"description": "Success",
"content": {
"text/plain": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/DrawingAccessRequest"
}
}
},
"application/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/DrawingAccessRequest"
}
}
},
"text/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/DrawingAccessRequest"
}
}
}
}
},
"401": {
"description": "Unauthorized"
},
"403": {
"description": "Forbidden"
}
},
"security": [
{
"oauth2": [
"DaivsModule:update"
]
}
]
}
},
"/api/daivs/{id}": {
"get": {
"tags": [
"De Havilland Engg Drawing Daivs Module"
],
"operationId": "DaivsModule_GetDrawingAccessRequestById",
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "string",
"nullable": true
}
}
],
"responses": {
"200": {
"description": "Success",
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/DrawingAccessRequest"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/DrawingAccessRequest"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/DrawingAccessRequest"
}
}
}
},
"401": {
"description": "Unauthorized"
},
"403": {
"description": "Forbidden"
}
},
"security": [
{
"oauth2": [
"DaivsModule:read"
]
}
]
},
"delete": {
"tags": [
"De Havilland Engg Drawing Daivs Module"
],
"operationId": "DaivsModule_Delete",
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "string",
"nullable": true
}
}
],
"responses": {
"204": {
"description": "Success"
},
"401": {
"description": "Unauthorized"
},
"403": {
"description": "Forbidden"
}
},
"security": [
{
"oauth2": [
"DaivsModule:access"
]
}
]
}
},
"/api/daivs/search": {
"post": {
"tags": [
"De Havilland Engg Drawing Daivs Module"
],
"operationId": "DaivsModule_Search",
"requestBody": {
"content": {
"application/json-patch+json": {
"schema": {
"allOf": [
{
"$ref": "#/components/schemas/DrawingAccessRequestSearchCriteria"
}
],
"nullable": true
}
},
"application/json": {
"schema": {
"allOf": [
{
"$ref": "#/components/schemas/DrawingAccessRequestSearchCriteria"
}
],
"nullable": true
}
},
"text/json": {
"schema": {
"allOf": [
{
"$ref": "#/components/schemas/DrawingAccessRequestSearchCriteria"
}
],
"nullable": true
}
}
}
},
"responses": {
"200": {
"description": "Success",
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/DrawingAccessRequestSearchResult"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/DrawingAccessRequestSearchResult"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/DrawingAccessRequestSearchResult"
}
}
}
},
"401": {
"description": "Unauthorized"
},
"403": {
"description": "Forbidden"
}
},
"security": [
{
"oauth2": [
"DaivsModule:read"
]
}
]
}
},
"/api/daivs/organization/{organizationId}": {
"get": {
"tags": [
"De Havilland Engg Drawing Daivs Module"
],
"operationId": "DaivsModule_GetDrawingAccessByOrgId",
"parameters": [
{
"name": "organizationId",
"in": "path",
"required": true,
"schema": {
"type": "string",
"nullable": true
}
}
],
"responses": {
"200": {
"description": "Success",
"content": {
"text/plain": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/DrawingAccessRequest"
}
}
},
"application/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/DrawingAccessRequest"
}
}
},
"text/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/DrawingAccessRequest"
}
}
}
}
},
"401": {
"description": "Unauthorized"
},
"403": {
"description": "Forbidden"
}
},
"security": [
{
"oauth2": [
"DaivsModule:read"
]
}
]
}
}
},
"components": {
"schemas": {
"Status": {
"enum": [
"PendingApproval",
"Approved",
"Rejected",
"Canceled"
],
"type": "string"
},
"DrawingAccessRequest": {
"type": "object",
"properties": {
"drawingNumber": {
"type": "string",
"nullable": true
},
"drawingRequester": {
"type": "string",
"nullable": true
},
"accessExpiry": {
"type": "string",
"format": "date-time"
},
"drawingApprover": {
"type": "string",
"nullable": true
},
"status": {
"enum": [
"PendingApproval",
"Approved",
"Rejected",
"Canceled"
],
"type": "string",
"allOf": [
{
"$ref": "#/components/schemas/Status"
}
]
},
"armsAccessId": {
"type": "string",
"nullable": true
},
"organizationId": {
"type": "string",
"nullable": true
},
"isForever": {
"type": "boolean"
},
"createdDate": {
"type": "string",
"format": "date-time"
},
"modifiedDate": {
"type": "string",
"format": "date-time",
"nullable": true
},
"createdBy": {
"maxLength": 64,
"minLength": 0,
"type": "string",
"nullable": true
},
"modifiedBy": {
"maxLength": 64,
"minLength": 0,
"type": "string",
"nullable": true
},
"id": {
"type": "string",
"nullable": true
}
},
"additionalProperties": false
},
"SortDirection": {
"enum": [
"Ascending",
"Descending"
],
"type": "string"
},
"SortInfo": {
"type": "object",
"properties": {
"sortColumn": {
"type": "string",
"nullable": true
},
"sortDirection": {
"enum": [
"Ascending",
"Descending"
],
"type": "string",
"allOf": [
{
"$ref": "#/components/schemas/SortDirection"
}
]
}
},
"additionalProperties": false
},
"DrawingAccessRequestSearchCriteria": {
"type": "object",
"properties": {
"drawingNumber": {
"type": "string",
"nullable": true
},
"drawingRequester": {
"type": "string",
"nullable": true
},
"drawingApprover": {
"type": "string",
"nullable": true
},
"status": {
"type": "string",
"nullable": true
},
"drawingNumbers": {
"type": "array",
"items": {
"type": "string"
},
"nullable": true
},
"armsAccessIds": {
"type": "array",
"items": {
"type": "string"
},
"nullable": true
},
"organizationIds": {
"type": "array",
"items": {
"type": "string"
},
"nullable": true
},
"responseGroup": {
"type": "string",
"nullable": true
},
"objectType": {
"type": "string",
"nullable": true
},
"objectTypes": {
"type": "array",
"items": {
"type": "string"
},
"nullable": true
},
"objectIds": {
"type": "array",
"items": {
"type": "string"
},
"nullable": true
},
"keyword": {
"type": "string",
"nullable": true
},
"searchPhrase": {
"type": "string",
"nullable": true
},
"languageCode": {
"type": "string",
"nullable": true
},
"sort": {
"type": "string",
"nullable": true
},
"sortInfos": {
"type": "array",
"items": {
"$ref": "#/components/schemas/SortInfo"
},
"nullable": true,
"readOnly": true
},
"skip": {
"type": "integer",
"format": "int32"
},
"take": {
"type": "integer",
"format": "int32"
}
},
"additionalProperties": false
},
"DrawingAccessRequestSearchResult": {
"type": "object",
"properties": {
"totalCount": {
"type": "integer",
"format": "int32"
},
"results": {
"type": "array",
"items": {
"$ref": "#/components/schemas/DrawingAccessRequest"
},
"nullable": true
}
},
"additionalProperties": false
}
},
"securitySchemes": {
"oauth2": {
"type": "oauth2",
"description": "OAuth2 Resource Owner Password Grant flow",
"flows": {
"password": {
"tokenUrl": "/connect/token",
"scopes": { }
}
}
}
}
}
}