+
+
+
+
+
diff --git a/EonaCat.DoxaApi.sln b/EonaCat.DoxaApi.sln
new file mode 100644
index 0000000..f3829f3
--- /dev/null
+++ b/EonaCat.DoxaApi.sln
@@ -0,0 +1,32 @@
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio Version 18
+VisualStudioVersion = 18.7.11903.348
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EonaCat.DoxaApi", "DoxaApi\EonaCat.DoxaApi.csproj", "{11111111-1111-1111-1111-111111111111}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SampleApi", "sample\SampleApi\SampleApi.csproj", "{22222222-2222-2222-2222-222222222222}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{3B167511-F7C3-4F80-B199-1E02ED686E11}"
+ ProjectSection(SolutionItems) = preProject
+ image.png = image.png
+ EndProjectSection
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Release|Any CPU = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {11111111-1111-1111-1111-111111111111}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {11111111-1111-1111-1111-111111111111}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {11111111-1111-1111-1111-111111111111}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {11111111-1111-1111-1111-111111111111}.Release|Any CPU.Build.0 = Release|Any CPU
+ {22222222-2222-2222-2222-222222222222}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {22222222-2222-2222-2222-222222222222}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {22222222-2222-2222-2222-222222222222}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {22222222-2222-2222-2222-222222222222}.Release|Any CPU.Build.0 = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
diff --git a/LICENSE b/LICENSE
index 494f695..ab37379 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,73 +1,204 @@
-Apache License
-Version 2.0, January 2004
-http://www.apache.org/licenses/
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+ https://EonaCat.com/license/
-TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+ OF SOFTWARE BY EONACAT (JEROEN SAEY)
-1. Definitions.
+ 1. Definitions.
-"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
-"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
-"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
-"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
-"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
-"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
-"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
-"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
-"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
-"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
-2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
-3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
-4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
- (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
- (b) You must cause any modified files to carry prominent notices stating that You changed the files; and
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
- (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
- (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License.
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
- You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
-5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
-6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
-7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
-8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
-9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
-END OF TERMS AND CONDITIONS
+ END OF TERMS AND CONDITIONS
-APPENDIX: How to apply the Apache License to your work.
+ APPENDIX: How to apply the Apache License to your work.
-To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives.
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
-Copyright 2026 EonaCat
+ Copyright [yyyy] [name of copyright owner]
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
-http://www.apache.org/licenses/LICENSE-2.0
+ http://www.apache.org/licenses/LICENSE-2.0
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
diff --git a/README.md b/README.md
index c982bde..62fc359 100644
--- a/README.md
+++ b/README.md
@@ -1,3 +1,162 @@
# EonaCat.DoxaApi
-EonaCat.DoxaApi
\ No newline at end of file
+A self-contained, API documentation UI for ASP.NET Core
+
+EonaCat.DoxaApi scans your controllers with plain `System.Reflection` and ASP.NET Core's own `IActionDescriptorCollectionProvider`,
+builds a small OpenAPI-like JSON document with `System.Text.Json`, and serves a UI
+This can also be used in an offline environment!
+
+
+
+## Install
+
+```bash
+dotnet add package EonaCat.DoxaApi
+```
+
+## Quick start
+
+```csharp
+using EonaCat.DoxaApi;
+using EonaCat.DoxaApi.Middleware;
+
+var builder = WebApplication.CreateBuilder(args);
+builder.Services.AddControllers();
+builder.Services.AddEonaCat.DoxaApi(options =>
+{
+ options.Title = "My API";
+ options.Description = "Internal service API";
+ options.AccentColor = "#6366f1"; // any hex color
+});
+
+var app = builder.Build();
+app.UseRouting();
+app.UseEonaCat.DoxaApi(); // serves UI at /doxa and spec at /doxa/DoxaApi.json
+app.MapControllers();
+
+app.Run();
+```
+
+Run your app and open `https://localhost:xxxx/doxa`.
+
+## Features
+
+- **Route-table style navigation** - endpoints grouped by controller, each method color-coded (GET/POST/PUT/PATCH/DELETE), searchable with `/`.
+- **Schema viewer** - nested request/response shapes rendered as readable, syntax-colored trees, with required fields marked.
+- **Try it out** - a real three-pane layout: browse → inspect → call, with path/query/header inputs, an editable JSON body (pre-filled with a generated example), and a live response panel with status, timing, and syntax-highlighted JSON.
+- **Light & dark themes**, persisted, with a system-preference default.
+- **XML doc comment support** - `/// `, ``, and `` are read directly from your project's generated `.xml` doc file (enable `true` in your csproj).
+- **Attributes for fine control**: `[EonaCat.DoxaApiGroup]`, `[EonaCat.DoxaApiSummary]`, `[EonaCat.DoxaApiDescription]`, `[EonaCat.DoxaApiExample]`, `[EonaCat.DoxaApiHidden]`.
+- **Zero external NuGet dependencies** - only references your app's own ASP.NET Core shared framework.
+
+## Configuration reference
+
+```csharp
+builder.Services.AddEonaCat.DoxaApi(options =>
+{
+ options.Title = "My API"; // shown in the top bar and browser tab
+ options.Description = "..."; // shown on the welcome screen
+ options.Version = "v1";
+ options.RoutePrefix = "doxa"; // UI served at /{RoutePrefix}
+ options.AccentColor = "#6366f1"; // primary button/accent color
+ options.Theme = "auto"; // "auto" | "light" | "dark"
+});
+```
+
+## Attributes
+
+```csharp
+[EonaCat.DoxaApiGroup("Users")] // override the left-nav group name
+public class UsersController : ControllerBase
+{
+ /// Lists all users. // picked up automatically
+ [HttpGet]
+ public ActionResult> GetUsers() => ...;
+
+ [HttpPost]
+ [EonaCat.DoxaApiExample("""{ "name": "Ada" }""")] // overrides the auto-generated example
+ public ActionResult Create(CreateUserRequest request) => ...;
+
+ [HttpDelete("{id}")]
+ [EonaCat.DoxaApiHidden] // omit from docs entirely
+ public IActionResult Delete(Guid id) => ...;
+}
+```
+
+## OpenAPI & Swagger
+
+EonaCat.DoxaApi exposes dedicated endpoints for importing and exporting industry-standard spec formats alongside its own native JSON.
+
+### Export
+
+| URL | Format | Notes |
+|-----|--------|-------|
+| `/{RoutePrefix}/DoxaApi.json` | Native EonaCat.DoxaApi JSON | Always available; used by the built-in UI |
+| `/{RoutePrefix}/openapi.json` | **OpenAPI 3.0.3** | Import into Postman, Insomnia, Stoplight, etc. |
+| `/{RoutePrefix}/swagger.json` | **Swagger 2.0** | Import into older tools, AWS API Gateway, Azure APIM, etc. |
+
+```bash
+# Download the OpenAPI 3.0 spec
+curl http://localhost:5000/doxa/openapi.json -o openapi.json
+
+# Download the Swagger 2.0 spec
+curl http://localhost:5000/doxa/swagger.json -o swagger.json
+```
+
+### Import
+
+`POST /{RoutePrefix}/import`
+
+Send any OpenAPI 3.x or Swagger 2.0 JSON document in the request body. The server detects the format automatically and returns the native EonaCat.DoxaApi document.
+
+```bash
+# Import a third-party OpenAPI spec and get the EonaCat.DoxaApi document back
+curl -X POST http://localhost:5000/doxa/import \
+ -H "Content-Type: application/json" \
+ --data-binary @path/to/openapi.json
+```
+
+**Use cases:**
+- Preview any public or third-party OpenAPI/Swagger spec in the EonaCat.DoxaApi UI
+- Validate that your spec round-trips correctly through import → export
+- Use the import endpoint as a conversion proxy (OpenAPI 3 ↔ Swagger 2)
+
+### Programmatic use
+
+The `OpenApiExporter`, `SwaggerExporter`, and `OpenApiImporter` classes in the
+`EonaCat.DoxaApi.Interop` namespace are `public static` and can be used directly in your
+own code:
+
+```csharp
+using EonaCat.DoxaApi.Interop;
+using EonaCat.DoxaApi.Models;
+
+// Export: ApiDocument → OpenAPI 3.0 JsonObject
+ApiDocument doc = /* ... */;
+System.Text.Json.Nodes.JsonObject openApi = OpenApiExporter.Export(doc);
+string json = openApi.ToJsonString(new JsonSerializerOptions { WriteIndented = true });
+
+// Export: ApiDocument → Swagger 2.0 JsonObject
+System.Text.Json.Nodes.JsonObject swagger = SwaggerExporter.Export(doc);
+
+// Import: OpenAPI 3.x or Swagger 2.0 string → ApiDocument
+ApiDocument imported = OpenApiImporter.Import(File.ReadAllText("openapi.json"));
+
+// Import from a Stream
+await using var stream = File.OpenRead("swagger.json");
+ApiDocument imported2 = OpenApiImporter.Import(stream);
+```
+
+## Sample project
+
+See `/sample/SampleApi` for a complete working example with two controllers (`Users`, `Orders`) demonstrating nested objects, enums, arrays, path/query parameters, and a deprecated endpoint.
+
+```bash
+cd sample/SampleApi
+dotnet run
+# open http://localhost:5000/doxa
+```
+
+## License
+
+MIT
diff --git a/icon.png b/icon.png
new file mode 100644
index 0000000..0595b89
Binary files /dev/null and b/icon.png differ
diff --git a/image.png b/image.png
new file mode 100644
index 0000000..5ec406a
Binary files /dev/null and b/image.png differ
diff --git a/sample/SampleApi/Controllers/OrdersController.cs b/sample/SampleApi/Controllers/OrdersController.cs
new file mode 100644
index 0000000..61a8c46
--- /dev/null
+++ b/sample/SampleApi/Controllers/OrdersController.cs
@@ -0,0 +1,54 @@
+using EonaCat.DoxaApi.Attributes;
+using Microsoft.AspNetCore.Mvc;
+using SampleApi.Models;
+
+namespace SampleApi.Controllers
+{
+ [ApiController]
+ [Route("api/orders")]
+ [DoxaApiGroup("Orders")]
+ public class OrdersController : ControllerBase
+ {
+ private static readonly List _orders = new();
+
+ [HttpGet]
+ public ActionResult> GetOrders()
+ => Ok(_orders.OrderByDescending(o => o.PlacedAt).ToList());
+
+ [HttpGet("{id}")]
+ public ActionResult GetById(Guid id)
+ {
+ var order = _orders.FirstOrDefault(o => o.Id == id);
+ return order is null ? NotFound() : Ok(order);
+ }
+
+ [HttpPost]
+ public ActionResult Create([FromBody] CreateOrderRequest request)
+ {
+ var order = new Order
+ {
+ Id = Guid.NewGuid(),
+ UserId = request.UserId,
+ Lines = request.Lines,
+ Total = request.Lines.Sum(l => l.UnitPrice * l.Quantity),
+ Status = OrderStatus.Pending,
+ PlacedAt = DateTime.UtcNow
+ };
+ _orders.Add(order);
+ return CreatedAtAction(nameof(GetById), new { id = order.Id }, order);
+ }
+
+ [HttpPost("{id}/cancel")]
+ public ActionResult Cancel(Guid id)
+ {
+ var order = _orders.FirstOrDefault(o => o.Id == id);
+ if (order is null)
+ {
+ return NotFound();
+ }
+
+ order.Status = OrderStatus.Cancelled;
+ return Ok(order);
+ }
+ }
+}
diff --git a/sample/SampleApi/Controllers/UsersController.cs b/sample/SampleApi/Controllers/UsersController.cs
new file mode 100644
index 0000000..dd9a61b
--- /dev/null
+++ b/sample/SampleApi/Controllers/UsersController.cs
@@ -0,0 +1,102 @@
+using EonaCat.DoxaApi.Attributes;
+using Microsoft.AspNetCore.Mvc;
+using SampleApi.Models;
+
+namespace SampleApi.Controllers
+{
+ [ApiController]
+ [Route("api/users")]
+ [DoxaApiGroup("Users")]
+ public class UsersController : ControllerBase
+ {
+ private static readonly List _users = new()
+ {
+ new User { Id = Guid.NewGuid(), Name = "Ada Lovelace", Email = "ada@example.com", Role = UserRole.Admin, CreatedAt = DateTime.UtcNow },
+ new User { Id = Guid.NewGuid(), Name = "Alan Turing", Email = "alan@example.com", Role = UserRole.Member, CreatedAt = DateTime.UtcNow },
+ };
+
+ [HttpGet]
+ public ActionResult> GetUsers([FromQuery] UserRole? role, [FromQuery] int page = 1)
+ {
+ var query = _users.AsEnumerable();
+ if (role is not null)
+ {
+ query = query.Where(u => u.Role == role);
+ }
+
+ return Ok(query.ToList());
+ }
+
+ [HttpGet("{id}")]
+ public ActionResult GetById(Guid id)
+ {
+ var user = _users.FirstOrDefault(u => u.Id == id);
+ return user is null ? NotFound() : Ok(user);
+ }
+
+ [HttpPost]
+ [DoxaApiExample("""
+ {
+ "name": "Grace Hopper",
+ "email": "grace@example.com",
+ "role": "Member",
+ "address": { "street": "1 Compiler Way", "city": "Arlington", "postalCode": "22201", "country": "US" }
+ }
+ """)]
+ public ActionResult Create([FromBody] CreateUserRequest request)
+ {
+ var user = new User
+ {
+ Id = Guid.NewGuid(),
+ Name = request.Name,
+ Email = request.Email,
+ Role = request.Role,
+ Address = request.Address,
+ CreatedAt = DateTime.UtcNow
+ };
+ _users.Add(user);
+ return CreatedAtAction(nameof(GetById), new { id = user.Id }, user);
+ }
+
+ [HttpPatch("{id}")]
+ public ActionResult Update(Guid id, [FromBody] UpdateUserRequest request)
+ {
+ var user = _users.FirstOrDefault(u => u.Id == id);
+ if (user is null)
+ {
+ return NotFound();
+ }
+
+ if (request.Name is not null)
+ {
+ user.Name = request.Name;
+ }
+
+ if (request.Email is not null)
+ {
+ user.Email = request.Email;
+ }
+
+ if (request.Role is not null)
+ {
+ user.Role = request.Role.Value;
+ }
+
+ return Ok(user);
+ }
+
+ [HttpDelete("{id}")]
+ [Obsolete("Use POST /api/users/{id}/archive instead.")]
+ public IActionResult Delete(Guid id)
+ {
+ var user = _users.FirstOrDefault(u => u.Id == id);
+ if (user is null)
+ {
+ return NotFound();
+ }
+
+ _users.Remove(user);
+ return NoContent();
+ }
+ }
+}
diff --git a/sample/SampleApi/Models/Models.cs b/sample/SampleApi/Models/Models.cs
new file mode 100644
index 0000000..a033c62
--- /dev/null
+++ b/sample/SampleApi/Models/Models.cs
@@ -0,0 +1,86 @@
+namespace SampleApi.Models
+{
+ public enum UserRole
+ {
+ Admin,
+ Member,
+ Guest
+ }
+
+ public class User
+ {
+
+ public Guid Id { get; set; }
+
+ public string Name { get; set; } = "";
+
+ public string Email { get; set; } = "";
+
+ public UserRole Role { get; set; }
+
+ public DateTime CreatedAt { get; set; }
+
+ public Address? Address { get; set; }
+
+ public List Tags { get; set; } = new();
+ }
+
+ public class Address
+ {
+ public string Street { get; set; } = "";
+ public string City { get; set; } = "";
+ public string PostalCode { get; set; } = "";
+ public string Country { get; set; } = "";
+ }
+
+ public class CreateUserRequest
+ {
+
+ public string Name { get; set; } = "";
+
+ public string Email { get; set; } = "";
+
+ public UserRole Role { get; set; } = UserRole.Member;
+
+ public Address? Address { get; set; }
+ }
+
+ public class UpdateUserRequest
+ {
+ public string? Name { get; set; }
+ public string? Email { get; set; }
+ public UserRole? Role { get; set; }
+ }
+
+ public class Order
+ {
+ public Guid Id { get; set; }
+ public Guid UserId { get; set; }
+ public List Lines { get; set; } = new();
+ public decimal Total { get; set; }
+ public OrderStatus Status { get; set; }
+ public DateTime PlacedAt { get; set; }
+ }
+
+ public class OrderLine
+ {
+ public string Sku { get; set; } = "";
+ public int Quantity { get; set; }
+ public decimal UnitPrice { get; set; }
+ }
+
+ public enum OrderStatus
+ {
+ Pending,
+ Paid,
+ Shipped,
+ Delivered,
+ Cancelled
+ }
+
+ public class CreateOrderRequest
+ {
+ public Guid UserId { get; set; }
+ public List Lines { get; set; } = new();
+ }
+}
diff --git a/sample/SampleApi/Program.cs b/sample/SampleApi/Program.cs
new file mode 100644
index 0000000..eece97d
--- /dev/null
+++ b/sample/SampleApi/Program.cs
@@ -0,0 +1,27 @@
+using EonaCat.DoxaApi;
+using EonaCat.DoxaApi.Middleware;
+
+var builder = WebApplication.CreateBuilder(args);
+
+builder.Services.AddControllers();
+builder.Services.AddDoxaApi(options =>
+{
+ options.Title = "Sample API";
+ options.Description = "A demo service showing off the DoxaApi UI - users and orders.";
+ options.Version = "v1";
+ options.AccentColor = "#6366f1";
+});
+
+var app = builder.Build();
+
+app.UseRouting();
+
+app.UseDoxaApi(options =>
+{
+
+ options.RoutePrefix = "doxa";
+});
+
+app.MapControllers();
+app.MapGet("/", () => Results.Redirect("/doxa"));
+app.Run();
diff --git a/sample/SampleApi/Properties/launchSettings.json b/sample/SampleApi/Properties/launchSettings.json
new file mode 100644
index 0000000..38c14d7
--- /dev/null
+++ b/sample/SampleApi/Properties/launchSettings.json
@@ -0,0 +1,12 @@
+{
+ "profiles": {
+ "SampleApi": {
+ "commandName": "Project",
+ "launchBrowser": true,
+ "environmentVariables": {
+ "ASPNETCORE_ENVIRONMENT": "Development"
+ },
+ "applicationUrl": "https://localhost:53010;http://localhost:53011"
+ }
+ }
+}
\ No newline at end of file
diff --git a/sample/SampleApi/SampleApi.csproj b/sample/SampleApi/SampleApi.csproj
new file mode 100644
index 0000000..98d4fca
--- /dev/null
+++ b/sample/SampleApi/SampleApi.csproj
@@ -0,0 +1,19 @@
+
+
+
+ net8.0
+ enable
+ enable
+ true
+ $(NoWarn);CS1591
+
+
+
+
+
+
+
+