Skip to content

Commit f72f549

Browse files
committed
BUILD/MAJOR: swagger: honor default values for fields set in the specification
1 parent bc5f8b1 commit f72f549

File tree

11 files changed

+424
-14
lines changed

11 files changed

+424
-14
lines changed

Makefile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,19 +33,19 @@ spec:
3333
go run cmd/specification/*.go -file specification/haproxy-spec.yaml > specification/build/haproxy_spec.yaml
3434

3535
.PHONY: models
36-
models: gentypes spec swagger-check go-method-gen-check
36+
models: gentypes spec swagger-check go-method-gen-check
37+
rm -rf models/
3738
./bin/swagger generate model --additional-initialism=FCGI -f ${PROJECT_PATH}/specification/build/haproxy_spec.yaml -r ${PROJECT_PATH}/specification/copyright.txt -m models -t ${PROJECT_PATH}
38-
rm -rf models/server_params_prepare_for_runtime.go
39-
rm -rf models/*_generated*.go
40-
rm -rf models/*_compare_test.go
4139
./bin/go-method-gen --header-file=specification/copyright.txt --scan=models --debug --overrides=models/funcs/overrides.yaml && find ./generated -name "*.go" -exec cp {} ./models \; && rm -rf generated
4240
go run cmd/struct_equal_generator/*.go -l ${PROJECT_PATH}/specification/copyright.txt ${PROJECT_PATH}/models
4341
go run cmd/struct_tags_checker/*.go ${PROJECT_PATH}/models
4442
go run cmd/kubebuilder_marker_generator/*.go ${PROJECT_PATH}/models
4543
go run cmd/server_params_runtime/*.go ${PROJECT_PATH}/models
44+
go run cmd/defaults-setter/main.go ${PROJECT_PATH}/specification/build/haproxy_spec.yaml ${PROJECT_PATH}/models
45+
$(MAKE) gofumpt
4646

4747
.PHONY: go-method-gen-check
48-
go-method-gen-check:
48+
go-method-gen-check:
4949
@GO_METHOD_GEN_BIN_NAME="go-method-gen"; \
5050
GO_METHOD_GEN_GITHUB="github.com/haproxytech/go-method-gen/cmd/go-method-gen@latest"; \
5151
if [ -f "$$GO_METHOD_GEN_BIN_NAME" ]; then \

0 commit comments

Comments
 (0)