|
2 | 2 |
|
3 | 3 | [](https://github.com/Software-Hardware-Integration-Lab/OpenAPI/actions/workflows/Validate.yml) |
4 | 4 |
|
5 | | -This repository contains the OpenAPI specifications for SHI International Corp's APIs. These specifications are used to define the structure and behavior of our APIs, enabling seamless integration and interaction between different services within the SHI ecosystem. |
| 5 | +This repository contains the OpenAPI specifications for SHI International Corp's APIs. These specifications define the structure and behavior of our APIs, enabling seamless integration and interaction between different services within the SHI ecosystem. |
6 | 6 |
|
7 | | -## Add Submodule |
| 7 | +## Repository Structure |
8 | 8 |
|
9 | | -This repository serves as a submodule in other SHI International Corp. projects, allowing for easy access to the API specifications. The specifications are used to automatically generate boilerplate code, aiding in the development and maintenance of our services. |
| 9 | +```text |
| 10 | +. |
| 11 | +├── specs/ # Raw OpenAPI specification files (JSON format) |
| 12 | +├── src/ |
| 13 | +│ ├── dataGateway/ # Source code and SDK for Data Gateway |
| 14 | +│ └── shield/ # Source code and SDK for SHIELD |
| 15 | +└── .github/workflows/ # CI/CD workflows for validation and SDK generation |
| 16 | +``` |
| 17 | + |
| 18 | +- `specs/`: Contains raw OpenAPI specification files in JSON format. These files serve as the source of truth for our APIs and are used to automatically generate SDKs. |
| 19 | + |
| 20 | +- `src/`: Contains SDK implementations automatically generated from the OpenAPI specifications using [Kiota](https://github.com/microsoft/kiota). |
| 21 | + |
| 22 | +## Using the Specifications |
| 23 | + |
| 24 | +### Accessing Raw Specifications |
| 25 | + |
| 26 | +The raw OpenAPI specification files are located in the [`specs`](./specs) folder. |
| 27 | +All specifications are provided in JSON format. |
10 | 28 |
|
11 | | -All specifications are to be in JSON format, not YAML. |
| 29 | +### Using Published SDK Packages |
12 | 30 |
|
13 | | -To use these specifications in your project, follow these steps: |
| 31 | +We provide SDK packages generated from these specifications, available on npm: |
14 | 32 |
|
15 | | -1\. **Clone the Repository**: Include this repository as a submodule in your project by running: |
| 33 | +- [SHI - Data Gateway SDK](https://www.npmjs.com/package/@shi-corp/sdk-data-gateway) |
| 34 | +- [SHIELD SDK](https://www.npmjs.com/package/@shi-corp/sdk-shield) |
| 35 | + |
| 36 | +You can install these packages using npm: |
16 | 37 |
|
17 | 38 | ```bash |
18 | | -git submodule add https://github.com/Software-Hardware-Integration-Lab/OpenAPI |
| 39 | +npm install @shi-corp/sdk-data-gateway |
19 | 40 | ``` |
20 | 41 |
|
21 | | -2\. **Accessing API Specifications**: The API specifications are located in the root directory. Refer to the specific OpenAPI spec JSON files for detailed API documentation. |
| 42 | +or |
| 43 | + |
| 44 | +```bash |
| 45 | +npm install @shi-corp/sdk-shield |
| 46 | +``` |
22 | 47 |
|
23 | | -## Update Submodule |
| 48 | +Our packages are cryptographically attested upon publishing, ensuring higher security assurance. |
24 | 49 |
|
25 | | -The API specs change over time and it will become necessary to update the specs in various repositories. |
| 50 | +## Development |
26 | 51 |
|
27 | | -To do this, execute the following command in the project's root directory: |
| 52 | +To regenerate SDKs from the OpenAPI specifications, use the provided scripts in each SDK's directory: |
28 | 53 |
|
29 | 54 | ```bash |
30 | | -git submodule update --recursive --remote |
| 55 | +npm run-script generate:Sdk |
31 | 56 | ``` |
32 | 57 |
|
| 58 | +## Security Assurance |
| 59 | + |
| 60 | +All SDK packages published by SHI International Corp. are cryptographically attested during the publishing process. This ensures the integrity and authenticity of the packages you consume. |
| 61 | + |
33 | 62 | ## Contributing |
34 | 63 |
|
35 | | -We welcome contributions and feedback on our API specifications. If you would like to propose changes or improvements, please follow these steps: |
| 64 | +To contribute to the specifications or SDKs: |
36 | 65 |
|
37 | 66 | 1. Fork the repository and create a new branch for your changes. |
38 | | -2. Make the necessary modifications to the API specifications. |
| 67 | +2. Make the necessary modifications to the API specifications or SDK generation scripts. |
39 | 68 | 3. Submit a pull request detailing the changes made and the rationale behind them. |
40 | 69 |
|
41 | 70 | ## See Also |
42 | 71 |
|
43 | 72 | - [SHI Lab - Documentation](https://docs.shilab.com) |
44 | | -- [SHI Lab - GitHub](https://github.com/Software-Hardware-Integration-Lab) |
|
0 commit comments