# README
crud-rest-api
REST API for Generic CRUD operations and OpenAPI 3 specification. Library and codegen tool.
Installation
go install github.com/nullc4t/crud-rest-api@latest
Prerequisites
Usage
Bootstrap
First, we need some bootstrap code
crud-rest-api bootstrap -a github.com/nullc4t/crud-rest-api/api -p auth
This will generate files:
api
├── build
├── gen.go
└── src
├── openapi.yaml
├── parameters
│ ├── _index.yaml
│ ├── path
│ │ └── id.yaml
│ └── query
│ ├── limit.yaml
│ ├── offset.yaml
│ └── sort.yaml
├── paths
├── responses
│ ├── BadRequest.yaml
│ ├── Created.yaml
│ ├── NoContent.yaml
│ ├── NotFound.yaml
│ ├── NullResponse.yaml
│ ├── OK.yaml
│ ├── Unauthorized.yaml
│ ├── UnexpectedError.yaml
│ └── _index.yaml
└── schemas
├── Any.yaml
├── AnyNull.yaml
├── BaseModel.yaml
├── Error.yaml
└── _index.yaml
gen.go
Generate
crud-rest-api generate example-config.yaml
go generate
Implement server
See server implementation and run example