Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 2 additions & 25 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest]
go-version: ['1.23', '1.24']
go-version: ['1.23', '1.24', '1.25']

steps:
- name: 📥 Checkout
Expand Down Expand Up @@ -96,32 +96,13 @@ jobs:
fail_ci_if_error: false
verbose: true

# ========================================
# Security Scan
# ========================================
security:
name: 🔒 Security Scan
runs-on: ubuntu-latest
timeout-minutes: 10
needs: quality
if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository)

steps:
- name: 📥 Checkout
uses: actions/checkout@v4

- name: Run Gosec Security Scanner
uses: securego/gosec@master
with:
args: './...'

# ========================================
# Final Status Check
# ========================================
ci-success:
name: ✅ CI Success
runs-on: ubuntu-latest
needs: [quality, test, security]
needs: [quality, test]
if: always()

steps:
Expand All @@ -135,8 +116,4 @@ jobs:
echo "Tests failed"
exit 1
fi
if [[ "${{ needs.security.result }}" != "success" && "${{ needs.security.result }}" != "skipped" ]]; then
echo "Security scan failed"
exit 1
fi
echo "All CI checks passed! 🎉"
447 changes: 447 additions & 0 deletions .golangci.yml

Large diffs are not rendered by default.

11 changes: 8 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ YELLOW := \033[1;33m
BLUE := \033[0;34m
NC := \033[0m # No Color

# Tool versions
GOLANGCI_LINT_VERSION := v2.3.1
GOTESTSUM_VERSION := v1.12.3

# Ensure all targets are marked as phony to avoid conflicts with filenames.
.PHONY: test test-adapter test-update testcov testcov-html
.PHONY: tidy sync lint check tidy-all
Expand Down Expand Up @@ -109,7 +113,8 @@ lint: ## Run linting
@echo "$(GREEN)✅ Core linting passed$(NC)"
@for a in $(ADAPTERS); do \
echo "$(BLUE)🔍 Linting adapter/$$a...$(NC)"; \
(cd "adapter/$$a" && golangci-lint run) || (echo "$(RED)❌ Adapter $$a linting failed$(NC)" && exit 1); \
golangci-lint run ./adapter/$$a/... || \
(echo "$(RED)❌ Adapter $$a linting failed$(NC)" && exit 1); \
done
@echo "$(GREEN)🎉 All linting passed!$(NC)"

Expand All @@ -118,8 +123,8 @@ check: sync tidy lint test ## Run all local development checks

install-tools: ## Install development tools
@echo "$(BLUE)📦 Installing development tools...$(NC)"
@go install gotest.tools/gotestsum@latest
@go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
@go install gotest.tools/gotestsum@$(GOTESTSUM_VERSION)
@go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@$(GOLANGCI_LINT_VERSION)
@echo "$(GREEN)✅ Tools installed successfully!$(NC)"

list-adapters: ## List available adapters
Expand Down
3 changes: 2 additions & 1 deletion adapter/chiopenapi/examples/basic/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@ require (
)

require (
github.com/kr/text v0.1.0 // indirect
github.com/oaswrap/spec-ui v0.1.4 // indirect
github.com/swaggest/jsonschema-go v0.3.78 // indirect
github.com/swaggest/openapi-go v0.2.59 // indirect
github.com/swaggest/openapi-go v0.2.60 // indirect
github.com/swaggest/refl v1.4.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
)
Expand Down
10 changes: 5 additions & 5 deletions adapter/chiopenapi/examples/basic/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=
github.com/iancoleman/orderedmap v0.3.0 h1:5cbR2grmZR/DiVt+VJopEhtVs9YGInGIxAoMJn+Ichc=
github.com/iancoleman/orderedmap v0.3.0/go.mod h1:XuLcCUkdL5owUCQeF2Ue9uuw1EptkJDkXXS7VoV7XGE=
github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI=
github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
github.com/oaswrap/spec v0.3.3 h1:ezFH6wflfTrDUo7sxk6iRi+dWWbkdzqRW8xXw139oVw=
github.com/oaswrap/spec v0.3.3/go.mod h1:cQiboTAf466DfgKGbFe0wCA14wXSBfhPcGMM0/zN1V8=
github.com/oaswrap/spec-ui v0.1.4 h1:XM2Z/ZS2Su90EtDSVuOHGr2+DLpVc2933mxkn6F4aeU=
Expand All @@ -18,22 +20,20 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/sergi/go-diff v1.3.1 h1:xkr+Oxo4BOQKmkn/B9eMK0g5Kg/983T9DqqPHwYqD+8=
github.com/sergi/go-diff v1.3.1/go.mod h1:aMJSSKb2lpPvRNec0+w3fl7LP9IOFzdc9Pa4NFbPK1I=
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U=
github.com/swaggest/assertjson v1.9.0 h1:dKu0BfJkIxv/xe//mkCrK5yZbs79jL7OVf9Ija7o2xQ=
github.com/swaggest/assertjson v1.9.0/go.mod h1:b+ZKX2VRiUjxfUIal0HDN85W0nHPAYUbYH5WkkSsFsU=
github.com/swaggest/jsonschema-go v0.3.78 h1:5+YFQrLxOR8z6CHvgtZc42WRy/Q9zRQQ4HoAxlinlHw=
github.com/swaggest/jsonschema-go v0.3.78/go.mod h1:4nniXBuE+FIGkOGuidjOINMH7OEqZK3HCSbfDuLRI0g=
github.com/swaggest/openapi-go v0.2.59 h1:9cUlCrSxbWn/Qn78IxitrhB5kaev0hOROfTxwywYLC0=
github.com/swaggest/openapi-go v0.2.59/go.mod h1:jmFOuYdsWGtHU0BOuILlHZQJxLqHiAE6en+baE+QQUk=
github.com/swaggest/openapi-go v0.2.60 h1:kglHH/WIfqAglfuWL4tu0LPakqNYySzklUWx06SjSKo=
github.com/swaggest/refl v1.4.0 h1:CftOSdTqRqs100xpFOT/Rifss5xBV/CT0S/FN60Xe9k=
github.com/swaggest/refl v1.4.0/go.mod h1:4uUVFVfPJ0NSX9FPwMPspeHos9wPFlCMGoPRllUbpvA=
github.com/yudai/gojsondiff v1.0.0 h1:27cbfqXLVEJ1o8I6v3y9lg8Ydm53EKqHXAOMxEGlCOA=
github.com/yudai/gojsondiff v1.0.0/go.mod h1:AY32+k2cwILAkW1fbgxQ5mUmMiZFgLIV+FBNExI05xg=
github.com/yudai/golcs v0.0.0-20170316035057-ecda9a501e82 h1:BHyfKlQyqbsFN5p3IfnEUduWvb9is428/nNb5L3U01M=
github.com/yudai/golcs v0.0.0-20170316035057-ecda9a501e82/go.mod h1:lgjkn3NuSvDfVJdfcVVdX+jpBxNmX4rDAzaS45IcYoM=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo=
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
Expand Down
6 changes: 4 additions & 2 deletions adapter/chiopenapi/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,18 @@ require (
github.com/go-chi/chi/v5 v5.2.2
github.com/oaswrap/spec v0.3.3
github.com/oaswrap/spec-ui v0.1.4
github.com/stretchr/testify v1.10.0
github.com/stretchr/testify v1.11.1
)

require (
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/google/go-cmp v0.7.0 // indirect
github.com/kr/pretty v0.1.0 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/swaggest/jsonschema-go v0.3.78 // indirect
github.com/swaggest/openapi-go v0.2.59 // indirect
github.com/swaggest/openapi-go v0.2.60 // indirect
github.com/swaggest/refl v1.4.0 // indirect
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
16 changes: 11 additions & 5 deletions adapter/chiopenapi/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=
github.com/iancoleman/orderedmap v0.3.0 h1:5cbR2grmZR/DiVt+VJopEhtVs9YGInGIxAoMJn+Ichc=
github.com/iancoleman/orderedmap v0.3.0/go.mod h1:XuLcCUkdL5owUCQeF2Ue9uuw1EptkJDkXXS7VoV7XGE=
github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI=
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/oaswrap/spec v0.3.3 h1:ezFH6wflfTrDUo7sxk6iRi+dWWbkdzqRW8xXw139oVw=
github.com/oaswrap/spec v0.3.3/go.mod h1:cQiboTAf466DfgKGbFe0wCA14wXSBfhPcGMM0/zN1V8=
github.com/oaswrap/spec-ui v0.1.4 h1:XM2Z/ZS2Su90EtDSVuOHGr2+DLpVc2933mxkn6F4aeU=
Expand All @@ -18,22 +23,23 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/sergi/go-diff v1.3.1 h1:xkr+Oxo4BOQKmkn/B9eMK0g5Kg/983T9DqqPHwYqD+8=
github.com/sergi/go-diff v1.3.1/go.mod h1:aMJSSKb2lpPvRNec0+w3fl7LP9IOFzdc9Pa4NFbPK1I=
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U=
github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=
github.com/swaggest/assertjson v1.9.0 h1:dKu0BfJkIxv/xe//mkCrK5yZbs79jL7OVf9Ija7o2xQ=
github.com/swaggest/assertjson v1.9.0/go.mod h1:b+ZKX2VRiUjxfUIal0HDN85W0nHPAYUbYH5WkkSsFsU=
github.com/swaggest/jsonschema-go v0.3.78 h1:5+YFQrLxOR8z6CHvgtZc42WRy/Q9zRQQ4HoAxlinlHw=
github.com/swaggest/jsonschema-go v0.3.78/go.mod h1:4nniXBuE+FIGkOGuidjOINMH7OEqZK3HCSbfDuLRI0g=
github.com/swaggest/openapi-go v0.2.59 h1:9cUlCrSxbWn/Qn78IxitrhB5kaev0hOROfTxwywYLC0=
github.com/swaggest/openapi-go v0.2.59/go.mod h1:jmFOuYdsWGtHU0BOuILlHZQJxLqHiAE6en+baE+QQUk=
github.com/swaggest/openapi-go v0.2.60 h1:kglHH/WIfqAglfuWL4tu0LPakqNYySzklUWx06SjSKo=
github.com/swaggest/openapi-go v0.2.60/go.mod h1:jmFOuYdsWGtHU0BOuILlHZQJxLqHiAE6en+baE+QQUk=
github.com/swaggest/refl v1.4.0 h1:CftOSdTqRqs100xpFOT/Rifss5xBV/CT0S/FN60Xe9k=
github.com/swaggest/refl v1.4.0/go.mod h1:4uUVFVfPJ0NSX9FPwMPspeHos9wPFlCMGoPRllUbpvA=
github.com/yudai/gojsondiff v1.0.0 h1:27cbfqXLVEJ1o8I6v3y9lg8Ydm53EKqHXAOMxEGlCOA=
github.com/yudai/gojsondiff v1.0.0/go.mod h1:AY32+k2cwILAkW1fbgxQ5mUmMiZFgLIV+FBNExI05xg=
github.com/yudai/golcs v0.0.0-20170316035057-ecda9a501e82 h1:BHyfKlQyqbsFN5p3IfnEUduWvb9is428/nNb5L3U01M=
github.com/yudai/golcs v0.0.0-20170316035057-ecda9a501e82/go.mod h1:lgjkn3NuSvDfVJdfcVVdX+jpBxNmX4rDAzaS45IcYoM=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo=
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
Expand Down
39 changes: 23 additions & 16 deletions adapter/chiopenapi/router_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import (
"github.com/stretchr/testify/require"
)

//nolint:gochecknoglobals // test flag for golden file updates
var update = flag.Bool("update", false, "update golden files")

func TestRouter_Spec(t *testing.T) {
Expand Down Expand Up @@ -119,7 +120,7 @@ func TestRouter_Spec(t *testing.T) {
option.Summary("Upload an image for a pet"),
option.Description("Uploads an image for a pet."),
option.Request(new(dto.UploadImageRequest)),
option.Response(200, new(dto.ApiResponse)),
option.Response(200, new(dto.APIResponse)),
)
r.Get("/{petId}", nil).With(
option.OperationID("getPetById"),
Expand Down Expand Up @@ -207,8 +208,9 @@ func TestRouter_Spec(t *testing.T) {
option.Summary("Update an existing user"),
option.Description("Update the details of an existing user."),
option.Request(new(struct {
Username string `path:"username" required:"true"`
dto.PetUser

Username string `path:"username" required:"true"`
})),
option.Response(200, new(dto.PetUser)),
option.Response(404, nil),
Expand Down Expand Up @@ -251,11 +253,11 @@ func TestRouter_Spec(t *testing.T) {

if tt.shouldErr {
err := r.Validate()
assert.Error(t, err, "expected error for invalid OpenAPI configuration")
require.Error(t, err, "expected error for invalid OpenAPI configuration")
return
}
err := r.Validate()
assert.NoError(t, err, "failed to validate OpenAPI configuration")
require.NoError(t, err, "failed to validate OpenAPI configuration")

// Test the OpenAPI schema generation
schema, err := r.GenerateSchema()
Expand All @@ -277,7 +279,7 @@ func TestRouter_Spec(t *testing.T) {
}
}

func pingHandler(w http.ResponseWriter, r *http.Request) {
func pingHandler(w http.ResponseWriter, _ *http.Request) {
w.WriteHeader(http.StatusOK)
_ = json.NewEncoder(w).Encode(map[string]string{"message": "pong"})
}
Expand Down Expand Up @@ -342,7 +344,7 @@ func TestRouter_Single(t *testing.T) {
err := r.Validate()
require.NoError(t, err, "failed to validate OpenAPI configuration")

req := httptest.NewRequest("GET", "/ping", nil)
req := httptest.NewRequest(http.MethodGet, "/ping", nil)
rr := httptest.NewRecorder()
c.ServeHTTP(rr, req)

Expand All @@ -366,7 +368,7 @@ func TestRouter_Single(t *testing.T) {
err := r.Validate()
require.NoError(t, err, "failed to validate OpenAPI configuration")

req := httptest.NewRequest("CONNECT", "/ping", nil)
req := httptest.NewRequest(http.MethodConnect, "/ping", nil)
rr := httptest.NewRecorder()
c.ServeHTTP(rr, req)

Expand All @@ -386,7 +388,7 @@ func TestRouter_Single(t *testing.T) {
err := r.Validate()
require.NoError(t, err, "failed to validate OpenAPI configuration")

req := httptest.NewRequest("GET", "/ping", nil)
req := httptest.NewRequest(http.MethodGet, "/ping", nil)
rr := httptest.NewRecorder()
c.ServeHTTP(rr, req)

Expand All @@ -401,7 +403,7 @@ func TestRouter_Single(t *testing.T) {
err := r.Validate()
require.NoError(t, err, "failed to validate OpenAPI configuration")

req := httptest.NewRequest("GET", "/ping", nil)
req := httptest.NewRequest(http.MethodGet, "/ping", nil)
rr := httptest.NewRecorder()
c.ServeHTTP(rr, req)

Expand All @@ -422,7 +424,7 @@ func TestRouter_Single(t *testing.T) {
err := r.Validate()
require.NoError(t, err, "failed to validate OpenAPI configuration")

req := httptest.NewRequest("GET", "/sub/ping", nil)
req := httptest.NewRequest(http.MethodGet, "/sub/ping", nil)
rr := httptest.NewRecorder()
c.ServeHTTP(rr, req)

Expand All @@ -445,7 +447,7 @@ func TestRouter_Group(t *testing.T) {
err := r.Validate()
require.NoError(t, err, "failed to validate OpenAPI configuration")

req := httptest.NewRequest("GET", "/ping", nil)
req := httptest.NewRequest(http.MethodGet, "/ping", nil)
rr := httptest.NewRecorder()
c.ServeHTTP(rr, req)

Expand All @@ -454,7 +456,12 @@ func TestRouter_Group(t *testing.T) {
schema, err := r.GenerateSchema()
require.NoError(t, err, "failed to generate OpenAPI schema")
assert.Contains(t, string(schema), "getPing", "expected OpenAPI schema to contain operation ID getPing")
assert.Contains(t, string(schema), "Ping the server with Group", "expected OpenAPI schema to contain summary for getPing")
assert.Contains(
t,
string(schema),
"Ping the server with Group",
"expected OpenAPI schema to contain summary for getPing",
)
assert.Contains(t, string(schema), "deprecated", "expected OpenAPI schema to contain deprecated flag for getPing")
}

Expand All @@ -474,7 +481,7 @@ func TestRouter_Middleware(t *testing.T) {
r.Get("/ping", pingHandler)
})

req := httptest.NewRequest("GET", "/ping", nil)
req := httptest.NewRequest(http.MethodGet, "/ping", nil)
rec := httptest.NewRecorder()
c.ServeHTTP(rec, req)
assert.True(t, called, "expected middleware to be called")
Expand All @@ -493,7 +500,7 @@ func TestRouter_Middleware(t *testing.T) {
r := chiopenapi.NewRouter(c)
r.With(middleware).Get("/ping", pingHandler)

req := httptest.NewRequest("GET", "/ping", nil)
req := httptest.NewRequest(http.MethodGet, "/ping", nil)
rec := httptest.NewRecorder()
c.ServeHTTP(rec, req)
assert.True(t, called, "expected middleware to be called")
Expand All @@ -505,7 +512,7 @@ func TestRouter_Middleware(t *testing.T) {
func TestRouter_NotFound(t *testing.T) {
c := chi.NewRouter()
r := chiopenapi.NewRouter(c)
r.NotFound(func(w http.ResponseWriter, r *http.Request) {
r.NotFound(func(w http.ResponseWriter, _ *http.Request) {
http.Error(w, "Not Found", http.StatusNotFound)
})

Expand All @@ -528,7 +535,7 @@ func TestRouter_MethodNotAllowed(t *testing.T) {
option.Summary("Ping the server"),
option.Description("This endpoint is used to check if the server is running."),
)
r.MethodNotAllowed(func(w http.ResponseWriter, r *http.Request) {
r.MethodNotAllowed(func(w http.ResponseWriter, _ *http.Request) {
http.Error(w, "Method Not Allowed", http.StatusMethodNotAllowed)
})

Expand Down
5 changes: 3 additions & 2 deletions adapter/chiopenapi/testdata/petstore.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ paths:
name: petId
required: true
schema:
format: int64
type: integer
requestBody:
content:
Expand All @@ -168,7 +169,7 @@ paths:
content:
application/json:
schema:
$ref: '#/components/schemas/DtoApiResponse'
$ref: '#/components/schemas/DtoAPIResponse'
description: OK
security:
- petstore_auth:
Expand Down Expand Up @@ -414,7 +415,7 @@ paths:
- user
components:
schemas:
DtoApiResponse:
DtoAPIResponse:
properties:
code:
type: integer
Expand Down
3 changes: 2 additions & 1 deletion adapter/echoopenapi/examples/basic/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,13 @@ require (
)

require (
github.com/kr/text v0.1.0 // indirect
github.com/labstack/gommon v0.4.2 // indirect
github.com/mattn/go-colorable v0.1.14 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/oaswrap/spec-ui v0.1.4 // indirect
github.com/swaggest/jsonschema-go v0.3.78 // indirect
github.com/swaggest/openapi-go v0.2.59 // indirect
github.com/swaggest/openapi-go v0.2.60 // indirect
github.com/swaggest/refl v1.4.0 // indirect
github.com/valyala/bytebufferpool v1.0.0 // indirect
github.com/valyala/fasttemplate v1.2.2 // indirect
Expand Down
Loading