-
-
Notifications
You must be signed in to change notification settings - Fork 435
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Validate json content in multipart/form-data request body #436
Comments
Hi! Thanks for the clear and complete issue! Please report your findings here & I'll turn your issue as an example for the docs. |
Signed-off-by: Pierre Fenoll <[email protected]>
Hi @fenollp. Thanks for your answer. I just created a PR on my fork of To make my findings more explicit I replaced For my test case, I used a very basic Please find below the full form payload: jsonSlice, err := json.Marshal([]map[string]interface{}{{"d1": "d1"}})
require.NoError(t, err)
multipartFormWithJSONSlice, multipartFormWithJSONSliceMime, err := newTestMultipartForm([]*testFormPart{
{name: "a", contentType: "text/plain", data: strings.NewReader("a1")},
{name: "b", contentType: "application/json", data: strings.NewReader("10")},
{name: "c", contentType: "text/plain", data: strings.NewReader("c1")},
{name: "c", contentType: "text/plain", data: strings.NewReader("c2")},
{name: "d", contentType: "application/json", data: bytes.NewReader(jsonSlice)},
{name: "f", contentType: "application/octet-stream", data: strings.NewReader("foo"), filename: "f1"},
{name: "g", data: strings.NewReader("g1")},
}) When running the test, we get the following output: --- FAIL: TestDecodeBody (0.01s)
--- FAIL: TestDecodeBody/multipart#01 (0.00s)
/Users/elliotmaincourt/github.com/kin-openapi/openapi3filter/req_resp_decoder_test.go:1223: assertion failed:
--- tc.want
+++ got
map[string]interface{}{
"a": string("a1"),
"b": float64(10),
"c": []interface{}{string("c1"), string("c2")},
- "d": []map[string]interface{}{{"d1": string("d1")}},
+ "d": []interface{}{map[string]interface{}{"d1": string("d1")}},
"f": string("foo"),
"g": string("g1"),
} As you can see, it seems that the type of the initial slice was somehow mutated. Basically What do you think ? I'm not actually even sure that this behaviour is of any help for my problem. Thanks in advance |
Actually after digging a little bit more I figured that if I replace those lines with the following the validation passes: if prop.Value.Type == "array" {
obj[name] = vv[0]
} else {
obj[name] = vv[0]
} So actually there seem to be no issue at all. I am probably just doing things wrong. In case of an package main
import (
"bytes"
"context"
"fmt"
"io"
"mime/multipart"
"net/http"
"net/textproto"
"strings"
"github.com/getkin/kin-openapi/openapi3"
"github.com/getkin/kin-openapi/openapi3filter"
"github.com/getkin/kin-openapi/routers/gorillamux"
)
const testSchema = `
openapi: 3.0.0
info:
title: 'Validator'
version: 0.0.1
paths:
/test:
post:
requestBody:
required: true
content:
multipart/form-data:
schema:
type: object
required:
- file
properties:
file:
type: string
format: binary
categories:
type: array
items:
$ref: "#/components/schemas/Category"
responses:
'200':
description: Created
components:
schemas:
Category:
type: object
properties:
name:
type: string
required:
- name
`
func main() {
swagger, err := openapi3.NewLoader().LoadFromData([]byte(testSchema))
if err != nil {
panic(err)
}
if err := swagger.Validate(context.Background()); err != nil {
panic(err)
}
router, err := gorillamux.NewRouter(swagger)
if err != nil {
panic(err)
}
body := &bytes.Buffer{}
writer := multipart.NewWriter(body)
h := make(textproto.MIMEHeader)
h.Set("Content-Disposition", fmt.Sprintf(`form-data; name="%s"`, "categories"))
h.Set("Content-Type", "application/json")
fw, err := writer.CreatePart(h)
if err != nil {
panic(err)
}
_, err = io.Copy(fw, strings.NewReader(`{"name": "foo"}`))
if err != nil {
panic(err)
}
h = make(textproto.MIMEHeader)
h.Set("Content-Disposition", fmt.Sprintf(`form-data; name="%s"`, "categories"))
h.Set("Content-Type", "application/json")
fw, err = writer.CreatePart(h)
if err != nil {
panic(err)
}
_, err = io.Copy(fw, strings.NewReader(`{"name": "bar"}`))
if err != nil {
panic(err)
}
fw, err = writer.CreateFormFile("file", "hello.txt")
if err != nil {
panic(err)
}
_, err = io.Copy(fw, strings.NewReader("hello"))
if err != nil {
panic(err)
}
writer.Close()
req, _ := http.NewRequest(http.MethodPost, "/test", bytes.NewReader(body.Bytes()))
req.Header.Set("Content-Type", writer.FormDataContentType())
route, pathParams, _ := router.FindRoute(req)
reqBody := route.Operation.RequestBody.Value
requestValidationInput := &openapi3filter.RequestValidationInput{
Request: req,
PathParams: pathParams,
Route: route,
}
err = openapi3filter.ValidateRequestBody(context.TODO(), requestValidationInput, reqBody)
if err == nil {
fmt.Println("Valid")
} else {
fmt.Printf("NOT valid. %s\n", err)
}
} I'm really sorry for that, the issue can be closed. Thank you once again for your time. |
* add couple tests around multiple file-specs (one needs fixing) + some code reuse (getkin#236) * Fix wrong `Found unresolved ref` error when converting from Swagger/OpenAPIv2 spec (getkin#237) * various fixes mainly to openapi2<->openapi3 conversion (getkin#239) * Add deprecated field in Schema (getkin#242) Change-Id: If750ff340ae29cf24a6ad870071502c9327485ca * Fix openapi3.referencedDocumentPath (getkin#248) * follow lint rules (getkin#250) * Fix broken link to alternative projects (getkin#255) * openapi2 security scheme requires accessCode not accesscode (getkin#256) Signed-off-by: Pierre Fenoll <[email protected]> * Validator: check readOnly/writeOnly properties (getkin#246) * feat: add Goa to README (getkin#261) Goa v3 depend on kin-openapi https://github.com/goadesign/goa/blob/v3/go.mod * swagger2 formData & request body refs (getkin#260) Co-authored-by: Francis Lennon <[email protected]> * Add support for error aggregation for request/response validation (getkin#259) * Prevent a panic in the error encoder (getkin#262) * Adds ipv4 and ipv6 formats support (getkin#258) Co-authored-by: Pierre Fenoll <[email protected]> * validate pattern or schema, not pattern xor schema anymore (getkin#265) * Consumes request bodies (getkin#263) Co-authored-by: Francis Lennon <[email protected]> Co-authored-by: Pierre Fenoll <[email protected]> * fixed panic in path validation (issue getkin#264) (getkin#266) Co-authored-by: Samuel Monderer <[email protected]> * Update doc.go (getkin#272) * Exposing Components 'IdentifierRegExp' to enable customized component key getkin#270 (getkin#273) * Add support for application/problem+json (getkin#275) Add support for content type application/problem+json for response validation * Enables jsonpointer support in openapi3 (getkin#276) * Fix flaky CI (getkin#278) * Fix failfast flag handling (getkin#284) * Add OIDC Schema format as per spec (getkin#287) Co-authored-by: Pierre Fenoll <[email protected]> * Support for alternate http auth mechanisms (getkin#291) Fixes getkin#290 * Return a more specific error when more than oneOf schemas match (getkin#292) * fix bug on indice to compare (getkin#295) * support extensions in oasv3.Server (getkin#302) Signed-off-by: Pierre Fenoll <[email protected]> * Add an example showing how to decode some extension props (getkin#304) * clarify defaults around openapi3filter.Options and openapi3filter.Aut… (getkin#305) Signed-off-by: Pierre Fenoll <[email protected]> * Add extensions in missing resources (getkin#306) * Enlarge support for JSON Path in $ref resolution (getkin#307) * Prevent infinite loop while loading openapi spec with recursive references (getkin#310) * nitpicks (getkin#313) * mention alternatives in README.md (getkin#315) Signed-off-by: Pierre Fenoll <[email protected]> * Bypass any file/URL reading by ReadFromURIFunc (getkin#316) * Drop `sl.LoadSwaggerFromURIFunc` (getkin#317) * Add an openapi3gen example + options (getkin#320) * Adds oneOf/discriminator/mapping management (getkin#321) * reproduce incorrect discriminator handling with ValidateRequest (getkin#323) * prepare for getkin#210 (getkin#325) * go:embed loader.ReadFromURIFunc example (getkin#319) * Rework router (getkin#210) * Reset compiledPattern when updating Pattern (getkin#327) * address getkin#326 (getkin#330) Signed-off-by: Pierre Fenoll <[email protected]> * Drop test dependency on go:embed (getkin#331) * Update README.md (getkin#333) * introduce openapi3filter.RegisteredBodyDecoder (getkin#340) Signed-off-by: Pierre Fenoll <[email protected]> * openapi3: allow variables in schemes in gorillamux router + better server variables validation (getkin#337) * Fix following refs to non-openapi3 root documents (but that are sub-documents) (getkin#346) * reproduce failing to load JSON refs in non-openapi document (getkin#314) * repro getkin#341 (getkin#342) * [Bugfix] fail readURL on http code > 399 (getkin#345) * [Bugfix] fail readUR if external reference returned http code > 399 * Replaced httpmock with httptest * Use require.EqualError instead testing Error and Contains of the errormessage * Test LoadSwaggerFromData as well * Support loading documents with `filepath.FromSlash` (getkin#251) * [Bugfix] fixed error message when only file is referenced (getkin#348) without internal reference * Follow callbacks references (getkin#347) * CI: test go1.14 (getkin#349) * Clean APIs from trademarked name "Swagger" (getkin#351) * Fix CI (getkin#352) Signed-off-by: Pierre Fenoll <[email protected]> * cannot reproduce getkin#353 (getkin#354) Signed-off-by: Pierre Fenoll <[email protected]> * add example usage of request validation with gorilla/mux router (getkin#359) Signed-off-by: Pierre Fenoll <[email protected]> * Have Header Object follow the structure of the Parameter Object (getkin#355) * CI: fix tests after tag (getkin#363) Signed-off-by: Pierre Fenoll <[email protected]> * Update openapi2_conv.go (getkin#365) Co-authored-by: Pierre Fenoll <[email protected]> * update that tag again... (getkin#374) * fix drilling down struct looking for additionalProperties (getkin#377) * fix drilling down additionalProperties in the boolean case (getkin#378) * Compile pattern on validate (getkin#375) Co-authored-by: Pierre Fenoll <[email protected]> * Add uint type to openapi3gen (getkin#379) * reproduce and fix issue getkin#382 (getkin#383) * Detect if a field is anonymous and handle the indirection (getkin#386) * Add missing yaml tags in marshaling openapi2.T (getkin#391) * Support reference cycles (getkin#393) * Add support for embedded struct pointers (getkin#396) * fix: Allow encoded path parameters with slashes (getkin#400) * Accept multipart/form-data's part without Content-Type (getkin#399) * fix that CI go:embed test forever, again (getkin#405) * fix bad ci script. I was under the impression this was working when I… (getkin#406) * Fix handling recursive refs (getkin#403) * fix issue 407, where if server URL has no path it throws exception (getkin#408) Co-authored-by: Naer Chang <[email protected]> * feature: Add more discriminator error messages and return specific er… (getkin#394) * feature: Add more discriminator error messages and return specific error when possible * feature: Always show more specific error message * test: Add schema oneOf tests * clean: Add missing word * Add nomad to list of projects using kin-openapi in README (getkin#413) * Schema customization plug-point (getkin#411) * Update README: remove github.com/getkin/kin (getkin#414) * fix alters by LGTM.com (getkin#415) * Add support for "application/x-yaml" (getkin#421) * sort out possible mishandling of ipv4 vs v6 (getkin#431) * Panic with customizer and embedded structs (getkin#434) * Fix getkin#422 added support for error unwrapping for errors with a single sub-error (getkin#433) * Do not escape regular expressions again (getkin#429) (getkin#435) * improve response validation error (getkin#437) * Define const schema types (getkin#438) * reproduce issue getkin#436 (getkin#439) * Fix scheme handling in v2->v3 conversion (getkin#441) * reproduce + fix getkin#444: ValidateRequest for application/x-yaml (getkin#445) * Internalize references (getkin#443) * ClientCredentials conversion to OpenAPI v2 (getkin#449) * Fix issue getkin#410 (getkin#450) Co-authored-by: Pierre Fenoll <[email protected]> * try reproducing getkin#447 (getkin#448) * fix: duplicate error reason when parameter is required but not present (getkin#453) * Provide support for generating recursive types into OpenAPI doc getkin#451 + my touches (getkin#454) Co-authored-by: Peter Broadhurst <[email protected]> * v2Tov3: handle parameter schema refs (getkin#455) Co-authored-by: Vincent Behar <[email protected]> * nitpicking: use type openapi3.Schemas (getkin#456) * Create FUNDING.yml (getkin#458) * Insert produces field (getkin#461) * fix error reason typo (getkin#466) * Update rfc422 regex as per spec: 'case insensitive on input' (getkin#463) * work around localhost host mismatch with relative server url (getkin#467) Co-authored-by: Chris Rodwell <[email protected]> * Add openapi3 validator middleware (getkin#462) * document union behaviour of XyzRef.s (getkin#468) * extensible-paths (getkin#470) * fix recipe for validating http requests/responses (getkin#474) * amend README.md to reflect BodyDecoder type (getkin#475) * openapi2conv: Convert response headers (getkin#483) * Fix oauth2 in openapi2conv.FromV3SecurityScheme (getkin#491) * Fix openapi3 validation: path param must be required (getkin#490) * updated date-time string format regexp to fully comply to standard (getkin#493) * distinguish form data in fromV3RequestBodies (getkin#494) * feat: cache resolved refs, improve URI reader extensibility (getkin#469) * Fix OpenAPI 3 validation: request body content is required (getkin#498) * Add OpenAPI 3 externalDocs validation (getkin#497) * issue/500 (getkin#501) Co-authored-by: Nathaniel J Cochran <[email protected]> * Fix OpenAPI 3 validation: operationId must be unique (getkin#504) * Check response headers and links (getkin#505) Co-authored-by: Ole Petersen <[email protected]> Co-authored-by: Pierre Fenoll <[email protected]> * fix that test situation (getkin#506) * Define missing XML in schema, minor fixes and doc additions (getkin#508) * discriminator value should verify the type is string to avoid panic (getkin#509) * Add nilness check to CI (getkin#510) * Add support for formats defined in JSON Draft 2019-09 (getkin#512) Co-authored-by: Steve Lessard <[email protected]> * Change the order of request validation to validate the Security schemas first before all other paramters (getkin#514) Co-authored-by: yarne <[email protected]> * Add support for allowEmptyValue (getkin#515) Co-authored-by: Pierre Fenoll <[email protected]> * RequestError Error() does not include reason if it is the same as err (getkin#517) Co-authored-by: Kanda <[email protected]> * Fix ExampleValidator test for 32-bit architectures (getkin#516) * openapi2: add missing schemes field of operation object (getkin#519) * Run CI tests on 386 too cc getkin#516 (getkin#518) * Add ExcludeSchema sentinel error for schemaCustomizer (getkin#522) Co-authored-by: Pierre Fenoll <[email protected]> * test link refs (getkin#525) * add missing validation of components: examples, links, callbacks (getkin#526) * openapi2: remove undefined tag (getkin#527) * testing: fix incorrect document (getkin#529) * testing: compare graphs using graph tools (getkin#528) * Fix some golints (getkin#530) * Internalize parameter references in the path as well (getkin#540) * fix bad error message on invalid value parse on query parameter (getkin#541) Co-authored-by: Kanda <[email protected]> * Follow up to getkin#540 with more tests (getkin#549) * feat: handling `default` in request body and parameter schema (getkin#544) * wip setting defaults for getkin#206 Signed-off-by: Pierre Fenoll <[email protected]> * introduce body encoders Signed-off-by: Pierre Fenoll <[email protected]> * re-encode only when needed Signed-off-by: Pierre Fenoll <[email protected]> * set default for parameter and add more test cases Co-authored-by: Pierre Fenoll <[email protected]> * following up on getkin#544: do not pass through on unhandled case (getkin#550) * Fix for CVE-2022-28948 (getkin#552) * CI: check-goimports Signed-off-by: Pierre Fenoll <[email protected]> * reorder imports per new CI check Signed-off-by: Pierre Fenoll <[email protected]> * switch from github.com/ghodss/yaml to github.com/invopop/yaml Signed-off-by: Pierre Fenoll <[email protected]> * remove all direct dependencies on gopkg.in/yaml.v2 Signed-off-by: Pierre Fenoll <[email protected]> * upgrade gopkg.in/yaml.v2 to latest published tag Signed-off-by: Pierre Fenoll <[email protected]> * upgrade gopkg.in/yaml.v3 to latest published tag Signed-off-by: Pierre Fenoll <[email protected]> * TestIssue430: fix racey behavior (getkin#553) * Handle port number variable of servers given to gorillamux.NewRouter (getkin#524) * update README.md with newer router/validator example (getkin#554) * Unit tests (getkin#556) * add gitlab.com/jamietanna/httptest-openapi to README.md (getkin#557) * fix: add deprecated field to openapi2.Operation (getkin#559) * fix: openapi2conv respects produces field (getkin#575) * Use go1.19 formatting (getkin#584) * Fix `resolveSchemaRef()` to load correctly an other spec. file referenced by `$ref` (getkin#583) * Protect from recursion in openapi3.InternaliseRefs (getkin#578) Co-authored-by: Dmitriy Lukiyanchuk <[email protected]> * cleanup after getkin#583 (getkin#585) * upgrade CI tools (getkin#586) * getkin#482 integer support broken with yaml (getkin#577) Co-authored-by: Christian Boitel <[email protected]> * Match on overridden servers at the path level, fixes getkin#564 (getkin#565) Co-authored-by: Pierre Fenoll <[email protected]> * feat: support validation options specifically for disabling pattern validation (getkin#590) * Add sponsor logo (getkin#595) * Examples validation (getkin#592) Co-authored-by: Pierre Fenoll <[email protected]> * use %w to wrap the errors (getkin#596) * Expose request/response validation options in the middleware Validator (getkin#608) * fix: detects circular references that can't be handled at the moment to avoid infinite loops loading documents (getkin#607) * Validate default values against schema (getkin#610) * fix: only inject default value for matched oneOf or anyOf (getkin#604) * Deterministic validation (getkin#602) * Improve error message when path validation fails (getkin#605) * Correctly resolve path of yaml resource if double referenced. (getkin#611) * Fix second level relative ref in property resolving (getkin#622) Co-authored-by: Dmitriy Lukiyanchuk <[email protected]> * rework convertError Example code to show query schema error (getkin#626) * Allow validations options when creating legace Router (getkin#614) * Additional error information (getkin#617) * Add SIMITGROUP`s repo to dependants shortlist (getkin#627) * Introduce package-wide CircularReferenceCounter to work around getkin#615 (getkin#628) Co-authored-by: sorintm <[email protected]> * fix: embedded struct handling (getkin#630) * openapi3filter: Fallback to string when decoding request parameters (getkin#631) * Introduce `(openapi3.*Server).BasePath()` and `(openapi3.Servers).BasePath()` (getkin#633) * Actually getkin#624, thanks to @orensolo (getkin#634) * Check for superfluous trailing whitespace (getkin#636) * show errors in security requirements (getkin#637) * Fix validation of complex enum values (getkin#647) * readOnly writeOnly validation (getkin#599) * fix: yaml marshal output (getkin#649) * openapi3filter: add missing response headers validation (getkin#650) * Fix lost error types in oneOf (getkin#658) * Add RegisterBodyEncoder (getkin#656) * fix panic slice out of range error getkin#652 (getkin#654) * Fixed recurive reference resolving when property referencies local co… (getkin#660) Co-authored-by: Anton Tolokan <[email protected]> * Add CodeQL workflow for GitHub code scanning (getkin#661) Co-authored-by: LGTM Migrator <[email protected]> * Support x-nullable (getkin#670) * Update content length after replacing request body (getkin#672) * fix: optional defaults (getkin#662) * fix: wrap the error that came back from the callback (getkin#674) (getkin#675) * fix: openapi3.SchemaError message customize (getkin#678) (getkin#679) Co-authored-by: Pierre Fenoll <[email protected]> * openapi3filter: fix crash when given arrays of objects as query parameters (getkin#664) * fix: error path is lost (getkin#681) (getkin#682) * feat: formatting some error messages (getkin#684) * fix: query param pattern (getkin#665) * fix: errors in oneOf not contain path (getkin#676) (getkin#677) * fix tests after merge train (getkin#686) * Internalize recursive external references getkin#618 (getkin#655) * Add variadic options to Validate method (getkin#692) * fix: setting defaults for oneOf and anyOf (getkin#690) * Try decoding as JSON first then YAML, for speed (getkin#693) Fixes getkin#680 * Use and update GetBody() member of request (getkin#704) * Bugfix/issue638 (getkin#700) * Add json patch support (getkin#702) * openapi3filter: Include schema ref or title in response body validation errors (getkin#699) Co-authored-by: Steve Lessard <[email protected]> * openapi3filter: parse integers with strconv.ParseInt instead of ParseFloat (getkin#711) Co-authored-by: Steve Lessard <[email protected]> * Fix inconsistent processing of server variables in gorillamux router (getkin#705) Co-authored-by: Steve Lessard <[email protected]> * Fix links to OpenAPI spec after GitHub changes (getkin#714) * openapi3: patch YAML serialization of dates (getkin#698) Co-authored-by: Pierre Fenoll <[email protected]> * Leave allocation capacity guessing to the runtime (getkin#716) * openapi3filter: validate non-string headers (getkin#712) Co-authored-by: Steve Lessard <[email protected]> * openapi3: unexport ValidationOptions fields and add some more (getkin#717) * openapi3: introduce (Paths).InMatchingOrder() paths iterator (getkin#719) * feat: improve error reporting for bad/missing discriminator (getkin#718) * openapi3: continue validation on valid oneOf properties (getkin#721) * openapi3filter: use option to skip setting defaults on validation (getkin#708) * openapi3: remove email string format (getkin#727) * openapi3filter: support for allOf request schema in multipart/form-data (getkin#729) fix getkin#722 * Disallow unexpected fields in validation and drop `jsoninfo` package (getkin#728) Fixes getkin#513 Fixes getkin#37 * openapi3filter: RegisterBodyDecoder for application/zip (getkin#730) * Keep track of API changes with CI (getkin#732) * openapi3filter: RegisterBodyDecoder for text/csv (getkin#734) fix getkin#696 * getkin#741 uri cache mutex (getkin#742) * Specify UseNumber() in the JSON decoder during JSON validation (getkin#738) * openapi3: fix error phrase in security scheme (getkin#745) Co-authored-by: Pierre Fenoll <[email protected]> * openapi3: remove value data from `SchemaError.Reason` field (getkin#737) Resolves getkin#735 * fix additional properties false not validated (getkin#747) * Refine schema error reason message (getkin#748) * openapi3: fix validation of non-empty interface slice value against array schema (getkin#752) Resolves getkin#751 * openapi3: empty scopes are valid (getkin#754) * openapi3: fix integer enum schema validation after json.Number PR (getkin#755) * optional readOnly and writeOnly validations (getkin#758) * openapi3: fix resolving Callbacks (getkin#757) Co-authored-by: Pierre Fenoll <[email protected]> fix getkin#341 * fixup some coding style divergences (getkin#760) * openapi3: make `bad data ...` error more actionable (getkin#761) * openapi3: add test from getkin#731 showing validating doc first is required (getkin#762) closes getkin#731 * cmd/validate: more expressive errors (getkin#769) * openapi3: fix an infinite loop that may have been introduced in getkin#700 (getkin#768) * openapi3: fix default values count even when disabled (getkin#767) (getkin#770) * openapi3: sort extra fields only once, during deserialization (getkin#773) * feat: support nil uuid (getkin#778) --------- Signed-off-by: Pierre Fenoll <[email protected]> Co-authored-by: Pierre Fenoll <[email protected]> Co-authored-by: Tevic <[email protected]> Co-authored-by: Kaushal Madappa <[email protected]> Co-authored-by: Kevin Disneur <[email protected]> Co-authored-by: 森 優太 <[email protected]> Co-authored-by: FrancisLennon17 <[email protected]> Co-authored-by: Francis Lennon <[email protected]> Co-authored-by: Zachary Lozano <[email protected]> Co-authored-by: Richard Rance <[email protected]> Co-authored-by: Riccardo Manfrin <[email protected]> Co-authored-by: Samuel Monderer <[email protected]> Co-authored-by: Samuel Monderer <[email protected]> Co-authored-by: duohedron <[email protected]> Co-authored-by: heyvister <[email protected]> Co-authored-by: DanielXu77 <[email protected]> Co-authored-by: Gordon Allott <[email protected]> Co-authored-by: Michael Krotscheck <[email protected]> Co-authored-by: Jake Scott <[email protected]> Co-authored-by: C H <[email protected]> Co-authored-by: Sergi Castro <[email protected]> Co-authored-by: hottestseason <[email protected]> Co-authored-by: Reuven Harrison <[email protected]> Co-authored-by: Steffen Rumpf <[email protected]> Co-authored-by: jasmanx11 <[email protected]> Co-authored-by: Alexander Bolgov <[email protected]> Co-authored-by: bianca rosa <[email protected]> Co-authored-by: Derek Strickland <[email protected]> Co-authored-by: Rodrigo Fernandes <[email protected]> Co-authored-by: stakme <[email protected]> Co-authored-by: NaerChang2 <[email protected]> Co-authored-by: Naer Chang <[email protected]> Co-authored-by: Peter Broadhurst <[email protected]> Co-authored-by: Oleksandr Redko <[email protected]> Co-authored-by: Guilherme Cardoso <[email protected]> Co-authored-by: Bion <[email protected]> Co-authored-by: José María Martín Luque <[email protected]> Co-authored-by: David Sharnoff <[email protected]> Co-authored-by: Mansur Marvanov <[email protected]> Co-authored-by: jhwz <[email protected]> Co-authored-by: Luukvdm <[email protected]> Co-authored-by: Andrey Dyatlov <[email protected]> Co-authored-by: Nick Ufer <[email protected]> Co-authored-by: Vincent Behar <[email protected]> Co-authored-by: Matteo Pietro Dazzi <[email protected]> Co-authored-by: Karl Möller <[email protected]> Co-authored-by: Chris Rodwell <[email protected]> Co-authored-by: Casey Marshall <[email protected]> Co-authored-by: general-kroll-4-life <[email protected]> Co-authored-by: Andreas Paul <[email protected]> Co-authored-by: Sergey Vilgelm <[email protected]> Co-authored-by: Clifton Kaznocha <[email protected]> Co-authored-by: Vasiliy Tsybenko <[email protected]> Co-authored-by: Anthony Clerc <[email protected]> Co-authored-by: Nathan Cochran <[email protected]> Co-authored-by: Nathaniel J Cochran <[email protected]> Co-authored-by: Ole Petersen <[email protected]> Co-authored-by: Ole Petersen <[email protected]> Co-authored-by: K Zhang <[email protected]> Co-authored-by: slessard <[email protected]> Co-authored-by: Steve Lessard <[email protected]> Co-authored-by: Yarne Decuyper <[email protected]> Co-authored-by: yarne <[email protected]> Co-authored-by: Kanda <[email protected]> Co-authored-by: Anthony Fok <[email protected]> Co-authored-by: Nicko Guyer <[email protected]> Co-authored-by: Christoph Petrausch <[email protected]> Co-authored-by: Nic <[email protected]> Co-authored-by: Idan Frimark <[email protected]> Co-authored-by: Nir <[email protected]> Co-authored-by: Masumi Kanai <[email protected]> Co-authored-by: wtertius <[email protected]> Co-authored-by: Dmitriy Lukiyanchuk <[email protected]> Co-authored-by: Christian Boitel <[email protected]> Co-authored-by: Christian Boitel <[email protected]> Co-authored-by: Amarjeet Rai <[email protected]> Co-authored-by: Tristan Cartledge <[email protected]> Co-authored-by: danicc097 <[email protected]> Co-authored-by: sorintm <[email protected]> Co-authored-by: Praneet Loke <[email protected]> Co-authored-by: Davor Sauer <[email protected]> Co-authored-by: Yannick Clybouw <[email protected]> Co-authored-by: sorintm <[email protected]> Co-authored-by: Nicholas Wiersma <[email protected]> Co-authored-by: Steven Hartland <[email protected]> Co-authored-by: Stepan I <[email protected]> Co-authored-by: Omar Ramadan <[email protected]> Co-authored-by: nk2ge5k <[email protected]> Co-authored-by: Derbylock <[email protected]> Co-authored-by: Anton Tolokan <[email protected]> Co-authored-by: lgtm-com[bot] <43144390+lgtm-com[bot]@users.noreply.github.com> Co-authored-by: LGTM Migrator <[email protected]> Co-authored-by: Chris Reeves <[email protected]> Co-authored-by: Andriy Borodiychuk <[email protected]> Co-authored-by: orensolo <[email protected]> Co-authored-by: Stepan I <[email protected]> Co-authored-by: Eloy Coto <[email protected]> Co-authored-by: tomato0111 <[email protected]> Co-authored-by: ShouheiNishi <[email protected]> Co-authored-by: Cosmos Nicolaou <[email protected]> Co-authored-by: Greg Ward <[email protected]> Co-authored-by: Vincent Le Goff <[email protected]> Co-authored-by: Katsumi Kato <[email protected]> Co-authored-by: Graham Crowell <[email protected]> Co-authored-by: Jeffrey Ying <[email protected]> Co-authored-by: Ori Shalom <[email protected]> Co-authored-by: Andrew Yang <[email protected]> Co-authored-by: Nodar Jarrar <[email protected]> Co-authored-by: orshlom <[email protected]> Co-authored-by: Vincent Le Goff <[email protected]>
Hi,
I've been trying to add an OpenAPI schema validation using the
oapi-codegen
validator which actually relies on youropenapi3filter
package and can't actually figure out how to make the validation pass when sendingapplication/json
content as part of amultipart/form-data
body. I'm pretty new tokin-openapi
and the whole OAPI3 ecosystem so I might be doing something wrong here. Please find below a reproducible failing example of what I'm trying to achieve:When running this snippet, validation fails. Also if I remove the
categories
field, the validation passes.Does the specification and the test scenario look correct ?
Thanks in advance
The text was updated successfully, but these errors were encountered: