Initial version

This commit is contained in:
2026-06-20 10:24:36 +02:00
parent f85b83d90f
commit 7e1173bf2c
40 changed files with 5438 additions and 63 deletions
+19
View File
@@ -0,0 +1,19 @@
using System.Text.Json.Serialization;
namespace EonaCat.DoxaApi.Models
{
public sealed class ApiDocument
{
[JsonPropertyName("info")]
public ApiInfo Info { get; set; } = new();
[JsonPropertyName("servers")]
public List<string> Servers { get; set; } = new();
[JsonPropertyName("groups")]
public List<ApiGroup> Groups { get; set; } = new();
[JsonPropertyName("schemas")]
public Dictionary<string, SchemaModel> Schemas { get; set; } = new();
}
}
+37
View File
@@ -0,0 +1,37 @@
using System.Text.Json.Serialization;
namespace EonaCat.DoxaApi.Models
{
public sealed class ApiEndpoint
{
[JsonPropertyName("operationId")]
public string OperationId { get; set; } = "";
[JsonPropertyName("summary")]
public string? Summary { get; set; }
[JsonPropertyName("description")]
public string? Description { get; set; }
[JsonPropertyName("method")]
public string Method { get; set; } = "GET";
[JsonPropertyName("path")]
public string Path { get; set; } = "/";
[JsonPropertyName("deprecated")]
public bool Deprecated { get; set; }
[JsonPropertyName("tags")]
public List<string> Tags { get; set; } = new();
[JsonPropertyName("parameters")]
public List<ApiParameter> Parameters { get; set; } = new();
[JsonPropertyName("requestBody")]
public RequestBodyModel? RequestBody { get; set; }
[JsonPropertyName("responses")]
public List<ResponseModel> Responses { get; set; } = new();
}
}
+16
View File
@@ -0,0 +1,16 @@
using System.Text.Json.Serialization;
namespace EonaCat.DoxaApi.Models
{
public sealed class ApiGroup
{
[JsonPropertyName("name")]
public string Name { get; set; } = "";
[JsonPropertyName("description")]
public string? Description { get; set; }
[JsonPropertyName("endpoints")]
public List<ApiEndpoint> Endpoints { get; set; } = new();
}
}
+16
View File
@@ -0,0 +1,16 @@
using System.Text.Json.Serialization;
namespace EonaCat.DoxaApi.Models
{
public sealed class ApiInfo
{
[JsonPropertyName("title")]
public string Title { get; set; } = "API Documentation";
[JsonPropertyName("description")]
public string? Description { get; set; }
[JsonPropertyName("version")]
public string Version { get; set; } = "v1";
}
}
+25
View File
@@ -0,0 +1,25 @@
using System.Text.Json.Serialization;
namespace EonaCat.DoxaApi.Models
{
public sealed class ApiParameter
{
[JsonPropertyName("name")]
public string Name { get; set; } = "";
[JsonPropertyName("in")]
public string In { get; set; } = "query";
[JsonPropertyName("required")]
public bool Required { get; set; }
[JsonPropertyName("description")]
public string? Description { get; set; }
[JsonPropertyName("schema")]
public SchemaModel Schema { get; set; } = new();
[JsonPropertyName("default")]
public object? Default { get; set; }
}
}
+19
View File
@@ -0,0 +1,19 @@
using System.Text.Json.Serialization;
namespace EonaCat.DoxaApi.Models
{
public sealed class RequestBodyModel
{
[JsonPropertyName("required")]
public bool Required { get; set; }
[JsonPropertyName("contentType")]
public string ContentType { get; set; } = "application/json";
[JsonPropertyName("schema")]
public SchemaModel Schema { get; set; } = new();
[JsonPropertyName("example")]
public string? Example { get; set; }
}
}
+16
View File
@@ -0,0 +1,16 @@
using System.Text.Json.Serialization;
namespace EonaCat.DoxaApi.Models
{
public sealed class ResponseModel
{
[JsonPropertyName("statusCode")]
public string StatusCode { get; set; } = "200";
[JsonPropertyName("description")]
public string? Description { get; set; }
[JsonPropertyName("schema")]
public SchemaModel? Schema { get; set; }
}
}
+31
View File
@@ -0,0 +1,31 @@
using System.Text.Json.Serialization;
namespace EonaCat.DoxaApi.Models
{
public sealed class SchemaModel
{
[JsonPropertyName("type")]
public string Type { get; set; } = "object";
[JsonPropertyName("format")]
public string? Format { get; set; }
[JsonPropertyName("refName")]
public string? RefName { get; set; }
[JsonPropertyName("items")]
public SchemaModel? Items { get; set; }
[JsonPropertyName("properties")]
public Dictionary<string, SchemaModel>? Properties { get; set; }
[JsonPropertyName("required")]
public List<string>? Required { get; set; }
[JsonPropertyName("enumValues")]
public List<string>? EnumValues { get; set; }
[JsonPropertyName("nullable")]
public bool Nullable { get; set; }
}
}