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

Commit

Permalink
Reset master and merge the commits ahead (#4)
Browse files Browse the repository at this point in the history
* 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]>
  • Loading branch information
Show file tree
Hide file tree
Showing 279 changed files with 26,381 additions and 5,577 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.yml text eol=lf
12 changes: 12 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# These are supported funding model platforms

github: [fenollp] # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
#patreon: # Replace with a single Patreon username
#open_collective: # Replace with a single Open Collective username
#ko_fi: # Replace with a single Ko-fi username
#tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
#community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
#liberapay: # Replace with a single Liberapay username
#issuehunt: # Replace with a single IssueHunt username
#otechie: # Replace with a single Otechie username
#custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
9 changes: 9 additions & 0 deletions .github/docs/openapi2.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
type Header struct{ ... }
type Operation struct{ ... }
type Parameter struct{ ... }
type Parameters []*Parameter
type PathItem struct{ ... }
type Response struct{ ... }
type SecurityRequirements []map[string][]string
type SecurityScheme struct{ ... }
type T struct{ ... }
25 changes: 25 additions & 0 deletions .github/docs/openapi2conv.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
func FromV3(doc3 *openapi3.T) (*openapi2.T, error)
func FromV3Headers(defs openapi3.Headers, components *openapi3.Components) (map[string]*openapi2.Header, error)
func FromV3Operation(doc3 *openapi3.T, operation *openapi3.Operation) (*openapi2.Operation, error)
func FromV3Parameter(ref *openapi3.ParameterRef, components *openapi3.Components) (*openapi2.Parameter, error)
func FromV3PathItem(doc3 *openapi3.T, pathItem *openapi3.PathItem) (*openapi2.PathItem, error)
func FromV3Ref(ref string) string
func FromV3RequestBody(name string, requestBodyRef *openapi3.RequestBodyRef, ...) (*openapi2.Parameter, error)
func FromV3RequestBodyFormData(mediaType *openapi3.MediaType) openapi2.Parameters
func FromV3Response(ref *openapi3.ResponseRef, components *openapi3.Components) (*openapi2.Response, error)
func FromV3Responses(responses map[string]*openapi3.ResponseRef, components *openapi3.Components) (map[string]*openapi2.Response, error)
func FromV3SchemaRef(schema *openapi3.SchemaRef, components *openapi3.Components) (*openapi3.SchemaRef, *openapi2.Parameter)
func FromV3Schemas(schemas map[string]*openapi3.SchemaRef, components *openapi3.Components) (map[string]*openapi3.SchemaRef, map[string]*openapi2.Parameter)
func FromV3SecurityRequirements(requirements openapi3.SecurityRequirements) openapi2.SecurityRequirements
func FromV3SecurityScheme(doc3 *openapi3.T, ref *openapi3.SecuritySchemeRef) (*openapi2.SecurityScheme, error)
func ToV3(doc2 *openapi2.T) (*openapi3.T, error)
func ToV3Headers(defs map[string]*openapi2.Header) openapi3.Headers
func ToV3Operation(doc2 *openapi2.T, components *openapi3.Components, pathItem *openapi2.PathItem, ...) (*openapi3.Operation, error)
func ToV3Parameter(components *openapi3.Components, parameter *openapi2.Parameter, ...) (*openapi3.ParameterRef, *openapi3.RequestBodyRef, ...)
func ToV3PathItem(doc2 *openapi2.T, components *openapi3.Components, pathItem *openapi2.PathItem, ...) (*openapi3.PathItem, error)
func ToV3Ref(ref string) string
func ToV3Response(response *openapi2.Response, produces []string) (*openapi3.ResponseRef, error)
func ToV3SchemaRef(schema *openapi3.SchemaRef) *openapi3.SchemaRef
func ToV3Schemas(defs map[string]*openapi3.SchemaRef) map[string]*openapi3.SchemaRef
func ToV3SecurityRequirements(requirements openapi2.SecurityRequirements) openapi3.SecurityRequirements
func ToV3SecurityScheme(securityScheme *openapi2.SecurityScheme) (*openapi3.SecuritySchemeRef, error)
155 changes: 155 additions & 0 deletions .github/docs/openapi3.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,155 @@
const ParameterInPath = "path" ...
const TypeArray = "array" ...
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)$` ...
const SerializationSimple = "simple" ...
var SchemaErrorDetailsDisabled = false ...
var CircularReferenceCounter = 3
var CircularReferenceError = "kin-openapi bug found: circular schema reference not handled"
var DefaultReadFromURI = URIMapCache(ReadFromURIs(ReadFromHTTP(http.DefaultClient), ReadFromFile))
var ErrURINotSupported = errors.New("unsupported URI")
var IdentifierRegExp = regexp.MustCompile(identifierPattern)
var SchemaStringFormats = make(map[string]Format, 4)
func BoolPtr(value bool) *bool
func DefaultRefNameResolver(ref string) string
func DefineIPv4Format()
func DefineIPv6Format()
func DefineStringFormat(name string, pattern string)
func DefineStringFormatCallback(name string, callback FormatCallback)
func Float64Ptr(value float64) *float64
func Int64Ptr(value int64) *int64
func ReadFromFile(loader *Loader, location *url.URL) ([]byte, error)
func RegisterArrayUniqueItemsChecker(fn SliceUniqueItemsChecker)
func Uint64Ptr(value uint64) *uint64
func ValidateIdentifier(value string) error
func WithValidationOptions(ctx context.Context, opts ...ValidationOption) context.Context
type AdditionalProperties struct{ ... }
type Callback map[string]*PathItem
type CallbackRef struct{ ... }
type Callbacks map[string]*CallbackRef
type Components struct{ ... }
func NewComponents() Components
type Contact struct{ ... }
type Content map[string]*MediaType
func NewContent() Content
func NewContentWithFormDataSchema(schema *Schema) Content
func NewContentWithFormDataSchemaRef(schema *SchemaRef) Content
func NewContentWithJSONSchema(schema *Schema) Content
func NewContentWithJSONSchemaRef(schema *SchemaRef) Content
func NewContentWithSchema(schema *Schema, consumes []string) Content
func NewContentWithSchemaRef(schema *SchemaRef, consumes []string) Content
type Discriminator struct{ ... }
type Encoding struct{ ... }
func NewEncoding() *Encoding
type Example struct{ ... }
func NewExample(value interface{}) *Example
type ExampleRef struct{ ... }
type Examples map[string]*ExampleRef
type ExternalDocs struct{ ... }
type Format struct{ ... }
type FormatCallback func(value string) error
type Header struct{ ... }
type HeaderRef struct{ ... }
type Headers map[string]*HeaderRef
type Info struct{ ... }
type License struct{ ... }
type Link struct{ ... }
type LinkRef struct{ ... }
type Links map[string]*LinkRef
type Loader struct{ ... }
func NewLoader() *Loader
type MediaType struct{ ... }
func NewMediaType() *MediaType
type MultiError []error
type OAuthFlow struct{ ... }
type OAuthFlows struct{ ... }
type Operation struct{ ... }
func NewOperation() *Operation
type Parameter struct{ ... }
func NewCookieParameter(name string) *Parameter
func NewHeaderParameter(name string) *Parameter
func NewPathParameter(name string) *Parameter
func NewQueryParameter(name string) *Parameter
type ParameterRef struct{ ... }
type Parameters []*ParameterRef
func NewParameters() Parameters
type ParametersMap map[string]*ParameterRef
type PathItem struct{ ... }
type Paths map[string]*PathItem
type ReadFromURIFunc func(loader *Loader, url *url.URL) ([]byte, error)
func ReadFromHTTP(cl *http.Client) ReadFromURIFunc
func ReadFromURIs(readers ...ReadFromURIFunc) ReadFromURIFunc
func URIMapCache(reader ReadFromURIFunc) ReadFromURIFunc
type Ref struct{ ... }
type RefNameResolver func(string) string
type RequestBodies map[string]*RequestBodyRef
type RequestBody struct{ ... }
func NewRequestBody() *RequestBody
type RequestBodyRef struct{ ... }
type Response struct{ ... }
func NewResponse() *Response
type ResponseRef struct{ ... }
type Responses map[string]*ResponseRef
func NewResponses() Responses
type Schema struct{ ... }
func NewAllOfSchema(schemas ...*Schema) *Schema
func NewAnyOfSchema(schemas ...*Schema) *Schema
func NewArraySchema() *Schema
func NewBoolSchema() *Schema
func NewBytesSchema() *Schema
func NewDateTimeSchema() *Schema
func NewFloat64Schema() *Schema
func NewInt32Schema() *Schema
func NewInt64Schema() *Schema
func NewIntegerSchema() *Schema
func NewObjectSchema() *Schema
func NewOneOfSchema(schemas ...*Schema) *Schema
func NewSchema() *Schema
func NewStringSchema() *Schema
func NewUUIDSchema() *Schema
type SchemaError struct{ ... }
type SchemaRef struct{ ... }
func NewSchemaRef(ref string, value *Schema) *SchemaRef
type SchemaRefs []*SchemaRef
type SchemaValidationOption func(*schemaValidationSettings)
func DefaultsSet(f func()) SchemaValidationOption
func DisablePatternValidation() SchemaValidationOption
func DisableReadOnlyValidation() SchemaValidationOption
func DisableWriteOnlyValidation() SchemaValidationOption
func EnableFormatValidation() SchemaValidationOption
func FailFast() SchemaValidationOption
func MultiErrors() SchemaValidationOption
func SetSchemaErrorMessageCustomizer(f func(err *SchemaError) string) SchemaValidationOption
func VisitAsRequest() SchemaValidationOption
func VisitAsResponse() SchemaValidationOption
type Schemas map[string]*SchemaRef
type SecurityRequirement map[string][]string
func NewSecurityRequirement() SecurityRequirement
type SecurityRequirements []SecurityRequirement
func NewSecurityRequirements() *SecurityRequirements
type SecurityScheme struct{ ... }
func NewCSRFSecurityScheme() *SecurityScheme
func NewJWTSecurityScheme() *SecurityScheme
func NewOIDCSecurityScheme(oidcUrl string) *SecurityScheme
func NewSecurityScheme() *SecurityScheme
type SecuritySchemeRef struct{ ... }
type SecuritySchemes map[string]*SecuritySchemeRef
type SerializationMethod struct{ ... }
type Server struct{ ... }
type ServerVariable struct{ ... }
type Servers []*Server
type SliceUniqueItemsChecker func(items []interface{}) bool
type T struct{ ... }
type Tag struct{ ... }
type Tags []*Tag
type ValidationOption func(options *ValidationOptions)
func AllowExtraSiblingFields(fields ...string) ValidationOption
func DisableExamplesValidation() ValidationOption
func DisableSchemaDefaultsValidation() ValidationOption
func DisableSchemaFormatValidation() ValidationOption
func DisableSchemaPatternValidation() ValidationOption
func EnableExamplesValidation() ValidationOption
func EnableSchemaDefaultsValidation() ValidationOption
func EnableSchemaFormatValidation() ValidationOption
func EnableSchemaPatternValidation() ValidationOption
type ValidationOptions struct{ ... }
type XML struct{ ... }
54 changes: 54 additions & 0 deletions .github/docs/openapi3filter.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
const ErrCodeOK = 0 ...
var DefaultOptions = &Options{}
var ErrAuthenticationServiceMissing = errors.New("missing AuthenticationFunc")
var ErrInvalidEmptyValue = errors.New("empty value is not allowed")
var ErrInvalidRequired = errors.New("value is required but missing")
var JSONPrefixes = []string{ ... }
func DefaultErrorEncoder(_ context.Context, err error, w http.ResponseWriter)
func FileBodyDecoder(body io.Reader, header http.Header, schema *openapi3.SchemaRef, ...) (interface{}, error)
func NoopAuthenticationFunc(context.Context, *AuthenticationInput) error
func RegisterBodyDecoder(contentType string, decoder BodyDecoder)
func RegisterBodyEncoder(contentType string, encoder BodyEncoder)
func TrimJSONPrefix(data []byte) []byte
func UnregisterBodyDecoder(contentType string)
func UnregisterBodyEncoder(contentType string)
func ValidateParameter(ctx context.Context, input *RequestValidationInput, ...) error
func ValidateRequest(ctx context.Context, input *RequestValidationInput) (err error)
func ValidateRequestBody(ctx context.Context, input *RequestValidationInput, ...) error
func ValidateResponse(ctx context.Context, input *ResponseValidationInput) error
func ValidateSecurityRequirements(ctx context.Context, input *RequestValidationInput, ...) error
type AuthenticationFunc func(context.Context, *AuthenticationInput) error
type AuthenticationInput struct{ ... }
type BodyDecoder func(io.Reader, http.Header, *openapi3.SchemaRef, EncodingFn) (interface{}, error)
func RegisteredBodyDecoder(contentType string) BodyDecoder
type BodyEncoder func(body interface{}) ([]byte, error)
func RegisteredBodyEncoder(contentType string) BodyEncoder
type ContentParameterDecoder func(param *openapi3.Parameter, values []string) (interface{}, *openapi3.Schema, error)
type CustomSchemaErrorFunc func(err *openapi3.SchemaError) string
type EncodingFn func(partName string) *openapi3.Encoding
type ErrCode int
type ErrFunc func(w http.ResponseWriter, status int, code ErrCode, err error)
type ErrorEncoder func(ctx context.Context, err error, w http.ResponseWriter)
type Headerer interface{ ... }
type LogFunc func(message string, err error)
type Options struct{ ... }
type ParseError struct{ ... }
type ParseErrorKind int
const KindOther ParseErrorKind = iota ...
type RequestError struct{ ... }
type RequestValidationInput struct{ ... }
type ResponseError struct{ ... }
type ResponseValidationInput struct{ ... }
type SecurityRequirementsError struct{ ... }
type StatusCoder interface{ ... }
type ValidationError struct{ ... }
type ValidationErrorEncoder struct{ ... }
type ValidationErrorSource struct{ ... }
type ValidationHandler struct{ ... }
type Validator struct{ ... }
func NewValidator(router routers.Router, options ...ValidatorOption) *Validator
type ValidatorOption func(*Validator)
func OnErr(f ErrFunc) ValidatorOption
func OnLog(f LogFunc) ValidatorOption
func Strict(strict bool) ValidatorOption
func ValidationOptions(options Options) ValidatorOption
Empty file.
11 changes: 11 additions & 0 deletions .github/docs/openapi3gen.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
var RefSchemaRef = openapi3.NewSchemaRef("Ref", ...)
func NewSchemaRefForValue(value interface{}, schemas openapi3.Schemas, opts ...Option) (*openapi3.SchemaRef, error)
type CycleError struct{}
type ExcludeSchemaSentinel struct{}
type Generator struct{ ... }
func NewGenerator(opts ...Option) *Generator
type Option func(*generatorOpt)
func SchemaCustomizer(sc SchemaCustomizerFn) Option
func ThrowErrorOnCycle() Option
func UseAllExportedFields() Option
type SchemaCustomizerFn func(name string, t reflect.Type, tag reflect.StructTag, schema *openapi3.Schema) error
5 changes: 5 additions & 0 deletions .github/docs/routers.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
var ErrMethodNotAllowed error = &RouteError{ ... }
var ErrPathNotFound error = &RouteError{ ... }
type Route struct{ ... }
type RouteError struct{ ... }
type Router interface{ ... }
2 changes: 2 additions & 0 deletions .github/docs/routers_gorillamux.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
func NewRouter(doc *openapi3.T) (routers.Router, error)
type Router struct{ ... }
3 changes: 3 additions & 0 deletions .github/docs/routers_legacy.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
func NewRouter(doc *openapi3.T, opts ...openapi3.ValidationOption) (routers.Router, error)
type Router struct{ ... }
type Routers []*Router
9 changes: 9 additions & 0 deletions .github/docs/routers_legacy_pathpattern.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
const SuffixKindConstant = SuffixKind(iota) ...
var DefaultOptions = &Options{ ... }
func EqualSuffix(a, b Suffix) bool
func PathFromHost(host string, specialDashes bool) string
type Node struct{ ... }
type Options struct{ ... }
type Suffix struct{ ... }
type SuffixKind int
type SuffixList []Suffix
Binary file added .github/sponsors/speakeasy.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
41 changes: 41 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: "CodeQL"

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
schedule:
- cron: "4 8 * * 4"

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: [ go ]

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
queries: +security-and-quality

- name: Autobuild
uses: github/codeql-action/autobuild@v2

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
with:
category: "/language:${{ matrix.language }}"
Loading

0 comments on commit 61c1afb

Please sign in to comment.