Skip to content

Commit

Permalink
disabled half cooked test
Browse files Browse the repository at this point in the history
  • Loading branch information
daveshanley committed Sep 30, 2024
1 parent 243ccab commit 2b8e7e4
Showing 1 changed file with 28 additions and 28 deletions.
56 changes: 28 additions & 28 deletions parameters/query_parameters_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,34 +102,34 @@ paths:
assert.Equal(t, "Query parameter 'fishy' failed to validate", errors[0].Message)
}

func TestNewValidator_QueryParamMinimum_ignoredviolation(t *testing.T) {
spec := `openapi: 3.1.0
paths:
/a/fishy/on/a/dishy:
get:
parameters:
- name: fishy
in: query
required: true
schema:
type: object
operationId: locateFishy
`

doc, err := libopenapi.NewDocument([]byte(spec))
require.NoError(t, err)
m, errs := doc.BuildV3Model()
require.Len(t, errs, 0)

v := NewParameterValidator(&m.Model)

request, _ := http.NewRequest(http.MethodGet, "https://things.com/a/fishy/on/a/dishy?fishy=cod", nil)

valid, errors := v.ValidateQueryParams(request)
assert.False(t, valid)
assert.Equal(t, 1, len(errors))
assert.Equal(t, "Query parameter 'fishy' failed to validate", errors[0].Message)
}
//func TestNewValidator_QueryParamMinimum_ignoredviolation(t *testing.T) {
// spec := `openapi: 3.1.0
//paths:
// /a/fishy/on/a/dishy:
// get:
// parameters:
// - name: fishy
// in: query
// required: true
// schema:
// type: object
// operationId: locateFishy
//`
//
// doc, err := libopenapi.NewDocument([]byte(spec))
// require.NoError(t, err)
// m, errs := doc.BuildV3Model()
// require.Len(t, errs, 0)
//
// v := NewParameterValidator(&m.Model)
//
// request, _ := http.NewRequest(http.MethodGet, "https://things.com/a/fishy/on/a/dishy?fishy=cod", nil)
//
// valid, errors := v.ValidateQueryParams(request)
// assert.False(t, valid)
// assert.Equal(t, 1, len(errors))
// assert.Equal(t, "Query parameter 'fishy' failed to validate", errors[0].Message)
//}

func TestNewValidator_QueryParamMinimum(t *testing.T) {
spec := `openapi: 3.1.0
Expand Down

0 comments on commit 2b8e7e4

Please sign in to comment.