Skip to content

Commit

Permalink
rename swagger -> openapi
Browse files Browse the repository at this point in the history
  • Loading branch information
Igor Polyakov committed Jun 18, 2024
1 parent e493a64 commit bbcb04b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -79,4 +79,4 @@ attach-db:

# Generate Go server boilerplate from OpenAPI 3
codegen:
oapi-codegen -generate models,chi -o internal/app/server/server.gen.go --package server api/swagger.yaml
oapi-codegen -generate models,chi -o internal/app/server/server.gen.go --package server api/openapi.yaml
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Roadmap [here](TODO.md)
```sh
.
├── api # http openapi schema
│   └── swagger.yaml
│   └── openapi.yaml
├── cmd # main app
│   └── ctf01d
│   └── main.go
Expand Down Expand Up @@ -82,10 +82,10 @@ $ go run cmd/ctf01d/main.go
will be available on - [http://localhost:4102](http://localhost:4102)


### Generate code from swagger schema
### Generate code from openapi schema

```shell
oapi-codegen -generate models,chi -o internal/app/server/server.gen.go --package routers api/swagger.yaml
oapi-codegen -generate models,chi -o internal/app/server/server.gen.go --package routers api/openapi.yaml
```

## DataBase
Expand Down Expand Up @@ -119,9 +119,9 @@ $ docker exec -it ctf01d-postgres psql -U postgres
### fuzz api

```shell
docker run --net=host --volume /home/user/ctf01d-training-platform/api:/api/ ghcr.io/matusf/openapi-fuzzer run -s '/api/swagger.yaml' --url http://localhost:4102
docker run --net=host --volume /home/user/ctf01d-training-platform/api:/api/ ghcr.io/matusf/openapi-fuzzer run -s '/api/openapi.yaml' --url http://localhost:4102

docker run --net=host --volume /home/user/ctf01d-training-platform/api:/api/ kisspeter/apifuzzer --src_file '/api/swagger.yaml' --url http://localhost:4102 -r /api/
docker run --net=host --volume /home/user/ctf01d-training-platform/api:/api/ kisspeter/apifuzzer --src_file '/api/openapi.yaml' --url http://localhost:4102 -r /api/
```


Expand All @@ -132,4 +132,4 @@ install:
```
$ go install github.com/oapi-codegen/oapi-codegen/v2/cmd/oapi-codegen@latest
$ export PATH="$PATH:$HOME/bin:$HOME/go/bin"
```
```
File renamed without changes.

0 comments on commit bbcb04b

Please sign in to comment.