Skip to content
This repository was archived by the owner on Oct 11, 2024. It is now read-only.

Commit 61c1afb

Browse files
QifanWuCFLTfenollpTevickshlmkdisneur
authored
Reset master and merge the commits ahead (#4)
* 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 <pierrefenoll@gmail.com> * 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 <francis.lennon@whitehatsec.com> * 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 <pierrefenoll@gmail.com> * validate pattern or schema, not pattern xor schema anymore (getkin#265) * Consumes request bodies (getkin#263) Co-authored-by: Francis Lennon <francis.lennon@whitehatsec.com> Co-authored-by: Pierre Fenoll <pierrefenoll@gmail.com> * fixed panic in path validation (issue getkin#264) (getkin#266) Co-authored-by: Samuel Monderer <samuelmo@radware.com> * 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 <pierrefenoll@gmail.com> * 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 <pierrefenoll@gmail.com> * 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 <pierrefenoll@gmail.com> * 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 <pierrefenoll@gmail.com> * 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 <pierrefenoll@gmail.com> * Drop test dependency on go:embed (getkin#331) * Update README.md (getkin#333) * introduce openapi3filter.RegisteredBodyDecoder (getkin#340) Signed-off-by: Pierre Fenoll <pierrefenoll@gmail.com> * 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 <pierrefenoll@gmail.com> * cannot reproduce getkin#353 (getkin#354) Signed-off-by: Pierre Fenoll <pierrefenoll@gmail.com> * add example usage of request validation with gorilla/mux router (getkin#359) Signed-off-by: Pierre Fenoll <pierrefenoll@gmail.com> * Have Header Object follow the structure of the Parameter Object (getkin#355) * CI: fix tests after tag (getkin#363) Signed-off-by: Pierre Fenoll <pierrefenoll@gmail.com> * Update openapi2_conv.go (getkin#365) Co-authored-by: Pierre Fenoll <pierrefenoll@gmail.com> * 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 <pierrefenoll@gmail.com> * 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 <naer_chang@mcafee.com> * 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 <pierrefenoll@gmail.com> * 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 <peter.broadhurst@kaleido.io> * v2Tov3: handle parameter schema refs (getkin#455) Co-authored-by: Vincent Behar <v.behar@free.fr> * 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 <crodwell@mediamath.com> * 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 <nathanjcochran@gmail.com> * Fix OpenAPI 3 validation: operationId must be unique (getkin#504) * Check response headers and links (getkin#505) Co-authored-by: Ole Petersen <ole.petersen@qaware.de> Co-authored-by: Pierre Fenoll <pierrefenoll@gmail.com> * 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 <steve.lessard@teradata.com> * Change the order of request validation to validate the Security schemas first before all other paramters (getkin#514) Co-authored-by: yarne <yarne@otainsight.com> * Add support for allowEmptyValue (getkin#515) Co-authored-by: Pierre Fenoll <pierrefenoll@gmail.com> * RequestError Error() does not include reason if it is the same as err (getkin#517) Co-authored-by: Kanda <kanda@synctera.com> * 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 <pierrefenoll@gmail.com> * 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 <kanda@synctera.com> * 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 <pierrefenoll@gmail.com> * introduce body encoders Signed-off-by: Pierre Fenoll <pierrefenoll@gmail.com> * re-encode only when needed Signed-off-by: Pierre Fenoll <pierrefenoll@gmail.com> * set default for parameter and add more test cases Co-authored-by: Pierre Fenoll <pierrefenoll@gmail.com> * 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 <pierrefenoll@gmail.com> * reorder imports per new CI check Signed-off-by: Pierre Fenoll <pierrefenoll@gmail.com> * switch from github.com/ghodss/yaml to github.com/invopop/yaml Signed-off-by: Pierre Fenoll <pierrefenoll@gmail.com> * remove all direct dependencies on gopkg.in/yaml.v2 Signed-off-by: Pierre Fenoll <pierrefenoll@gmail.com> * upgrade gopkg.in/yaml.v2 to latest published tag Signed-off-by: Pierre Fenoll <pierrefenoll@gmail.com> * upgrade gopkg.in/yaml.v3 to latest published tag Signed-off-by: Pierre Fenoll <pierrefenoll@gmail.com> * 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 <dmitriy.lukiyanchuk@instamart.ru> * 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 <cboitel@lfdj.com> * Match on overridden servers at the path level, fixes getkin#564 (getkin#565) Co-authored-by: Pierre Fenoll <pierrefenoll@gmail.com> * 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 <pierrefenoll@gmail.com> * 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 <dmitriy.lukiyanchuk@instamart.ru> * 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 <sorin@xata.io> * 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 <anton.tolokan@sbermarket.ru> * Add CodeQL workflow for GitHub code scanning (getkin#661) Co-authored-by: LGTM Migrator <lgtm-migrator@users.noreply.github.com> * 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 <pierrefenoll@gmail.com> * 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 <steve.lessard@teradata.com> * openapi3filter: parse integers with strconv.ParseInt instead of ParseFloat (getkin#711) Co-authored-by: Steve Lessard <steve.lessard@teradata.com> * Fix inconsistent processing of server variables in gorillamux router (getkin#705) Co-authored-by: Steve Lessard <steve.lessard@teradata.com> * Fix links to OpenAPI spec after GitHub changes (getkin#714) * openapi3: patch YAML serialization of dates (getkin#698) Co-authored-by: Pierre Fenoll <pierrefenoll@gmail.com> * Leave allocation capacity guessing to the runtime (getkin#716) * openapi3filter: validate non-string headers (getkin#712) Co-authored-by: Steve Lessard <steve.lessard@teradata.com> * 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 <pierrefenoll@gmail.com> * 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 <pierrefenoll@gmail.com> 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 <pierrefenoll@gmail.com> Co-authored-by: Pierre Fenoll <pierrefenoll@gmail.com> Co-authored-by: Tevic <tevic.tt@gmail.com> Co-authored-by: Kaushal Madappa <kshlmster@gmail.com> Co-authored-by: Kevin Disneur <kevin@disneur.me> Co-authored-by: 森 優太 <59682979+uta-mori@users.noreply.github.com> Co-authored-by: FrancisLennon17 <Francislennon17@gmail.com> Co-authored-by: Francis Lennon <francis.lennon@whitehatsec.com> Co-authored-by: Zachary Lozano <zacharylozano@invisionapp.com> Co-authored-by: Richard Rance <lagerenas@gmail.com> Co-authored-by: Riccardo Manfrin <RiccardoManfrin@users.noreply.github.com> Co-authored-by: Samuel Monderer <schmilmonderer@gmail.com> Co-authored-by: Samuel Monderer <samuelmo@radware.com> Co-authored-by: duohedron <40067856+duohedron@users.noreply.github.com> Co-authored-by: heyvister <41934916+heyvister@users.noreply.github.com> Co-authored-by: DanielXu77 <52269333+DanielXu77@users.noreply.github.com> Co-authored-by: Gordon Allott <gordallott@gmail.com> Co-authored-by: Michael Krotscheck <krotscheck@gmail.com> Co-authored-by: Jake Scott <jake@jakethesnake.dev> Co-authored-by: C H <cyrille.hemidy@gmail.com> Co-authored-by: Sergi Castro <sergikstro@gmail.com> Co-authored-by: hottestseason <hottestseason@gmail.com> Co-authored-by: Reuven Harrison <rh@tufin.com> Co-authored-by: Steffen Rumpf <39158011+steffakasid@users.noreply.github.com> Co-authored-by: jasmanx11 <61581398+jasmanx11@users.noreply.github.com> Co-authored-by: Alexander Bolgov <49677698+alexanderbolgov-ef@users.noreply.github.com> Co-authored-by: bianca rosa <me@biancarosa.com.br> Co-authored-by: Derek Strickland <1111455+DerekStrickland@users.noreply.github.com> Co-authored-by: Rodrigo Fernandes <rtfrodrigo@gmail.com> Co-authored-by: stakme <stak.me.g@gmail.com> Co-authored-by: NaerChang2 <naer_chang@yahoo.ca> Co-authored-by: Naer Chang <naer_chang@mcafee.com> Co-authored-by: Peter Broadhurst <peter.broadhurst@kaleido.io> Co-authored-by: Oleksandr Redko <oleksandr.red+github@gmail.com> Co-authored-by: Guilherme Cardoso <gjc@ua.pt> Co-authored-by: Bion <520596+bionoren@users.noreply.github.com> Co-authored-by: José María Martín Luque <jmmartinluque@gmail.com> Co-authored-by: David Sharnoff <github@dave.sharnoff.org> Co-authored-by: Mansur Marvanov <nanorobocop@gmail.com> Co-authored-by: jhwz <52683873+jhwz@users.noreply.github.com> Co-authored-by: Luukvdm <luuk.vdm@hotmail.com> Co-authored-by: Andrey Dyatlov <adyatlov@posteo.net> Co-authored-by: Nick Ufer <nick@ufer.dev> Co-authored-by: Vincent Behar <v.behar@free.fr> Co-authored-by: Matteo Pietro Dazzi <matteopietro.dazzi@gmail.com> Co-authored-by: Karl Möller <93589605+karl-dau@users.noreply.github.com> Co-authored-by: Chris Rodwell <crodwell@mediamath.com> Co-authored-by: Casey Marshall <cmars@users.noreply.github.com> Co-authored-by: general-kroll-4-life <82620104+general-kroll-4-life@users.noreply.github.com> Co-authored-by: Andreas Paul <xorpaul@gmail.com> Co-authored-by: Sergey Vilgelm <sergey@vilgelm.com> Co-authored-by: Clifton Kaznocha <ckaznocha@gmail.com> Co-authored-by: Vasiliy Tsybenko <VasayXTX@gmail.com> Co-authored-by: Anthony Clerc <21290922+Cr4psy@users.noreply.github.com> Co-authored-by: Nathan Cochran <cochran@niche.com> Co-authored-by: Nathaniel J Cochran <nathanjcochran@gmail.com> Co-authored-by: Ole Petersen <56505957+peteole@users.noreply.github.com> Co-authored-by: Ole Petersen <ole.petersen@qaware.de> Co-authored-by: K Zhang <kandazhang@gmail.com> Co-authored-by: slessard <slessard@users.noreply.github.com> Co-authored-by: Steve Lessard <steve.lessard@teradata.com> Co-authored-by: Yarne Decuyper <yarne@decuyper.info> Co-authored-by: yarne <yarne@otainsight.com> Co-authored-by: Kanda <kanda@synctera.com> Co-authored-by: Anthony Fok <anthony.fok@canada.ca> Co-authored-by: Nicko Guyer <nguyer@users.noreply.github.com> Co-authored-by: Christoph Petrausch <263448+hikhvar@users.noreply.github.com> Co-authored-by: Nic <qianyong@api7.ai> Co-authored-by: Idan Frimark <40820488+FrimIdan@users.noreply.github.com> Co-authored-by: Nir <35661734+nirhaas@users.noreply.github.com> Co-authored-by: Masumi Kanai <masumi.net@gmail.com> Co-authored-by: wtertius <wtertius@gmail.com> Co-authored-by: Dmitriy Lukiyanchuk <dmitriy.lukiyanchuk@instamart.ru> Co-authored-by: Christian Boitel <40855349+cboitel@users.noreply.github.com> Co-authored-by: Christian Boitel <cboitel@lfdj.com> Co-authored-by: Amarjeet Rai <sonu27@users.noreply.github.com> Co-authored-by: Tristan Cartledge <108070248+TristanSpeakEasy@users.noreply.github.com> Co-authored-by: danicc097 <71724149+danicc097@users.noreply.github.com> Co-authored-by: sorintm <112782063+sorintm@users.noreply.github.com> Co-authored-by: Praneet Loke <1466314+praneetloke@users.noreply.github.com> Co-authored-by: Davor Sauer <davor.sauer@gmail.com> Co-authored-by: Yannick Clybouw <yannick.clybouw@otainsight.com> Co-authored-by: sorintm <sorin@xata.io> Co-authored-by: Nicholas Wiersma <nick@wiersma.co.za> Co-authored-by: Steven Hartland <steven.hartland@multiplay.co.uk> Co-authored-by: Stepan I <2688692+micronull@users.noreply.github.com> Co-authored-by: Omar Ramadan <omar.ramadan93@gmail.com> Co-authored-by: nk2ge5k <nk2ge5k@gmail.com> Co-authored-by: Derbylock <derbylock@gmail.com> Co-authored-by: Anton Tolokan <anton.tolokan@sbermarket.ru> Co-authored-by: lgtm-com[bot] <43144390+lgtm-com[bot]@users.noreply.github.com> Co-authored-by: LGTM Migrator <lgtm-migrator@users.noreply.github.com> Co-authored-by: Chris Reeves <hey@krak3n.io> Co-authored-by: Andriy Borodiychuk <ab@markusweb.com> Co-authored-by: orensolo <46680749+orensolo@users.noreply.github.com> Co-authored-by: Stepan I <micronullist@gmail.com> Co-authored-by: Eloy Coto <eloy.coto@gmail.com> Co-authored-by: tomato0111 <119634480+tomato0111@users.noreply.github.com> Co-authored-by: ShouheiNishi <96609867+ShouheiNishi@users.noreply.github.com> Co-authored-by: Cosmos Nicolaou <cosmos.nicolaou@gmail.com> Co-authored-by: Greg Ward <greg@gerg.ca> Co-authored-by: Vincent Le Goff <vince.legoff@gmail.com> Co-authored-by: Katsumi Kato <k2tzumi@users.noreply.github.com> Co-authored-by: Graham Crowell <grahamcrowell@users.noreply.github.com> Co-authored-by: Jeffrey Ying <jeffrey.ying86@live.com> Co-authored-by: Ori Shalom <ori-shalom@users.noreply.github.com> Co-authored-by: Andrew Yang <andrewyang96@gmail.com> Co-authored-by: Nodar Jarrar <36896519+nodar963@users.noreply.github.com> Co-authored-by: orshlom <44160965+orshlom@users.noreply.github.com> Co-authored-by: Vincent Le Goff <vincent.legoff@konghq.com>
1 parent abe831a commit 61c1afb

File tree

279 files changed

+26381
-5577
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

279 files changed

+26381
-5577
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*.yml text eol=lf

.github/FUNDING.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# These are supported funding model platforms
2+
3+
github: [fenollp] # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
4+
#patreon: # Replace with a single Patreon username
5+
#open_collective: # Replace with a single Open Collective username
6+
#ko_fi: # Replace with a single Ko-fi username
7+
#tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
8+
#community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
9+
#liberapay: # Replace with a single Liberapay username
10+
#issuehunt: # Replace with a single IssueHunt username
11+
#otechie: # Replace with a single Otechie username
12+
#custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']

.github/docs/openapi2.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
type Header struct{ ... }
2+
type Operation struct{ ... }
3+
type Parameter struct{ ... }
4+
type Parameters []*Parameter
5+
type PathItem struct{ ... }
6+
type Response struct{ ... }
7+
type SecurityRequirements []map[string][]string
8+
type SecurityScheme struct{ ... }
9+
type T struct{ ... }

.github/docs/openapi2conv.txt

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
func FromV3(doc3 *openapi3.T) (*openapi2.T, error)
2+
func FromV3Headers(defs openapi3.Headers, components *openapi3.Components) (map[string]*openapi2.Header, error)
3+
func FromV3Operation(doc3 *openapi3.T, operation *openapi3.Operation) (*openapi2.Operation, error)
4+
func FromV3Parameter(ref *openapi3.ParameterRef, components *openapi3.Components) (*openapi2.Parameter, error)
5+
func FromV3PathItem(doc3 *openapi3.T, pathItem *openapi3.PathItem) (*openapi2.PathItem, error)
6+
func FromV3Ref(ref string) string
7+
func FromV3RequestBody(name string, requestBodyRef *openapi3.RequestBodyRef, ...) (*openapi2.Parameter, error)
8+
func FromV3RequestBodyFormData(mediaType *openapi3.MediaType) openapi2.Parameters
9+
func FromV3Response(ref *openapi3.ResponseRef, components *openapi3.Components) (*openapi2.Response, error)
10+
func FromV3Responses(responses map[string]*openapi3.ResponseRef, components *openapi3.Components) (map[string]*openapi2.Response, error)
11+
func FromV3SchemaRef(schema *openapi3.SchemaRef, components *openapi3.Components) (*openapi3.SchemaRef, *openapi2.Parameter)
12+
func FromV3Schemas(schemas map[string]*openapi3.SchemaRef, components *openapi3.Components) (map[string]*openapi3.SchemaRef, map[string]*openapi2.Parameter)
13+
func FromV3SecurityRequirements(requirements openapi3.SecurityRequirements) openapi2.SecurityRequirements
14+
func FromV3SecurityScheme(doc3 *openapi3.T, ref *openapi3.SecuritySchemeRef) (*openapi2.SecurityScheme, error)
15+
func ToV3(doc2 *openapi2.T) (*openapi3.T, error)
16+
func ToV3Headers(defs map[string]*openapi2.Header) openapi3.Headers
17+
func ToV3Operation(doc2 *openapi2.T, components *openapi3.Components, pathItem *openapi2.PathItem, ...) (*openapi3.Operation, error)
18+
func ToV3Parameter(components *openapi3.Components, parameter *openapi2.Parameter, ...) (*openapi3.ParameterRef, *openapi3.RequestBodyRef, ...)
19+
func ToV3PathItem(doc2 *openapi2.T, components *openapi3.Components, pathItem *openapi2.PathItem, ...) (*openapi3.PathItem, error)
20+
func ToV3Ref(ref string) string
21+
func ToV3Response(response *openapi2.Response, produces []string) (*openapi3.ResponseRef, error)
22+
func ToV3SchemaRef(schema *openapi3.SchemaRef) *openapi3.SchemaRef
23+
func ToV3Schemas(defs map[string]*openapi3.SchemaRef) map[string]*openapi3.SchemaRef
24+
func ToV3SecurityRequirements(requirements openapi2.SecurityRequirements) openapi3.SecurityRequirements
25+
func ToV3SecurityScheme(securityScheme *openapi2.SecurityScheme) (*openapi3.SecuritySchemeRef, error)

.github/docs/openapi3.txt

Lines changed: 155 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,155 @@
1+
const ParameterInPath = "path" ...
2+
const TypeArray = "array" ...
3+
const FormatOfStringForUUIDOfRFC4122 = `^(?:[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$` ...
4+
const SerializationSimple = "simple" ...
5+
var SchemaErrorDetailsDisabled = false ...
6+
var CircularReferenceCounter = 3
7+
var CircularReferenceError = "kin-openapi bug found: circular schema reference not handled"
8+
var DefaultReadFromURI = URIMapCache(ReadFromURIs(ReadFromHTTP(http.DefaultClient), ReadFromFile))
9+
var ErrURINotSupported = errors.New("unsupported URI")
10+
var IdentifierRegExp = regexp.MustCompile(identifierPattern)
11+
var SchemaStringFormats = make(map[string]Format, 4)
12+
func BoolPtr(value bool) *bool
13+
func DefaultRefNameResolver(ref string) string
14+
func DefineIPv4Format()
15+
func DefineIPv6Format()
16+
func DefineStringFormat(name string, pattern string)
17+
func DefineStringFormatCallback(name string, callback FormatCallback)
18+
func Float64Ptr(value float64) *float64
19+
func Int64Ptr(value int64) *int64
20+
func ReadFromFile(loader *Loader, location *url.URL) ([]byte, error)
21+
func RegisterArrayUniqueItemsChecker(fn SliceUniqueItemsChecker)
22+
func Uint64Ptr(value uint64) *uint64
23+
func ValidateIdentifier(value string) error
24+
func WithValidationOptions(ctx context.Context, opts ...ValidationOption) context.Context
25+
type AdditionalProperties struct{ ... }
26+
type Callback map[string]*PathItem
27+
type CallbackRef struct{ ... }
28+
type Callbacks map[string]*CallbackRef
29+
type Components struct{ ... }
30+
func NewComponents() Components
31+
type Contact struct{ ... }
32+
type Content map[string]*MediaType
33+
func NewContent() Content
34+
func NewContentWithFormDataSchema(schema *Schema) Content
35+
func NewContentWithFormDataSchemaRef(schema *SchemaRef) Content
36+
func NewContentWithJSONSchema(schema *Schema) Content
37+
func NewContentWithJSONSchemaRef(schema *SchemaRef) Content
38+
func NewContentWithSchema(schema *Schema, consumes []string) Content
39+
func NewContentWithSchemaRef(schema *SchemaRef, consumes []string) Content
40+
type Discriminator struct{ ... }
41+
type Encoding struct{ ... }
42+
func NewEncoding() *Encoding
43+
type Example struct{ ... }
44+
func NewExample(value interface{}) *Example
45+
type ExampleRef struct{ ... }
46+
type Examples map[string]*ExampleRef
47+
type ExternalDocs struct{ ... }
48+
type Format struct{ ... }
49+
type FormatCallback func(value string) error
50+
type Header struct{ ... }
51+
type HeaderRef struct{ ... }
52+
type Headers map[string]*HeaderRef
53+
type Info struct{ ... }
54+
type License struct{ ... }
55+
type Link struct{ ... }
56+
type LinkRef struct{ ... }
57+
type Links map[string]*LinkRef
58+
type Loader struct{ ... }
59+
func NewLoader() *Loader
60+
type MediaType struct{ ... }
61+
func NewMediaType() *MediaType
62+
type MultiError []error
63+
type OAuthFlow struct{ ... }
64+
type OAuthFlows struct{ ... }
65+
type Operation struct{ ... }
66+
func NewOperation() *Operation
67+
type Parameter struct{ ... }
68+
func NewCookieParameter(name string) *Parameter
69+
func NewHeaderParameter(name string) *Parameter
70+
func NewPathParameter(name string) *Parameter
71+
func NewQueryParameter(name string) *Parameter
72+
type ParameterRef struct{ ... }
73+
type Parameters []*ParameterRef
74+
func NewParameters() Parameters
75+
type ParametersMap map[string]*ParameterRef
76+
type PathItem struct{ ... }
77+
type Paths map[string]*PathItem
78+
type ReadFromURIFunc func(loader *Loader, url *url.URL) ([]byte, error)
79+
func ReadFromHTTP(cl *http.Client) ReadFromURIFunc
80+
func ReadFromURIs(readers ...ReadFromURIFunc) ReadFromURIFunc
81+
func URIMapCache(reader ReadFromURIFunc) ReadFromURIFunc
82+
type Ref struct{ ... }
83+
type RefNameResolver func(string) string
84+
type RequestBodies map[string]*RequestBodyRef
85+
type RequestBody struct{ ... }
86+
func NewRequestBody() *RequestBody
87+
type RequestBodyRef struct{ ... }
88+
type Response struct{ ... }
89+
func NewResponse() *Response
90+
type ResponseRef struct{ ... }
91+
type Responses map[string]*ResponseRef
92+
func NewResponses() Responses
93+
type Schema struct{ ... }
94+
func NewAllOfSchema(schemas ...*Schema) *Schema
95+
func NewAnyOfSchema(schemas ...*Schema) *Schema
96+
func NewArraySchema() *Schema
97+
func NewBoolSchema() *Schema
98+
func NewBytesSchema() *Schema
99+
func NewDateTimeSchema() *Schema
100+
func NewFloat64Schema() *Schema
101+
func NewInt32Schema() *Schema
102+
func NewInt64Schema() *Schema
103+
func NewIntegerSchema() *Schema
104+
func NewObjectSchema() *Schema
105+
func NewOneOfSchema(schemas ...*Schema) *Schema
106+
func NewSchema() *Schema
107+
func NewStringSchema() *Schema
108+
func NewUUIDSchema() *Schema
109+
type SchemaError struct{ ... }
110+
type SchemaRef struct{ ... }
111+
func NewSchemaRef(ref string, value *Schema) *SchemaRef
112+
type SchemaRefs []*SchemaRef
113+
type SchemaValidationOption func(*schemaValidationSettings)
114+
func DefaultsSet(f func()) SchemaValidationOption
115+
func DisablePatternValidation() SchemaValidationOption
116+
func DisableReadOnlyValidation() SchemaValidationOption
117+
func DisableWriteOnlyValidation() SchemaValidationOption
118+
func EnableFormatValidation() SchemaValidationOption
119+
func FailFast() SchemaValidationOption
120+
func MultiErrors() SchemaValidationOption
121+
func SetSchemaErrorMessageCustomizer(f func(err *SchemaError) string) SchemaValidationOption
122+
func VisitAsRequest() SchemaValidationOption
123+
func VisitAsResponse() SchemaValidationOption
124+
type Schemas map[string]*SchemaRef
125+
type SecurityRequirement map[string][]string
126+
func NewSecurityRequirement() SecurityRequirement
127+
type SecurityRequirements []SecurityRequirement
128+
func NewSecurityRequirements() *SecurityRequirements
129+
type SecurityScheme struct{ ... }
130+
func NewCSRFSecurityScheme() *SecurityScheme
131+
func NewJWTSecurityScheme() *SecurityScheme
132+
func NewOIDCSecurityScheme(oidcUrl string) *SecurityScheme
133+
func NewSecurityScheme() *SecurityScheme
134+
type SecuritySchemeRef struct{ ... }
135+
type SecuritySchemes map[string]*SecuritySchemeRef
136+
type SerializationMethod struct{ ... }
137+
type Server struct{ ... }
138+
type ServerVariable struct{ ... }
139+
type Servers []*Server
140+
type SliceUniqueItemsChecker func(items []interface{}) bool
141+
type T struct{ ... }
142+
type Tag struct{ ... }
143+
type Tags []*Tag
144+
type ValidationOption func(options *ValidationOptions)
145+
func AllowExtraSiblingFields(fields ...string) ValidationOption
146+
func DisableExamplesValidation() ValidationOption
147+
func DisableSchemaDefaultsValidation() ValidationOption
148+
func DisableSchemaFormatValidation() ValidationOption
149+
func DisableSchemaPatternValidation() ValidationOption
150+
func EnableExamplesValidation() ValidationOption
151+
func EnableSchemaDefaultsValidation() ValidationOption
152+
func EnableSchemaFormatValidation() ValidationOption
153+
func EnableSchemaPatternValidation() ValidationOption
154+
type ValidationOptions struct{ ... }
155+
type XML struct{ ... }

.github/docs/openapi3filter.txt

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
const ErrCodeOK = 0 ...
2+
var DefaultOptions = &Options{}
3+
var ErrAuthenticationServiceMissing = errors.New("missing AuthenticationFunc")
4+
var ErrInvalidEmptyValue = errors.New("empty value is not allowed")
5+
var ErrInvalidRequired = errors.New("value is required but missing")
6+
var JSONPrefixes = []string{ ... }
7+
func DefaultErrorEncoder(_ context.Context, err error, w http.ResponseWriter)
8+
func FileBodyDecoder(body io.Reader, header http.Header, schema *openapi3.SchemaRef, ...) (interface{}, error)
9+
func NoopAuthenticationFunc(context.Context, *AuthenticationInput) error
10+
func RegisterBodyDecoder(contentType string, decoder BodyDecoder)
11+
func RegisterBodyEncoder(contentType string, encoder BodyEncoder)
12+
func TrimJSONPrefix(data []byte) []byte
13+
func UnregisterBodyDecoder(contentType string)
14+
func UnregisterBodyEncoder(contentType string)
15+
func ValidateParameter(ctx context.Context, input *RequestValidationInput, ...) error
16+
func ValidateRequest(ctx context.Context, input *RequestValidationInput) (err error)
17+
func ValidateRequestBody(ctx context.Context, input *RequestValidationInput, ...) error
18+
func ValidateResponse(ctx context.Context, input *ResponseValidationInput) error
19+
func ValidateSecurityRequirements(ctx context.Context, input *RequestValidationInput, ...) error
20+
type AuthenticationFunc func(context.Context, *AuthenticationInput) error
21+
type AuthenticationInput struct{ ... }
22+
type BodyDecoder func(io.Reader, http.Header, *openapi3.SchemaRef, EncodingFn) (interface{}, error)
23+
func RegisteredBodyDecoder(contentType string) BodyDecoder
24+
type BodyEncoder func(body interface{}) ([]byte, error)
25+
func RegisteredBodyEncoder(contentType string) BodyEncoder
26+
type ContentParameterDecoder func(param *openapi3.Parameter, values []string) (interface{}, *openapi3.Schema, error)
27+
type CustomSchemaErrorFunc func(err *openapi3.SchemaError) string
28+
type EncodingFn func(partName string) *openapi3.Encoding
29+
type ErrCode int
30+
type ErrFunc func(w http.ResponseWriter, status int, code ErrCode, err error)
31+
type ErrorEncoder func(ctx context.Context, err error, w http.ResponseWriter)
32+
type Headerer interface{ ... }
33+
type LogFunc func(message string, err error)
34+
type Options struct{ ... }
35+
type ParseError struct{ ... }
36+
type ParseErrorKind int
37+
const KindOther ParseErrorKind = iota ...
38+
type RequestError struct{ ... }
39+
type RequestValidationInput struct{ ... }
40+
type ResponseError struct{ ... }
41+
type ResponseValidationInput struct{ ... }
42+
type SecurityRequirementsError struct{ ... }
43+
type StatusCoder interface{ ... }
44+
type ValidationError struct{ ... }
45+
type ValidationErrorEncoder struct{ ... }
46+
type ValidationErrorSource struct{ ... }
47+
type ValidationHandler struct{ ... }
48+
type Validator struct{ ... }
49+
func NewValidator(router routers.Router, options ...ValidatorOption) *Validator
50+
type ValidatorOption func(*Validator)
51+
func OnErr(f ErrFunc) ValidatorOption
52+
func OnLog(f LogFunc) ValidatorOption
53+
func Strict(strict bool) ValidatorOption
54+
func ValidationOptions(options Options) ValidatorOption

.github/docs/openapi3filter_fixtures.txt

Whitespace-only changes.

.github/docs/openapi3gen.txt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
var RefSchemaRef = openapi3.NewSchemaRef("Ref", ...)
2+
func NewSchemaRefForValue(value interface{}, schemas openapi3.Schemas, opts ...Option) (*openapi3.SchemaRef, error)
3+
type CycleError struct{}
4+
type ExcludeSchemaSentinel struct{}
5+
type Generator struct{ ... }
6+
func NewGenerator(opts ...Option) *Generator
7+
type Option func(*generatorOpt)
8+
func SchemaCustomizer(sc SchemaCustomizerFn) Option
9+
func ThrowErrorOnCycle() Option
10+
func UseAllExportedFields() Option
11+
type SchemaCustomizerFn func(name string, t reflect.Type, tag reflect.StructTag, schema *openapi3.Schema) error

.github/docs/routers.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
var ErrMethodNotAllowed error = &RouteError{ ... }
2+
var ErrPathNotFound error = &RouteError{ ... }
3+
type Route struct{ ... }
4+
type RouteError struct{ ... }
5+
type Router interface{ ... }
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
func NewRouter(doc *openapi3.T) (routers.Router, error)
2+
type Router struct{ ... }

0 commit comments

Comments
 (0)