Skip to content

Commit

Permalink
bot: Bump github.com/getkin/kin-openapi from 0.120.0 to 0.122.0 (sour…
Browse files Browse the repository at this point in the history
…cenetwork#2097)

Bumps
[github.com/getkin/kin-openapi](https://github.com/getkin/kin-openapi)
from 0.120.0 to 0.122.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/getkin/kin-openapi/releases">github.com/getkin/kin-openapi's
releases</a>.</em></p>
<blockquote>
<h2>v0.122.0</h2>
<h2>What's Changed</h2>
<ul>
<li>docs.sh: fix narrow docs checks spectrum by <a
href="https://github.com/fenollp"><code>@​fenollp</code></a> in <a
href="https://redirect.github.com/getkin/kin-openapi/pull/877">getkin/kin-openapi#877</a></li>
<li>fix after <a
href="https://redirect.github.com/getkin/kin-openapi/issues/870">#870</a>:
make sure Bis does not surface up by <a
href="https://github.com/fenollp"><code>@​fenollp</code></a> in <a
href="https://redirect.github.com/getkin/kin-openapi/pull/878">getkin/kin-openapi#878</a></li>
<li>openapi3: add support for extensions on the few types left by <a
href="https://github.com/fenollp"><code>@​fenollp</code></a> in <a
href="https://redirect.github.com/getkin/kin-openapi/pull/763">getkin/kin-openapi#763</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/getkin/kin-openapi/compare/v0.121.0...v0.122.0">https://github.com/getkin/kin-openapi/compare/v0.121.0...v0.122.0</a></p>
<h2>v0.121.0</h2>
<h2>What's Changed</h2>
<ul>
<li>Replace deprecated io/ioutil with io by <a
href="https://github.com/alexandear"><code>@​alexandear</code></a> in <a
href="https://redirect.github.com/getkin/kin-openapi/pull/840">getkin/kin-openapi#840</a></li>
<li>fix compile errors in README example code by <a
href="https://github.com/Jumpaku"><code>@​Jumpaku</code></a> in <a
href="https://redirect.github.com/getkin/kin-openapi/pull/842">getkin/kin-openapi#842</a></li>
<li>openapi3: add length of circular reference to error message by <a
href="https://github.com/jamietanna"><code>@​jamietanna</code></a> in <a
href="https://redirect.github.com/getkin/kin-openapi/pull/839">getkin/kin-openapi#839</a></li>
<li>openapi2conv: fix that removes an extra <code>required</code> array
from <code>formDataBody</code> by <a
href="https://github.com/liankui"><code>@​liankui</code></a> in <a
href="https://redirect.github.com/getkin/kin-openapi/pull/848">getkin/kin-openapi#848</a></li>
<li>openapi3: fix schema validation for <code>anyOf</code>,
<code>allOf</code>, <code>oneOf</code> operations by <a
href="https://github.com/AmadeusK525"><code>@​AmadeusK525</code></a> in
<a
href="https://redirect.github.com/getkin/kin-openapi/pull/850">getkin/kin-openapi#850</a></li>
<li>reproduce incorrect allOf + nullable behaviour by <a
href="https://github.com/fenollp"><code>@​fenollp</code></a> in <a
href="https://redirect.github.com/getkin/kin-openapi/pull/253">getkin/kin-openapi#253</a></li>
<li>reproduce issue <a
href="https://redirect.github.com/getkin/kin-openapi/issues/423">#423</a>
by <a href="https://github.com/fenollp"><code>@​fenollp</code></a> in <a
href="https://redirect.github.com/getkin/kin-openapi/pull/432">getkin/kin-openapi#432</a></li>
<li>openapi2conv: expose loader and location to ToV3 by <a
href="https://github.com/AriehSchneier"><code>@​AriehSchneier</code></a>
in <a
href="https://redirect.github.com/getkin/kin-openapi/pull/851">getkin/kin-openapi#851</a></li>
<li>openAPI3 template T class add server helper function by <a
href="https://github.com/spdrcd"><code>@​spdrcd</code></a> in <a
href="https://redirect.github.com/getkin/kin-openapi/pull/852">getkin/kin-openapi#852</a></li>
<li>openapi3: handle tangible *nil in Schema.IsEmpty impl by <a
href="https://github.com/fenollp"><code>@​fenollp</code></a> in <a
href="https://redirect.github.com/getkin/kin-openapi/pull/858">getkin/kin-openapi#858</a></li>
<li>openapi3: no longer error when drilling into a silenced yaml tag by
<a href="https://github.com/fenollp"><code>@​fenollp</code></a> in <a
href="https://redirect.github.com/getkin/kin-openapi/pull/859">getkin/kin-openapi#859</a></li>
<li>openapi3: shave some tests by <a
href="https://github.com/fenollp"><code>@​fenollp</code></a> in <a
href="https://redirect.github.com/getkin/kin-openapi/pull/862">getkin/kin-openapi#862</a></li>
<li>openapi3: refacto drill bit by <a
href="https://github.com/fenollp"><code>@​fenollp</code></a> in <a
href="https://redirect.github.com/getkin/kin-openapi/pull/865">getkin/kin-openapi#865</a></li>
<li>openapi3: unify Loader.resolve*Ref impls by <a
href="https://github.com/fenollp"><code>@​fenollp</code></a> in <a
href="https://redirect.github.com/getkin/kin-openapi/pull/863">getkin/kin-openapi#863</a></li>
<li>openapi3: refacto path resolving, remove a couple error cases by <a
href="https://github.com/fenollp"><code>@​fenollp</code></a> in <a
href="https://redirect.github.com/getkin/kin-openapi/pull/864">getkin/kin-openapi#864</a></li>
<li>openapi3: fast path drilling into UFO-type refs by <a
href="https://github.com/fenollp"><code>@​fenollp</code></a> in <a
href="https://redirect.github.com/getkin/kin-openapi/pull/866">getkin/kin-openapi#866</a></li>
<li>cmd/validate: read v2 documents that dont mention swagger as well by
<a href="https://github.com/fenollp"><code>@​fenollp</code></a> in <a
href="https://redirect.github.com/getkin/kin-openapi/pull/868">getkin/kin-openapi#868</a></li>
<li>openapi3: save some allocs when checking extras in refs by <a
href="https://github.com/fenollp"><code>@​fenollp</code></a> in <a
href="https://redirect.github.com/getkin/kin-openapi/pull/869">getkin/kin-openapi#869</a></li>
<li>openapi3: fix validating extra siblings in remote refs by <a
href="https://github.com/fenollp"><code>@​fenollp</code></a> in <a
href="https://redirect.github.com/getkin/kin-openapi/pull/872">getkin/kin-openapi#872</a></li>
<li>openapi3: reclaims Extensions unused mem post-unmarshal by <a
href="https://github.com/fenollp"><code>@​fenollp</code></a> in <a
href="https://redirect.github.com/getkin/kin-openapi/pull/871">getkin/kin-openapi#871</a></li>
<li>openapi3: handle refs missing fragment by <a
href="https://github.com/fenollp"><code>@​fenollp</code></a> in <a
href="https://redirect.github.com/getkin/kin-openapi/pull/511">getkin/kin-openapi#511</a></li>
<li>openapi3: support \uC4FE codepoint syntax in Schema.Pattern by <a
href="https://github.com/fenollp"><code>@​fenollp</code></a> in <a
href="https://redirect.github.com/getkin/kin-openapi/pull/873">getkin/kin-openapi#873</a></li>
<li>close <a
href="https://redirect.github.com/getkin/kin-openapi/issues/594">#594</a>:
yaml &quot;control characters are not allowed&quot; no longer
reproducible by <a
href="https://github.com/fenollp"><code>@​fenollp</code></a> in <a
href="https://redirect.github.com/getkin/kin-openapi/pull/597">getkin/kin-openapi#597</a></li>
<li>openapi{2,3}: simplify unmarshal errors by <a
href="https://github.com/fenollp"><code>@​fenollp</code></a> in <a
href="https://redirect.github.com/getkin/kin-openapi/pull/870">getkin/kin-openapi#870</a></li>
<li>openapi3: refacto ref-resolving end conditions by <a
href="https://github.com/fenollp"><code>@​fenollp</code></a> in <a
href="https://redirect.github.com/getkin/kin-openapi/pull/874">getkin/kin-openapi#874</a></li>
<li>openapi3: rename type of Components.Responses to ResponseBodies
(from Responses) by <a
href="https://github.com/fenollp"><code>@​fenollp</code></a> in <a
href="https://redirect.github.com/getkin/kin-openapi/pull/875">getkin/kin-openapi#875</a></li>
<li>openapi3: correct implementations of JSONLookup by <a
href="https://github.com/fenollp"><code>@​fenollp</code></a> in <a
href="https://redirect.github.com/getkin/kin-openapi/pull/876">getkin/kin-openapi#876</a></li>
</ul>
<h2>New Contributors</h2>
<ul>
<li><a href="https://github.com/Jumpaku"><code>@​Jumpaku</code></a> made
their first contribution in <a
href="https://redirect.github.com/getkin/kin-openapi/pull/842">getkin/kin-openapi#842</a></li>
<li><a
href="https://github.com/jamietanna"><code>@​jamietanna</code></a> made
their first contribution in <a
href="https://redirect.github.com/getkin/kin-openapi/pull/839">getkin/kin-openapi#839</a></li>
<li><a href="https://github.com/liankui"><code>@​liankui</code></a> made
their first contribution in <a
href="https://redirect.github.com/getkin/kin-openapi/pull/848">getkin/kin-openapi#848</a></li>
<li><a
href="https://github.com/AmadeusK525"><code>@​AmadeusK525</code></a>
made their first contribution in <a
href="https://redirect.github.com/getkin/kin-openapi/pull/850">getkin/kin-openapi#850</a></li>
<li><a
href="https://github.com/AriehSchneier"><code>@​AriehSchneier</code></a>
made their first contribution in <a
href="https://redirect.github.com/getkin/kin-openapi/pull/851">getkin/kin-openapi#851</a></li>
<li><a href="https://github.com/spdrcd"><code>@​spdrcd</code></a> made
their first contribution in <a
href="https://redirect.github.com/getkin/kin-openapi/pull/852">getkin/kin-openapi#852</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/getkin/kin-openapi/compare/v0.120.0...v0.121.0">https://github.com/getkin/kin-openapi/compare/v0.120.0...v0.121.0</a></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/getkin/kin-openapi/commit/6740cd2b25853647fafc2e40c33d60f6f78b4fd2"><code>6740cd2</code></a>
openapi3: add support for extensions on the few types left (<a
href="https://redirect.github.com/getkin/kin-openapi/issues/763">#763</a>)</li>
<li><a
href="https://github.com/getkin/kin-openapi/commit/f6d1b8c132b1ba26fe4054238278b1c0c016248f"><code>f6d1b8c</code></a>
fix after <a
href="https://redirect.github.com/getkin/kin-openapi/issues/870">#870</a>:
make sure Bis does not surface up (<a
href="https://redirect.github.com/getkin/kin-openapi/issues/878">#878</a>)</li>
<li><a
href="https://github.com/getkin/kin-openapi/commit/0cc5e2214e16fe574ac2c4867fa8bbabbddfa6e6"><code>0cc5e22</code></a>
docs.sh: fix narrow docs checks spectrum (<a
href="https://redirect.github.com/getkin/kin-openapi/issues/877">#877</a>)</li>
<li><a
href="https://github.com/getkin/kin-openapi/commit/4e7d03195bde822fdfe798fd04dbee5b0e3109d9"><code>4e7d031</code></a>
openapi3: correct implementations of JSONLookup (<a
href="https://redirect.github.com/getkin/kin-openapi/issues/876">#876</a>)</li>
<li><a
href="https://github.com/getkin/kin-openapi/commit/c1681a9dadb2a5e9e579ce54b6a026bb902cd976"><code>c1681a9</code></a>
openapi3: rename type of Components.Responses to ResponseBodies (from
Respons...</li>
<li><a
href="https://github.com/getkin/kin-openapi/commit/663b0ddf417355c6c9bd3a412c90bedc55e4e584"><code>663b0dd</code></a>
openapi3: refacto ref-resolving end conditions (<a
href="https://redirect.github.com/getkin/kin-openapi/issues/874">#874</a>)</li>
<li><a
href="https://github.com/getkin/kin-openapi/commit/377bb40b6e2b46cd93cbd0a6ee2065f0999e489d"><code>377bb40</code></a>
openapi{2,3}: simplify unmarshal errors (<a
href="https://redirect.github.com/getkin/kin-openapi/issues/870">#870</a>)</li>
<li><a
href="https://github.com/getkin/kin-openapi/commit/fe1c5f5e84a3ed4b7c4ff55b3a5d3ac53d569257"><code>fe1c5f5</code></a>
close <a
href="https://redirect.github.com/getkin/kin-openapi/issues/594">#594</a>:
yaml &quot;control characters are not allowed&quot; no longer
reproducible ...</li>
<li><a
href="https://github.com/getkin/kin-openapi/commit/e7a726a9f8e85c51f997ab5b15f70c571b968533"><code>e7a726a</code></a>
openapi3: support \uC4FE codepoint syntax in Schema.Pattern (<a
href="https://redirect.github.com/getkin/kin-openapi/issues/873">#873</a>)</li>
<li><a
href="https://github.com/getkin/kin-openapi/commit/582e6d06120fa34d3a4bac4123d1924218b4c678"><code>582e6d0</code></a>
openapi3: handle refs missing fragment (<a
href="https://redirect.github.com/getkin/kin-openapi/issues/511">#511</a>)</li>
<li>Additional commits viewable in <a
href="https://github.com/getkin/kin-openapi/compare/v0.120.0...v0.122.0">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=github.com/getkin/kin-openapi&package-manager=go_modules&previous-version=0.120.0&new-version=0.122.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Keenan Nemetz <[email protected]>
  • Loading branch information
2 people authored and shahzadlone committed Jan 20, 2024
1 parent 883c9c6 commit 35de28b
Show file tree
Hide file tree
Showing 9 changed files with 87 additions and 87 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ require (
github.com/bxcodec/faker v2.0.1+incompatible
github.com/evanphx/json-patch/v5 v5.7.0
github.com/fxamacker/cbor/v2 v2.5.0
github.com/getkin/kin-openapi v0.120.0
github.com/getkin/kin-openapi v0.122.0
github.com/go-chi/chi/v5 v5.0.11
github.com/go-chi/cors v1.2.1
github.com/go-errors/errors v1.5.1
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@ github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nos
github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM=
github.com/fxamacker/cbor/v2 v2.5.0 h1:oHsG0V/Q6E/wqTS2O1Cozzsy69nqCiguo5Q1a1ADivE=
github.com/fxamacker/cbor/v2 v2.5.0/go.mod h1:TA1xS00nchWmaBnEIxPSE5oHLuJBAVvqrtAnWBwBCVo=
github.com/getkin/kin-openapi v0.120.0 h1:MqJcNJFrMDFNc07iwE8iFC5eT2k/NPUFDIpNeiZv8Jg=
github.com/getkin/kin-openapi v0.120.0/go.mod h1:PCWw/lfBrJY4HcdqE3jj+QFkaFK8ABoqo7PvqVhXXqw=
github.com/getkin/kin-openapi v0.122.0 h1:WB9Jbl0Hp/T79/JF9xlSW5Kl9uYdk/AWD0yAd9HOM10=
github.com/getkin/kin-openapi v0.122.0/go.mod h1:PCWw/lfBrJY4HcdqE3jj+QFkaFK8ABoqo7PvqVhXXqw=
github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
github.com/gliderlabs/ssh v0.1.1/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aevW3Awn0=
github.com/go-chi/chi/v5 v5.0.11 h1:BnpYbFZ3T3S1WMpD79r7R5ThWX40TaFB7L31Y8xqSwA=
Expand Down
4 changes: 2 additions & 2 deletions http/handler_ccip.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ func (h *ccipHandler) bindRoutes(router *Router) {
Value: ccipRequest,
}
ccipPost.AddResponse(200, ccipResponse)
ccipPost.Responses["400"] = errorResponse
ccipPost.Responses.Set("400", errorResponse)

dataPathParam := openapi3.NewPathParameter("data").
WithDescription("Hex encoded request data").
Expand All @@ -117,7 +117,7 @@ func (h *ccipHandler) bindRoutes(router *Router) {
ccipGet.AddParameter(dataPathParam)
ccipGet.AddParameter(senderPathParam)
ccipGet.AddResponse(200, ccipResponse)
ccipGet.Responses["400"] = errorResponse
ccipGet.Responses.Set("400", errorResponse)

router.AddRoute("/ccip/{sender}/{data}", http.MethodGet, ccipGet, h.ExecCCIP)
router.AddRoute("/ccip", http.MethodPost, ccipPost, h.ExecCCIP)
Expand Down
40 changes: 20 additions & 20 deletions http/handler_collection.go
Original file line number Diff line number Diff line change
Expand Up @@ -379,9 +379,9 @@ func (h *collectionHandler) bindRoutes(router *Router) {
collectionCreate.RequestBody = &openapi3.RequestBodyRef{
Value: collectionCreateRequest,
}
collectionCreate.Responses = make(openapi3.Responses)
collectionCreate.Responses["200"] = successResponse
collectionCreate.Responses["400"] = errorResponse
collectionCreate.Responses = openapi3.NewResponses()
collectionCreate.Responses.Set("200", successResponse)
collectionCreate.Responses.Set("400", errorResponse)

collectionUpdateWithRequest := openapi3.NewRequestBody().
WithRequired(true).
Expand All @@ -400,7 +400,7 @@ func (h *collectionHandler) bindRoutes(router *Router) {
Value: collectionUpdateWithRequest,
}
collectionUpdateWith.AddResponse(200, collectionUpdateWithResponse)
collectionUpdateWith.Responses["400"] = errorResponse
collectionUpdateWith.Responses.Set("400", errorResponse)

collectionDeleteWithRequest := openapi3.NewRequestBody().
WithRequired(true).
Expand All @@ -419,7 +419,7 @@ func (h *collectionHandler) bindRoutes(router *Router) {
Value: collectionDeleteWithRequest,
}
collectionDeleteWith.AddResponse(200, collectionDeleteWithResponse)
collectionDeleteWith.Responses["400"] = errorResponse
collectionDeleteWith.Responses.Set("400", errorResponse)

createIndexRequest := openapi3.NewRequestBody().
WithRequired(true).
Expand All @@ -437,7 +437,7 @@ func (h *collectionHandler) bindRoutes(router *Router) {
Value: createIndexRequest,
}
createIndex.AddResponse(200, createIndexResponse)
createIndex.Responses["400"] = errorResponse
createIndex.Responses.Set("400", errorResponse)

indexArraySchema := openapi3.NewArraySchema()
indexArraySchema.Items = indexSchema
Expand All @@ -452,7 +452,7 @@ func (h *collectionHandler) bindRoutes(router *Router) {
getIndexes.Tags = []string{"index"}
getIndexes.AddParameter(collectionNamePathParam)
getIndexes.AddResponse(200, getIndexesResponse)
getIndexes.Responses["400"] = errorResponse
getIndexes.Responses.Set("400", errorResponse)

indexPathParam := openapi3.NewPathParameter("index").
WithRequired(true).
Expand All @@ -464,9 +464,9 @@ func (h *collectionHandler) bindRoutes(router *Router) {
dropIndex.Tags = []string{"index"}
dropIndex.AddParameter(collectionNamePathParam)
dropIndex.AddParameter(indexPathParam)
dropIndex.Responses = make(openapi3.Responses)
dropIndex.Responses["200"] = successResponse
dropIndex.Responses["400"] = errorResponse
dropIndex.Responses = openapi3.NewResponses()
dropIndex.Responses.Set("200", successResponse)
dropIndex.Responses.Set("400", errorResponse)

documentIDPathParam := openapi3.NewPathParameter("docID").
WithRequired(true).
Expand All @@ -483,36 +483,36 @@ func (h *collectionHandler) bindRoutes(router *Router) {
collectionGet.AddParameter(collectionNamePathParam)
collectionGet.AddParameter(documentIDPathParam)
collectionGet.AddResponse(200, collectionGetResponse)
collectionGet.Responses["400"] = errorResponse
collectionGet.Responses.Set("400", errorResponse)

collectionUpdate := openapi3.NewOperation()
collectionUpdate.Description = "Update a document by docID"
collectionUpdate.OperationID = "collection_update"
collectionUpdate.Tags = []string{"collection"}
collectionUpdate.AddParameter(collectionNamePathParam)
collectionUpdate.AddParameter(documentIDPathParam)
collectionUpdate.Responses = make(openapi3.Responses)
collectionUpdate.Responses["200"] = successResponse
collectionUpdate.Responses["400"] = errorResponse
collectionUpdate.Responses = openapi3.NewResponses()
collectionUpdate.Responses.Set("200", successResponse)
collectionUpdate.Responses.Set("400", errorResponse)

collectionDelete := openapi3.NewOperation()
collectionDelete.Description = "Delete a document by docID"
collectionDelete.OperationID = "collection_delete"
collectionDelete.Tags = []string{"collection"}
collectionDelete.AddParameter(collectionNamePathParam)
collectionDelete.AddParameter(documentIDPathParam)
collectionDelete.Responses = make(openapi3.Responses)
collectionDelete.Responses["200"] = successResponse
collectionDelete.Responses["400"] = errorResponse
collectionDelete.Responses = openapi3.NewResponses()
collectionDelete.Responses.Set("200", successResponse)
collectionDelete.Responses.Set("400", errorResponse)

collectionKeys := openapi3.NewOperation()
collectionKeys.AddParameter(collectionNamePathParam)
collectionKeys.Description = "Get all document IDs"
collectionKeys.OperationID = "collection_keys"
collectionKeys.Tags = []string{"collection"}
collectionKeys.Responses = make(openapi3.Responses)
collectionKeys.Responses["200"] = successResponse
collectionKeys.Responses["400"] = errorResponse
collectionKeys.Responses = openapi3.NewResponses()
collectionKeys.Responses.Set("200", successResponse)
collectionKeys.Responses.Set("400", errorResponse)

router.AddRoute("/collections/{name}", http.MethodGet, collectionKeys, h.GetAllDocIDs)
router.AddRoute("/collections/{name}", http.MethodPost, collectionCreate, h.Create)
Expand Down
32 changes: 16 additions & 16 deletions http/handler_lens.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ func (h *lensHandler) bindRoutes(router *Router) {
lensConfig.Description = "List lens migrations"
lensConfig.Tags = []string{"lens"}
lensConfig.AddResponse(200, lensConfigResponse)
lensConfig.Responses["400"] = errorResponse
lensConfig.Responses.Set("400", errorResponse)

setMigrationRequest := openapi3.NewRequestBody().
WithRequired(true).
Expand All @@ -160,17 +160,17 @@ func (h *lensHandler) bindRoutes(router *Router) {
setMigration.RequestBody = &openapi3.RequestBodyRef{
Value: setMigrationRequest,
}
setMigration.Responses = make(openapi3.Responses)
setMigration.Responses["200"] = successResponse
setMigration.Responses["400"] = errorResponse
setMigration.Responses = openapi3.NewResponses()
setMigration.Responses.Set("200", successResponse)
setMigration.Responses.Set("400", errorResponse)

reloadLenses := openapi3.NewOperation()
reloadLenses.OperationID = "lens_reload"
reloadLenses.Description = "Reload lens migrations"
reloadLenses.Tags = []string{"lens"}
reloadLenses.Responses = make(openapi3.Responses)
reloadLenses.Responses["200"] = successResponse
reloadLenses.Responses["400"] = errorResponse
reloadLenses.Responses = openapi3.NewResponses()
reloadLenses.Responses.Set("200", successResponse)
reloadLenses.Responses.Set("400", errorResponse)

versionPathParam := openapi3.NewPathParameter("version").
WithRequired(true).
Expand All @@ -181,9 +181,9 @@ func (h *lensHandler) bindRoutes(router *Router) {
hasMigration.Description = "Check if a migration exists"
hasMigration.Tags = []string{"lens"}
hasMigration.AddParameter(versionPathParam)
hasMigration.Responses = make(openapi3.Responses)
hasMigration.Responses["200"] = successResponse
hasMigration.Responses["400"] = errorResponse
hasMigration.Responses = openapi3.NewResponses()
hasMigration.Responses.Set("200", successResponse)
hasMigration.Responses.Set("400", errorResponse)

migrateSchema := openapi3.NewArraySchema()
migrateSchema.Items = documentSchema
Expand All @@ -199,9 +199,9 @@ func (h *lensHandler) bindRoutes(router *Router) {
Value: migrateRequest,
}
migrateUp.AddParameter(versionPathParam)
migrateUp.Responses = make(openapi3.Responses)
migrateUp.Responses["200"] = successResponse
migrateUp.Responses["400"] = errorResponse
migrateUp.Responses = openapi3.NewResponses()
migrateUp.Responses.Set("200", successResponse)
migrateUp.Responses.Set("400", errorResponse)

migrateDown := openapi3.NewOperation()
migrateDown.OperationID = "lens_migrate_down"
Expand All @@ -211,9 +211,9 @@ func (h *lensHandler) bindRoutes(router *Router) {
Value: migrateRequest,
}
migrateDown.AddParameter(versionPathParam)
migrateDown.Responses = make(openapi3.Responses)
migrateDown.Responses["200"] = successResponse
migrateDown.Responses["400"] = errorResponse
migrateDown.Responses = openapi3.NewResponses()
migrateDown.Responses.Set("200", successResponse)
migrateDown.Responses.Set("400", errorResponse)

router.AddRoute("/lens", http.MethodGet, lensConfig, h.Config)
router.AddRoute("/lens", http.MethodPost, setMigration, h.SetMigration)
Expand Down
30 changes: 15 additions & 15 deletions http/handler_p2p.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ func (h *p2pHandler) bindRoutes(router *Router) {
peerInfo.OperationID = "peer_info"
peerInfo.Tags = []string{"p2p"}
peerInfo.AddResponse(200, peerInfoResponse)
peerInfo.Responses["400"] = errorResponse
peerInfo.Responses.Set("400", errorResponse)

getReplicatorsSchema := openapi3.NewArraySchema()
getReplicatorsSchema.Items = replicatorSchema
Expand All @@ -174,7 +174,7 @@ func (h *p2pHandler) bindRoutes(router *Router) {
getReplicators.OperationID = "peer_replicator_list"
getReplicators.Tags = []string{"p2p"}
getReplicators.AddResponse(200, getReplicatorsResponse)
getReplicators.Responses["400"] = errorResponse
getReplicators.Responses.Set("400", errorResponse)

replicatorRequest := openapi3.NewRequestBody().
WithRequired(true).
Expand All @@ -187,9 +187,9 @@ func (h *p2pHandler) bindRoutes(router *Router) {
setReplicator.RequestBody = &openapi3.RequestBodyRef{
Value: replicatorRequest,
}
setReplicator.Responses = make(openapi3.Responses)
setReplicator.Responses["200"] = successResponse
setReplicator.Responses["400"] = errorResponse
setReplicator.Responses = openapi3.NewResponses()
setReplicator.Responses.Set("200", successResponse)
setReplicator.Responses.Set("400", errorResponse)

deleteReplicator := openapi3.NewOperation()
deleteReplicator.Description = "Delete peer replicators"
Expand All @@ -198,9 +198,9 @@ func (h *p2pHandler) bindRoutes(router *Router) {
deleteReplicator.RequestBody = &openapi3.RequestBodyRef{
Value: replicatorRequest,
}
deleteReplicator.Responses = make(openapi3.Responses)
deleteReplicator.Responses["200"] = successResponse
deleteReplicator.Responses["400"] = errorResponse
deleteReplicator.Responses = openapi3.NewResponses()
deleteReplicator.Responses.Set("200", successResponse)
deleteReplicator.Responses.Set("400", errorResponse)

peerCollectionsSchema := openapi3.NewArraySchema().
WithItems(openapi3.NewStringSchema())
Expand All @@ -218,7 +218,7 @@ func (h *p2pHandler) bindRoutes(router *Router) {
getPeerCollections.OperationID = "peer_collection_list"
getPeerCollections.Tags = []string{"p2p"}
getPeerCollections.AddResponse(200, getPeerCollectionsResponse)
getPeerCollections.Responses["400"] = errorResponse
getPeerCollections.Responses.Set("400", errorResponse)

addPeerCollections := openapi3.NewOperation()
addPeerCollections.Description = "Add peer collections"
Expand All @@ -227,9 +227,9 @@ func (h *p2pHandler) bindRoutes(router *Router) {
addPeerCollections.RequestBody = &openapi3.RequestBodyRef{
Value: peerCollectionRequest,
}
addPeerCollections.Responses = make(openapi3.Responses)
addPeerCollections.Responses["200"] = successResponse
addPeerCollections.Responses["400"] = errorResponse
addPeerCollections.Responses = openapi3.NewResponses()
addPeerCollections.Responses.Set("200", successResponse)
addPeerCollections.Responses.Set("400", errorResponse)

removePeerCollections := openapi3.NewOperation()
removePeerCollections.Description = "Remove peer collections"
Expand All @@ -238,9 +238,9 @@ func (h *p2pHandler) bindRoutes(router *Router) {
removePeerCollections.RequestBody = &openapi3.RequestBodyRef{
Value: peerCollectionRequest,
}
removePeerCollections.Responses = make(openapi3.Responses)
removePeerCollections.Responses["200"] = successResponse
removePeerCollections.Responses["400"] = errorResponse
removePeerCollections.Responses = openapi3.NewResponses()
removePeerCollections.Responses.Set("200", successResponse)
removePeerCollections.Responses.Set("400", errorResponse)

router.AddRoute("/p2p/info", http.MethodGet, peerInfo, h.PeerInfo)
router.AddRoute("/p2p/replicators", http.MethodGet, getReplicators, h.GetAllReplicators)
Expand Down
Loading

0 comments on commit 35de28b

Please sign in to comment.