generated from Patagia/template-nix
Compare commits
1 commit
13819278fe
...
1fd9d45ff7
Author | SHA1 | Date | |
---|---|---|---|
1fd9d45ff7 |
3 changed files with 67 additions and 1 deletions
62
api.json
62
api.json
|
@ -5,6 +5,44 @@
|
|||
"version": "1.0.0"
|
||||
},
|
||||
"paths": {
|
||||
"/users/{userId}": {
|
||||
"get": {
|
||||
"tags": [
|
||||
"user"
|
||||
],
|
||||
"summary": "Fetch user info.",
|
||||
"operationId": "get_user_by_id",
|
||||
"parameters": [
|
||||
{
|
||||
"in": "path",
|
||||
"name": "userId",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"type": "string",
|
||||
"format": "uuid"
|
||||
}
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "successful operation",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/User"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"4XX": {
|
||||
"$ref": "#/components/responses/Error"
|
||||
},
|
||||
"5XX": {
|
||||
"$ref": "#/components/responses/Error"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/version": {
|
||||
"get": {
|
||||
"summary": "Fetch version info.",
|
||||
|
@ -51,6 +89,23 @@
|
|||
"request_id"
|
||||
]
|
||||
},
|
||||
"User": {
|
||||
"description": "User",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "string",
|
||||
"format": "uuid"
|
||||
},
|
||||
"name": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"id",
|
||||
"name"
|
||||
]
|
||||
},
|
||||
"VersionInfo": {
|
||||
"description": "Version and build information",
|
||||
"type": "object",
|
||||
|
@ -80,5 +135,10 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"tags": [
|
||||
{
|
||||
"name": "user"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
@ -49,6 +49,7 @@
|
|||
root = ./.;
|
||||
fileset = pkgs.lib.fileset.unions [
|
||||
./api.json
|
||||
./controller/.sqlx
|
||||
(craneLib.fileset.commonCargoSources ./.)
|
||||
];
|
||||
};
|
||||
|
@ -116,6 +117,7 @@
|
|||
formatter =
|
||||
(treefmt-nix.lib.evalModule pkgs {
|
||||
projectRootFile = "flake.nix";
|
||||
|
||||
programs = {
|
||||
nixfmt.enable = true;
|
||||
nixfmt.package = pkgs.nixfmt-rfc-style;
|
||||
|
|
4
justfile
4
justfile
|
@ -50,6 +50,10 @@ machete:
|
|||
open-api:
|
||||
cargo xtask open-api
|
||||
|
||||
# Update OpenAPI spec
|
||||
open-api-update:
|
||||
cargo xtask open-api > api.json
|
||||
|
||||
# Run all tests
|
||||
check: check-nix
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue