Skip to content

Commit 6aa0fde

Browse files
committed
Replace "go-swagger" by "oapi-codegen".
1 parent c7f5e7c commit 6aa0fde

File tree

13 files changed

+49
-479
lines changed

13 files changed

+49
-479
lines changed

.gitignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
.DS_Store
2-
.env
3-
.gobincache/
2+
/.env

Dockerfile

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
ARG GO_VERSION=1.21.3-alpine3.18
2-
ARG GOIMPORTS_VERSION=0.6.0
3-
ARG DELVE_VERSION=1.20.1
4-
ARG SWAGGER_VERSION=0.30.4
2+
ARG DELVE_VERSION=1.21.1
3+
ARG OAPICODEGEN_VERSION=1.15.0
54

65

76
## Base image
@@ -15,9 +14,8 @@ ENV CGO_ENABLED=0
1514
## Development image
1615
FROM base AS development
1716

18-
ARG GOIMPORTS_VERSION
1917
ARG DELVE_VERSION
20-
ARG SWAGGER_VERSION
18+
ARG OAPICODEGEN_VERSION
2119

2220
RUN apk add \
2321
bash \
@@ -26,9 +24,8 @@ RUN apk add \
2624
jq \
2725
python3 \
2826
zsh \
29-
&& go install golang.org/x/tools/cmd/goimports@v${GOIMPORTS_VERSION} \
3027
&& go install github.com/go-delve/delve/cmd/dlv@v${DELVE_VERSION} \
31-
&& go install github.com/go-swagger/go-swagger/cmd/swagger@v${SWAGGER_VERSION}
28+
&& go install github.com/deepmap/oapi-codegen/cmd/oapi-codegen@v${OAPICODEGEN_VERSION}
3229

3330
ARG USER_ID=1000
3431
ENV USER_NAME=default

Makefile

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ define set_env
55
sed $(if $(IS_DARWIN),-i "",-i) -e "s/^#*\($(1)=\).*/$(if $(2),,#)\1$(2)/" .env
66
endef
77

8-
EXEC := docker compose exec app
8+
EXEC := docker compose exec main
99

1010
# Environment recipes
1111
.PHONY: default
@@ -33,8 +33,17 @@ shell:
3333
build:
3434
$(EXEC) ./scripts/set-versions.sh $(NETBOX_VERSION) $(NETBOX_DOCKER_VERSION)
3535
./scripts/fetch-spec.sh $$(cat api/netbox_version) $$(cat api/netbox_docker_version)
36-
$(EXEC) ./scripts/generate-code.sh
36+
$(EXEC) ./scripts/fix-spec.sh
37+
$(EXEC) go generate ./...
38+
39+
.PHONY: deps
40+
deps:
41+
$(EXEC) go mod download
42+
43+
.PHONY: lint
44+
lint:
45+
$(EXEC) go vet ./...
3746

3847
.PHONY: test
3948
test:
40-
$(EXEC) go test ./... -tags=integration
49+
$(EXEC) go test -v ./...

0 commit comments

Comments
 (0)