diff --git a/.gitignore b/.gitignore index ccd6def5740553b1ac1d4cb6dc25c1988671f117..46fc72702aea8efb1d9a037ae2f1a1fac89228c1 100644 --- a/.gitignore +++ b/.gitignore @@ -3,5 +3,3 @@ *.iml .idea/ dist/ - -spec/submission-api-bundled.yaml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 057166325bf9724d1a608b3e29f310bbde443856..e8bb0827602239a82d6db3355d8256c83c00c9a2 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -39,7 +39,7 @@ lint: name: $CI_REGISTRY/stoplight/spectral:5 entrypoint: [ "" ] script: - - spectral lint dist/submission-api.yaml -D + - spectral lint dist/submission-api.yaml --verbose upload:preview: stage: upload diff --git a/.spectral.yml b/.spectral.yml index c7be1e0099b46110e5ef9b3b54dd97a9b9b7ed39..1d2811e0bfc1ea66d0eeb5a8cfbb3c930f7d40b3 100644 --- a/.spectral.yml +++ b/.spectral.yml @@ -1,6 +1,5 @@ extends: - spectral:oas - # - https://italia.github.io/api-oas-checker/spectral.yml - https://italia.github.io/api-oas-checker/spectral-generic.yml - https://italia.github.io/api-oas-checker/spectral-security.yml @@ -9,7 +8,7 @@ functions: - pagination-response rules: - no-default-additionalProperties: hint + no-default-additionalProperties: off string-maxlength: hint typed-enum: error response-with-json-object: error @@ -19,7 +18,8 @@ rules: paths-status: off paths-status-return-problem: off paths-status-problem-schema: off - use-semver: off + + use-semver: off # Versioning is handled by CI patch-media-type: off cache-responses-undocumented: off diff --git a/bundle.sh b/bundle.sh index 578b5ea5d479409ca4f06a3f62fb800d5f2903bb..20d1f2def439d24e447356dc3fe7450fa734f4fa 100755 --- a/bundle.sh +++ b/bundle.sh @@ -3,7 +3,7 @@ set -eu YML_IN="spec/submission-api.yaml" -YML_OUT="spec/submission-api-bundled.yaml" +YML_OUT="dist/submission-api.yaml" docker run --rm -v "$(pwd):/work" jeanberu/swagger-cli \ swagger-cli bundle -t yaml -o "/work/$YML_OUT" "/work/$YML_IN" diff --git a/spec/endpoints/attachments/uuid.yaml b/spec/endpoints/attachments/uuid.yaml index fd4ca8d3f9c0219995635f3c150be23d2668deb3..250b0ad2e86aaf0f02320911f2a25a55f8280929 100644 --- a/spec/endpoints/attachments/uuid.yaml +++ b/spec/endpoints/attachments/uuid.yaml @@ -12,7 +12,7 @@ get: - Einreichungsempfang security: - OAuth2: - - 'subscribe:destination:<id>' + - 'subscribe:destination:<id>' responses: '200': description: OK @@ -28,25 +28,25 @@ get: content: application/problem+json: schema: - $ref: ../../schemas/error.yaml + $ref: '../../schemas/error.yaml' '401': description: Unauthorized content: application/problem+json: schema: - $ref: ../../schemas/error.yaml + $ref: '../../schemas/error.yaml' '403': description: Forbidden content: application/problem+json: schema: - $ref: ../../schemas/error.yaml + $ref: '../../schemas/error.yaml' '404': description: Submission not found, not in state submitted or forwarded or attachment for submission not found content: application/problem+json: schema: - $ref: ../../schemas/error.yaml + $ref: '../../schemas/error.yaml' put: operationId: add-submission-attachment @@ -77,34 +77,34 @@ put: content: application/problem+json: schema: - $ref: ../../schemas/error.yaml + $ref: '../../schemas/error.yaml' '401': description: Unauthorized content: application/problem+json: schema: - $ref: ../../schemas/error.yaml + $ref: '../../schemas/error.yaml' '403': description: Forbidden content: application/problem+json: schema: - $ref: ../../schemas/error.yaml + $ref: '../../schemas/error.yaml' '413': # TODO: Check description: Request Entity Too Large content: application/problem+json: schema: - $ref: ../../schemas/error.yaml + $ref: '../../schemas/error.yaml' '415': description: Unsupported Media Type (wrong content type sent) content: application/problem+json: schema: - $ref: ../../schemas/error.yaml + $ref: '../../schemas/error.yaml' '422': description: Attachment not announced. Must upload attachments under their announced UUIDs. content: application/problem+json: schema: - $ref: ../../schemas/error.yaml + $ref: '../../schemas/error.yaml' diff --git a/spec/endpoints/cases/events/index.yaml b/spec/endpoints/cases/events/index.yaml index 6d5b87c41efa2a11409ed98bb14de1d17af62690..cfdc68efa873f916927b18adacf8647612247417 100644 --- a/spec/endpoints/cases/events/index.yaml +++ b/spec/endpoints/cases/events/index.yaml @@ -12,10 +12,10 @@ get: - Einreichungsübermittlung security: - OAuth2: - - 'subscribe:destination:<id>' - - 'manage:destination:<id>' - - 'send:region:DE<region-id>+send:service:<service-uri>' - - 'send:region:DE<region-id>' + - 'subscribe:destination:<id>' + - 'manage:destination:<id>' + - 'send:region:DE<region-id>+send:service:<service-uri>' + - 'send:region:DE<region-id>' parameters: - $ref: '../../../parameters/pagination/limit.yaml' - $ref: '../../../parameters/pagination/offset.yaml' @@ -60,7 +60,7 @@ post: - Einreichungsempfang security: - OAuth2: - - 'subscribe:destination:<id>' + - 'subscribe:destination:<id>' requestBody: required: true content: diff --git a/spec/endpoints/destinations/index.yaml b/spec/endpoints/destinations/index.yaml index 5b1a3d60a4f6738ca39465f668f9f7fa6937c05d..560bd5860b2814cfefcb7118ac2d4d88c91e9f1b 100644 --- a/spec/endpoints/destinations/index.yaml +++ b/spec/endpoints/destinations/index.yaml @@ -7,8 +7,8 @@ get: - Zustellpunktverwaltung security: - OAuth2: - - 'subscribe:destination:<id>' - - 'manage:destination:<id>' + - 'subscribe:destination:<id>' + - 'manage:destination:<id>' parameters: - $ref: '../../parameters/pagination/limit.yaml' - $ref: '../../parameters/pagination/offset.yaml' @@ -49,7 +49,7 @@ post: - Zustellpunktverwaltung security: - OAuth2: - - 'create:destination' + - 'create:destination' requestBody: required: true content: @@ -82,16 +82,16 @@ post: content: application/problem+json: schema: - $ref: ../../schemas/error.yaml + $ref: '../../schemas/error.yaml' '401': description: Unauthorized content: application/problem+json: schema: - $ref: ../../schemas/error.yaml + $ref: '../../schemas/error.yaml' '403': description: Forbidden content: application/problem+json: schema: - $ref: ../../schemas/error.yaml + $ref: '../../schemas/error.yaml' diff --git a/spec/endpoints/destinations/keys/index.yaml b/spec/endpoints/destinations/keys/index.yaml index da143f143aa78e47da149f6df6a1430ce4a0d36c..a1b8e845c7b9d81698d343ef1fd4f19453f56e2b 100644 --- a/spec/endpoints/destinations/keys/index.yaml +++ b/spec/endpoints/destinations/keys/index.yaml @@ -9,7 +9,7 @@ post: - Zustellpunktverwaltung security: - OAuth2: - - 'manage:destination:<id>' + - 'manage:destination:<id>' requestBody: required: true content: @@ -32,22 +32,22 @@ post: content: application/problem+json: schema: - $ref: ../../../schemas/error.yaml + $ref: '../../../schemas/error.yaml' '401': description: Unauthorized content: application/problem+json: schema: - $ref: ../../../schemas/error.yaml + $ref: '../../../schemas/error.yaml' '403': description: Forbidden content: application/problem+json: schema: - $ref: ../../../schemas/error.yaml + $ref: '../../../schemas/error.yaml' '404': description: Not Found content: application/problem+json: schema: - $ref: ../../../schemas/error.yaml + $ref: '../../../schemas/error.yaml' diff --git a/spec/endpoints/destinations/uuid.yaml b/spec/endpoints/destinations/uuid.yaml index 97168b6f645053c658bbace678a85c51efd9c9d0..a323ad41fa929bdc5d209befa930a5237ad115cd 100644 --- a/spec/endpoints/destinations/uuid.yaml +++ b/spec/endpoints/destinations/uuid.yaml @@ -9,10 +9,10 @@ get: - Einreichungsübermittlung security: - OAuth2: - - 'subscribe:destination:<id>' - - 'manage:destination:<id>' - - 'send:region:DE<region-id>+send:service:<service-uri>' - - 'send:region:DE<region-id>' + - 'subscribe:destination:<id>' + - 'manage:destination:<id>' + - 'send:region:DE<region-id>+send:service:<service-uri>' + - 'send:region:DE<region-id>' responses: '200': description: OK @@ -33,19 +33,19 @@ get: content: application/problem+json: schema: - $ref: ../../schemas/error.yaml + $ref: '../../schemas/error.yaml' '403': description: Forbidden content: application/problem+json: schema: - $ref: ../../schemas/error.yaml + $ref: '../../schemas/error.yaml' '404': description: Not Found content: application/problem+json: schema: - $ref: ../../schemas/error.yaml + $ref: '../../schemas/error.yaml' put: deprecated: true @@ -56,7 +56,7 @@ put: - Zustellpunktverwaltung security: - OAuth2: - - 'manage:destination:<id>' + - 'manage:destination:<id>' requestBody: required: true content: @@ -87,25 +87,25 @@ put: content: application/problem+json: schema: - $ref: ../../schemas/error.yaml + $ref: '../../schemas/error.yaml' '401': description: Unauthorized content: application/problem+json: schema: - $ref: ../../schemas/error.yaml + $ref: '../../schemas/error.yaml' '403': description: Forbidden content: application/problem+json: schema: - $ref: ../../schemas/error.yaml + $ref: '../../schemas/error.yaml' '404': description: Not Found content: application/problem+json: schema: - $ref: ../../schemas/error.yaml + $ref: '../../schemas/error.yaml' patch: deprecated: true @@ -118,7 +118,7 @@ patch: - Zustellpunktverwaltung security: - OAuth2: - - 'manage:destination:<id>' + - 'manage:destination:<id>' requestBody: required: true content: @@ -126,7 +126,10 @@ patch: schema: $ref: '../../schemas/patch-destination.yaml' examples: - $ref: '../../examples/patch-destination.yaml' + Patch Status: + $ref: '../../examples/patch-destination-status.yaml' + Patch Contact: + $ref: '../../examples/patch-destination-contact.yaml' callbacks: NewSubmissions: $ref: '../../callbacks/new-submissions.yaml' @@ -148,25 +151,25 @@ patch: content: application/problem+json: schema: - $ref: ../../schemas/error.yaml + $ref: '../../schemas/error.yaml' '401': description: Unauthorized content: application/problem+json: schema: - $ref: ../../schemas/error.yaml + $ref: '../../schemas/error.yaml' '403': description: Forbidden content: application/problem+json: schema: - $ref: ../../schemas/error.yaml + $ref: '../../schemas/error.yaml' '404': description: Not Found content: application/problem+json: schema: - $ref: ../../schemas/error.yaml + $ref: '../../schemas/error.yaml' delete: deprecated: true @@ -177,7 +180,7 @@ delete: - Zustellpunktverwaltung security: - OAuth2: - - 'manage:destination:<id>' + - 'manage:destination:<id>' responses: '204': description: Zustellpunkt erfolgreich gelöscht. @@ -186,23 +189,22 @@ delete: content: application/problem+json: schema: - $ref: ../../schemas/error.yaml + $ref: '../../schemas/error.yaml' '401': description: Unauthorized content: application/problem+json: schema: - $ref: ../../schemas/error.yaml + $ref: '../../schemas/error.yaml' '403': description: Forbidden content: application/problem+json: schema: - $ref: ../../schemas/error.yaml + $ref: '../../schemas/error.yaml' '404': description: Not Found content: application/problem+json: schema: - $ref: ../../schemas/error.yaml - + $ref: '../../schemas/error.yaml' diff --git a/spec/endpoints/submissions/index.yaml b/spec/endpoints/submissions/index.yaml index 89ec3e2ec106d810a245f019754aac311f05db73..33d71fb87e1e51aba485839d7021784293e447b8 100644 --- a/spec/endpoints/submissions/index.yaml +++ b/spec/endpoints/submissions/index.yaml @@ -6,7 +6,7 @@ get: - Einreichungsempfang security: - OAuth2: - - 'subscribe:destination:<id>' + - 'subscribe:destination:<id>' parameters: - $ref: '../../parameters/destinationIdInQuery.yaml' - $ref: '../../parameters/pagination/limit.yaml' @@ -44,8 +44,8 @@ post: - Einreichungsübermittlung security: - OAuth2: - - 'send:region:DE<region-id>+send:service:<service-uri>' - - 'send:region:DE<region-id>' + - 'send:region:DE<region-id>+send:service:<service-uri>' + - 'send:region:DE<region-id>' requestBody: required: true content: @@ -73,34 +73,34 @@ post: content: application/problem+json: schema: - $ref: ../../schemas/error.yaml + $ref: '../../schemas/error.yaml' '401': description: Unauthorized content: application/problem+json: schema: - $ref: ../../schemas/error.yaml + $ref: '../../schemas/error.yaml' '403': description: Forbidden content: application/problem+json: schema: - $ref: ../../schemas/error.yaml + $ref: '../../schemas/error.yaml' '404': description: Destination not found content: application/problem+json: schema: - $ref: ../../schemas/error.yaml + $ref: '../../schemas/error.yaml' '413': # TODO: Check description: Request Entity Too Large content: application/problem+json: schema: - $ref: ../../schemas/error.yaml + $ref: '../../schemas/error.yaml' '422': description: 'Unprocessable Entity: Es konnte keine Submission angelegt werden, z.B. weil der Zustellpunkt (Destination) den falschen Status hat.' content: application/problem+json: schema: - $ref: ../../schemas/error.yaml + $ref: '../../schemas/error.yaml' diff --git a/spec/endpoints/submissions/uuid.yaml b/spec/endpoints/submissions/uuid.yaml index 8576b2d9b049320c432d1bd89b4aa1824ea8e1f9..d619d9f5811b66d804377defffc2817c00caa1e1 100644 --- a/spec/endpoints/submissions/uuid.yaml +++ b/spec/endpoints/submissions/uuid.yaml @@ -11,7 +11,7 @@ get: - Einreichungsempfang security: - OAuth2: - - 'subscribe:destination:<id>' + - 'subscribe:destination:<id>' responses: '200': description: OK @@ -27,25 +27,25 @@ get: content: application/problem+json: schema: - $ref: ../../schemas/error.yaml + $ref: '../../schemas/error.yaml' '401': description: Unauthorized content: application/problem+json: schema: - $ref: ../../schemas/error.yaml + $ref: '../../schemas/error.yaml' '403': description: Forbidden content: application/problem+json: schema: - $ref: ../../schemas/error.yaml + $ref: '../../schemas/error.yaml' '404': description: Submission not found, not in state submitted or forwarded content: application/problem+json: schema: - $ref: ../../schemas/error.yaml + $ref: '../../schemas/error.yaml' put: operationId: submit-submission @@ -58,8 +58,8 @@ put: - Einreichungsübermittlung security: - OAuth2: - - 'send:region:DE<region-id>+send:service:<service-uri>' - - 'send:region:DE<region-id>' + - 'send:region:DE<region-id>+send:service:<service-uri>' + - 'send:region:DE<region-id>' requestBody: required: true content: @@ -84,40 +84,40 @@ put: content: application/problem+json: schema: - $ref: ../../schemas/error.yaml + $ref: '../../schemas/error.yaml' '401': description: Unauthorized content: application/problem+json: schema: - $ref: ../../schemas/error.yaml + $ref: '../../schemas/error.yaml' '403': description: Forbidden content: application/problem+json: schema: - $ref: ../../schemas/error.yaml + $ref: '../../schemas/error.yaml' '404': description: Submission not found content: application/problem+json: schema: - $ref: ../../schemas/error.yaml + $ref: '../../schemas/error.yaml' '413': # TODO: Check description: Request Entity Too Large content: application/problem+json: schema: - $ref: ../../schemas/error.yaml + $ref: '../../schemas/error.yaml' '415': description: Unsupported Media Type (wrong content type sent) content: application/problem+json: schema: - $ref: ../../schemas/error.yaml + $ref: '../../schemas/error.yaml' '422': description: Gesamtantrag unvollständig. Angekündigte Anlagen noch nicht hochgeladen. content: application/problem+json: schema: - $ref: ../../schemas/error.yaml + $ref: '../../schemas/error.yaml' diff --git a/spec/examples/encrypted-message.yaml b/spec/examples/encrypted-message.yaml index 47674fd8c66d20c85446375fc413b8791335cb33..6bc34acbfc1566d3f0fca28f553b318a92d5c348 100644 --- a/spec/examples/encrypted-message.yaml +++ b/spec/examples/encrypted-message.yaml @@ -1 +1 @@ -value: eyJlbmMiOiJBMjU2R0NNIiwiYWxnIjoiUlNBLU9BRVAtMjU2In0.nlXGAufYH36IABDy0En0LXEhGfC20IZSSchs27ADalHpRoTZKfXhc7hcMk8Y9V8yTP0jYbmrq6NtEg-QS2O5TQFD9Hluhpb631PBgKjPXHYX1Y6iUcR1sXxSUPjePi8F8PcZUZuUJLnhz6myyc9scdAq9BXG2cDJVgkfLI8eZdrqnrY24Hh32_7d5OKLFSpSDrBlqfyQuY8Wbs2h8Wy4Z4hwT1aWDO7b-SqJA181hUbNcF_rR4Mze3Fdtu-3uOIQYgLBBRmN1ZHDLk0EKNCI4B8MyDKLGPoM0ZomV5lVwVWjAMRI4CgQkIQ9rnm-Adof-GbegQL3yJSoNIWRWgzCnZBYZ638QgPllCMVW3WvEVvsgj0Hj16PbofqXTQ5S73LINfP6FZawfC0yMrYjSV_N2L0Lkp2KI3BkJcy-PcFhBnhwu2IsJGAlyDRCnXdVqig8m5yLHuSMQTpLW69LzPEskfsjhnNDR-CEBZpicjMfc-4CL6U7E7YoGc_99DzE5U5._JfqyKH23GiKsnDW.ZtMMjZ3GgcgHss8qbFRhrjl4L0kAfbco-oXICkk.VBHJ00FyDTYjOA_OYfiz5g \ No newline at end of file +value: eyJlbmMiOiJBMjU2R0NNIiwiYWxnIjoiUlNBLU9BRVAtMjU2In0.nlXGAufYH36IABDy0En0LXEhGfC20IZSSchs27ADalHpRoTZKfXhc7hcMk8Y9V8yTP0jYbmrq6NtEg-QS2O5TQFD9Hluhpb631PBgKjPXHYX1Y6iUcR1sXxSUPjePi8F8PcZUZuUJLnhz6myyc9scdAq9BXG2cDJVgkfLI8eZdrqnrY24Hh32_7d5OKLFSpSDrBlqfyQuY8Wbs2h8Wy4Z4hwT1aWDO7b-SqJA181hUbNcF_rR4Mze3Fdtu-3uOIQYgLBBRmN1ZHDLk0EKNCI4B8MyDKLGPoM0ZomV5lVwVWjAMRI4CgQkIQ9rnm-Adof-GbegQL3yJSoNIWRWgzCnZBYZ638QgPllCMVW3WvEVvsgj0Hj16PbofqXTQ5S73LINfP6FZawfC0yMrYjSV_N2L0Lkp2KI3BkJcy-PcFhBnhwu2IsJGAlyDRCnXdVqig8m5yLHuSMQTpLW69LzPEskfsjhnNDR-CEBZpicjMfc-4CL6U7E7YoGc_99DzE5U5._JfqyKH23GiKsnDW.ZtMMjZ3GgcgHss8qbFRhrjl4L0kAfbco-oXICkk.VBHJ00FyDTYjOA_OYfiz5g diff --git a/spec/examples/patch-destination-contact.yaml b/spec/examples/patch-destination-contact.yaml new file mode 100644 index 0000000000000000000000000000000000000000..ea0f93d021866207d27b8fb30420f05cdfa1471d --- /dev/null +++ b/spec/examples/patch-destination-contact.yaml @@ -0,0 +1,7 @@ +value: + contactInformation: + legalName: Max + address: Musterstr. 31, 10000 Berlin, Deutschland + phone: "+49170123456789" + email: max@mustermann.not + unit: Department XYZ \ No newline at end of file diff --git a/spec/examples/patch-destination-status.yaml b/spec/examples/patch-destination-status.yaml new file mode 100644 index 0000000000000000000000000000000000000000..6cf215f2dd1cb02811c080449ca4936da23d99f9 --- /dev/null +++ b/spec/examples/patch-destination-status.yaml @@ -0,0 +1,2 @@ +value: + status: active \ No newline at end of file diff --git a/spec/examples/patch-destination.yaml b/spec/examples/patch-destination.yaml deleted file mode 100644 index f7f52bf5ef15408603625fed7b832ddb686b1c87..0000000000000000000000000000000000000000 --- a/spec/examples/patch-destination.yaml +++ /dev/null @@ -1,11 +0,0 @@ -Beispiel Kontakt: - value: - contactInformation: - legalName: Max - address: Musterstr. 31, 10000 Berlin, Deutschland - phone: "+49170123456789" - email: max@mustermann.not - unit: Department XYZ -Beispiel Status: - value: - status: active \ No newline at end of file diff --git a/spec/headers/hmac-cb-authentication.yaml b/spec/headers/hmac-cb-authentication.yaml index 7e23d97e7abd7f1464ec9211d9a38c8fb0f5b94a..6932a8d1c69e73596eef81987202a00ab38a7a73 100644 --- a/spec/headers/hmac-cb-authentication.yaml +++ b/spec/headers/hmac-cb-authentication.yaml @@ -1,5 +1,5 @@ in: header -name: 'callback-authentication' +name: 'Callback-Authentication' required: true description: Der Message Authentication Code des übertragenen Callbacks schema: diff --git a/spec/headers/hmac-cb-timestamp.yaml b/spec/headers/hmac-cb-timestamp.yaml index d23d6958ec00b015627faec0c00c2f0b9ed9f7dc..48ddfbb54054869942960e64b370ef18038fcf1b 100644 --- a/spec/headers/hmac-cb-timestamp.yaml +++ b/spec/headers/hmac-cb-timestamp.yaml @@ -1,5 +1,5 @@ in: header -name: 'callback-timestamp' +name: 'Callback-Timestamp' required: true description: Der Timestamp des Message Authentication Code. schema: diff --git a/spec/parameters/destinationId.yaml b/spec/parameters/destinationId.yaml index bbf0bed8ecec4495ea5f942474565983ebb025ec..91c1f39875ecb9fa5a1804a4064de36c0f8ea75f 100644 --- a/spec/parameters/destinationId.yaml +++ b/spec/parameters/destinationId.yaml @@ -6,4 +6,4 @@ schema: format: uuid minLength: 32 maxLength: 36 -description: Die UUID des Zustellpunktes \ No newline at end of file +description: Die UUID des Zustellpunktes diff --git a/spec/submission-api.yaml b/spec/submission-api.yaml index 29f141150377cb64fbb002e3569a18078437119a..48a06151cef84c64d767b2777a60d4701afbfca4 100644 --- a/spec/submission-api.yaml +++ b/spec/submission-api.yaml @@ -1,4 +1,5 @@ openapi: 3.0.0 + info: version: 'API_VERSION' title: Submission API für Antragsverfahren und Berichtspflichten @@ -11,12 +12,15 @@ info: url: 'https://creativecommons.org/licenses/by-sa/4.0/' name: Creative Commons Attribution Share Alike 4.0 (CC BY-SA 4.0) termsOfService: https://docs.fitko.de/fit-connect/docs/details/terms-of-use-testing/ + servers: - url: 'https://submission-api-testing.fit-connect.fitko.dev' description: "FIT-Connect Testumgebung" + externalDocs: description: FIT-Connect-Dokumentationsportal mit Dokumentation zur API-Nutzung url: https://docs.fitko.de/fit-connect + tags: - name: Zustellpunktverwaltung description: >- @@ -85,6 +89,10 @@ components: $ref: './parameters/pagination/limit.yaml' offset: $ref: './parameters/pagination/offset.yaml' + + # Callback Headers need to be defined in the parameters section of a callback which requires + # an 'in' key that is incompatible with the headers section here where it is disallowed. Solution: + # define them here in the parameteters with 'in' key Callback-Authentication: $ref: './headers/hmac-cb-authentication.yaml' Callback-Timestamp: @@ -187,6 +195,12 @@ components: $ref: './examples/jwk-verify.yaml' JWKWrapKey: $ref: './examples/jwk-wrapKey.yaml' + UpdateDestination: + $ref: './examples/update-destination.yaml' + PatchDestinationStatus: + $ref: './examples/patch-destination-status.yaml' + PatchDestinationContact: + $ref: './examples/patch-destination-contact.yaml' callbacks: NewEvents: diff --git a/validate.sh b/validate.sh index 1e267b22a741cf3743037431f59e532c9b2c84b7..a31ddecad7dfe8f2ffd925515f7268712c0242e3 100755 --- a/validate.sh +++ b/validate.sh @@ -4,15 +4,14 @@ set -eu ./bundle.sh -YML_IN="spec/submission-api-bundled.yaml" +YML_IN="spec/submission-api.yaml" +YML_OUT="dist/submission-api.yaml" docker run --rm -v "$(pwd):/work" jeanberu/swagger-cli \ swagger-cli validate "/work/$YML_IN" -docker run --rm -v "$(pwd):/work" -w /work stoplight/spectral:5 \ - lint "/work/$YML_IN" -D +docker run --rm -v "$(pwd):/work" -w /work stoplight/spectral:5.9.1 \ + lint "$YML_IN" --verbose -java -jar openapi4j-parser-cli-1.0.0.jar "$YML_IN" - -grep -c '~' "$YML_IN" >/dev/null && \ - { echo "You have relative references in the output. Fix them by adding it to the components tree."; exit 1; } \ No newline at end of file +grep -c '~' "$YML_OUT" >/dev/null && \ + { echo "You have relative references in the output. Fix them by adding them to the components tree."; exit 1; }