You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Welcome to the `Pandatech.SharedKernel` NuGet package, a centralized library designed to streamline development across all PandaTech projects. This package consolidates shared configurations, utilities, and extensions into a single, reusable resource.
4
4
5
-
## Features
5
+
Though this package is primarily intended for internal use, it is publicly available for anyone who may find it useful. We recommend forking or copying the classes in this repository and creating your own package to suit your needs.
6
6
7
-
## Installation
7
+
By leveraging this shared kernel, we aim to:
8
8
9
-
## Usage
9
+
- Reduce the amount of boilerplate code required to start a new project.
10
+
- Ensure consistency across all PandaTech projects.
11
+
- Simplify the process of updating shared configurations and utilities.
10
12
11
-
## License
13
+
## Scope
12
14
13
-
Pandatech.*** is licensed under the MIT License.
15
+
This package currently supports:
16
+
17
+
-**OpenAPI Configuration** with SwaggerUI and Scalar.
18
+
19
+
20
+
## OpenAPI
21
+
22
+
`Microsoft.AspNetCore.OpenApi` is the new standard for creating OpenAPI JSON files. We have adopted this library instead of Swashbuckle for generating OpenAPI definitions. While using this new library, we have integrated `SwaggerUI` and `Scalar` to provide user-friendly interfaces in addition to the JSON files.
23
+
24
+
### Key Features
25
+
26
+
-**Multiple API Documents:** Easily define and organize multiple API documentation groups.
27
+
-**Enum String Values:** Enum string values are automatically displayed in the documentation, simplifying integration for external partners.
28
+
-**Customizable SwaggerUI:** Add custom styles and JavaScript to tailor the UI.
29
+
-**Security Schemes:** Configure security headers directly in your OpenAPI settings.
30
+
31
+
32
+
### Adding OpenAPI to Your Project
33
+
34
+
To enable OpenAPI in your project, add the following code:
35
+
36
+
```csharp
37
+
varbuilder=WebApplication.CreateBuilder(args);
38
+
builder.AddOpenApi();
39
+
varapp=builder.Build();
40
+
app.UseOpenApi();
41
+
app.Run();
42
+
```
43
+
44
+
You can also customize the `AddOpenApi` method with options:
-**For External Use:** If you set `ForExternalUse: true` for a document, it will be available both within the regular SwaggerUI and a separate SwaggerUI instance. This allows you to provide a dedicated URL to external partners while keeping internal documents private.
108
+
-**Scalar UI Limitations:** Scalar currently does not support multiple documents within a single URL. Consequently, all documents in Scalar will be separated into individual URLs. Support for multiple documents is expected in future Scalar updates.
109
+
110
+
### Example URLs
111
+
112
+
Based on the above configuration, the UI will be accessible at the following URLs:
0 commit comments