diff --git a/ApiCodeGenerator.OpenApi.Refit.Tests/ApiCodeGenerator.OpenApi.Refit.Tests.csproj b/ApiCodeGenerator.OpenApi.Refit.Tests/ApiCodeGenerator.OpenApi.Refit.Tests.csproj index 4a4508c..113bbb6 100644 --- a/ApiCodeGenerator.OpenApi.Refit.Tests/ApiCodeGenerator.OpenApi.Refit.Tests.csproj +++ b/ApiCodeGenerator.OpenApi.Refit.Tests/ApiCodeGenerator.OpenApi.Refit.Tests.csproj @@ -19,7 +19,7 @@ - + diff --git a/ApiCodeGenerator.OpenApi.Refit/ApiCodeGenerator.OpenApi.Refit.csproj b/ApiCodeGenerator.OpenApi.Refit/ApiCodeGenerator.OpenApi.Refit.csproj index cc1f1eb..2b9042a 100644 --- a/ApiCodeGenerator.OpenApi.Refit/ApiCodeGenerator.OpenApi.Refit.csproj +++ b/ApiCodeGenerator.OpenApi.Refit/ApiCodeGenerator.OpenApi.Refit.csproj @@ -1,4 +1,4 @@ - + Generates code for the Refit library from an OpenApi document. diff --git a/ApiCodeGenerator.OpenApi.Refit/RefitCodeGeneratorSettings.cs b/ApiCodeGenerator.OpenApi.Refit/RefitCodeGeneratorSettings.cs index c7900b2..31d1b53 100644 --- a/ApiCodeGenerator.OpenApi.Refit/RefitCodeGeneratorSettings.cs +++ b/ApiCodeGenerator.OpenApi.Refit/RefitCodeGeneratorSettings.cs @@ -66,7 +66,7 @@ public RefitCodeGeneratorSettings() public bool AuthorizationHeaderParameter { get; set; } /// - /// Тип используемый для двоичного содержиого. + /// Тип используемый для двоичного содержимого. /// public string BinaryPartType { get; set; } = "StreamPart"; } diff --git a/schemas/nswag.json b/schemas/nswag.json new file mode 100644 index 0000000..5e6eb6c --- /dev/null +++ b/schemas/nswag.json @@ -0,0 +1,84 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "allOf": [ + { + "$ref": "https://raw.githubusercontent.com/MobileTeleSystems/ApiCodeGenerator/refs/heads/dev/schemas/nswag.json#/definitions/nswagDocument" + }, + { + "properties": { + "codeGenerators": { + "oneOf": [ + { + "$ref": "#/definitions/openApiToRefit" + }, + { + "$ref": "https://raw.githubusercontent.com/MobileTeleSystems/ApiCodeGenerator/refs/heads/master/schemas/nswag.json#/definitions/codeGenerators" + } + ] + } + } + } + ], + "definitions": { + "openApiToRefit": { + "additionalProperties": false, + "properties": { + "openApiToRefitClient": { + "description": "Generates a client description for the Refit library", + "$ref": "#/definitions/refitGeneratorSettings" + } + }, + "required": [ + "openApiToRefitClient" + ] + }, + "refitGeneratorSettings": { + "anyOf": [ + { + "$ref": "https://raw.githubusercontent.com/MobileTeleSystems/ApiCodeGenerator/refs/heads/master/schemas/nswag.json#/definitions/csGeneratorBaseSettings" + }, + { + "properties": { + "clientBaseInterface": { + "type": "boolean", + "description": "The full name of the base interface." + }, + "interfaceAccessModifier": { + "type": "string", + "description": "The client interface access modifier (default: public).", + "default": "public" + }, + "operationAsyncSuffix": { + "type": "boolean", + "description": "Value indicating whether to append 'Async' suffix to the method name." + }, + "operationCancelationToken": { + "type": "boolean", + "description": "Value indicating whether to add the cancellation token to the parameter list." + }, + "pathExtractExpression": { + "type": "string", + "description": "The Regular expression for getting the operation path." + }, + "wrapQueryParmetersMethods": { + "type": "array", + "description": "The list of methods where query parameters are wrapped (\"ControllerName.MethodName\", '*' may be used).", + "items": { + "type": "string" + } + }, + "authorizationHeaderParameter": { + "type": "boolean", + "description": "Value indicating whether to add the authorization header to the parameter list." + }, + "binaryPartType": { + "type": "string", + "description": "The .NET type used for binary data (default: StreamPart).", + "default": "StreamPart" + } + } + } + ] + } + } +}