Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/cristipufu/aspnetcore-openapi-source-generator
Roslyn source generator that automatically creates ASP.NET Core controllers and models from OpenAPI YAML specifications
https://github.com/cristipufu/aspnetcore-openapi-source-generator
aspnetcore fake-server mock-server net openapi openapi-generator roslyn-analyzer roslyn-generator scriban
Last synced: 21 days ago
JSON representation
Roslyn source generator that automatically creates ASP.NET Core controllers and models from OpenAPI YAML specifications
- Host: GitHub
- URL: https://github.com/cristipufu/aspnetcore-openapi-source-generator
- Owner: cristipufu
- License: mit
- Created: 2024-04-07T07:03:28.000Z (10 months ago)
- Default Branch: master
- Last Pushed: 2024-04-13T05:21:52.000Z (10 months ago)
- Last Synced: 2024-11-21T08:59:34.419Z (2 months ago)
- Topics: aspnetcore, fake-server, mock-server, net, openapi, openapi-generator, roslyn-analyzer, roslyn-generator, scriban
- Language: C#
- Homepage:
- Size: 20.5 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# ASP.NET Web API Source Generator
Quickly set up a CRUD mock API using a Roslyn-based source generator designed to read OpenAPI specifications. Build and run the project with a specified YAML file and you will have a fully functional mock API ready in seconds.
## quick start
Follow these steps to get your mock API server up and running:
### step 1: clone the repository
Clone this repository to your local machine:
```bash
cd aspnetcore-openapi-source-generator/src/OpenApi.WebApi
```
### step 2: run the project
Run the project by specifying the path to your OpenAPI specification YAML file:```bash
dotnet run -p:OpenApiSpecPath="path_to_openapi_spec.yaml"
```Replace `path_to_openapi_spec.yaml` with the path to your OpenAPI YAML file. This command builds and runs the project, generating the necessary API endpoints as defined in your YAML file.
### step 3: browse the API
After the application starts, it will display the URL where the server is hosted. Append `/swagger/index.html` to this URL in your browser to view and interact with your newly created mock API through the Swagger UI.
```bash
http://localhost:5287/swagger/index.html
```## contributing
Contributions are welcome! Feel free to fork this repository and submit pull requests, or open issues to suggest improvements or report bugs.## license
This project is licensed under the MIT License.## support
If you need help or have any questions about using this tool, please open an issue in the repository.