Skip to content

Commit

Permalink
Merge pull request #8 from MobileTeleSystems/feture/upd_sdk
Browse files Browse the repository at this point in the history
Add Schema
  • Loading branch information
genusP authored Dec 13, 2024
2 parents bb96aaf + 65d08bd commit 33a4235
Show file tree
Hide file tree
Showing 4 changed files with 87 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="ApiCodeGenerator.OpenApi.Sdk" Version="3.0.0-rc.44" />
<PackageReference Include="ApiCodeGenerator.OpenApi.Sdk" Version="3.0.0" />
<PackageReference Include="NSwag.Core.Yaml" Version="14.0.2" />
<PackageReference Include="NSwag.CodeGeneration.CSharp" Version="14.0.2" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.3.1" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="ApiCodeGenerator.OpenApi.Sdk/3.0.0-rc.44">
<Project Sdk="ApiCodeGenerator.OpenApi.Sdk/3.0.0">

<PropertyGroup>
<Description>Generates code for the Refit library from an OpenApi document.</Description>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public RefitCodeGeneratorSettings()
public bool AuthorizationHeaderParameter { get; set; }

/// <summary>
/// Тип используемый для двоичного содержиого.
/// Тип используемый для двоичного содержимого.
/// </summary>
public string BinaryPartType { get; set; } = "StreamPart";
}
Expand Down
84 changes: 84 additions & 0 deletions schemas/nswag.json
Original file line number Diff line number Diff line change
@@ -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"
}
}
}
]
}
}
}

0 comments on commit 33a4235

Please sign in to comment.