From a9d6a5d5772e2264df204e0479a55fe4c3fd7b2e Mon Sep 17 00:00:00 2001 From: Melsy Huamani Date: Tue, 5 May 2026 14:09:05 -0500 Subject: [PATCH 01/28] feat: add comprehensive test coverage for openapi 3.1 and 3.2 --- .../sonar/openapi/BaseCheckTest.java | 25 +- .../openapi/ExtendedOpenApiCheckVerifier.java | 10 +- .../wso2/OAR002ValidWso2ScopesCheckTest.java | 42 ++ ...DefinedWso2ScopesDescriptionCheckTest.java | 26 + .../OAR004ValidWso2ScopesRolesCheckTest.java | 18 + .../OAR005UndefinedWso2ScopeUseCheckTest.java | 26 + ...OAR040StandardWso2ScopesNameCheckTest.java | 18 + ...ndefinedAuthTypeForWso2ScopeCheckTest.java | 26 + .../examples/OAR031ExamplesCheckTest.java | 34 + .../examples/OAR094UseExamplesCheckTest.java | 26 + ...006UndefinedRequestMediaTypeCheckTest.java | 10 + ...07UndefinedResponseMediaTypeCheckTest.java | 10 + ...AR009DefaultRequestMediaTypeCheckTest.java | 58 ++ ...R010DefaultResponseMediaTypeCheckTest.java | 50 ++ .../OAR011UrlNamingConventionCheckTest.java | 26 + ...012ParameterNamingConventionCheckTest.java | 12 + .../format/OAR016NumericFormatCheckTest.java | 18 + .../format/OAR037StringFormatCheckTest.java | 18 + .../format/OAR042BasePathCheckTest.java | 26 + .../format/OAR044MediaTypeCheckTest.java | 10 + .../OAR050ProvideOpSummaryCheckTest.java | 10 + ...051DescriptionDiffersSummaryCheckTest.java | 10 + ...OAR052UndefinedNumericFormatCheckTest.java | 18 + ...066SnakeCaseNamingConventionCheckTest.java | 18 + ...067CamelCaseNamingConventionCheckTest.java | 18 + ...68PascalCaseNamingConventionCheckTest.java | 26 + ...77ParametersInQuerySnakeCaseCheckTest.java | 18 + .../OAR086DescriptionFormatCheckTest.java | 34 + .../format/OAR087SummaryFormatCheckTest.java | 18 + .../format/OAR088RefParamCheckTest.java | 18 + .../format/OAR089RefRequestBodyCheckTest.java | 18 + .../format/OAR090RefResponseCheckTest.java | 18 + .../format/OAR097ShortBasePathCheckTest.java | 18 + .../format/OAR098LongBasePathCheckTest.java | 18 + .../OAR099ApiPrefixBasePathCheckTest.java | 18 + .../OAR100LastPartBasePathCheckTest.java | 18 + .../OAR101FirstPartBasePathCheckTest.java | 18 + .../OAR102SecondPartBasePathCheckTest.java | 18 + .../OAR110LicenseInformationCheckTest.java | 10 + .../OAR111ContactInformationCheckTest.java | 10 + .../format/OAR113CustomFieldCheckTest.java | 18 + .../OAR115VerifyRequiredFieldsTest.java | 18 + .../OAR008AllowedHttpVerbCheckTest.java | 10 + .../OAR013DefaultResponseCheckTest.java | 10 + ...LevelWithinNonSuggestedRangeCheckTest.java | 10 + ...AR015ResourceLevelMaxAllowedCheckTest.java | 10 + .../OAR017ResourcePathCheckTest.java | 10 + .../OAR018ResourcesByVerbCheckTest.java | 10 + ...27PostResponseLocationHeaderCheckTest.java | 42 ++ .../OAR030StatusEndpointCheckTest.java | 26 + .../OAR032AmbiguousElementsPathCheckTest.java | 18 + ...OAR038StandardCreateResponseCheckTest.java | 50 ++ .../OAR039StandardResponseCodesCheckTest.java | 18 + .../OAR046DeclaredTagCheckTest.java | 10 + .../OAR047DocumentedTagCheckTest.java | 2 + ...OAR048AtMostOneBodyParameterCheckTest.java | 2 + .../operations/OAR061GetMethodCheckTest.java | 18 + .../operations/OAR062PostMethodCheckTest.java | 18 + .../operations/OAR063PutMethodCheckTest.java | 18 + .../OAR064PatchMethodCheckTest.java | 18 + .../OAR065DeleteMethodCheckTest.java | 18 + .../OAR071GetQueryParamsDefinedCheckTest.java | 18 + .../OAR091ParamOnlyRefCheckTest.java | 18 + .../OAR092RequestBodyOnlyRefCheckTest.java | 18 + .../OAR093ResponseOnlyRefCheckTest.java | 18 + .../OAR103ResourcesByGetVerbCheckTest.java | 10 + .../OAR104ResourcesByPostVerbCheckTest.java | 10 + .../OAR105ResourcesByPutVerbCheckTest.java | 10 + .../OAR106ResourcesByPatchVerbCheckTest.java | 10 + .../OAR107ResourcesByDeleteVerbCheckTest.java | 10 + ...ForbiddenInternalServerErrorCheckTest.java | 10 + .../OAR070BrokenAccessControlCheckTest.java | 18 + .../owasp/OAR073RateLimitCheckTest.java | 18 + .../OAR019SelectParameterCheckTest.java | 50 +- .../OAR020ExpandParameterCheckTest.java | 42 ++ .../OAR021ExcludeParameterCheckTest.java | 42 ++ .../OAR022OrderbyParameterCheckTest.java | 26 + .../OAR023TotalParameterCheckTest.java | 26 + .../OAR024StartParameterCheckTest.java | 26 + .../OAR025LimitParameterCheckTest.java | 26 + ...26TotalParameterDefaultValueCheckTest.java | 10 + .../OAR028FilterParameterCheckTest.java | 50 ++ ...AR060QueryParametersOptionalCheckTest.java | 18 + .../OAR069PathParamAndQueryCheckTest.java | 18 + .../checks/regex/OAR112RegexCheckTest.java | 124 +++- ...OAR029StandardResponseSchemaCheckTest.java | 44 +- ...4StandardPagedResponseSchemaCheckTest.java | 83 ++- .../OAR080SecuritySchemasCheckTest.java | 2 + .../OAR108SchemaValidatorCheckTest.java | 18 + ...OAR001MandatoryHttpsProtocolCheckTest.java | 18 + .../security/OAR033HttpHeadersCheckTest.java | 26 + ...OAR035AuthorizationResponsesCheckTest.java | 18 + .../OAR036SessionMechanismCheckTest.java | 18 + .../OAR045DefinedResponseCheckTest.java | 2 + .../OAR049NoContentIn204CheckTest.java | 10 + .../OAR053ResponseHeadersCheckTest.java | 10 + .../checks/security/OAR054HostCheckTest.java | 10 + .../OAR072NonOKModelResponseCheckTest.java | 18 + ...074NumericParameterIntegrityCheckTest.java | 18 + ...R075StringParameterIntegrityCheckTest.java | 18 + .../OAR076NumericFormatCheckTest.java | 18 + .../OAR078VerbsSecurityCheckTest.java | 18 + .../OAR079PathParameter404CheckTest.java | 34 + .../OAR081PasswordFormatCheckTest.java | 26 + .../OAR082BinaryOrByteFormatCheckTest.java | 10 + .../OAR083ForbiddenQueryParamsCheckTest.java | 58 ++ ...AR084ForbiddenFormatsInQueryCheckTest.java | 58 ++ .../OAR085OpenAPIVersionCheckTest.java | 18 +- .../OAR096ForbiddenResponseCheckTest.java | 18 + .../OAR114HttpResponseHeadersChecksTest.java | 26 + .../v3/core/OAR045/defined-response.json | 78 +++ .../v3/core/OAR045/defined-response.yaml | 48 ++ .../operations/OAR045/defined-response.json | 78 +++ .../operations/OAR045/defined-response.yaml | 48 ++ .../v3/security/OAR045/defined-response.json | 78 +++ .../v3/security/OAR045/defined-response.yaml | 48 ++ .../checks/v31/core/OAR044/media-type.json | 45 ++ .../checks/v31/core/OAR044/media-type.yaml | 29 + .../v31/core/OAR045/defined-response.json | 78 +++ .../v31/core/OAR045/defined-response.yaml | 48 ++ .../checks/v31/core/OAR046/declared-tag.json | 26 + .../checks/v31/core/OAR046/declared-tag.yaml | 17 + .../v31/core/OAR047/documented-tag.json | 24 + .../v31/core/OAR047/documented-tag.yaml | 18 + .../v31/core/OAR049/no-content-in-204.json | 25 + .../v31/core/OAR049/no-content-in-204.yaml | 14 + .../v31/core/OAR050/provide-summary.json | 26 + .../v31/core/OAR050/provide-summary.yaml | 15 + .../core/OAR051/different-description.json | 30 + .../core/OAR051/different-description.yaml | 21 + .../v31/examples/OAR094/externalref.yaml | 62 ++ .../v31/examples/OAR094/invalid-example.json | 54 ++ .../v31/examples/OAR094/invalid-example.yaml | 31 + .../v31/examples/OAR094/valid-example.json | 62 ++ .../v31/examples/OAR094/valid-example.yaml | 35 ++ .../v31/format/OAR006/without-anything.json | 18 + .../v31/format/OAR006/without-anything.yaml | 10 + .../v31/format/OAR007/without-anything.json | 18 + .../v31/format/OAR007/without-anything.yaml | 10 + .../operation-not-allows-request-body.json | 23 + .../operation-not-allows-request-body.yaml | 14 + .../format/OAR009/with-default-and-$ref.json | 43 ++ .../format/OAR009/with-default-and-$ref.yaml | 25 + .../OAR009/with-default-and-specific.json | 38 ++ .../OAR009/with-default-and-specific.yaml | 22 + .../v31/format/OAR009/with-specific.json | 37 ++ .../v31/format/OAR009/with-specific.yaml | 22 + .../with-wrong-default-and-specific.json | 37 ++ .../with-wrong-default-and-specific.yaml | 21 + .../v31/format/OAR009/with-wrong-default.json | 23 + .../v31/format/OAR009/with-wrong-default.yaml | 13 + .../v31/format/OAR009/without-anything.json | 18 + .../v31/format/OAR009/without-anything.yaml | 10 + .../format/OAR010/with-default-and-$ref.json | 29 + .../format/OAR010/with-default-and-$ref.yaml | 17 + .../OAR010/with-default-and-specific.json | 34 + .../OAR010/with-default-and-specific.yaml | 20 + .../v31/format/OAR010/with-specific.json | 33 + .../v31/format/OAR010/with-specific.yaml | 20 + .../with-wrong-default-and-specific.json | 33 + .../with-wrong-default-and-specific.yaml | 19 + .../v31/format/OAR010/with-wrong-default.json | 21 + .../v31/format/OAR010/with-wrong-default.yaml | 12 + .../v31/format/OAR010/without-anything.json | 18 + .../v31/format/OAR010/without-anything.yaml | 10 + .../v31/format/OAR011/base-path-ok.json | 13 + .../v31/format/OAR011/base-path-ok.yaml | 7 + .../v31/format/OAR011/base-path-wrong.json | 13 + .../v31/format/OAR011/base-path-wrong.yaml | 7 + .../checks/v31/format/OAR011/plain.json | 90 +++ .../checks/v31/format/OAR011/plain.yaml | 50 ++ .../v31/format/OAR012/camel-case-plain.json | 136 ++++ .../v31/format/OAR012/camel-case-plain.yaml | 78 +++ .../format/OAR012/camel-case-with-$ref.json | 209 +++++++ .../format/OAR012/camel-case-with-$ref.yaml | 130 ++++ .../v31/format/OAR012/kebab-case-plain.json | 136 ++++ .../v31/format/OAR012/kebab-case-plain.yaml | 78 +++ .../format/OAR012/kebab-case-with-$ref.json | 209 +++++++ .../format/OAR012/kebab-case-with-$ref.yaml | 130 ++++ .../v31/format/OAR012/snake-case-plain.json | 136 ++++ .../v31/format/OAR012/snake-case-plain.yaml | 78 +++ .../format/OAR012/snake-case-with-$ref.json | 209 +++++++ .../format/OAR012/snake-case-with-$ref.yaml | 130 ++++ .../checks/v31/format/OAR016/nested.json | 40 ++ .../checks/v31/format/OAR016/nested.yaml | 25 + .../checks/v31/format/OAR016/plain.json | 42 ++ .../checks/v31/format/OAR016/plain.yaml | 27 + .../checks/v31/format/OAR016/with-$ref.json | 47 ++ .../checks/v31/format/OAR016/with-$ref.yaml | 29 + .../checks/v31/format/OAR037/complete.json | 116 ++++ .../checks/v31/format/OAR037/complete.yaml | 76 +++ .../checks/v31/format/OAR037/nested.json | 36 ++ .../checks/v31/format/OAR037/nested.yaml | 22 + .../checks/v31/format/OAR037/with-$ref.json | 47 ++ .../checks/v31/format/OAR037/with-$ref.yaml | 29 + .../v31/format/OAR042/incorrect-version.json | 13 + .../v31/format/OAR042/incorrect-version.yaml | 7 + .../checks/v31/format/OAR042/too-long.json | 13 + .../checks/v31/format/OAR042/too-long.yaml | 7 + .../checks/v31/format/OAR042/too-short.json | 13 + .../checks/v31/format/OAR042/too-short.yaml | 7 + .../checks/v31/format/OAR042/valid.json | 13 + .../checks/v31/format/OAR042/valid.yaml | 7 + .../v31/format/OAR042/without-api-prefix.json | 13 + .../v31/format/OAR042/without-api-prefix.yaml | 7 + .../checks/v31/format/OAR052/nested.json | 39 ++ .../checks/v31/format/OAR052/nested.yaml | 24 + .../checks/v31/format/OAR052/plain.json | 40 ++ .../checks/v31/format/OAR052/plain.yaml | 24 + .../checks/v31/format/OAR052/with-$ref.json | 46 ++ .../checks/v31/format/OAR052/with-$ref.yaml | 28 + .../v31/format/OAR066/snake-case-error.json | 42 ++ .../v31/format/OAR066/snake-case-error.yaml | 29 + .../checks/v31/format/OAR066/valid.json | 40 ++ .../checks/v31/format/OAR066/valid.yaml | 25 + .../v31/format/OAR067/camel-case-error.json | 42 ++ .../v31/format/OAR067/camel-case-error.yaml | 29 + .../checks/v31/format/OAR067/valid.json | 40 ++ .../checks/v31/format/OAR067/valid.yaml | 25 + .../checks/v31/format/OAR068/externalref.yaml | 62 ++ .../v31/format/OAR068/pascal-case-error.json | 41 ++ .../v31/format/OAR068/pascal-case-error.yaml | 29 + .../checks/v31/format/OAR068/valid.json | 40 ++ .../checks/v31/format/OAR068/valid.yaml | 25 + .../v31/format/OAR077/not-valid-in-query.json | 34 + .../v31/format/OAR077/not-valid-in-query.yaml | 19 + .../v31/format/OAR077/valid-in-query.json | 34 + .../v31/format/OAR077/valid-in-query.yaml | 19 + .../format/OAR086/external-refexample.yaml | 62 ++ .../format/OAR086/internal-refexample.yaml | 66 ++ .../v31/format/OAR086/invalid-example.json | 60 ++ .../v31/format/OAR086/invalid-example.yaml | 41 ++ .../v31/format/OAR086/valid-example.json | 60 ++ .../v31/format/OAR086/valid-example.yaml | 69 +++ .../v31/format/OAR087/invalid-example.json | 38 ++ .../v31/format/OAR087/invalid-example.yaml | 26 + .../v31/format/OAR087/valid-example.json | 38 ++ .../v31/format/OAR087/valid-example.yaml | 26 + .../checks/v31/format/OAR088/invalid-ref.json | 35 ++ .../checks/v31/format/OAR088/invalid-ref.yaml | 20 + .../checks/v31/format/OAR088/valid-ref.json | 35 ++ .../checks/v31/format/OAR088/valid-ref.yaml | 20 + .../checks/v31/format/OAR089/invalid-ref.json | 49 ++ .../checks/v31/format/OAR089/invalid-ref.yaml | 28 + .../checks/v31/format/OAR089/valid-ref.json | 49 ++ .../checks/v31/format/OAR089/valid-ref.yaml | 28 + .../checks/v31/format/OAR090/invalid-ref.json | 25 + .../checks/v31/format/OAR090/invalid-ref.yaml | 14 + .../checks/v31/format/OAR090/valid-ref.json | 25 + .../checks/v31/format/OAR090/valid-ref.yaml | 14 + .../checks/v31/format/OAR097/too-short.json | 13 + .../checks/v31/format/OAR097/too-short.yaml | 7 + .../checks/v31/format/OAR097/valid.json | 13 + .../checks/v31/format/OAR097/valid.yaml | 7 + .../checks/v31/format/OAR098/too-long.json | 13 + .../checks/v31/format/OAR098/too-long.yaml | 7 + .../checks/v31/format/OAR098/valid.json | 13 + .../checks/v31/format/OAR098/valid.yaml | 7 + .../checks/v31/format/OAR099/valid.json | 13 + .../checks/v31/format/OAR099/valid.yaml | 7 + .../v31/format/OAR099/without-api-prefix.json | 13 + .../v31/format/OAR099/without-api-prefix.yaml | 7 + .../v31/format/OAR100/incorrect-version.json | 13 + .../v31/format/OAR100/incorrect-version.yaml | 7 + .../checks/v31/format/OAR100/valid.json | 13 + .../checks/v31/format/OAR100/valid.yaml | 7 + .../checks/v31/format/OAR101/empty-path.json | 13 + .../checks/v31/format/OAR101/empty-path.yaml | 7 + .../checks/v31/format/OAR101/invalid.json | 13 + .../checks/v31/format/OAR101/invalid.yaml | 7 + .../v31/format/OAR101/valid-with-values.json | 13 + .../v31/format/OAR101/valid-with-values.yaml | 7 + .../checks/v31/format/OAR101/valid.json | 13 + .../checks/v31/format/OAR101/valid.yaml | 7 + .../checks/v31/format/OAR102/invalid.json | 13 + .../checks/v31/format/OAR102/invalid.yaml | 7 + .../v31/format/OAR102/one-part-path.json | 13 + .../v31/format/OAR102/one-part-path.yaml | 7 + .../v31/format/OAR102/valid-with-values.json | 13 + .../v31/format/OAR102/valid-with-values.yaml | 7 + .../checks/v31/format/OAR102/valid.json | 13 + .../checks/v31/format/OAR102/valid.yaml | 7 + .../checks/v31/format/OAR110/valid.json | 19 + .../checks/v31/format/OAR110/valid.yaml | 14 + .../checks/v31/format/OAR111/valid.json | 19 + .../checks/v31/format/OAR111/valid.yaml | 14 + .../checks/v31/format/OAR113/invalid.json | 26 + .../checks/v31/format/OAR113/invalid.yaml | 16 + .../checks/v31/format/OAR113/valid.json | 45 ++ .../checks/v31/format/OAR113/valid.yaml | 27 + .../checks/v31/format/OAR115/invalid.json | 45 ++ .../checks/v31/format/OAR115/invalid.yaml | 30 + .../checks/v31/format/OAR115/valid.json | 44 ++ .../checks/v31/format/OAR115/valid.yaml | 29 + .../operations/OAR045/defined-response.json | 78 +++ .../operations/OAR045/defined-response.yaml | 48 ++ .../operations/OAR048/many-body-params.json | 75 +++ .../operations/OAR048/many-body-params.yaml | 47 ++ .../OAR061/insuficent-response-codes.json | 39 ++ .../OAR061/insuficent-response-codes.yaml | 23 + .../checks/v31/operations/OAR061/valid.json | 41 ++ .../checks/v31/operations/OAR061/valid.yaml | 25 + .../OAR062/insuficent-response-codes.json | 39 ++ .../OAR062/insuficent-response-codes.yaml | 23 + .../checks/v31/operations/OAR062/valid.json | 41 ++ .../checks/v31/operations/OAR062/valid.yaml | 25 + .../OAR063/insuficent-response-codes.json | 39 ++ .../OAR063/insuficent-response-codes.yaml | 23 + .../checks/v31/operations/OAR063/valid.json | 41 ++ .../checks/v31/operations/OAR063/valid.yaml | 25 + .../OAR064/insuficent-response-codes.json | 39 ++ .../OAR064/insuficent-response-codes.yaml | 23 + .../checks/v31/operations/OAR064/valid.json | 41 ++ .../checks/v31/operations/OAR064/valid.yaml | 25 + .../OAR065/insuficent-response-codes.json | 39 ++ .../OAR065/insuficent-response-codes.yaml | 24 + .../checks/v31/operations/OAR065/valid.json | 41 ++ .../checks/v31/operations/OAR065/valid.yaml | 25 + .../OAR071/missing-query-params.json | 59 ++ .../OAR071/missing-query-params.yaml | 34 + .../operations/OAR071/valid-query-params.json | 66 ++ .../operations/OAR071/valid-query-params.yaml | 38 ++ .../checks/v31/operations/OAR091/no-ref.json | 37 ++ .../checks/v31/operations/OAR091/no-ref.yaml | 22 + .../v31/operations/OAR091/with-ref.json | 44 ++ .../v31/operations/OAR091/with-ref.yaml | 26 + .../checks/v31/operations/OAR092/no-ref.json | 52 ++ .../checks/v31/operations/OAR092/no-ref.yaml | 579 ++++++++++++++++++ .../v31/operations/OAR092/with-ref.json | 44 ++ .../v31/operations/OAR092/with-ref.yaml | 33 + .../checks/v31/operations/OAR093/no-ref.json | 37 ++ .../checks/v31/operations/OAR093/no-ref.yaml | 22 + .../v31/operations/OAR093/with-ref.json | 44 ++ .../v31/operations/OAR093/with-ref.yaml | 26 + .../checks/v31/operations/OAR103/plain.json | 63 ++ .../checks/v31/operations/OAR103/plain.yaml | 35 ++ .../checks/v31/operations/OAR104/plain.yaml | 40 ++ .../checks/v31/operations/OAR105/plain.json | 63 ++ .../checks/v31/operations/OAR105/plain.yaml | 35 ++ .../checks/v31/operations/OAR106/plain.json | 63 ++ .../checks/v31/operations/OAR106/plain.yaml | 35 ++ .../checks/v31/operations/OAR107/plain.json | 63 ++ .../checks/v31/operations/OAR107/plain.yaml | 35 ++ .../checks/v31/operations/OAR109/plain.json | 42 ++ .../checks/v31/operations/OAR109/plain.yaml | 25 + .../checks/v31/owasp/OAR070/no-numeric.json | 42 ++ .../checks/v31/owasp/OAR070/no-numeric.yaml | 25 + .../checks/v31/owasp/OAR070/numeric.json | 42 ++ .../checks/v31/owasp/OAR070/numeric.yaml | 25 + .../v31/owasp/OAR073/no-rate-limit.json | 29 + .../v31/owasp/OAR073/no-rate-limit.yaml | 17 + .../checks/v31/owasp/OAR073/no-responses.json | 14 + .../checks/v31/owasp/OAR073/no-responses.yaml | 8 + .../checks/v31/owasp/OAR073/rate-limit.json | 39 ++ .../checks/v31/owasp/OAR073/rate-limit.yaml | 23 + .../v31/parameters/OAR019/excluded.json | 2 +- .../v31/parameters/OAR019/excluded.yaml | 2 +- .../v31/parameters/OAR019/plain-without.json | 2 +- .../v31/parameters/OAR019/plain-without.yaml | 2 +- .../checks/v31/parameters/OAR019/plain.json | 2 +- .../checks/v31/parameters/OAR019/plain.yaml | 2 +- .../parameters/OAR019/with-$ref-without.json | 47 ++ .../parameters/OAR019/with-$ref-without.yaml | 29 + .../v31/parameters/OAR019/with-$ref.json | 47 ++ .../v31/parameters/OAR019/with-$ref.yaml | 29 + .../v31/parameters/OAR019/with-param.json | 27 + .../v31/parameters/OAR019/with-param.yaml | 15 + .../v31/parameters/OAR019/with-ref.json | 2 +- .../v31/parameters/OAR019/with-ref.yaml | 2 +- .../parameters/OAR019/without-parameters.json | 18 + .../parameters/OAR019/without-parameters.yaml | 10 + .../v31/parameters/OAR020/excluded.json | 37 ++ .../v31/parameters/OAR020/excluded.yaml | 23 + .../v31/parameters/OAR020/excluded2.json | 37 ++ .../v31/parameters/OAR020/excluded2.yaml | 23 + .../v31/parameters/OAR020/plain-without.json | 37 ++ .../v31/parameters/OAR020/plain-without.yaml | 23 + .../v31/parameters/OAR020/plain-without2.json | 37 ++ .../v31/parameters/OAR020/plain-without2.yaml | 23 + .../checks/v31/parameters/OAR020/plain.json | 37 ++ .../checks/v31/parameters/OAR020/plain.yaml | 23 + .../checks/v31/parameters/OAR020/plain2.json | 37 ++ .../checks/v31/parameters/OAR020/plain2.yaml | 23 + .../parameters/OAR020/with-$ref-without.json | 47 ++ .../parameters/OAR020/with-$ref-without.yaml | 29 + .../v31/parameters/OAR020/with-$ref.json | 47 ++ .../v31/parameters/OAR020/with-$ref.yaml | 29 + .../v31/parameters/OAR020/with-param.json | 27 + .../v31/parameters/OAR020/with-param.yaml | 15 + .../v31/parameters/OAR020/with-ref.json | 37 ++ .../v31/parameters/OAR020/with-ref.yaml | 23 + .../parameters/OAR020/without-parameters.json | 18 + .../parameters/OAR020/without-parameters.yaml | 10 + .../v31/parameters/OAR021/excluded.json | 37 ++ .../v31/parameters/OAR021/excluded.yaml | 23 + .../v31/parameters/OAR021/plain-without.json | 37 ++ .../v31/parameters/OAR021/plain-without.yaml | 23 + .../checks/v31/parameters/OAR021/plain.json | 37 ++ .../checks/v31/parameters/OAR021/plain.yaml | 23 + .../parameters/OAR021/with-$ref-without.json | 47 ++ .../parameters/OAR021/with-$ref-without.yaml | 29 + .../v31/parameters/OAR021/with-$ref.json | 47 ++ .../v31/parameters/OAR021/with-$ref.yaml | 29 + .../v31/parameters/OAR021/with-param.json | 27 + .../v31/parameters/OAR021/with-param.yaml | 15 + .../v31/parameters/OAR021/with-ref.json | 37 ++ .../v31/parameters/OAR021/with-ref.yaml | 23 + .../parameters/OAR021/without-parameters.json | 18 + .../parameters/OAR021/without-parameters.yaml | 10 + .../v31/parameters/OAR022/excluded.json | 37 ++ .../v31/parameters/OAR022/excluded.yaml | 23 + .../v31/parameters/OAR022/plain-without.json | 37 ++ .../v31/parameters/OAR022/plain-without.yaml | 23 + .../checks/v31/parameters/OAR022/plain.json | 37 ++ .../checks/v31/parameters/OAR022/plain.yaml | 23 + .../parameters/OAR022/with-$ref-without.json | 47 ++ .../parameters/OAR022/with-$ref-without.yaml | 29 + .../v31/parameters/OAR022/with-$ref.json | 47 ++ .../v31/parameters/OAR022/with-$ref.yaml | 29 + .../parameters/OAR022/without-parameters.json | 18 + .../parameters/OAR022/without-parameters.yaml | 10 + .../v31/parameters/OAR023/excluded.json | 37 ++ .../v31/parameters/OAR023/excluded.yaml | 23 + .../v31/parameters/OAR023/plain-without.json | 37 ++ .../v31/parameters/OAR023/plain-without.yaml | 23 + .../checks/v31/parameters/OAR023/plain.json | 37 ++ .../checks/v31/parameters/OAR023/plain.yaml | 23 + .../parameters/OAR023/with-$ref-without.json | 44 ++ .../parameters/OAR023/with-$ref-without.yaml | 27 + .../v31/parameters/OAR023/with-$ref.json | 44 ++ .../v31/parameters/OAR023/with-$ref.yaml | 27 + .../parameters/OAR023/without-parameters.json | 18 + .../parameters/OAR023/without-parameters.yaml | 10 + .../v31/parameters/OAR024/excluded.json | 37 ++ .../v31/parameters/OAR024/excluded.yaml | 23 + .../v31/parameters/OAR024/plain-without.json | 37 ++ .../v31/parameters/OAR024/plain-without.yaml | 23 + .../checks/v31/parameters/OAR024/plain.json | 37 ++ .../checks/v31/parameters/OAR024/plain.yaml | 23 + .../parameters/OAR024/with-$ref-without.json | 45 ++ .../parameters/OAR024/with-$ref-without.yaml | 28 + .../v31/parameters/OAR024/with-$ref.json | 45 ++ .../v31/parameters/OAR024/with-$ref.yaml | 28 + .../parameters/OAR024/without-parameters.json | 18 + .../parameters/OAR024/without-parameters.yaml | 10 + .../v31/parameters/OAR025/excluded.json | 37 ++ .../v31/parameters/OAR025/excluded.yaml | 23 + .../v31/parameters/OAR025/plain-without.json | 37 ++ .../v31/parameters/OAR025/plain-without.yaml | 23 + .../checks/v31/parameters/OAR025/plain.json | 37 ++ .../checks/v31/parameters/OAR025/plain.yaml | 23 + .../parameters/OAR025/with-$ref-without.json | 45 ++ .../parameters/OAR025/with-$ref-without.yaml | 28 + .../v31/parameters/OAR025/with-$ref.json | 46 ++ .../v31/parameters/OAR025/with-$ref.yaml | 28 + .../parameters/OAR025/without-parameters.json | 18 + .../parameters/OAR025/without-parameters.yaml | 10 + .../plain-with-$total-with-defval-false.json | 35 ++ .../plain-with-$total-with-defval-false.yaml | 22 + .../plain-with-$total-with-defval-true.json | 35 ++ .../plain-with-$total-with-defval-true.yaml | 22 + .../plain-with-$total-without-defval.json | 34 + .../plain-with-$total-without-defval.yaml | 21 + .../OAR026/plain-without-$total.json | 34 + .../OAR026/plain-without-$total.yaml | 21 + ...th-$ref-with-$total-with-defval-false.json | 45 ++ ...th-$ref-with-$total-with-defval-false.yaml | 28 + ...ith-$ref-with-$total-with-defval-true.json | 45 ++ ...ith-$ref-with-$total-with-defval-true.yaml | 28 + .../with-$ref-with-$total-without-defval.json | 44 ++ .../with-$ref-with-$total-without-defval.yaml | 27 + .../OAR026/with-$ref-without-$total.json | 44 ++ .../OAR026/with-$ref-without-$total.yaml | 27 + .../parameters/OAR026/without-parameters.json | 18 + .../parameters/OAR026/without-parameters.yaml | 10 + .../parameters/OAR028/components-param.json | 29 + .../parameters/OAR028/components-param.yaml | 17 + .../OAR028/exclude-noncompliant.json | 37 ++ .../OAR028/exclude-noncompliant.yaml | 23 + .../v31/parameters/OAR028/excluded.json | 37 ++ .../v31/parameters/OAR028/excluded.yaml | 23 + .../v31/parameters/OAR028/plain-without.json | 37 ++ .../v31/parameters/OAR028/plain-without.yaml | 23 + .../checks/v31/parameters/OAR028/plain.json | 37 ++ .../checks/v31/parameters/OAR028/plain.yaml | 23 + .../parameters/OAR028/with-$ref-without.json | 47 ++ .../parameters/OAR028/with-$ref-without.yaml | 29 + .../v31/parameters/OAR028/with-$ref.json | 47 ++ .../v31/parameters/OAR028/with-$ref.yaml | 29 + .../parameters/OAR028/without-parameters.json | 18 + .../parameters/OAR028/without-parameters.yaml | 10 + .../v31/parameters/OAR060/required-false.json | 39 ++ .../v31/parameters/OAR060/required-false.yaml | 25 + .../v31/parameters/OAR060/required-true.json | 39 ++ .../v31/parameters/OAR060/required-true.yaml | 25 + .../v31/parameters/OAR069/bad-request400.json | 42 ++ .../v31/parameters/OAR069/bad-request400.yaml | 25 + .../parameters/OAR069/no-bad-request400.json | 38 ++ .../parameters/OAR069/no-bad-request400.yaml | 22 + .../regex/OAR112/external-docs-invalid.json | 12 + .../regex/OAR112/external-docs-invalid.yaml | 8 + .../v31/regex/OAR112/external-docs-valid.json | 12 + .../v31/regex/OAR112/external-docs-valid.yaml | 8 + .../checks/v31/regex/OAR112/info-invalid.json | 9 + .../checks/v31/regex/OAR112/info-invalid.yaml | 6 + .../checks/v31/regex/OAR112/minimal.json | 8 + .../checks/v31/regex/OAR112/minimal.yaml | 5 + .../v31/regex/OAR112/missing-description.json | 8 + .../v31/regex/OAR112/missing-description.yaml | 5 + .../v31/regex/OAR112/operation-invalid.json | 19 + .../v31/regex/OAR112/operation-invalid.yaml | 11 + .../v31/regex/OAR112/operation-valid.json | 19 + .../v31/regex/OAR112/operation-valid.yaml | 11 + .../v31/regex/OAR112/parameters-invalid.json | 26 + .../v31/regex/OAR112/parameters-invalid.yaml | 16 + .../v31/regex/OAR112/parameters-valid.json | 26 + .../v31/regex/OAR112/parameters-valid.yaml | 16 + .../checks/v31/regex/OAR112/plain.json | 37 ++ .../checks/v31/regex/OAR112/plain.yaml | 46 ++ .../v31/regex/OAR112/servers-invalid.json | 12 + .../v31/regex/OAR112/servers-invalid.yaml | 8 + .../v31/regex/OAR112/servers-valid.json | 12 + .../v31/regex/OAR112/servers-valid.yaml | 8 + .../checks/v31/regex/OAR112/tags-invalid.json | 11 + .../checks/v31/regex/OAR112/tags-invalid.yaml | 7 + .../checks/v31/regex/OAR112/tags-valid.json | 11 + .../checks/v31/regex/OAR112/tags-valid.yaml | 7 + .../checks/v31/resources/OAR008/plain.json | 60 ++ .../checks/v31/resources/OAR008/plain.yaml | 35 ++ .../checks/v31/resources/OAR013/plain.json | 25 + .../checks/v31/resources/OAR013/plain.yaml | 14 + .../checks/v31/resources/OAR014/plain.json | 54 ++ .../checks/v31/resources/OAR014/plain.yaml | 30 + .../checks/v31/resources/OAR015/plain.json | 72 +++ .../checks/v31/resources/OAR015/plain.yaml | 40 ++ .../checks/v31/resources/OAR017/plain.json | 63 ++ .../checks/v31/resources/OAR017/plain.yaml | 52 ++ .../checks/v31/resources/OAR018/plain.json | 194 ++++++ .../checks/v31/resources/OAR018/plain.yaml | 114 ++++ .../checks/v31/resources/OAR027/no-post.json | 18 + .../checks/v31/resources/OAR027/no-post.yaml | 10 + .../OAR027/post-201-with-location.json | 25 + .../OAR027/post-201-with-location.yaml | 14 + .../OAR027/post-201-with-other-headers.json | 25 + .../OAR027/post-201-with-other-headers.yaml | 14 + .../OAR027/post-201-without-location.json | 18 + .../OAR027/post-201-without-location.yaml | 10 + .../v31/resources/OAR027/post-no-201.json | 18 + .../v31/resources/OAR027/post-no-201.yaml | 10 + .../v31/resources/OAR029/valid-all-of-md.json | 134 ++++ .../v31/resources/OAR029/valid-all-of-md.yaml | 78 +++ .../v31/resources/OAR029/valid-all-of.json | 116 ++++ .../v31/resources/OAR029/valid-all-of.yaml | 76 +++ .../checks/v31/resources/OAR029/valid-md.json | 116 ++++ .../checks/v31/resources/OAR029/valid-md.yaml | 69 +++ .../checks/v31/resources/OAR029/valid-r.json | 96 +++ .../checks/v31/resources/OAR029/valid-r.yaml | 59 ++ .../checks/v31/resources/OAR029/valid.json | 105 ++++ .../checks/v31/resources/OAR029/valid.yaml | 69 +++ ...th-error-with-properties-wrong-type-r.json | 88 +++ ...th-error-with-properties-wrong-type-r.yaml | 55 ++ .../with-error-without-properties-r.json | 75 +++ .../with-error-without-properties-r.yaml | 47 ++ .../OAR029/with-error-wrong-type-r.json | 91 +++ .../OAR029/with-error-wrong-type-r.yaml | 57 ++ ...-result-with-properties-wrong-type-md.json | 96 +++ ...-result-with-properties-wrong-type-md.yaml | 56 ++ .../with-result-without-properties-md.json | 80 +++ .../with-result-without-properties-md.yaml | 48 ++ .../OAR029/with-result-wrong-type-md.json | 101 +++ .../OAR029/with-result-wrong-type-md.yaml | 59 ++ ...ith-status-with-properties-wrong-type.json | 90 +++ ...ith-status-with-properties-wrong-type.yaml | 59 ++ .../with-status-without-properties.json | 74 +++ .../with-status-without-properties.yaml | 49 ++ .../OAR029/with-status-wrong-type.json | 101 +++ .../OAR029/with-status-wrong-type.yaml | 66 ++ .../v31/resources/OAR029/without-data-md.json | 103 ++++ .../v31/resources/OAR029/without-data-md.yaml | 61 ++ .../v31/resources/OAR029/without-data.json | 101 +++ .../v31/resources/OAR029/without-data.yaml | 66 ++ .../v31/resources/OAR029/without-error-r.json | 91 +++ .../v31/resources/OAR029/without-error-r.yaml | 57 ++ .../resources/OAR029/without-payload-r.json | 91 +++ .../resources/OAR029/without-payload-r.yaml | 57 ++ .../OAR029/without-required-fields-md.json | 107 ++++ .../OAR029/without-required-fields-md.yaml | 64 ++ .../OAR029/without-required-fields-r.json | 89 +++ .../OAR029/without-required-fields-r.yaml | 55 ++ .../OAR029/without-required-fields.json | 101 +++ .../OAR029/without-required-fields.yaml | 63 ++ .../resources/OAR029/without-result-md.json | 101 +++ .../resources/OAR029/without-result-md.yaml | 59 ++ .../v31/resources/OAR029/without-status.json | 101 +++ .../v31/resources/OAR029/without-status.yaml | 66 ++ .../checks/v31/resources/OAR030/valid.json | 27 + .../checks/v31/resources/OAR030/valid.yaml | 15 + .../OAR030/with-status-without-get.json | 27 + .../OAR030/with-status-without-get.yaml | 15 + .../v31/resources/OAR030/without-status.json | 18 + .../v31/resources/OAR030/without-status.yaml | 10 + .../checks/v31/resources/OAR031/valid.json | 170 +++++ .../checks/v31/resources/OAR031/valid.yaml | 113 ++++ .../resources/OAR031/without-examples.json | 120 ++++ .../resources/OAR031/without-examples.yaml | 73 +++ .../v31/resources/OAR032/forbidden-names.json | 36 ++ .../v31/resources/OAR032/forbidden-names.yaml | 20 + .../checks/v31/resources/OAR032/valid.json | 27 + .../checks/v31/resources/OAR032/valid.yaml | 15 + .../v31/resources/OAR034/valid-all-of.json | 126 ++++ .../v31/resources/OAR034/valid-all-of.yaml | 84 +++ .../checks/v31/resources/OAR034/valid.json | 116 ++++ .../checks/v31/resources/OAR034/valid.yaml | 79 +++ .../OAR034/with-links-without-properties.json | 96 +++ .../OAR034/with-links-without-properties.yaml | 66 ++ ...th-paging-with-properties-wrong-types.json | 91 +++ ...th-paging-with-properties-wrong-types.yaml | 63 ++ .../with-paging-without-properties.json | 78 +++ .../with-paging-without-properties.yaml | 51 ++ .../OAR034/with-paging-wrong-type.json | 73 +++ .../OAR034/with-paging-wrong-type.yaml | 48 ++ .../OAR034/without-links-required-fields.json | 116 ++++ .../OAR034/without-links-required-fields.yaml | 77 +++ .../without-pagination-required-fields.json | 116 ++++ .../without-pagination-required-fields.yaml | 77 +++ .../v31/resources/OAR034/without-paging.json | 61 ++ .../v31/resources/OAR034/without-paging.yaml | 37 ++ .../OAR038/valid-multiple-properties.json | 48 ++ .../OAR038/valid-multiple-properties.yaml | 29 + .../resources/OAR038/valid-one-property.json | 45 ++ .../resources/OAR038/valid-one-property.yaml | 27 + .../OAR038/with-properties-empty.json | 41 ++ .../OAR038/with-properties-empty.yaml | 25 + .../v31/resources/OAR038/without-data.json | 35 ++ .../v31/resources/OAR038/without-data.yaml | 21 + .../resources/OAR038/without-properties.json | 53 ++ .../resources/OAR038/without-properties.yaml | 33 + .../v31/resources/OAR038/without-schema.json | 21 + .../v31/resources/OAR038/without-schema.yaml | 12 + .../v31/resources/OAR039/missing-codes.json | 109 ++++ .../v31/resources/OAR039/missing-codes.yaml | 68 ++ .../checks/v31/resources/OAR039/valid.json | 283 +++++++++ .../checks/v31/resources/OAR039/valid.yaml | 184 ++++++ .../schemas/OAR080/empty-global-security.json | 20 + .../schemas/OAR080/empty-global-security.yaml | 12 + .../v31/schemas/OAR080/empty-security.json | 31 + .../v31/schemas/OAR080/empty-security.yaml | 19 + .../v31/schemas/OAR080/global-security.json | 53 ++ .../v31/schemas/OAR080/global-security.yaml | 51 ++ .../v31/schemas/OAR080/with-security.json | 71 +++ .../v31/schemas/OAR080/with-security.yaml | 39 ++ .../v31/schemas/OAR080/without-security.json | 69 +++ .../v31/schemas/OAR080/without-security.yaml | 37 ++ .../v31/schemas/OAR080/wrong-scheme.json | 54 ++ .../v31/schemas/OAR080/wrong-scheme.yaml | 35 ++ .../checks/v31/schemas/OAR108/invalid.json | 38 ++ .../checks/v31/schemas/OAR108/invalid.yaml | 25 + .../checks/v31/schemas/OAR108/valid.json | 38 ++ .../checks/v31/schemas/OAR108/valid.yaml | 47 ++ .../v31/security/OAR001/with-servers.json | 15 + .../v31/security/OAR001/with-servers.yaml | 8 + .../v31/security/OAR001/without-servers.json | 10 + .../v31/security/OAR001/without-servers.yaml | 7 + .../checks/v31/security/OAR033/valid.json | 52 ++ .../checks/v31/security/OAR033/valid.yaml | 31 + .../OAR033/with-forbidden-params.json | 54 ++ .../OAR033/with-forbidden-params.yaml | 32 + .../OAR033/without-required-params.json | 53 ++ .../OAR033/without-required-params.yaml | 32 + .../checks/v31/security/OAR035/valid.json | 117 ++++ .../checks/v31/security/OAR035/valid.yaml | 70 +++ .../without-authorization-responses.json | 100 +++ .../without-authorization-responses.yaml | 62 ++ .../checks/v31/security/OAR036/valid.json | 26 + .../checks/v31/security/OAR036/valid.yaml | 16 + .../v31/security/OAR036/with-cookie.json | 42 ++ .../v31/security/OAR036/with-cookie.yaml | 27 + .../v31/security/OAR045/defined-response.json | 78 +++ .../v31/security/OAR045/defined-response.yaml | 48 ++ .../checks/v31/security/OAR053/valid.json | 42 ++ .../checks/v31/security/OAR053/valid.yaml | 26 + .../checks/v31/security/OAR054/valid.json | 19 + .../checks/v31/security/OAR054/valid.yaml | 9 + .../v31/security/OAR072/no-stack-trace.json | 47 ++ .../v31/security/OAR072/no-stack-trace.yaml | 36 ++ .../v31/security/OAR072/with-stack-trace.json | 62 ++ .../v31/security/OAR072/with-stack-trace.yaml | 40 ++ .../v31/security/OAR074/no-restrictions.json | 35 ++ .../v31/security/OAR074/no-restrictions.yaml | 20 + .../security/OAR074/with-restrictions.json | 40 ++ .../security/OAR074/with-restrictions.yaml | 26 + .../v31/security/OAR075/no-restrictions.json | 28 + .../v31/security/OAR075/no-restrictions.yaml | 16 + .../security/OAR075/with-restrictions.json | 32 + .../security/OAR075/with-restrictions.yaml | 20 + .../checks/v31/security/OAR076/nested.json | 40 ++ .../checks/v31/security/OAR076/nested.yaml | 25 + .../checks/v31/security/OAR076/plain.json | 42 ++ .../checks/v31/security/OAR076/plain.yaml | 27 + .../checks/v31/security/OAR076/with-$ref.json | 47 ++ .../checks/v31/security/OAR076/with-$ref.yaml | 29 + .../v31/security/OAR078/no-security.json | 54 ++ .../v31/security/OAR078/no-security.yaml | 33 + .../v31/security/OAR078/with-security.json | 74 +++ .../v31/security/OAR078/with-security.yaml | 49 ++ .../v31/security/OAR079/bad-request404.json | 42 ++ .../v31/security/OAR079/bad-request404.yaml | 25 + .../security/OAR079/no-bad-request404.json | 38 ++ .../security/OAR079/no-bad-request404.yaml | 22 + .../v31/security/OAR079/no-parameters.json | 19 + .../v31/security/OAR079/no-parameters.yaml | 11 + .../v31/security/OAR079/query-param-only.json | 26 + .../v31/security/OAR079/query-param-only.yaml | 16 + .../checks/v31/security/OAR081/.gitkeep | 0 .../security/OAR081/not-valid-password.json | 52 ++ .../security/OAR081/not-valid-password.yaml | 31 + .../v31/security/OAR081/valid-password.json | 52 ++ .../v31/security/OAR081/valid-password.yaml | 31 + .../OAR081/valid-with-components.json | 50 ++ .../OAR081/valid-with-components.yaml | 29 + .../checks/v31/security/OAR082/.gitkeep | 0 .../v31/security/OAR082/valid-format.json | 45 ++ .../v31/security/OAR082/valid-format.yaml | 23 + .../OAR083/forbidden-query-params.json | 45 ++ .../OAR083/forbidden-query-params.yaml | 26 + .../v31/security/OAR083/no-parameters.json | 19 + .../v31/security/OAR083/no-parameters.yaml | 11 + .../v31/security/OAR083/null-name-param.json | 30 + .../v31/security/OAR083/null-name-param.yaml | 21 + .../security/OAR083/options-operation.json | 24 + .../security/OAR083/options-operation.yaml | 16 + .../security/OAR083/valid-query-params.json | 45 ++ .../security/OAR083/valid-query-params.yaml | 26 + .../OAR084/forbidden-query-formats.json | 46 ++ .../OAR084/forbidden-query-formats.yaml | 27 + .../v31/security/OAR084/no-parameters.json | 17 + .../v31/security/OAR084/no-parameters.yaml | 11 + .../v31/security/OAR084/non-query-param.json | 28 + .../v31/security/OAR084/non-query-param.yaml | 18 + .../security/OAR084/null-format-param.json | 27 + .../security/OAR084/null-format-param.yaml | 17 + .../security/OAR084/valid-query-formats.json | 45 ++ .../security/OAR084/valid-query-formats.yaml | 27 + .../OAR085/invalid-openapi-version.json | 9 + .../OAR085/invalid-openapi-version.yaml | 6 + .../OAR085/valid-openapi-version.json | 9 + .../OAR085/valid-openapi-version.yaml | 2 +- .../checks/v31/security/OAR096/valid.json | 117 ++++ .../checks/v31/security/OAR096/valid.yaml | 70 +++ .../without-authorization-responses.json | 100 +++ .../without-authorization-responses.yaml | 62 ++ .../checks/v31/security/OAR114/valid.json | 32 + .../checks/v31/security/OAR114/valid.yaml | 19 + .../OAR114/with-forbidden-params.json | 26 + .../OAR114/with-forbidden-params.yaml | 15 + .../OAR114/without-required-params.json | 26 + .../OAR114/without-required-params.yaml | 15 + .../checks/v32/core/OAR044/media-type.json | 45 ++ .../checks/v32/core/OAR044/media-type.yaml | 29 + .../v32/core/OAR045/defined-response.json | 78 +++ .../v32/core/OAR045/defined-response.yaml | 48 ++ .../checks/v32/core/OAR046/declared-tag.json | 26 + .../checks/v32/core/OAR046/declared-tag.yaml | 17 + .../v32/core/OAR047/documented-tag.json | 24 + .../v32/core/OAR047/documented-tag.yaml | 18 + .../v32/core/OAR049/no-content-in-204.json | 25 + .../v32/core/OAR049/no-content-in-204.yaml | 14 + .../v32/core/OAR050/provide-summary.json | 26 + .../v32/core/OAR050/provide-summary.yaml | 15 + .../core/OAR051/different-description.json | 30 + .../core/OAR051/different-description.yaml | 21 + .../v32/examples/OAR094/externalref.yaml | 62 ++ .../v32/examples/OAR094/invalid-example.json | 54 ++ .../v32/examples/OAR094/invalid-example.yaml | 31 + .../v32/examples/OAR094/valid-example.json | 62 ++ .../v32/examples/OAR094/valid-example.yaml | 35 ++ .../v32/format/OAR006/without-anything.json | 18 + .../v32/format/OAR006/without-anything.yaml | 10 + .../v32/format/OAR007/without-anything.json | 18 + .../v32/format/OAR007/without-anything.yaml | 10 + .../operation-not-allows-request-body.json | 23 + .../operation-not-allows-request-body.yaml | 14 + .../format/OAR009/with-default-and-$ref.json | 43 ++ .../format/OAR009/with-default-and-$ref.yaml | 25 + .../OAR009/with-default-and-specific.json | 38 ++ .../OAR009/with-default-and-specific.yaml | 22 + .../v32/format/OAR009/with-specific.json | 37 ++ .../v32/format/OAR009/with-specific.yaml | 22 + .../with-wrong-default-and-specific.json | 37 ++ .../with-wrong-default-and-specific.yaml | 21 + .../v32/format/OAR009/with-wrong-default.json | 23 + .../v32/format/OAR009/with-wrong-default.yaml | 13 + .../v32/format/OAR009/without-anything.json | 18 + .../v32/format/OAR009/without-anything.yaml | 10 + .../format/OAR010/with-default-and-$ref.json | 29 + .../format/OAR010/with-default-and-$ref.yaml | 17 + .../OAR010/with-default-and-specific.json | 34 + .../OAR010/with-default-and-specific.yaml | 20 + .../v32/format/OAR010/with-specific.json | 33 + .../v32/format/OAR010/with-specific.yaml | 20 + .../with-wrong-default-and-specific.json | 33 + .../with-wrong-default-and-specific.yaml | 19 + .../v32/format/OAR010/with-wrong-default.json | 21 + .../v32/format/OAR010/with-wrong-default.yaml | 12 + .../v32/format/OAR010/without-anything.json | 18 + .../v32/format/OAR010/without-anything.yaml | 10 + .../v32/format/OAR011/base-path-ok.json | 13 + .../v32/format/OAR011/base-path-ok.yaml | 7 + .../v32/format/OAR011/base-path-wrong.json | 13 + .../v32/format/OAR011/base-path-wrong.yaml | 7 + .../checks/v32/format/OAR011/plain.json | 90 +++ .../checks/v32/format/OAR011/plain.yaml | 50 ++ .../v32/format/OAR012/camel-case-plain.json | 136 ++++ .../v32/format/OAR012/camel-case-plain.yaml | 78 +++ .../format/OAR012/camel-case-with-$ref.json | 209 +++++++ .../format/OAR012/camel-case-with-$ref.yaml | 130 ++++ .../v32/format/OAR012/kebab-case-plain.json | 136 ++++ .../v32/format/OAR012/kebab-case-plain.yaml | 78 +++ .../format/OAR012/kebab-case-with-$ref.json | 209 +++++++ .../format/OAR012/kebab-case-with-$ref.yaml | 130 ++++ .../v32/format/OAR012/snake-case-plain.json | 136 ++++ .../v32/format/OAR012/snake-case-plain.yaml | 78 +++ .../format/OAR012/snake-case-with-$ref.json | 209 +++++++ .../format/OAR012/snake-case-with-$ref.yaml | 130 ++++ .../checks/v32/format/OAR016/nested.json | 40 ++ .../checks/v32/format/OAR016/nested.yaml | 25 + .../checks/v32/format/OAR016/plain.json | 42 ++ .../checks/v32/format/OAR016/plain.yaml | 27 + .../checks/v32/format/OAR016/with-$ref.json | 47 ++ .../checks/v32/format/OAR016/with-$ref.yaml | 29 + .../checks/v32/format/OAR037/complete.json | 116 ++++ .../checks/v32/format/OAR037/complete.yaml | 76 +++ .../checks/v32/format/OAR037/nested.json | 36 ++ .../checks/v32/format/OAR037/nested.yaml | 22 + .../checks/v32/format/OAR037/with-$ref.json | 47 ++ .../checks/v32/format/OAR037/with-$ref.yaml | 29 + .../v32/format/OAR042/incorrect-version.json | 13 + .../v32/format/OAR042/incorrect-version.yaml | 7 + .../checks/v32/format/OAR042/too-long.json | 13 + .../checks/v32/format/OAR042/too-long.yaml | 7 + .../checks/v32/format/OAR042/too-short.json | 13 + .../checks/v32/format/OAR042/too-short.yaml | 7 + .../checks/v32/format/OAR042/valid.json | 13 + .../checks/v32/format/OAR042/valid.yaml | 7 + .../v32/format/OAR042/without-api-prefix.json | 13 + .../v32/format/OAR042/without-api-prefix.yaml | 7 + .../checks/v32/format/OAR052/nested.json | 39 ++ .../checks/v32/format/OAR052/nested.yaml | 24 + .../checks/v32/format/OAR052/plain.json | 40 ++ .../checks/v32/format/OAR052/plain.yaml | 24 + .../checks/v32/format/OAR052/with-$ref.json | 46 ++ .../checks/v32/format/OAR052/with-$ref.yaml | 28 + .../v32/format/OAR066/snake-case-error.json | 42 ++ .../v32/format/OAR066/snake-case-error.yaml | 29 + .../checks/v32/format/OAR066/valid.json | 40 ++ .../checks/v32/format/OAR066/valid.yaml | 25 + .../v32/format/OAR067/camel-case-error.json | 42 ++ .../v32/format/OAR067/camel-case-error.yaml | 29 + .../checks/v32/format/OAR067/valid.json | 40 ++ .../checks/v32/format/OAR067/valid.yaml | 25 + .../checks/v32/format/OAR068/externalref.yaml | 62 ++ .../v32/format/OAR068/pascal-case-error.json | 41 ++ .../v32/format/OAR068/pascal-case-error.yaml | 29 + .../checks/v32/format/OAR068/valid.json | 40 ++ .../checks/v32/format/OAR068/valid.yaml | 25 + .../v32/format/OAR077/not-valid-in-query.json | 34 + .../v32/format/OAR077/not-valid-in-query.yaml | 19 + .../v32/format/OAR077/valid-in-query.json | 34 + .../v32/format/OAR077/valid-in-query.yaml | 19 + .../format/OAR086/external-refexample.yaml | 62 ++ .../format/OAR086/internal-refexample.yaml | 66 ++ .../v32/format/OAR086/invalid-example.json | 60 ++ .../v32/format/OAR086/invalid-example.yaml | 41 ++ .../v32/format/OAR086/valid-example.json | 60 ++ .../v32/format/OAR086/valid-example.yaml | 69 +++ .../v32/format/OAR087/invalid-example.json | 38 ++ .../v32/format/OAR087/invalid-example.yaml | 26 + .../v32/format/OAR087/valid-example.json | 38 ++ .../v32/format/OAR087/valid-example.yaml | 26 + .../checks/v32/format/OAR088/invalid-ref.json | 35 ++ .../checks/v32/format/OAR088/invalid-ref.yaml | 20 + .../checks/v32/format/OAR088/valid-ref.json | 35 ++ .../checks/v32/format/OAR088/valid-ref.yaml | 20 + .../checks/v32/format/OAR089/invalid-ref.json | 49 ++ .../checks/v32/format/OAR089/invalid-ref.yaml | 28 + .../checks/v32/format/OAR089/valid-ref.json | 49 ++ .../checks/v32/format/OAR089/valid-ref.yaml | 28 + .../checks/v32/format/OAR090/invalid-ref.json | 25 + .../checks/v32/format/OAR090/invalid-ref.yaml | 14 + .../checks/v32/format/OAR090/valid-ref.json | 25 + .../checks/v32/format/OAR090/valid-ref.yaml | 14 + .../checks/v32/format/OAR097/too-short.json | 13 + .../checks/v32/format/OAR097/too-short.yaml | 7 + .../checks/v32/format/OAR097/valid.json | 13 + .../checks/v32/format/OAR097/valid.yaml | 7 + .../checks/v32/format/OAR098/too-long.json | 13 + .../checks/v32/format/OAR098/too-long.yaml | 7 + .../checks/v32/format/OAR098/valid.json | 13 + .../checks/v32/format/OAR098/valid.yaml | 7 + .../checks/v32/format/OAR099/valid.json | 13 + .../checks/v32/format/OAR099/valid.yaml | 7 + .../v32/format/OAR099/without-api-prefix.json | 13 + .../v32/format/OAR099/without-api-prefix.yaml | 7 + .../v32/format/OAR100/incorrect-version.json | 13 + .../v32/format/OAR100/incorrect-version.yaml | 7 + .../checks/v32/format/OAR100/valid.json | 13 + .../checks/v32/format/OAR100/valid.yaml | 7 + .../checks/v32/format/OAR101/empty-path.json | 13 + .../checks/v32/format/OAR101/empty-path.yaml | 7 + .../checks/v32/format/OAR101/invalid.json | 13 + .../checks/v32/format/OAR101/invalid.yaml | 7 + .../v32/format/OAR101/valid-with-values.json | 13 + .../v32/format/OAR101/valid-with-values.yaml | 7 + .../checks/v32/format/OAR101/valid.json | 13 + .../checks/v32/format/OAR101/valid.yaml | 7 + .../checks/v32/format/OAR102/invalid.json | 13 + .../checks/v32/format/OAR102/invalid.yaml | 7 + .../v32/format/OAR102/one-part-path.json | 13 + .../v32/format/OAR102/one-part-path.yaml | 7 + .../v32/format/OAR102/valid-with-values.json | 13 + .../v32/format/OAR102/valid-with-values.yaml | 7 + .../checks/v32/format/OAR102/valid.json | 13 + .../checks/v32/format/OAR102/valid.yaml | 7 + .../checks/v32/format/OAR110/valid.json | 19 + .../checks/v32/format/OAR110/valid.yaml | 14 + .../checks/v32/format/OAR111/valid.json | 19 + .../checks/v32/format/OAR111/valid.yaml | 14 + .../checks/v32/format/OAR113/invalid.json | 26 + .../checks/v32/format/OAR113/invalid.yaml | 16 + .../checks/v32/format/OAR113/valid.json | 45 ++ .../checks/v32/format/OAR113/valid.yaml | 27 + .../checks/v32/format/OAR115/invalid.json | 45 ++ .../checks/v32/format/OAR115/invalid.yaml | 30 + .../checks/v32/format/OAR115/valid.json | 44 ++ .../checks/v32/format/OAR115/valid.yaml | 29 + .../operations/OAR045/defined-response.json | 78 +++ .../operations/OAR045/defined-response.yaml | 48 ++ .../operations/OAR048/many-body-params.json | 75 +++ .../operations/OAR048/many-body-params.yaml | 47 ++ .../OAR061/insuficent-response-codes.json | 39 ++ .../OAR061/insuficent-response-codes.yaml | 23 + .../checks/v32/operations/OAR061/valid.json | 41 ++ .../checks/v32/operations/OAR061/valid.yaml | 25 + .../OAR062/insuficent-response-codes.json | 39 ++ .../OAR062/insuficent-response-codes.yaml | 23 + .../checks/v32/operations/OAR062/valid.json | 41 ++ .../checks/v32/operations/OAR062/valid.yaml | 25 + .../OAR063/insuficent-response-codes.json | 39 ++ .../OAR063/insuficent-response-codes.yaml | 23 + .../checks/v32/operations/OAR063/valid.json | 41 ++ .../checks/v32/operations/OAR063/valid.yaml | 25 + .../OAR064/insuficent-response-codes.json | 39 ++ .../OAR064/insuficent-response-codes.yaml | 23 + .../checks/v32/operations/OAR064/valid.json | 41 ++ .../checks/v32/operations/OAR064/valid.yaml | 25 + .../OAR065/insuficent-response-codes.json | 39 ++ .../OAR065/insuficent-response-codes.yaml | 24 + .../checks/v32/operations/OAR065/valid.json | 41 ++ .../checks/v32/operations/OAR065/valid.yaml | 25 + .../OAR071/missing-query-params.json | 59 ++ .../OAR071/missing-query-params.yaml | 34 + .../operations/OAR071/valid-query-params.json | 66 ++ .../operations/OAR071/valid-query-params.yaml | 38 ++ .../checks/v32/operations/OAR091/no-ref.json | 37 ++ .../checks/v32/operations/OAR091/no-ref.yaml | 22 + .../v32/operations/OAR091/with-ref.json | 44 ++ .../v32/operations/OAR091/with-ref.yaml | 26 + .../checks/v32/operations/OAR092/no-ref.json | 52 ++ .../checks/v32/operations/OAR092/no-ref.yaml | 579 ++++++++++++++++++ .../v32/operations/OAR092/with-ref.json | 44 ++ .../v32/operations/OAR092/with-ref.yaml | 33 + .../checks/v32/operations/OAR093/no-ref.json | 37 ++ .../checks/v32/operations/OAR093/no-ref.yaml | 22 + .../v32/operations/OAR093/with-ref.json | 44 ++ .../v32/operations/OAR093/with-ref.yaml | 26 + .../checks/v32/operations/OAR103/plain.json | 63 ++ .../checks/v32/operations/OAR103/plain.yaml | 35 ++ .../checks/v32/operations/OAR104/plain.yaml | 40 ++ .../checks/v32/operations/OAR105/plain.json | 63 ++ .../checks/v32/operations/OAR105/plain.yaml | 35 ++ .../checks/v32/operations/OAR106/plain.json | 63 ++ .../checks/v32/operations/OAR106/plain.yaml | 35 ++ .../checks/v32/operations/OAR107/plain.json | 63 ++ .../checks/v32/operations/OAR107/plain.yaml | 35 ++ .../checks/v32/operations/OAR109/plain.json | 42 ++ .../checks/v32/operations/OAR109/plain.yaml | 25 + .../checks/v32/owasp/OAR070/no-numeric.json | 42 ++ .../checks/v32/owasp/OAR070/no-numeric.yaml | 25 + .../checks/v32/owasp/OAR070/numeric.json | 42 ++ .../checks/v32/owasp/OAR070/numeric.yaml | 25 + .../v32/owasp/OAR073/no-rate-limit.json | 29 + .../v32/owasp/OAR073/no-rate-limit.yaml | 17 + .../checks/v32/owasp/OAR073/no-responses.json | 14 + .../checks/v32/owasp/OAR073/no-responses.yaml | 8 + .../checks/v32/owasp/OAR073/rate-limit.json | 39 ++ .../checks/v32/owasp/OAR073/rate-limit.yaml | 23 + .../v32/parameters/OAR019/excluded.json | 37 ++ .../v32/parameters/OAR019/excluded.yaml | 23 + .../v32/parameters/OAR019/plain-without.json | 37 ++ .../v32/parameters/OAR019/plain-without.yaml | 23 + .../checks/v32/parameters/OAR019/plain.json | 37 ++ .../checks/v32/parameters/OAR019/plain.yaml | 23 + .../parameters/OAR019/with-$ref-without.json | 47 ++ .../parameters/OAR019/with-$ref-without.yaml | 29 + .../v32/parameters/OAR019/with-$ref.json | 47 ++ .../v32/parameters/OAR019/with-$ref.yaml | 29 + .../v32/parameters/OAR019/with-param.json | 27 + .../v32/parameters/OAR019/with-param.yaml | 15 + .../v32/parameters/OAR019/with-ref.json | 37 ++ .../v32/parameters/OAR019/with-ref.yaml | 23 + .../parameters/OAR019/without-parameters.json | 18 + .../parameters/OAR019/without-parameters.yaml | 10 + .../v32/parameters/OAR020/excluded.json | 37 ++ .../v32/parameters/OAR020/excluded.yaml | 23 + .../v32/parameters/OAR020/excluded2.json | 37 ++ .../v32/parameters/OAR020/excluded2.yaml | 23 + .../v32/parameters/OAR020/plain-without.json | 37 ++ .../v32/parameters/OAR020/plain-without.yaml | 23 + .../v32/parameters/OAR020/plain-without2.json | 37 ++ .../v32/parameters/OAR020/plain-without2.yaml | 23 + .../checks/v32/parameters/OAR020/plain.json | 37 ++ .../checks/v32/parameters/OAR020/plain.yaml | 23 + .../checks/v32/parameters/OAR020/plain2.json | 37 ++ .../checks/v32/parameters/OAR020/plain2.yaml | 23 + .../parameters/OAR020/with-$ref-without.json | 47 ++ .../parameters/OAR020/with-$ref-without.yaml | 29 + .../v32/parameters/OAR020/with-$ref.json | 47 ++ .../v32/parameters/OAR020/with-$ref.yaml | 29 + .../v32/parameters/OAR020/with-param.json | 27 + .../v32/parameters/OAR020/with-param.yaml | 15 + .../v32/parameters/OAR020/with-ref.json | 37 ++ .../v32/parameters/OAR020/with-ref.yaml | 23 + .../parameters/OAR020/without-parameters.json | 18 + .../parameters/OAR020/without-parameters.yaml | 10 + .../v32/parameters/OAR021/excluded.json | 37 ++ .../v32/parameters/OAR021/excluded.yaml | 23 + .../v32/parameters/OAR021/plain-without.json | 37 ++ .../v32/parameters/OAR021/plain-without.yaml | 23 + .../checks/v32/parameters/OAR021/plain.json | 37 ++ .../checks/v32/parameters/OAR021/plain.yaml | 23 + .../parameters/OAR021/with-$ref-without.json | 47 ++ .../parameters/OAR021/with-$ref-without.yaml | 29 + .../v32/parameters/OAR021/with-$ref.json | 47 ++ .../v32/parameters/OAR021/with-$ref.yaml | 29 + .../v32/parameters/OAR021/with-param.json | 27 + .../v32/parameters/OAR021/with-param.yaml | 15 + .../v32/parameters/OAR021/with-ref.json | 37 ++ .../v32/parameters/OAR021/with-ref.yaml | 23 + .../parameters/OAR021/without-parameters.json | 18 + .../parameters/OAR021/without-parameters.yaml | 10 + .../v32/parameters/OAR022/excluded.json | 37 ++ .../v32/parameters/OAR022/excluded.yaml | 23 + .../v32/parameters/OAR022/plain-without.json | 37 ++ .../v32/parameters/OAR022/plain-without.yaml | 23 + .../checks/v32/parameters/OAR022/plain.json | 37 ++ .../checks/v32/parameters/OAR022/plain.yaml | 23 + .../parameters/OAR022/with-$ref-without.json | 47 ++ .../parameters/OAR022/with-$ref-without.yaml | 29 + .../v32/parameters/OAR022/with-$ref.json | 47 ++ .../v32/parameters/OAR022/with-$ref.yaml | 29 + .../parameters/OAR022/without-parameters.json | 18 + .../parameters/OAR022/without-parameters.yaml | 10 + .../v32/parameters/OAR023/excluded.json | 37 ++ .../v32/parameters/OAR023/excluded.yaml | 23 + .../v32/parameters/OAR023/plain-without.json | 37 ++ .../v32/parameters/OAR023/plain-without.yaml | 23 + .../checks/v32/parameters/OAR023/plain.json | 37 ++ .../checks/v32/parameters/OAR023/plain.yaml | 23 + .../parameters/OAR023/with-$ref-without.json | 44 ++ .../parameters/OAR023/with-$ref-without.yaml | 27 + .../v32/parameters/OAR023/with-$ref.json | 44 ++ .../v32/parameters/OAR023/with-$ref.yaml | 27 + .../parameters/OAR023/without-parameters.json | 18 + .../parameters/OAR023/without-parameters.yaml | 10 + .../v32/parameters/OAR024/excluded.json | 37 ++ .../v32/parameters/OAR024/excluded.yaml | 23 + .../v32/parameters/OAR024/plain-without.json | 37 ++ .../v32/parameters/OAR024/plain-without.yaml | 23 + .../checks/v32/parameters/OAR024/plain.json | 37 ++ .../checks/v32/parameters/OAR024/plain.yaml | 23 + .../parameters/OAR024/with-$ref-without.json | 45 ++ .../parameters/OAR024/with-$ref-without.yaml | 28 + .../v32/parameters/OAR024/with-$ref.json | 45 ++ .../v32/parameters/OAR024/with-$ref.yaml | 28 + .../parameters/OAR024/without-parameters.json | 18 + .../parameters/OAR024/without-parameters.yaml | 10 + .../v32/parameters/OAR025/excluded.json | 37 ++ .../v32/parameters/OAR025/excluded.yaml | 23 + .../v32/parameters/OAR025/plain-without.json | 37 ++ .../v32/parameters/OAR025/plain-without.yaml | 23 + .../checks/v32/parameters/OAR025/plain.json | 37 ++ .../checks/v32/parameters/OAR025/plain.yaml | 23 + .../parameters/OAR025/with-$ref-without.json | 45 ++ .../parameters/OAR025/with-$ref-without.yaml | 28 + .../v32/parameters/OAR025/with-$ref.json | 46 ++ .../v32/parameters/OAR025/with-$ref.yaml | 28 + .../parameters/OAR025/without-parameters.json | 18 + .../parameters/OAR025/without-parameters.yaml | 10 + .../plain-with-$total-with-defval-false.json | 35 ++ .../plain-with-$total-with-defval-false.yaml | 22 + .../plain-with-$total-with-defval-true.json | 35 ++ .../plain-with-$total-with-defval-true.yaml | 22 + .../plain-with-$total-without-defval.json | 34 + .../plain-with-$total-without-defval.yaml | 21 + .../OAR026/plain-without-$total.json | 34 + .../OAR026/plain-without-$total.yaml | 21 + ...th-$ref-with-$total-with-defval-false.json | 45 ++ ...th-$ref-with-$total-with-defval-false.yaml | 28 + ...ith-$ref-with-$total-with-defval-true.json | 45 ++ ...ith-$ref-with-$total-with-defval-true.yaml | 28 + .../with-$ref-with-$total-without-defval.json | 44 ++ .../with-$ref-with-$total-without-defval.yaml | 27 + .../OAR026/with-$ref-without-$total.json | 44 ++ .../OAR026/with-$ref-without-$total.yaml | 27 + .../parameters/OAR026/without-parameters.json | 18 + .../parameters/OAR026/without-parameters.yaml | 10 + .../parameters/OAR028/components-param.json | 29 + .../parameters/OAR028/components-param.yaml | 17 + .../OAR028/exclude-noncompliant.json | 37 ++ .../OAR028/exclude-noncompliant.yaml | 23 + .../v32/parameters/OAR028/excluded.json | 37 ++ .../v32/parameters/OAR028/excluded.yaml | 23 + .../v32/parameters/OAR028/plain-without.json | 37 ++ .../v32/parameters/OAR028/plain-without.yaml | 23 + .../checks/v32/parameters/OAR028/plain.json | 37 ++ .../checks/v32/parameters/OAR028/plain.yaml | 23 + .../parameters/OAR028/with-$ref-without.json | 47 ++ .../parameters/OAR028/with-$ref-without.yaml | 29 + .../v32/parameters/OAR028/with-$ref.json | 47 ++ .../v32/parameters/OAR028/with-$ref.yaml | 29 + .../parameters/OAR028/without-parameters.json | 18 + .../parameters/OAR028/without-parameters.yaml | 10 + .../v32/parameters/OAR060/required-false.json | 39 ++ .../v32/parameters/OAR060/required-false.yaml | 25 + .../v32/parameters/OAR060/required-true.json | 39 ++ .../v32/parameters/OAR060/required-true.yaml | 25 + .../v32/parameters/OAR069/bad-request400.json | 42 ++ .../v32/parameters/OAR069/bad-request400.yaml | 25 + .../parameters/OAR069/no-bad-request400.json | 38 ++ .../parameters/OAR069/no-bad-request400.yaml | 22 + .../regex/OAR112/external-docs-invalid.json | 12 + .../regex/OAR112/external-docs-invalid.yaml | 8 + .../v32/regex/OAR112/external-docs-valid.json | 12 + .../v32/regex/OAR112/external-docs-valid.yaml | 8 + .../checks/v32/regex/OAR112/info-invalid.json | 9 + .../checks/v32/regex/OAR112/info-invalid.yaml | 6 + .../checks/v32/regex/OAR112/minimal.json | 8 + .../checks/v32/regex/OAR112/minimal.yaml | 5 + .../v32/regex/OAR112/missing-description.json | 8 + .../v32/regex/OAR112/missing-description.yaml | 5 + .../v32/regex/OAR112/operation-invalid.json | 19 + .../v32/regex/OAR112/operation-invalid.yaml | 11 + .../v32/regex/OAR112/operation-valid.json | 19 + .../v32/regex/OAR112/operation-valid.yaml | 11 + .../v32/regex/OAR112/parameters-invalid.json | 26 + .../v32/regex/OAR112/parameters-invalid.yaml | 16 + .../v32/regex/OAR112/parameters-valid.json | 26 + .../v32/regex/OAR112/parameters-valid.yaml | 16 + .../checks/v32/regex/OAR112/plain.json | 37 ++ .../checks/v32/regex/OAR112/plain.yaml | 46 ++ .../v32/regex/OAR112/servers-invalid.json | 12 + .../v32/regex/OAR112/servers-invalid.yaml | 8 + .../v32/regex/OAR112/servers-valid.json | 12 + .../v32/regex/OAR112/servers-valid.yaml | 8 + .../checks/v32/regex/OAR112/tags-invalid.json | 11 + .../checks/v32/regex/OAR112/tags-invalid.yaml | 7 + .../checks/v32/regex/OAR112/tags-valid.json | 11 + .../checks/v32/regex/OAR112/tags-valid.yaml | 7 + .../checks/v32/resources/OAR008/plain.json | 60 ++ .../checks/v32/resources/OAR008/plain.yaml | 35 ++ .../checks/v32/resources/OAR013/plain.json | 25 + .../checks/v32/resources/OAR013/plain.yaml | 14 + .../checks/v32/resources/OAR014/plain.json | 54 ++ .../checks/v32/resources/OAR014/plain.yaml | 30 + .../checks/v32/resources/OAR015/plain.json | 72 +++ .../checks/v32/resources/OAR015/plain.yaml | 40 ++ .../checks/v32/resources/OAR017/plain.json | 63 ++ .../checks/v32/resources/OAR017/plain.yaml | 52 ++ .../checks/v32/resources/OAR018/plain.json | 194 ++++++ .../checks/v32/resources/OAR018/plain.yaml | 114 ++++ .../checks/v32/resources/OAR027/no-post.json | 18 + .../checks/v32/resources/OAR027/no-post.yaml | 10 + .../OAR027/post-201-with-location.json | 25 + .../OAR027/post-201-with-location.yaml | 14 + .../OAR027/post-201-with-other-headers.json | 25 + .../OAR027/post-201-with-other-headers.yaml | 14 + .../OAR027/post-201-without-location.json | 18 + .../OAR027/post-201-without-location.yaml | 10 + .../v32/resources/OAR027/post-no-201.json | 18 + .../v32/resources/OAR027/post-no-201.yaml | 10 + .../v32/resources/OAR029/valid-all-of-md.json | 134 ++++ .../v32/resources/OAR029/valid-all-of-md.yaml | 78 +++ .../v32/resources/OAR029/valid-all-of.json | 116 ++++ .../v32/resources/OAR029/valid-all-of.yaml | 76 +++ .../checks/v32/resources/OAR029/valid-md.json | 116 ++++ .../checks/v32/resources/OAR029/valid-md.yaml | 69 +++ .../checks/v32/resources/OAR029/valid-r.json | 96 +++ .../checks/v32/resources/OAR029/valid-r.yaml | 59 ++ .../checks/v32/resources/OAR029/valid.json | 105 ++++ .../checks/v32/resources/OAR029/valid.yaml | 69 +++ ...th-error-with-properties-wrong-type-r.json | 88 +++ ...th-error-with-properties-wrong-type-r.yaml | 55 ++ .../with-error-without-properties-r.json | 75 +++ .../with-error-without-properties-r.yaml | 47 ++ .../OAR029/with-error-wrong-type-r.json | 91 +++ .../OAR029/with-error-wrong-type-r.yaml | 57 ++ ...-result-with-properties-wrong-type-md.json | 96 +++ ...-result-with-properties-wrong-type-md.yaml | 56 ++ .../with-result-without-properties-md.json | 80 +++ .../with-result-without-properties-md.yaml | 48 ++ .../OAR029/with-result-wrong-type-md.json | 101 +++ .../OAR029/with-result-wrong-type-md.yaml | 59 ++ ...ith-status-with-properties-wrong-type.json | 90 +++ ...ith-status-with-properties-wrong-type.yaml | 59 ++ .../with-status-without-properties.json | 74 +++ .../with-status-without-properties.yaml | 49 ++ .../OAR029/with-status-wrong-type.json | 101 +++ .../OAR029/with-status-wrong-type.yaml | 66 ++ .../v32/resources/OAR029/without-data-md.json | 103 ++++ .../v32/resources/OAR029/without-data-md.yaml | 61 ++ .../v32/resources/OAR029/without-data.json | 101 +++ .../v32/resources/OAR029/without-data.yaml | 66 ++ .../v32/resources/OAR029/without-error-r.json | 91 +++ .../v32/resources/OAR029/without-error-r.yaml | 57 ++ .../resources/OAR029/without-payload-r.json | 91 +++ .../resources/OAR029/without-payload-r.yaml | 57 ++ .../OAR029/without-required-fields-md.json | 107 ++++ .../OAR029/without-required-fields-md.yaml | 64 ++ .../OAR029/without-required-fields-r.json | 89 +++ .../OAR029/without-required-fields-r.yaml | 55 ++ .../OAR029/without-required-fields.json | 101 +++ .../OAR029/without-required-fields.yaml | 63 ++ .../resources/OAR029/without-result-md.json | 101 +++ .../resources/OAR029/without-result-md.yaml | 59 ++ .../v32/resources/OAR029/without-status.json | 101 +++ .../v32/resources/OAR029/without-status.yaml | 66 ++ .../checks/v32/resources/OAR030/valid.json | 27 + .../checks/v32/resources/OAR030/valid.yaml | 15 + .../OAR030/with-status-without-get.json | 27 + .../OAR030/with-status-without-get.yaml | 15 + .../v32/resources/OAR030/without-status.json | 18 + .../v32/resources/OAR030/without-status.yaml | 10 + .../checks/v32/resources/OAR031/valid.json | 170 +++++ .../checks/v32/resources/OAR031/valid.yaml | 113 ++++ .../resources/OAR031/without-examples.json | 120 ++++ .../resources/OAR031/without-examples.yaml | 73 +++ .../v32/resources/OAR032/forbidden-names.json | 36 ++ .../v32/resources/OAR032/forbidden-names.yaml | 20 + .../checks/v32/resources/OAR032/valid.json | 27 + .../checks/v32/resources/OAR032/valid.yaml | 15 + .../v32/resources/OAR034/valid-all-of.json | 126 ++++ .../v32/resources/OAR034/valid-all-of.yaml | 84 +++ .../checks/v32/resources/OAR034/valid.json | 116 ++++ .../checks/v32/resources/OAR034/valid.yaml | 79 +++ .../OAR034/with-links-without-properties.json | 96 +++ .../OAR034/with-links-without-properties.yaml | 66 ++ ...th-paging-with-properties-wrong-types.json | 91 +++ ...th-paging-with-properties-wrong-types.yaml | 63 ++ .../with-paging-without-properties.json | 78 +++ .../with-paging-without-properties.yaml | 51 ++ .../OAR034/with-paging-wrong-type.json | 73 +++ .../OAR034/with-paging-wrong-type.yaml | 48 ++ .../OAR034/without-links-required-fields.json | 116 ++++ .../OAR034/without-links-required-fields.yaml | 77 +++ .../without-pagination-required-fields.json | 116 ++++ .../without-pagination-required-fields.yaml | 77 +++ .../v32/resources/OAR034/without-paging.json | 61 ++ .../v32/resources/OAR034/without-paging.yaml | 37 ++ .../OAR038/valid-multiple-properties.json | 48 ++ .../OAR038/valid-multiple-properties.yaml | 29 + .../resources/OAR038/valid-one-property.json | 45 ++ .../resources/OAR038/valid-one-property.yaml | 27 + .../OAR038/with-properties-empty.json | 41 ++ .../OAR038/with-properties-empty.yaml | 25 + .../v32/resources/OAR038/without-data.json | 35 ++ .../v32/resources/OAR038/without-data.yaml | 21 + .../resources/OAR038/without-properties.json | 53 ++ .../resources/OAR038/without-properties.yaml | 33 + .../v32/resources/OAR038/without-schema.json | 21 + .../v32/resources/OAR038/without-schema.yaml | 12 + .../v32/resources/OAR039/missing-codes.json | 109 ++++ .../v32/resources/OAR039/missing-codes.yaml | 68 ++ .../checks/v32/resources/OAR039/valid.json | 283 +++++++++ .../checks/v32/resources/OAR039/valid.yaml | 184 ++++++ .../schemas/OAR080/empty-global-security.json | 20 + .../schemas/OAR080/empty-global-security.yaml | 12 + .../v32/schemas/OAR080/empty-security.json | 31 + .../v32/schemas/OAR080/empty-security.yaml | 19 + .../v32/schemas/OAR080/global-security.json | 53 ++ .../v32/schemas/OAR080/global-security.yaml | 51 ++ .../v32/schemas/OAR080/with-security.json | 71 +++ .../v32/schemas/OAR080/with-security.yaml | 39 ++ .../v32/schemas/OAR080/without-security.json | 69 +++ .../v32/schemas/OAR080/without-security.yaml | 37 ++ .../v32/schemas/OAR080/wrong-scheme.json | 54 ++ .../v32/schemas/OAR080/wrong-scheme.yaml | 35 ++ .../checks/v32/schemas/OAR108/invalid.json | 38 ++ .../checks/v32/schemas/OAR108/invalid.yaml | 25 + .../checks/v32/schemas/OAR108/valid.json | 38 ++ .../checks/v32/schemas/OAR108/valid.yaml | 47 ++ .../v32/security/OAR001/with-servers.json | 15 + .../v32/security/OAR001/with-servers.yaml | 8 + .../v32/security/OAR001/without-servers.json | 10 + .../v32/security/OAR001/without-servers.yaml | 7 + .../checks/v32/security/OAR033/valid.json | 52 ++ .../checks/v32/security/OAR033/valid.yaml | 31 + .../OAR033/with-forbidden-params.json | 54 ++ .../OAR033/with-forbidden-params.yaml | 32 + .../OAR033/without-required-params.json | 53 ++ .../OAR033/without-required-params.yaml | 32 + .../checks/v32/security/OAR035/valid.json | 117 ++++ .../checks/v32/security/OAR035/valid.yaml | 70 +++ .../without-authorization-responses.json | 100 +++ .../without-authorization-responses.yaml | 62 ++ .../checks/v32/security/OAR036/valid.json | 26 + .../checks/v32/security/OAR036/valid.yaml | 16 + .../v32/security/OAR036/with-cookie.json | 42 ++ .../v32/security/OAR036/with-cookie.yaml | 27 + .../v32/security/OAR045/defined-response.json | 78 +++ .../v32/security/OAR045/defined-response.yaml | 48 ++ .../checks/v32/security/OAR053/valid.json | 42 ++ .../checks/v32/security/OAR053/valid.yaml | 26 + .../checks/v32/security/OAR054/valid.json | 19 + .../checks/v32/security/OAR054/valid.yaml | 9 + .../v32/security/OAR072/no-stack-trace.json | 47 ++ .../v32/security/OAR072/no-stack-trace.yaml | 36 ++ .../v32/security/OAR072/with-stack-trace.json | 62 ++ .../v32/security/OAR072/with-stack-trace.yaml | 40 ++ .../v32/security/OAR074/no-restrictions.json | 35 ++ .../v32/security/OAR074/no-restrictions.yaml | 20 + .../security/OAR074/with-restrictions.json | 40 ++ .../security/OAR074/with-restrictions.yaml | 26 + .../v32/security/OAR075/no-restrictions.json | 28 + .../v32/security/OAR075/no-restrictions.yaml | 16 + .../security/OAR075/with-restrictions.json | 32 + .../security/OAR075/with-restrictions.yaml | 20 + .../checks/v32/security/OAR076/nested.json | 40 ++ .../checks/v32/security/OAR076/nested.yaml | 25 + .../checks/v32/security/OAR076/plain.json | 42 ++ .../checks/v32/security/OAR076/plain.yaml | 27 + .../checks/v32/security/OAR076/with-$ref.json | 47 ++ .../checks/v32/security/OAR076/with-$ref.yaml | 29 + .../v32/security/OAR078/no-security.json | 54 ++ .../v32/security/OAR078/no-security.yaml | 33 + .../v32/security/OAR078/with-security.json | 74 +++ .../v32/security/OAR078/with-security.yaml | 49 ++ .../v32/security/OAR079/bad-request404.json | 42 ++ .../v32/security/OAR079/bad-request404.yaml | 25 + .../security/OAR079/no-bad-request404.json | 38 ++ .../security/OAR079/no-bad-request404.yaml | 22 + .../v32/security/OAR079/no-parameters.json | 19 + .../v32/security/OAR079/no-parameters.yaml | 11 + .../v32/security/OAR079/query-param-only.json | 26 + .../v32/security/OAR079/query-param-only.yaml | 16 + .../checks/v32/security/OAR081/.gitkeep | 0 .../security/OAR081/not-valid-password.json | 52 ++ .../security/OAR081/not-valid-password.yaml | 31 + .../v32/security/OAR081/valid-password.json | 52 ++ .../v32/security/OAR081/valid-password.yaml | 31 + .../OAR081/valid-with-components.json | 50 ++ .../OAR081/valid-with-components.yaml | 29 + .../checks/v32/security/OAR082/.gitkeep | 0 .../v32/security/OAR082/valid-format.json | 45 ++ .../v32/security/OAR082/valid-format.yaml | 23 + .../OAR083/forbidden-query-params.json | 45 ++ .../OAR083/forbidden-query-params.yaml | 26 + .../v32/security/OAR083/no-parameters.json | 19 + .../v32/security/OAR083/no-parameters.yaml | 11 + .../v32/security/OAR083/null-name-param.json | 30 + .../v32/security/OAR083/null-name-param.yaml | 21 + .../security/OAR083/options-operation.json | 24 + .../security/OAR083/options-operation.yaml | 16 + .../security/OAR083/valid-query-params.json | 45 ++ .../security/OAR083/valid-query-params.yaml | 26 + .../OAR084/forbidden-query-formats.json | 46 ++ .../OAR084/forbidden-query-formats.yaml | 27 + .../v32/security/OAR084/no-parameters.json | 17 + .../v32/security/OAR084/no-parameters.yaml | 11 + .../v32/security/OAR084/non-query-param.json | 28 + .../v32/security/OAR084/non-query-param.yaml | 18 + .../security/OAR084/null-format-param.json | 27 + .../security/OAR084/null-format-param.yaml | 17 + .../security/OAR084/valid-query-formats.json | 45 ++ .../security/OAR084/valid-query-formats.yaml | 27 + .../OAR085/invalid-openapi-version.json | 9 + .../OAR085/invalid-openapi-version.yaml | 6 + .../OAR085/valid-openapi-version.json | 9 + .../OAR085/valid-openapi-version.yaml | 6 + .../checks/v32/security/OAR096/valid.json | 117 ++++ .../checks/v32/security/OAR096/valid.yaml | 70 +++ .../without-authorization-responses.json | 100 +++ .../without-authorization-responses.yaml | 62 ++ .../checks/v32/security/OAR114/valid.json | 32 + .../checks/v32/security/OAR114/valid.yaml | 19 + .../OAR114/with-forbidden-params.json | 26 + .../OAR114/with-forbidden-params.yaml | 15 + .../OAR114/without-required-params.json | 26 + .../OAR114/without-required-params.yaml | 15 + .../validation-test-all-violations.yaml | 110 ++++ 1399 files changed, 53070 insertions(+), 48 deletions(-) create mode 100644 src/test/resources/checks/v3/core/OAR045/defined-response.json create mode 100644 src/test/resources/checks/v3/core/OAR045/defined-response.yaml create mode 100644 src/test/resources/checks/v3/operations/OAR045/defined-response.json create mode 100644 src/test/resources/checks/v3/operations/OAR045/defined-response.yaml create mode 100644 src/test/resources/checks/v3/security/OAR045/defined-response.json create mode 100644 src/test/resources/checks/v3/security/OAR045/defined-response.yaml create mode 100644 src/test/resources/checks/v31/core/OAR044/media-type.json create mode 100644 src/test/resources/checks/v31/core/OAR044/media-type.yaml create mode 100644 src/test/resources/checks/v31/core/OAR045/defined-response.json create mode 100644 src/test/resources/checks/v31/core/OAR045/defined-response.yaml create mode 100644 src/test/resources/checks/v31/core/OAR046/declared-tag.json create mode 100644 src/test/resources/checks/v31/core/OAR046/declared-tag.yaml create mode 100644 src/test/resources/checks/v31/core/OAR047/documented-tag.json create mode 100644 src/test/resources/checks/v31/core/OAR047/documented-tag.yaml create mode 100644 src/test/resources/checks/v31/core/OAR049/no-content-in-204.json create mode 100644 src/test/resources/checks/v31/core/OAR049/no-content-in-204.yaml create mode 100644 src/test/resources/checks/v31/core/OAR050/provide-summary.json create mode 100644 src/test/resources/checks/v31/core/OAR050/provide-summary.yaml create mode 100644 src/test/resources/checks/v31/core/OAR051/different-description.json create mode 100644 src/test/resources/checks/v31/core/OAR051/different-description.yaml create mode 100644 src/test/resources/checks/v31/examples/OAR094/externalref.yaml create mode 100644 src/test/resources/checks/v31/examples/OAR094/invalid-example.json create mode 100644 src/test/resources/checks/v31/examples/OAR094/invalid-example.yaml create mode 100644 src/test/resources/checks/v31/examples/OAR094/valid-example.json create mode 100644 src/test/resources/checks/v31/examples/OAR094/valid-example.yaml create mode 100644 src/test/resources/checks/v31/format/OAR006/without-anything.json create mode 100644 src/test/resources/checks/v31/format/OAR006/without-anything.yaml create mode 100644 src/test/resources/checks/v31/format/OAR007/without-anything.json create mode 100644 src/test/resources/checks/v31/format/OAR007/without-anything.yaml create mode 100644 src/test/resources/checks/v31/format/OAR009/operation-not-allows-request-body.json create mode 100644 src/test/resources/checks/v31/format/OAR009/operation-not-allows-request-body.yaml create mode 100644 src/test/resources/checks/v31/format/OAR009/with-default-and-$ref.json create mode 100644 src/test/resources/checks/v31/format/OAR009/with-default-and-$ref.yaml create mode 100644 src/test/resources/checks/v31/format/OAR009/with-default-and-specific.json create mode 100644 src/test/resources/checks/v31/format/OAR009/with-default-and-specific.yaml create mode 100644 src/test/resources/checks/v31/format/OAR009/with-specific.json create mode 100644 src/test/resources/checks/v31/format/OAR009/with-specific.yaml create mode 100644 src/test/resources/checks/v31/format/OAR009/with-wrong-default-and-specific.json create mode 100644 src/test/resources/checks/v31/format/OAR009/with-wrong-default-and-specific.yaml create mode 100644 src/test/resources/checks/v31/format/OAR009/with-wrong-default.json create mode 100644 src/test/resources/checks/v31/format/OAR009/with-wrong-default.yaml create mode 100644 src/test/resources/checks/v31/format/OAR009/without-anything.json create mode 100644 src/test/resources/checks/v31/format/OAR009/without-anything.yaml create mode 100644 src/test/resources/checks/v31/format/OAR010/with-default-and-$ref.json create mode 100644 src/test/resources/checks/v31/format/OAR010/with-default-and-$ref.yaml create mode 100644 src/test/resources/checks/v31/format/OAR010/with-default-and-specific.json create mode 100644 src/test/resources/checks/v31/format/OAR010/with-default-and-specific.yaml create mode 100644 src/test/resources/checks/v31/format/OAR010/with-specific.json create mode 100644 src/test/resources/checks/v31/format/OAR010/with-specific.yaml create mode 100644 src/test/resources/checks/v31/format/OAR010/with-wrong-default-and-specific.json create mode 100644 src/test/resources/checks/v31/format/OAR010/with-wrong-default-and-specific.yaml create mode 100644 src/test/resources/checks/v31/format/OAR010/with-wrong-default.json create mode 100644 src/test/resources/checks/v31/format/OAR010/with-wrong-default.yaml create mode 100644 src/test/resources/checks/v31/format/OAR010/without-anything.json create mode 100644 src/test/resources/checks/v31/format/OAR010/without-anything.yaml create mode 100644 src/test/resources/checks/v31/format/OAR011/base-path-ok.json create mode 100644 src/test/resources/checks/v31/format/OAR011/base-path-ok.yaml create mode 100644 src/test/resources/checks/v31/format/OAR011/base-path-wrong.json create mode 100644 src/test/resources/checks/v31/format/OAR011/base-path-wrong.yaml create mode 100644 src/test/resources/checks/v31/format/OAR011/plain.json create mode 100644 src/test/resources/checks/v31/format/OAR011/plain.yaml create mode 100644 src/test/resources/checks/v31/format/OAR012/camel-case-plain.json create mode 100644 src/test/resources/checks/v31/format/OAR012/camel-case-plain.yaml create mode 100644 src/test/resources/checks/v31/format/OAR012/camel-case-with-$ref.json create mode 100644 src/test/resources/checks/v31/format/OAR012/camel-case-with-$ref.yaml create mode 100644 src/test/resources/checks/v31/format/OAR012/kebab-case-plain.json create mode 100644 src/test/resources/checks/v31/format/OAR012/kebab-case-plain.yaml create mode 100644 src/test/resources/checks/v31/format/OAR012/kebab-case-with-$ref.json create mode 100644 src/test/resources/checks/v31/format/OAR012/kebab-case-with-$ref.yaml create mode 100644 src/test/resources/checks/v31/format/OAR012/snake-case-plain.json create mode 100644 src/test/resources/checks/v31/format/OAR012/snake-case-plain.yaml create mode 100644 src/test/resources/checks/v31/format/OAR012/snake-case-with-$ref.json create mode 100644 src/test/resources/checks/v31/format/OAR012/snake-case-with-$ref.yaml create mode 100644 src/test/resources/checks/v31/format/OAR016/nested.json create mode 100644 src/test/resources/checks/v31/format/OAR016/nested.yaml create mode 100644 src/test/resources/checks/v31/format/OAR016/plain.json create mode 100644 src/test/resources/checks/v31/format/OAR016/plain.yaml create mode 100644 src/test/resources/checks/v31/format/OAR016/with-$ref.json create mode 100644 src/test/resources/checks/v31/format/OAR016/with-$ref.yaml create mode 100644 src/test/resources/checks/v31/format/OAR037/complete.json create mode 100644 src/test/resources/checks/v31/format/OAR037/complete.yaml create mode 100644 src/test/resources/checks/v31/format/OAR037/nested.json create mode 100644 src/test/resources/checks/v31/format/OAR037/nested.yaml create mode 100644 src/test/resources/checks/v31/format/OAR037/with-$ref.json create mode 100644 src/test/resources/checks/v31/format/OAR037/with-$ref.yaml create mode 100644 src/test/resources/checks/v31/format/OAR042/incorrect-version.json create mode 100644 src/test/resources/checks/v31/format/OAR042/incorrect-version.yaml create mode 100644 src/test/resources/checks/v31/format/OAR042/too-long.json create mode 100644 src/test/resources/checks/v31/format/OAR042/too-long.yaml create mode 100644 src/test/resources/checks/v31/format/OAR042/too-short.json create mode 100644 src/test/resources/checks/v31/format/OAR042/too-short.yaml create mode 100644 src/test/resources/checks/v31/format/OAR042/valid.json create mode 100644 src/test/resources/checks/v31/format/OAR042/valid.yaml create mode 100644 src/test/resources/checks/v31/format/OAR042/without-api-prefix.json create mode 100644 src/test/resources/checks/v31/format/OAR042/without-api-prefix.yaml create mode 100644 src/test/resources/checks/v31/format/OAR052/nested.json create mode 100644 src/test/resources/checks/v31/format/OAR052/nested.yaml create mode 100644 src/test/resources/checks/v31/format/OAR052/plain.json create mode 100644 src/test/resources/checks/v31/format/OAR052/plain.yaml create mode 100644 src/test/resources/checks/v31/format/OAR052/with-$ref.json create mode 100644 src/test/resources/checks/v31/format/OAR052/with-$ref.yaml create mode 100644 src/test/resources/checks/v31/format/OAR066/snake-case-error.json create mode 100644 src/test/resources/checks/v31/format/OAR066/snake-case-error.yaml create mode 100644 src/test/resources/checks/v31/format/OAR066/valid.json create mode 100644 src/test/resources/checks/v31/format/OAR066/valid.yaml create mode 100644 src/test/resources/checks/v31/format/OAR067/camel-case-error.json create mode 100644 src/test/resources/checks/v31/format/OAR067/camel-case-error.yaml create mode 100644 src/test/resources/checks/v31/format/OAR067/valid.json create mode 100644 src/test/resources/checks/v31/format/OAR067/valid.yaml create mode 100644 src/test/resources/checks/v31/format/OAR068/externalref.yaml create mode 100644 src/test/resources/checks/v31/format/OAR068/pascal-case-error.json create mode 100644 src/test/resources/checks/v31/format/OAR068/pascal-case-error.yaml create mode 100644 src/test/resources/checks/v31/format/OAR068/valid.json create mode 100644 src/test/resources/checks/v31/format/OAR068/valid.yaml create mode 100644 src/test/resources/checks/v31/format/OAR077/not-valid-in-query.json create mode 100644 src/test/resources/checks/v31/format/OAR077/not-valid-in-query.yaml create mode 100644 src/test/resources/checks/v31/format/OAR077/valid-in-query.json create mode 100644 src/test/resources/checks/v31/format/OAR077/valid-in-query.yaml create mode 100644 src/test/resources/checks/v31/format/OAR086/external-refexample.yaml create mode 100644 src/test/resources/checks/v31/format/OAR086/internal-refexample.yaml create mode 100644 src/test/resources/checks/v31/format/OAR086/invalid-example.json create mode 100644 src/test/resources/checks/v31/format/OAR086/invalid-example.yaml create mode 100644 src/test/resources/checks/v31/format/OAR086/valid-example.json create mode 100644 src/test/resources/checks/v31/format/OAR086/valid-example.yaml create mode 100644 src/test/resources/checks/v31/format/OAR087/invalid-example.json create mode 100644 src/test/resources/checks/v31/format/OAR087/invalid-example.yaml create mode 100644 src/test/resources/checks/v31/format/OAR087/valid-example.json create mode 100644 src/test/resources/checks/v31/format/OAR087/valid-example.yaml create mode 100644 src/test/resources/checks/v31/format/OAR088/invalid-ref.json create mode 100644 src/test/resources/checks/v31/format/OAR088/invalid-ref.yaml create mode 100644 src/test/resources/checks/v31/format/OAR088/valid-ref.json create mode 100644 src/test/resources/checks/v31/format/OAR088/valid-ref.yaml create mode 100644 src/test/resources/checks/v31/format/OAR089/invalid-ref.json create mode 100644 src/test/resources/checks/v31/format/OAR089/invalid-ref.yaml create mode 100644 src/test/resources/checks/v31/format/OAR089/valid-ref.json create mode 100644 src/test/resources/checks/v31/format/OAR089/valid-ref.yaml create mode 100644 src/test/resources/checks/v31/format/OAR090/invalid-ref.json create mode 100644 src/test/resources/checks/v31/format/OAR090/invalid-ref.yaml create mode 100644 src/test/resources/checks/v31/format/OAR090/valid-ref.json create mode 100644 src/test/resources/checks/v31/format/OAR090/valid-ref.yaml create mode 100644 src/test/resources/checks/v31/format/OAR097/too-short.json create mode 100644 src/test/resources/checks/v31/format/OAR097/too-short.yaml create mode 100644 src/test/resources/checks/v31/format/OAR097/valid.json create mode 100644 src/test/resources/checks/v31/format/OAR097/valid.yaml create mode 100644 src/test/resources/checks/v31/format/OAR098/too-long.json create mode 100644 src/test/resources/checks/v31/format/OAR098/too-long.yaml create mode 100644 src/test/resources/checks/v31/format/OAR098/valid.json create mode 100644 src/test/resources/checks/v31/format/OAR098/valid.yaml create mode 100644 src/test/resources/checks/v31/format/OAR099/valid.json create mode 100644 src/test/resources/checks/v31/format/OAR099/valid.yaml create mode 100644 src/test/resources/checks/v31/format/OAR099/without-api-prefix.json create mode 100644 src/test/resources/checks/v31/format/OAR099/without-api-prefix.yaml create mode 100644 src/test/resources/checks/v31/format/OAR100/incorrect-version.json create mode 100644 src/test/resources/checks/v31/format/OAR100/incorrect-version.yaml create mode 100644 src/test/resources/checks/v31/format/OAR100/valid.json create mode 100644 src/test/resources/checks/v31/format/OAR100/valid.yaml create mode 100644 src/test/resources/checks/v31/format/OAR101/empty-path.json create mode 100644 src/test/resources/checks/v31/format/OAR101/empty-path.yaml create mode 100644 src/test/resources/checks/v31/format/OAR101/invalid.json create mode 100644 src/test/resources/checks/v31/format/OAR101/invalid.yaml create mode 100644 src/test/resources/checks/v31/format/OAR101/valid-with-values.json create mode 100644 src/test/resources/checks/v31/format/OAR101/valid-with-values.yaml create mode 100644 src/test/resources/checks/v31/format/OAR101/valid.json create mode 100644 src/test/resources/checks/v31/format/OAR101/valid.yaml create mode 100644 src/test/resources/checks/v31/format/OAR102/invalid.json create mode 100644 src/test/resources/checks/v31/format/OAR102/invalid.yaml create mode 100644 src/test/resources/checks/v31/format/OAR102/one-part-path.json create mode 100644 src/test/resources/checks/v31/format/OAR102/one-part-path.yaml create mode 100644 src/test/resources/checks/v31/format/OAR102/valid-with-values.json create mode 100644 src/test/resources/checks/v31/format/OAR102/valid-with-values.yaml create mode 100644 src/test/resources/checks/v31/format/OAR102/valid.json create mode 100644 src/test/resources/checks/v31/format/OAR102/valid.yaml create mode 100644 src/test/resources/checks/v31/format/OAR110/valid.json create mode 100644 src/test/resources/checks/v31/format/OAR110/valid.yaml create mode 100644 src/test/resources/checks/v31/format/OAR111/valid.json create mode 100644 src/test/resources/checks/v31/format/OAR111/valid.yaml create mode 100644 src/test/resources/checks/v31/format/OAR113/invalid.json create mode 100644 src/test/resources/checks/v31/format/OAR113/invalid.yaml create mode 100644 src/test/resources/checks/v31/format/OAR113/valid.json create mode 100644 src/test/resources/checks/v31/format/OAR113/valid.yaml create mode 100644 src/test/resources/checks/v31/format/OAR115/invalid.json create mode 100644 src/test/resources/checks/v31/format/OAR115/invalid.yaml create mode 100644 src/test/resources/checks/v31/format/OAR115/valid.json create mode 100644 src/test/resources/checks/v31/format/OAR115/valid.yaml create mode 100644 src/test/resources/checks/v31/operations/OAR045/defined-response.json create mode 100644 src/test/resources/checks/v31/operations/OAR045/defined-response.yaml create mode 100644 src/test/resources/checks/v31/operations/OAR048/many-body-params.json create mode 100644 src/test/resources/checks/v31/operations/OAR048/many-body-params.yaml create mode 100644 src/test/resources/checks/v31/operations/OAR061/insuficent-response-codes.json create mode 100644 src/test/resources/checks/v31/operations/OAR061/insuficent-response-codes.yaml create mode 100644 src/test/resources/checks/v31/operations/OAR061/valid.json create mode 100644 src/test/resources/checks/v31/operations/OAR061/valid.yaml create mode 100644 src/test/resources/checks/v31/operations/OAR062/insuficent-response-codes.json create mode 100644 src/test/resources/checks/v31/operations/OAR062/insuficent-response-codes.yaml create mode 100644 src/test/resources/checks/v31/operations/OAR062/valid.json create mode 100644 src/test/resources/checks/v31/operations/OAR062/valid.yaml create mode 100644 src/test/resources/checks/v31/operations/OAR063/insuficent-response-codes.json create mode 100644 src/test/resources/checks/v31/operations/OAR063/insuficent-response-codes.yaml create mode 100644 src/test/resources/checks/v31/operations/OAR063/valid.json create mode 100644 src/test/resources/checks/v31/operations/OAR063/valid.yaml create mode 100644 src/test/resources/checks/v31/operations/OAR064/insuficent-response-codes.json create mode 100644 src/test/resources/checks/v31/operations/OAR064/insuficent-response-codes.yaml create mode 100644 src/test/resources/checks/v31/operations/OAR064/valid.json create mode 100644 src/test/resources/checks/v31/operations/OAR064/valid.yaml create mode 100644 src/test/resources/checks/v31/operations/OAR065/insuficent-response-codes.json create mode 100644 src/test/resources/checks/v31/operations/OAR065/insuficent-response-codes.yaml create mode 100644 src/test/resources/checks/v31/operations/OAR065/valid.json create mode 100644 src/test/resources/checks/v31/operations/OAR065/valid.yaml create mode 100644 src/test/resources/checks/v31/operations/OAR071/missing-query-params.json create mode 100644 src/test/resources/checks/v31/operations/OAR071/missing-query-params.yaml create mode 100644 src/test/resources/checks/v31/operations/OAR071/valid-query-params.json create mode 100644 src/test/resources/checks/v31/operations/OAR071/valid-query-params.yaml create mode 100644 src/test/resources/checks/v31/operations/OAR091/no-ref.json create mode 100644 src/test/resources/checks/v31/operations/OAR091/no-ref.yaml create mode 100644 src/test/resources/checks/v31/operations/OAR091/with-ref.json create mode 100644 src/test/resources/checks/v31/operations/OAR091/with-ref.yaml create mode 100644 src/test/resources/checks/v31/operations/OAR092/no-ref.json create mode 100644 src/test/resources/checks/v31/operations/OAR092/no-ref.yaml create mode 100644 src/test/resources/checks/v31/operations/OAR092/with-ref.json create mode 100644 src/test/resources/checks/v31/operations/OAR092/with-ref.yaml create mode 100644 src/test/resources/checks/v31/operations/OAR093/no-ref.json create mode 100644 src/test/resources/checks/v31/operations/OAR093/no-ref.yaml create mode 100644 src/test/resources/checks/v31/operations/OAR093/with-ref.json create mode 100644 src/test/resources/checks/v31/operations/OAR093/with-ref.yaml create mode 100644 src/test/resources/checks/v31/operations/OAR103/plain.json create mode 100644 src/test/resources/checks/v31/operations/OAR103/plain.yaml create mode 100644 src/test/resources/checks/v31/operations/OAR104/plain.yaml create mode 100644 src/test/resources/checks/v31/operations/OAR105/plain.json create mode 100644 src/test/resources/checks/v31/operations/OAR105/plain.yaml create mode 100644 src/test/resources/checks/v31/operations/OAR106/plain.json create mode 100644 src/test/resources/checks/v31/operations/OAR106/plain.yaml create mode 100644 src/test/resources/checks/v31/operations/OAR107/plain.json create mode 100644 src/test/resources/checks/v31/operations/OAR107/plain.yaml create mode 100644 src/test/resources/checks/v31/operations/OAR109/plain.json create mode 100644 src/test/resources/checks/v31/operations/OAR109/plain.yaml create mode 100644 src/test/resources/checks/v31/owasp/OAR070/no-numeric.json create mode 100644 src/test/resources/checks/v31/owasp/OAR070/no-numeric.yaml create mode 100644 src/test/resources/checks/v31/owasp/OAR070/numeric.json create mode 100644 src/test/resources/checks/v31/owasp/OAR070/numeric.yaml create mode 100644 src/test/resources/checks/v31/owasp/OAR073/no-rate-limit.json create mode 100644 src/test/resources/checks/v31/owasp/OAR073/no-rate-limit.yaml create mode 100644 src/test/resources/checks/v31/owasp/OAR073/no-responses.json create mode 100644 src/test/resources/checks/v31/owasp/OAR073/no-responses.yaml create mode 100644 src/test/resources/checks/v31/owasp/OAR073/rate-limit.json create mode 100644 src/test/resources/checks/v31/owasp/OAR073/rate-limit.yaml create mode 100644 src/test/resources/checks/v31/parameters/OAR019/with-$ref-without.json create mode 100644 src/test/resources/checks/v31/parameters/OAR019/with-$ref-without.yaml create mode 100644 src/test/resources/checks/v31/parameters/OAR019/with-$ref.json create mode 100644 src/test/resources/checks/v31/parameters/OAR019/with-$ref.yaml create mode 100644 src/test/resources/checks/v31/parameters/OAR019/with-param.json create mode 100644 src/test/resources/checks/v31/parameters/OAR019/with-param.yaml create mode 100644 src/test/resources/checks/v31/parameters/OAR019/without-parameters.json create mode 100644 src/test/resources/checks/v31/parameters/OAR019/without-parameters.yaml create mode 100644 src/test/resources/checks/v31/parameters/OAR020/excluded.json create mode 100644 src/test/resources/checks/v31/parameters/OAR020/excluded.yaml create mode 100644 src/test/resources/checks/v31/parameters/OAR020/excluded2.json create mode 100644 src/test/resources/checks/v31/parameters/OAR020/excluded2.yaml create mode 100644 src/test/resources/checks/v31/parameters/OAR020/plain-without.json create mode 100644 src/test/resources/checks/v31/parameters/OAR020/plain-without.yaml create mode 100644 src/test/resources/checks/v31/parameters/OAR020/plain-without2.json create mode 100644 src/test/resources/checks/v31/parameters/OAR020/plain-without2.yaml create mode 100644 src/test/resources/checks/v31/parameters/OAR020/plain.json create mode 100644 src/test/resources/checks/v31/parameters/OAR020/plain.yaml create mode 100644 src/test/resources/checks/v31/parameters/OAR020/plain2.json create mode 100644 src/test/resources/checks/v31/parameters/OAR020/plain2.yaml create mode 100644 src/test/resources/checks/v31/parameters/OAR020/with-$ref-without.json create mode 100644 src/test/resources/checks/v31/parameters/OAR020/with-$ref-without.yaml create mode 100644 src/test/resources/checks/v31/parameters/OAR020/with-$ref.json create mode 100644 src/test/resources/checks/v31/parameters/OAR020/with-$ref.yaml create mode 100644 src/test/resources/checks/v31/parameters/OAR020/with-param.json create mode 100644 src/test/resources/checks/v31/parameters/OAR020/with-param.yaml create mode 100644 src/test/resources/checks/v31/parameters/OAR020/with-ref.json create mode 100644 src/test/resources/checks/v31/parameters/OAR020/with-ref.yaml create mode 100644 src/test/resources/checks/v31/parameters/OAR020/without-parameters.json create mode 100644 src/test/resources/checks/v31/parameters/OAR020/without-parameters.yaml create mode 100644 src/test/resources/checks/v31/parameters/OAR021/excluded.json create mode 100644 src/test/resources/checks/v31/parameters/OAR021/excluded.yaml create mode 100644 src/test/resources/checks/v31/parameters/OAR021/plain-without.json create mode 100644 src/test/resources/checks/v31/parameters/OAR021/plain-without.yaml create mode 100644 src/test/resources/checks/v31/parameters/OAR021/plain.json create mode 100644 src/test/resources/checks/v31/parameters/OAR021/plain.yaml create mode 100644 src/test/resources/checks/v31/parameters/OAR021/with-$ref-without.json create mode 100644 src/test/resources/checks/v31/parameters/OAR021/with-$ref-without.yaml create mode 100644 src/test/resources/checks/v31/parameters/OAR021/with-$ref.json create mode 100644 src/test/resources/checks/v31/parameters/OAR021/with-$ref.yaml create mode 100644 src/test/resources/checks/v31/parameters/OAR021/with-param.json create mode 100644 src/test/resources/checks/v31/parameters/OAR021/with-param.yaml create mode 100644 src/test/resources/checks/v31/parameters/OAR021/with-ref.json create mode 100644 src/test/resources/checks/v31/parameters/OAR021/with-ref.yaml create mode 100644 src/test/resources/checks/v31/parameters/OAR021/without-parameters.json create mode 100644 src/test/resources/checks/v31/parameters/OAR021/without-parameters.yaml create mode 100644 src/test/resources/checks/v31/parameters/OAR022/excluded.json create mode 100644 src/test/resources/checks/v31/parameters/OAR022/excluded.yaml create mode 100644 src/test/resources/checks/v31/parameters/OAR022/plain-without.json create mode 100644 src/test/resources/checks/v31/parameters/OAR022/plain-without.yaml create mode 100644 src/test/resources/checks/v31/parameters/OAR022/plain.json create mode 100644 src/test/resources/checks/v31/parameters/OAR022/plain.yaml create mode 100644 src/test/resources/checks/v31/parameters/OAR022/with-$ref-without.json create mode 100644 src/test/resources/checks/v31/parameters/OAR022/with-$ref-without.yaml create mode 100644 src/test/resources/checks/v31/parameters/OAR022/with-$ref.json create mode 100644 src/test/resources/checks/v31/parameters/OAR022/with-$ref.yaml create mode 100644 src/test/resources/checks/v31/parameters/OAR022/without-parameters.json create mode 100644 src/test/resources/checks/v31/parameters/OAR022/without-parameters.yaml create mode 100644 src/test/resources/checks/v31/parameters/OAR023/excluded.json create mode 100644 src/test/resources/checks/v31/parameters/OAR023/excluded.yaml create mode 100644 src/test/resources/checks/v31/parameters/OAR023/plain-without.json create mode 100644 src/test/resources/checks/v31/parameters/OAR023/plain-without.yaml create mode 100644 src/test/resources/checks/v31/parameters/OAR023/plain.json create mode 100644 src/test/resources/checks/v31/parameters/OAR023/plain.yaml create mode 100644 src/test/resources/checks/v31/parameters/OAR023/with-$ref-without.json create mode 100644 src/test/resources/checks/v31/parameters/OAR023/with-$ref-without.yaml create mode 100644 src/test/resources/checks/v31/parameters/OAR023/with-$ref.json create mode 100644 src/test/resources/checks/v31/parameters/OAR023/with-$ref.yaml create mode 100644 src/test/resources/checks/v31/parameters/OAR023/without-parameters.json create mode 100644 src/test/resources/checks/v31/parameters/OAR023/without-parameters.yaml create mode 100644 src/test/resources/checks/v31/parameters/OAR024/excluded.json create mode 100644 src/test/resources/checks/v31/parameters/OAR024/excluded.yaml create mode 100644 src/test/resources/checks/v31/parameters/OAR024/plain-without.json create mode 100644 src/test/resources/checks/v31/parameters/OAR024/plain-without.yaml create mode 100644 src/test/resources/checks/v31/parameters/OAR024/plain.json create mode 100644 src/test/resources/checks/v31/parameters/OAR024/plain.yaml create mode 100644 src/test/resources/checks/v31/parameters/OAR024/with-$ref-without.json create mode 100644 src/test/resources/checks/v31/parameters/OAR024/with-$ref-without.yaml create mode 100644 src/test/resources/checks/v31/parameters/OAR024/with-$ref.json create mode 100644 src/test/resources/checks/v31/parameters/OAR024/with-$ref.yaml create mode 100644 src/test/resources/checks/v31/parameters/OAR024/without-parameters.json create mode 100644 src/test/resources/checks/v31/parameters/OAR024/without-parameters.yaml create mode 100644 src/test/resources/checks/v31/parameters/OAR025/excluded.json create mode 100644 src/test/resources/checks/v31/parameters/OAR025/excluded.yaml create mode 100644 src/test/resources/checks/v31/parameters/OAR025/plain-without.json create mode 100644 src/test/resources/checks/v31/parameters/OAR025/plain-without.yaml create mode 100644 src/test/resources/checks/v31/parameters/OAR025/plain.json create mode 100644 src/test/resources/checks/v31/parameters/OAR025/plain.yaml create mode 100644 src/test/resources/checks/v31/parameters/OAR025/with-$ref-without.json create mode 100644 src/test/resources/checks/v31/parameters/OAR025/with-$ref-without.yaml create mode 100644 src/test/resources/checks/v31/parameters/OAR025/with-$ref.json create mode 100644 src/test/resources/checks/v31/parameters/OAR025/with-$ref.yaml create mode 100644 src/test/resources/checks/v31/parameters/OAR025/without-parameters.json create mode 100644 src/test/resources/checks/v31/parameters/OAR025/without-parameters.yaml create mode 100644 src/test/resources/checks/v31/parameters/OAR026/plain-with-$total-with-defval-false.json create mode 100644 src/test/resources/checks/v31/parameters/OAR026/plain-with-$total-with-defval-false.yaml create mode 100644 src/test/resources/checks/v31/parameters/OAR026/plain-with-$total-with-defval-true.json create mode 100644 src/test/resources/checks/v31/parameters/OAR026/plain-with-$total-with-defval-true.yaml create mode 100644 src/test/resources/checks/v31/parameters/OAR026/plain-with-$total-without-defval.json create mode 100644 src/test/resources/checks/v31/parameters/OAR026/plain-with-$total-without-defval.yaml create mode 100644 src/test/resources/checks/v31/parameters/OAR026/plain-without-$total.json create mode 100644 src/test/resources/checks/v31/parameters/OAR026/plain-without-$total.yaml create mode 100644 src/test/resources/checks/v31/parameters/OAR026/with-$ref-with-$total-with-defval-false.json create mode 100644 src/test/resources/checks/v31/parameters/OAR026/with-$ref-with-$total-with-defval-false.yaml create mode 100644 src/test/resources/checks/v31/parameters/OAR026/with-$ref-with-$total-with-defval-true.json create mode 100644 src/test/resources/checks/v31/parameters/OAR026/with-$ref-with-$total-with-defval-true.yaml create mode 100644 src/test/resources/checks/v31/parameters/OAR026/with-$ref-with-$total-without-defval.json create mode 100644 src/test/resources/checks/v31/parameters/OAR026/with-$ref-with-$total-without-defval.yaml create mode 100644 src/test/resources/checks/v31/parameters/OAR026/with-$ref-without-$total.json create mode 100644 src/test/resources/checks/v31/parameters/OAR026/with-$ref-without-$total.yaml create mode 100644 src/test/resources/checks/v31/parameters/OAR026/without-parameters.json create mode 100644 src/test/resources/checks/v31/parameters/OAR026/without-parameters.yaml create mode 100644 src/test/resources/checks/v31/parameters/OAR028/components-param.json create mode 100644 src/test/resources/checks/v31/parameters/OAR028/components-param.yaml create mode 100644 src/test/resources/checks/v31/parameters/OAR028/exclude-noncompliant.json create mode 100644 src/test/resources/checks/v31/parameters/OAR028/exclude-noncompliant.yaml create mode 100644 src/test/resources/checks/v31/parameters/OAR028/excluded.json create mode 100644 src/test/resources/checks/v31/parameters/OAR028/excluded.yaml create mode 100644 src/test/resources/checks/v31/parameters/OAR028/plain-without.json create mode 100644 src/test/resources/checks/v31/parameters/OAR028/plain-without.yaml create mode 100644 src/test/resources/checks/v31/parameters/OAR028/plain.json create mode 100644 src/test/resources/checks/v31/parameters/OAR028/plain.yaml create mode 100644 src/test/resources/checks/v31/parameters/OAR028/with-$ref-without.json create mode 100644 src/test/resources/checks/v31/parameters/OAR028/with-$ref-without.yaml create mode 100644 src/test/resources/checks/v31/parameters/OAR028/with-$ref.json create mode 100644 src/test/resources/checks/v31/parameters/OAR028/with-$ref.yaml create mode 100644 src/test/resources/checks/v31/parameters/OAR028/without-parameters.json create mode 100644 src/test/resources/checks/v31/parameters/OAR028/without-parameters.yaml create mode 100644 src/test/resources/checks/v31/parameters/OAR060/required-false.json create mode 100644 src/test/resources/checks/v31/parameters/OAR060/required-false.yaml create mode 100644 src/test/resources/checks/v31/parameters/OAR060/required-true.json create mode 100644 src/test/resources/checks/v31/parameters/OAR060/required-true.yaml create mode 100644 src/test/resources/checks/v31/parameters/OAR069/bad-request400.json create mode 100644 src/test/resources/checks/v31/parameters/OAR069/bad-request400.yaml create mode 100644 src/test/resources/checks/v31/parameters/OAR069/no-bad-request400.json create mode 100644 src/test/resources/checks/v31/parameters/OAR069/no-bad-request400.yaml create mode 100644 src/test/resources/checks/v31/regex/OAR112/external-docs-invalid.json create mode 100644 src/test/resources/checks/v31/regex/OAR112/external-docs-invalid.yaml create mode 100644 src/test/resources/checks/v31/regex/OAR112/external-docs-valid.json create mode 100644 src/test/resources/checks/v31/regex/OAR112/external-docs-valid.yaml create mode 100644 src/test/resources/checks/v31/regex/OAR112/info-invalid.json create mode 100644 src/test/resources/checks/v31/regex/OAR112/info-invalid.yaml create mode 100644 src/test/resources/checks/v31/regex/OAR112/minimal.json create mode 100644 src/test/resources/checks/v31/regex/OAR112/minimal.yaml create mode 100644 src/test/resources/checks/v31/regex/OAR112/missing-description.json create mode 100644 src/test/resources/checks/v31/regex/OAR112/missing-description.yaml create mode 100644 src/test/resources/checks/v31/regex/OAR112/operation-invalid.json create mode 100644 src/test/resources/checks/v31/regex/OAR112/operation-invalid.yaml create mode 100644 src/test/resources/checks/v31/regex/OAR112/operation-valid.json create mode 100644 src/test/resources/checks/v31/regex/OAR112/operation-valid.yaml create mode 100644 src/test/resources/checks/v31/regex/OAR112/parameters-invalid.json create mode 100644 src/test/resources/checks/v31/regex/OAR112/parameters-invalid.yaml create mode 100644 src/test/resources/checks/v31/regex/OAR112/parameters-valid.json create mode 100644 src/test/resources/checks/v31/regex/OAR112/parameters-valid.yaml create mode 100644 src/test/resources/checks/v31/regex/OAR112/plain.json create mode 100644 src/test/resources/checks/v31/regex/OAR112/plain.yaml create mode 100644 src/test/resources/checks/v31/regex/OAR112/servers-invalid.json create mode 100644 src/test/resources/checks/v31/regex/OAR112/servers-invalid.yaml create mode 100644 src/test/resources/checks/v31/regex/OAR112/servers-valid.json create mode 100644 src/test/resources/checks/v31/regex/OAR112/servers-valid.yaml create mode 100644 src/test/resources/checks/v31/regex/OAR112/tags-invalid.json create mode 100644 src/test/resources/checks/v31/regex/OAR112/tags-invalid.yaml create mode 100644 src/test/resources/checks/v31/regex/OAR112/tags-valid.json create mode 100644 src/test/resources/checks/v31/regex/OAR112/tags-valid.yaml create mode 100644 src/test/resources/checks/v31/resources/OAR008/plain.json create mode 100644 src/test/resources/checks/v31/resources/OAR008/plain.yaml create mode 100644 src/test/resources/checks/v31/resources/OAR013/plain.json create mode 100644 src/test/resources/checks/v31/resources/OAR013/plain.yaml create mode 100644 src/test/resources/checks/v31/resources/OAR014/plain.json create mode 100644 src/test/resources/checks/v31/resources/OAR014/plain.yaml create mode 100644 src/test/resources/checks/v31/resources/OAR015/plain.json create mode 100644 src/test/resources/checks/v31/resources/OAR015/plain.yaml create mode 100644 src/test/resources/checks/v31/resources/OAR017/plain.json create mode 100644 src/test/resources/checks/v31/resources/OAR017/plain.yaml create mode 100644 src/test/resources/checks/v31/resources/OAR018/plain.json create mode 100644 src/test/resources/checks/v31/resources/OAR018/plain.yaml create mode 100644 src/test/resources/checks/v31/resources/OAR027/no-post.json create mode 100644 src/test/resources/checks/v31/resources/OAR027/no-post.yaml create mode 100644 src/test/resources/checks/v31/resources/OAR027/post-201-with-location.json create mode 100644 src/test/resources/checks/v31/resources/OAR027/post-201-with-location.yaml create mode 100644 src/test/resources/checks/v31/resources/OAR027/post-201-with-other-headers.json create mode 100644 src/test/resources/checks/v31/resources/OAR027/post-201-with-other-headers.yaml create mode 100644 src/test/resources/checks/v31/resources/OAR027/post-201-without-location.json create mode 100644 src/test/resources/checks/v31/resources/OAR027/post-201-without-location.yaml create mode 100644 src/test/resources/checks/v31/resources/OAR027/post-no-201.json create mode 100644 src/test/resources/checks/v31/resources/OAR027/post-no-201.yaml create mode 100644 src/test/resources/checks/v31/resources/OAR029/valid-all-of-md.json create mode 100644 src/test/resources/checks/v31/resources/OAR029/valid-all-of-md.yaml create mode 100644 src/test/resources/checks/v31/resources/OAR029/valid-all-of.json create mode 100644 src/test/resources/checks/v31/resources/OAR029/valid-all-of.yaml create mode 100644 src/test/resources/checks/v31/resources/OAR029/valid-md.json create mode 100644 src/test/resources/checks/v31/resources/OAR029/valid-md.yaml create mode 100644 src/test/resources/checks/v31/resources/OAR029/valid-r.json create mode 100644 src/test/resources/checks/v31/resources/OAR029/valid-r.yaml create mode 100644 src/test/resources/checks/v31/resources/OAR029/valid.json create mode 100644 src/test/resources/checks/v31/resources/OAR029/valid.yaml create mode 100644 src/test/resources/checks/v31/resources/OAR029/with-error-with-properties-wrong-type-r.json create mode 100644 src/test/resources/checks/v31/resources/OAR029/with-error-with-properties-wrong-type-r.yaml create mode 100644 src/test/resources/checks/v31/resources/OAR029/with-error-without-properties-r.json create mode 100644 src/test/resources/checks/v31/resources/OAR029/with-error-without-properties-r.yaml create mode 100644 src/test/resources/checks/v31/resources/OAR029/with-error-wrong-type-r.json create mode 100644 src/test/resources/checks/v31/resources/OAR029/with-error-wrong-type-r.yaml create mode 100644 src/test/resources/checks/v31/resources/OAR029/with-result-with-properties-wrong-type-md.json create mode 100644 src/test/resources/checks/v31/resources/OAR029/with-result-with-properties-wrong-type-md.yaml create mode 100644 src/test/resources/checks/v31/resources/OAR029/with-result-without-properties-md.json create mode 100644 src/test/resources/checks/v31/resources/OAR029/with-result-without-properties-md.yaml create mode 100644 src/test/resources/checks/v31/resources/OAR029/with-result-wrong-type-md.json create mode 100644 src/test/resources/checks/v31/resources/OAR029/with-result-wrong-type-md.yaml create mode 100644 src/test/resources/checks/v31/resources/OAR029/with-status-with-properties-wrong-type.json create mode 100644 src/test/resources/checks/v31/resources/OAR029/with-status-with-properties-wrong-type.yaml create mode 100644 src/test/resources/checks/v31/resources/OAR029/with-status-without-properties.json create mode 100644 src/test/resources/checks/v31/resources/OAR029/with-status-without-properties.yaml create mode 100644 src/test/resources/checks/v31/resources/OAR029/with-status-wrong-type.json create mode 100644 src/test/resources/checks/v31/resources/OAR029/with-status-wrong-type.yaml create mode 100644 src/test/resources/checks/v31/resources/OAR029/without-data-md.json create mode 100644 src/test/resources/checks/v31/resources/OAR029/without-data-md.yaml create mode 100644 src/test/resources/checks/v31/resources/OAR029/without-data.json create mode 100644 src/test/resources/checks/v31/resources/OAR029/without-data.yaml create mode 100644 src/test/resources/checks/v31/resources/OAR029/without-error-r.json create mode 100644 src/test/resources/checks/v31/resources/OAR029/without-error-r.yaml create mode 100644 src/test/resources/checks/v31/resources/OAR029/without-payload-r.json create mode 100644 src/test/resources/checks/v31/resources/OAR029/without-payload-r.yaml create mode 100644 src/test/resources/checks/v31/resources/OAR029/without-required-fields-md.json create mode 100644 src/test/resources/checks/v31/resources/OAR029/without-required-fields-md.yaml create mode 100644 src/test/resources/checks/v31/resources/OAR029/without-required-fields-r.json create mode 100644 src/test/resources/checks/v31/resources/OAR029/without-required-fields-r.yaml create mode 100644 src/test/resources/checks/v31/resources/OAR029/without-required-fields.json create mode 100644 src/test/resources/checks/v31/resources/OAR029/without-required-fields.yaml create mode 100644 src/test/resources/checks/v31/resources/OAR029/without-result-md.json create mode 100644 src/test/resources/checks/v31/resources/OAR029/without-result-md.yaml create mode 100644 src/test/resources/checks/v31/resources/OAR029/without-status.json create mode 100644 src/test/resources/checks/v31/resources/OAR029/without-status.yaml create mode 100644 src/test/resources/checks/v31/resources/OAR030/valid.json create mode 100644 src/test/resources/checks/v31/resources/OAR030/valid.yaml create mode 100644 src/test/resources/checks/v31/resources/OAR030/with-status-without-get.json create mode 100644 src/test/resources/checks/v31/resources/OAR030/with-status-without-get.yaml create mode 100644 src/test/resources/checks/v31/resources/OAR030/without-status.json create mode 100644 src/test/resources/checks/v31/resources/OAR030/without-status.yaml create mode 100644 src/test/resources/checks/v31/resources/OAR031/valid.json create mode 100644 src/test/resources/checks/v31/resources/OAR031/valid.yaml create mode 100644 src/test/resources/checks/v31/resources/OAR031/without-examples.json create mode 100644 src/test/resources/checks/v31/resources/OAR031/without-examples.yaml create mode 100644 src/test/resources/checks/v31/resources/OAR032/forbidden-names.json create mode 100644 src/test/resources/checks/v31/resources/OAR032/forbidden-names.yaml create mode 100644 src/test/resources/checks/v31/resources/OAR032/valid.json create mode 100644 src/test/resources/checks/v31/resources/OAR032/valid.yaml create mode 100644 src/test/resources/checks/v31/resources/OAR034/valid-all-of.json create mode 100644 src/test/resources/checks/v31/resources/OAR034/valid-all-of.yaml create mode 100644 src/test/resources/checks/v31/resources/OAR034/valid.json create mode 100644 src/test/resources/checks/v31/resources/OAR034/valid.yaml create mode 100644 src/test/resources/checks/v31/resources/OAR034/with-links-without-properties.json create mode 100644 src/test/resources/checks/v31/resources/OAR034/with-links-without-properties.yaml create mode 100644 src/test/resources/checks/v31/resources/OAR034/with-paging-with-properties-wrong-types.json create mode 100644 src/test/resources/checks/v31/resources/OAR034/with-paging-with-properties-wrong-types.yaml create mode 100644 src/test/resources/checks/v31/resources/OAR034/with-paging-without-properties.json create mode 100644 src/test/resources/checks/v31/resources/OAR034/with-paging-without-properties.yaml create mode 100644 src/test/resources/checks/v31/resources/OAR034/with-paging-wrong-type.json create mode 100644 src/test/resources/checks/v31/resources/OAR034/with-paging-wrong-type.yaml create mode 100644 src/test/resources/checks/v31/resources/OAR034/without-links-required-fields.json create mode 100644 src/test/resources/checks/v31/resources/OAR034/without-links-required-fields.yaml create mode 100644 src/test/resources/checks/v31/resources/OAR034/without-pagination-required-fields.json create mode 100644 src/test/resources/checks/v31/resources/OAR034/without-pagination-required-fields.yaml create mode 100644 src/test/resources/checks/v31/resources/OAR034/without-paging.json create mode 100644 src/test/resources/checks/v31/resources/OAR034/without-paging.yaml create mode 100644 src/test/resources/checks/v31/resources/OAR038/valid-multiple-properties.json create mode 100644 src/test/resources/checks/v31/resources/OAR038/valid-multiple-properties.yaml create mode 100644 src/test/resources/checks/v31/resources/OAR038/valid-one-property.json create mode 100644 src/test/resources/checks/v31/resources/OAR038/valid-one-property.yaml create mode 100644 src/test/resources/checks/v31/resources/OAR038/with-properties-empty.json create mode 100644 src/test/resources/checks/v31/resources/OAR038/with-properties-empty.yaml create mode 100644 src/test/resources/checks/v31/resources/OAR038/without-data.json create mode 100644 src/test/resources/checks/v31/resources/OAR038/without-data.yaml create mode 100644 src/test/resources/checks/v31/resources/OAR038/without-properties.json create mode 100644 src/test/resources/checks/v31/resources/OAR038/without-properties.yaml create mode 100644 src/test/resources/checks/v31/resources/OAR038/without-schema.json create mode 100644 src/test/resources/checks/v31/resources/OAR038/without-schema.yaml create mode 100644 src/test/resources/checks/v31/resources/OAR039/missing-codes.json create mode 100644 src/test/resources/checks/v31/resources/OAR039/missing-codes.yaml create mode 100644 src/test/resources/checks/v31/resources/OAR039/valid.json create mode 100644 src/test/resources/checks/v31/resources/OAR039/valid.yaml create mode 100644 src/test/resources/checks/v31/schemas/OAR080/empty-global-security.json create mode 100644 src/test/resources/checks/v31/schemas/OAR080/empty-global-security.yaml create mode 100644 src/test/resources/checks/v31/schemas/OAR080/empty-security.json create mode 100644 src/test/resources/checks/v31/schemas/OAR080/empty-security.yaml create mode 100644 src/test/resources/checks/v31/schemas/OAR080/global-security.json create mode 100644 src/test/resources/checks/v31/schemas/OAR080/global-security.yaml create mode 100644 src/test/resources/checks/v31/schemas/OAR080/with-security.json create mode 100644 src/test/resources/checks/v31/schemas/OAR080/with-security.yaml create mode 100644 src/test/resources/checks/v31/schemas/OAR080/without-security.json create mode 100644 src/test/resources/checks/v31/schemas/OAR080/without-security.yaml create mode 100644 src/test/resources/checks/v31/schemas/OAR080/wrong-scheme.json create mode 100644 src/test/resources/checks/v31/schemas/OAR080/wrong-scheme.yaml create mode 100644 src/test/resources/checks/v31/schemas/OAR108/invalid.json create mode 100644 src/test/resources/checks/v31/schemas/OAR108/invalid.yaml create mode 100644 src/test/resources/checks/v31/schemas/OAR108/valid.json create mode 100644 src/test/resources/checks/v31/schemas/OAR108/valid.yaml create mode 100644 src/test/resources/checks/v31/security/OAR001/with-servers.json create mode 100644 src/test/resources/checks/v31/security/OAR001/with-servers.yaml create mode 100644 src/test/resources/checks/v31/security/OAR001/without-servers.json create mode 100644 src/test/resources/checks/v31/security/OAR001/without-servers.yaml create mode 100644 src/test/resources/checks/v31/security/OAR033/valid.json create mode 100644 src/test/resources/checks/v31/security/OAR033/valid.yaml create mode 100644 src/test/resources/checks/v31/security/OAR033/with-forbidden-params.json create mode 100644 src/test/resources/checks/v31/security/OAR033/with-forbidden-params.yaml create mode 100644 src/test/resources/checks/v31/security/OAR033/without-required-params.json create mode 100644 src/test/resources/checks/v31/security/OAR033/without-required-params.yaml create mode 100644 src/test/resources/checks/v31/security/OAR035/valid.json create mode 100644 src/test/resources/checks/v31/security/OAR035/valid.yaml create mode 100644 src/test/resources/checks/v31/security/OAR035/without-authorization-responses.json create mode 100644 src/test/resources/checks/v31/security/OAR035/without-authorization-responses.yaml create mode 100644 src/test/resources/checks/v31/security/OAR036/valid.json create mode 100644 src/test/resources/checks/v31/security/OAR036/valid.yaml create mode 100644 src/test/resources/checks/v31/security/OAR036/with-cookie.json create mode 100644 src/test/resources/checks/v31/security/OAR036/with-cookie.yaml create mode 100644 src/test/resources/checks/v31/security/OAR045/defined-response.json create mode 100644 src/test/resources/checks/v31/security/OAR045/defined-response.yaml create mode 100644 src/test/resources/checks/v31/security/OAR053/valid.json create mode 100644 src/test/resources/checks/v31/security/OAR053/valid.yaml create mode 100644 src/test/resources/checks/v31/security/OAR054/valid.json create mode 100644 src/test/resources/checks/v31/security/OAR054/valid.yaml create mode 100644 src/test/resources/checks/v31/security/OAR072/no-stack-trace.json create mode 100644 src/test/resources/checks/v31/security/OAR072/no-stack-trace.yaml create mode 100644 src/test/resources/checks/v31/security/OAR072/with-stack-trace.json create mode 100644 src/test/resources/checks/v31/security/OAR072/with-stack-trace.yaml create mode 100644 src/test/resources/checks/v31/security/OAR074/no-restrictions.json create mode 100644 src/test/resources/checks/v31/security/OAR074/no-restrictions.yaml create mode 100644 src/test/resources/checks/v31/security/OAR074/with-restrictions.json create mode 100644 src/test/resources/checks/v31/security/OAR074/with-restrictions.yaml create mode 100644 src/test/resources/checks/v31/security/OAR075/no-restrictions.json create mode 100644 src/test/resources/checks/v31/security/OAR075/no-restrictions.yaml create mode 100644 src/test/resources/checks/v31/security/OAR075/with-restrictions.json create mode 100644 src/test/resources/checks/v31/security/OAR075/with-restrictions.yaml create mode 100644 src/test/resources/checks/v31/security/OAR076/nested.json create mode 100644 src/test/resources/checks/v31/security/OAR076/nested.yaml create mode 100644 src/test/resources/checks/v31/security/OAR076/plain.json create mode 100644 src/test/resources/checks/v31/security/OAR076/plain.yaml create mode 100644 src/test/resources/checks/v31/security/OAR076/with-$ref.json create mode 100644 src/test/resources/checks/v31/security/OAR076/with-$ref.yaml create mode 100644 src/test/resources/checks/v31/security/OAR078/no-security.json create mode 100644 src/test/resources/checks/v31/security/OAR078/no-security.yaml create mode 100644 src/test/resources/checks/v31/security/OAR078/with-security.json create mode 100644 src/test/resources/checks/v31/security/OAR078/with-security.yaml create mode 100644 src/test/resources/checks/v31/security/OAR079/bad-request404.json create mode 100644 src/test/resources/checks/v31/security/OAR079/bad-request404.yaml create mode 100644 src/test/resources/checks/v31/security/OAR079/no-bad-request404.json create mode 100644 src/test/resources/checks/v31/security/OAR079/no-bad-request404.yaml create mode 100644 src/test/resources/checks/v31/security/OAR079/no-parameters.json create mode 100644 src/test/resources/checks/v31/security/OAR079/no-parameters.yaml create mode 100644 src/test/resources/checks/v31/security/OAR079/query-param-only.json create mode 100644 src/test/resources/checks/v31/security/OAR079/query-param-only.yaml create mode 100644 src/test/resources/checks/v31/security/OAR081/.gitkeep create mode 100644 src/test/resources/checks/v31/security/OAR081/not-valid-password.json create mode 100644 src/test/resources/checks/v31/security/OAR081/not-valid-password.yaml create mode 100644 src/test/resources/checks/v31/security/OAR081/valid-password.json create mode 100644 src/test/resources/checks/v31/security/OAR081/valid-password.yaml create mode 100644 src/test/resources/checks/v31/security/OAR081/valid-with-components.json create mode 100644 src/test/resources/checks/v31/security/OAR081/valid-with-components.yaml create mode 100644 src/test/resources/checks/v31/security/OAR082/.gitkeep create mode 100644 src/test/resources/checks/v31/security/OAR082/valid-format.json create mode 100644 src/test/resources/checks/v31/security/OAR082/valid-format.yaml create mode 100644 src/test/resources/checks/v31/security/OAR083/forbidden-query-params.json create mode 100644 src/test/resources/checks/v31/security/OAR083/forbidden-query-params.yaml create mode 100644 src/test/resources/checks/v31/security/OAR083/no-parameters.json create mode 100644 src/test/resources/checks/v31/security/OAR083/no-parameters.yaml create mode 100644 src/test/resources/checks/v31/security/OAR083/null-name-param.json create mode 100644 src/test/resources/checks/v31/security/OAR083/null-name-param.yaml create mode 100644 src/test/resources/checks/v31/security/OAR083/options-operation.json create mode 100644 src/test/resources/checks/v31/security/OAR083/options-operation.yaml create mode 100644 src/test/resources/checks/v31/security/OAR083/valid-query-params.json create mode 100644 src/test/resources/checks/v31/security/OAR083/valid-query-params.yaml create mode 100644 src/test/resources/checks/v31/security/OAR084/forbidden-query-formats.json create mode 100644 src/test/resources/checks/v31/security/OAR084/forbidden-query-formats.yaml create mode 100644 src/test/resources/checks/v31/security/OAR084/no-parameters.json create mode 100644 src/test/resources/checks/v31/security/OAR084/no-parameters.yaml create mode 100644 src/test/resources/checks/v31/security/OAR084/non-query-param.json create mode 100644 src/test/resources/checks/v31/security/OAR084/non-query-param.yaml create mode 100644 src/test/resources/checks/v31/security/OAR084/null-format-param.json create mode 100644 src/test/resources/checks/v31/security/OAR084/null-format-param.yaml create mode 100644 src/test/resources/checks/v31/security/OAR084/valid-query-formats.json create mode 100644 src/test/resources/checks/v31/security/OAR084/valid-query-formats.yaml create mode 100644 src/test/resources/checks/v31/security/OAR085/invalid-openapi-version.json create mode 100644 src/test/resources/checks/v31/security/OAR085/invalid-openapi-version.yaml create mode 100644 src/test/resources/checks/v31/security/OAR085/valid-openapi-version.json create mode 100644 src/test/resources/checks/v31/security/OAR096/valid.json create mode 100644 src/test/resources/checks/v31/security/OAR096/valid.yaml create mode 100644 src/test/resources/checks/v31/security/OAR096/without-authorization-responses.json create mode 100644 src/test/resources/checks/v31/security/OAR096/without-authorization-responses.yaml create mode 100644 src/test/resources/checks/v31/security/OAR114/valid.json create mode 100644 src/test/resources/checks/v31/security/OAR114/valid.yaml create mode 100644 src/test/resources/checks/v31/security/OAR114/with-forbidden-params.json create mode 100644 src/test/resources/checks/v31/security/OAR114/with-forbidden-params.yaml create mode 100644 src/test/resources/checks/v31/security/OAR114/without-required-params.json create mode 100644 src/test/resources/checks/v31/security/OAR114/without-required-params.yaml create mode 100644 src/test/resources/checks/v32/core/OAR044/media-type.json create mode 100644 src/test/resources/checks/v32/core/OAR044/media-type.yaml create mode 100644 src/test/resources/checks/v32/core/OAR045/defined-response.json create mode 100644 src/test/resources/checks/v32/core/OAR045/defined-response.yaml create mode 100644 src/test/resources/checks/v32/core/OAR046/declared-tag.json create mode 100644 src/test/resources/checks/v32/core/OAR046/declared-tag.yaml create mode 100644 src/test/resources/checks/v32/core/OAR047/documented-tag.json create mode 100644 src/test/resources/checks/v32/core/OAR047/documented-tag.yaml create mode 100644 src/test/resources/checks/v32/core/OAR049/no-content-in-204.json create mode 100644 src/test/resources/checks/v32/core/OAR049/no-content-in-204.yaml create mode 100644 src/test/resources/checks/v32/core/OAR050/provide-summary.json create mode 100644 src/test/resources/checks/v32/core/OAR050/provide-summary.yaml create mode 100644 src/test/resources/checks/v32/core/OAR051/different-description.json create mode 100644 src/test/resources/checks/v32/core/OAR051/different-description.yaml create mode 100644 src/test/resources/checks/v32/examples/OAR094/externalref.yaml create mode 100644 src/test/resources/checks/v32/examples/OAR094/invalid-example.json create mode 100644 src/test/resources/checks/v32/examples/OAR094/invalid-example.yaml create mode 100644 src/test/resources/checks/v32/examples/OAR094/valid-example.json create mode 100644 src/test/resources/checks/v32/examples/OAR094/valid-example.yaml create mode 100644 src/test/resources/checks/v32/format/OAR006/without-anything.json create mode 100644 src/test/resources/checks/v32/format/OAR006/without-anything.yaml create mode 100644 src/test/resources/checks/v32/format/OAR007/without-anything.json create mode 100644 src/test/resources/checks/v32/format/OAR007/without-anything.yaml create mode 100644 src/test/resources/checks/v32/format/OAR009/operation-not-allows-request-body.json create mode 100644 src/test/resources/checks/v32/format/OAR009/operation-not-allows-request-body.yaml create mode 100644 src/test/resources/checks/v32/format/OAR009/with-default-and-$ref.json create mode 100644 src/test/resources/checks/v32/format/OAR009/with-default-and-$ref.yaml create mode 100644 src/test/resources/checks/v32/format/OAR009/with-default-and-specific.json create mode 100644 src/test/resources/checks/v32/format/OAR009/with-default-and-specific.yaml create mode 100644 src/test/resources/checks/v32/format/OAR009/with-specific.json create mode 100644 src/test/resources/checks/v32/format/OAR009/with-specific.yaml create mode 100644 src/test/resources/checks/v32/format/OAR009/with-wrong-default-and-specific.json create mode 100644 src/test/resources/checks/v32/format/OAR009/with-wrong-default-and-specific.yaml create mode 100644 src/test/resources/checks/v32/format/OAR009/with-wrong-default.json create mode 100644 src/test/resources/checks/v32/format/OAR009/with-wrong-default.yaml create mode 100644 src/test/resources/checks/v32/format/OAR009/without-anything.json create mode 100644 src/test/resources/checks/v32/format/OAR009/without-anything.yaml create mode 100644 src/test/resources/checks/v32/format/OAR010/with-default-and-$ref.json create mode 100644 src/test/resources/checks/v32/format/OAR010/with-default-and-$ref.yaml create mode 100644 src/test/resources/checks/v32/format/OAR010/with-default-and-specific.json create mode 100644 src/test/resources/checks/v32/format/OAR010/with-default-and-specific.yaml create mode 100644 src/test/resources/checks/v32/format/OAR010/with-specific.json create mode 100644 src/test/resources/checks/v32/format/OAR010/with-specific.yaml create mode 100644 src/test/resources/checks/v32/format/OAR010/with-wrong-default-and-specific.json create mode 100644 src/test/resources/checks/v32/format/OAR010/with-wrong-default-and-specific.yaml create mode 100644 src/test/resources/checks/v32/format/OAR010/with-wrong-default.json create mode 100644 src/test/resources/checks/v32/format/OAR010/with-wrong-default.yaml create mode 100644 src/test/resources/checks/v32/format/OAR010/without-anything.json create mode 100644 src/test/resources/checks/v32/format/OAR010/without-anything.yaml create mode 100644 src/test/resources/checks/v32/format/OAR011/base-path-ok.json create mode 100644 src/test/resources/checks/v32/format/OAR011/base-path-ok.yaml create mode 100644 src/test/resources/checks/v32/format/OAR011/base-path-wrong.json create mode 100644 src/test/resources/checks/v32/format/OAR011/base-path-wrong.yaml create mode 100644 src/test/resources/checks/v32/format/OAR011/plain.json create mode 100644 src/test/resources/checks/v32/format/OAR011/plain.yaml create mode 100644 src/test/resources/checks/v32/format/OAR012/camel-case-plain.json create mode 100644 src/test/resources/checks/v32/format/OAR012/camel-case-plain.yaml create mode 100644 src/test/resources/checks/v32/format/OAR012/camel-case-with-$ref.json create mode 100644 src/test/resources/checks/v32/format/OAR012/camel-case-with-$ref.yaml create mode 100644 src/test/resources/checks/v32/format/OAR012/kebab-case-plain.json create mode 100644 src/test/resources/checks/v32/format/OAR012/kebab-case-plain.yaml create mode 100644 src/test/resources/checks/v32/format/OAR012/kebab-case-with-$ref.json create mode 100644 src/test/resources/checks/v32/format/OAR012/kebab-case-with-$ref.yaml create mode 100644 src/test/resources/checks/v32/format/OAR012/snake-case-plain.json create mode 100644 src/test/resources/checks/v32/format/OAR012/snake-case-plain.yaml create mode 100644 src/test/resources/checks/v32/format/OAR012/snake-case-with-$ref.json create mode 100644 src/test/resources/checks/v32/format/OAR012/snake-case-with-$ref.yaml create mode 100644 src/test/resources/checks/v32/format/OAR016/nested.json create mode 100644 src/test/resources/checks/v32/format/OAR016/nested.yaml create mode 100644 src/test/resources/checks/v32/format/OAR016/plain.json create mode 100644 src/test/resources/checks/v32/format/OAR016/plain.yaml create mode 100644 src/test/resources/checks/v32/format/OAR016/with-$ref.json create mode 100644 src/test/resources/checks/v32/format/OAR016/with-$ref.yaml create mode 100644 src/test/resources/checks/v32/format/OAR037/complete.json create mode 100644 src/test/resources/checks/v32/format/OAR037/complete.yaml create mode 100644 src/test/resources/checks/v32/format/OAR037/nested.json create mode 100644 src/test/resources/checks/v32/format/OAR037/nested.yaml create mode 100644 src/test/resources/checks/v32/format/OAR037/with-$ref.json create mode 100644 src/test/resources/checks/v32/format/OAR037/with-$ref.yaml create mode 100644 src/test/resources/checks/v32/format/OAR042/incorrect-version.json create mode 100644 src/test/resources/checks/v32/format/OAR042/incorrect-version.yaml create mode 100644 src/test/resources/checks/v32/format/OAR042/too-long.json create mode 100644 src/test/resources/checks/v32/format/OAR042/too-long.yaml create mode 100644 src/test/resources/checks/v32/format/OAR042/too-short.json create mode 100644 src/test/resources/checks/v32/format/OAR042/too-short.yaml create mode 100644 src/test/resources/checks/v32/format/OAR042/valid.json create mode 100644 src/test/resources/checks/v32/format/OAR042/valid.yaml create mode 100644 src/test/resources/checks/v32/format/OAR042/without-api-prefix.json create mode 100644 src/test/resources/checks/v32/format/OAR042/without-api-prefix.yaml create mode 100644 src/test/resources/checks/v32/format/OAR052/nested.json create mode 100644 src/test/resources/checks/v32/format/OAR052/nested.yaml create mode 100644 src/test/resources/checks/v32/format/OAR052/plain.json create mode 100644 src/test/resources/checks/v32/format/OAR052/plain.yaml create mode 100644 src/test/resources/checks/v32/format/OAR052/with-$ref.json create mode 100644 src/test/resources/checks/v32/format/OAR052/with-$ref.yaml create mode 100644 src/test/resources/checks/v32/format/OAR066/snake-case-error.json create mode 100644 src/test/resources/checks/v32/format/OAR066/snake-case-error.yaml create mode 100644 src/test/resources/checks/v32/format/OAR066/valid.json create mode 100644 src/test/resources/checks/v32/format/OAR066/valid.yaml create mode 100644 src/test/resources/checks/v32/format/OAR067/camel-case-error.json create mode 100644 src/test/resources/checks/v32/format/OAR067/camel-case-error.yaml create mode 100644 src/test/resources/checks/v32/format/OAR067/valid.json create mode 100644 src/test/resources/checks/v32/format/OAR067/valid.yaml create mode 100644 src/test/resources/checks/v32/format/OAR068/externalref.yaml create mode 100644 src/test/resources/checks/v32/format/OAR068/pascal-case-error.json create mode 100644 src/test/resources/checks/v32/format/OAR068/pascal-case-error.yaml create mode 100644 src/test/resources/checks/v32/format/OAR068/valid.json create mode 100644 src/test/resources/checks/v32/format/OAR068/valid.yaml create mode 100644 src/test/resources/checks/v32/format/OAR077/not-valid-in-query.json create mode 100644 src/test/resources/checks/v32/format/OAR077/not-valid-in-query.yaml create mode 100644 src/test/resources/checks/v32/format/OAR077/valid-in-query.json create mode 100644 src/test/resources/checks/v32/format/OAR077/valid-in-query.yaml create mode 100644 src/test/resources/checks/v32/format/OAR086/external-refexample.yaml create mode 100644 src/test/resources/checks/v32/format/OAR086/internal-refexample.yaml create mode 100644 src/test/resources/checks/v32/format/OAR086/invalid-example.json create mode 100644 src/test/resources/checks/v32/format/OAR086/invalid-example.yaml create mode 100644 src/test/resources/checks/v32/format/OAR086/valid-example.json create mode 100644 src/test/resources/checks/v32/format/OAR086/valid-example.yaml create mode 100644 src/test/resources/checks/v32/format/OAR087/invalid-example.json create mode 100644 src/test/resources/checks/v32/format/OAR087/invalid-example.yaml create mode 100644 src/test/resources/checks/v32/format/OAR087/valid-example.json create mode 100644 src/test/resources/checks/v32/format/OAR087/valid-example.yaml create mode 100644 src/test/resources/checks/v32/format/OAR088/invalid-ref.json create mode 100644 src/test/resources/checks/v32/format/OAR088/invalid-ref.yaml create mode 100644 src/test/resources/checks/v32/format/OAR088/valid-ref.json create mode 100644 src/test/resources/checks/v32/format/OAR088/valid-ref.yaml create mode 100644 src/test/resources/checks/v32/format/OAR089/invalid-ref.json create mode 100644 src/test/resources/checks/v32/format/OAR089/invalid-ref.yaml create mode 100644 src/test/resources/checks/v32/format/OAR089/valid-ref.json create mode 100644 src/test/resources/checks/v32/format/OAR089/valid-ref.yaml create mode 100644 src/test/resources/checks/v32/format/OAR090/invalid-ref.json create mode 100644 src/test/resources/checks/v32/format/OAR090/invalid-ref.yaml create mode 100644 src/test/resources/checks/v32/format/OAR090/valid-ref.json create mode 100644 src/test/resources/checks/v32/format/OAR090/valid-ref.yaml create mode 100644 src/test/resources/checks/v32/format/OAR097/too-short.json create mode 100644 src/test/resources/checks/v32/format/OAR097/too-short.yaml create mode 100644 src/test/resources/checks/v32/format/OAR097/valid.json create mode 100644 src/test/resources/checks/v32/format/OAR097/valid.yaml create mode 100644 src/test/resources/checks/v32/format/OAR098/too-long.json create mode 100644 src/test/resources/checks/v32/format/OAR098/too-long.yaml create mode 100644 src/test/resources/checks/v32/format/OAR098/valid.json create mode 100644 src/test/resources/checks/v32/format/OAR098/valid.yaml create mode 100644 src/test/resources/checks/v32/format/OAR099/valid.json create mode 100644 src/test/resources/checks/v32/format/OAR099/valid.yaml create mode 100644 src/test/resources/checks/v32/format/OAR099/without-api-prefix.json create mode 100644 src/test/resources/checks/v32/format/OAR099/without-api-prefix.yaml create mode 100644 src/test/resources/checks/v32/format/OAR100/incorrect-version.json create mode 100644 src/test/resources/checks/v32/format/OAR100/incorrect-version.yaml create mode 100644 src/test/resources/checks/v32/format/OAR100/valid.json create mode 100644 src/test/resources/checks/v32/format/OAR100/valid.yaml create mode 100644 src/test/resources/checks/v32/format/OAR101/empty-path.json create mode 100644 src/test/resources/checks/v32/format/OAR101/empty-path.yaml create mode 100644 src/test/resources/checks/v32/format/OAR101/invalid.json create mode 100644 src/test/resources/checks/v32/format/OAR101/invalid.yaml create mode 100644 src/test/resources/checks/v32/format/OAR101/valid-with-values.json create mode 100644 src/test/resources/checks/v32/format/OAR101/valid-with-values.yaml create mode 100644 src/test/resources/checks/v32/format/OAR101/valid.json create mode 100644 src/test/resources/checks/v32/format/OAR101/valid.yaml create mode 100644 src/test/resources/checks/v32/format/OAR102/invalid.json create mode 100644 src/test/resources/checks/v32/format/OAR102/invalid.yaml create mode 100644 src/test/resources/checks/v32/format/OAR102/one-part-path.json create mode 100644 src/test/resources/checks/v32/format/OAR102/one-part-path.yaml create mode 100644 src/test/resources/checks/v32/format/OAR102/valid-with-values.json create mode 100644 src/test/resources/checks/v32/format/OAR102/valid-with-values.yaml create mode 100644 src/test/resources/checks/v32/format/OAR102/valid.json create mode 100644 src/test/resources/checks/v32/format/OAR102/valid.yaml create mode 100644 src/test/resources/checks/v32/format/OAR110/valid.json create mode 100644 src/test/resources/checks/v32/format/OAR110/valid.yaml create mode 100644 src/test/resources/checks/v32/format/OAR111/valid.json create mode 100644 src/test/resources/checks/v32/format/OAR111/valid.yaml create mode 100644 src/test/resources/checks/v32/format/OAR113/invalid.json create mode 100644 src/test/resources/checks/v32/format/OAR113/invalid.yaml create mode 100644 src/test/resources/checks/v32/format/OAR113/valid.json create mode 100644 src/test/resources/checks/v32/format/OAR113/valid.yaml create mode 100644 src/test/resources/checks/v32/format/OAR115/invalid.json create mode 100644 src/test/resources/checks/v32/format/OAR115/invalid.yaml create mode 100644 src/test/resources/checks/v32/format/OAR115/valid.json create mode 100644 src/test/resources/checks/v32/format/OAR115/valid.yaml create mode 100644 src/test/resources/checks/v32/operations/OAR045/defined-response.json create mode 100644 src/test/resources/checks/v32/operations/OAR045/defined-response.yaml create mode 100644 src/test/resources/checks/v32/operations/OAR048/many-body-params.json create mode 100644 src/test/resources/checks/v32/operations/OAR048/many-body-params.yaml create mode 100644 src/test/resources/checks/v32/operations/OAR061/insuficent-response-codes.json create mode 100644 src/test/resources/checks/v32/operations/OAR061/insuficent-response-codes.yaml create mode 100644 src/test/resources/checks/v32/operations/OAR061/valid.json create mode 100644 src/test/resources/checks/v32/operations/OAR061/valid.yaml create mode 100644 src/test/resources/checks/v32/operations/OAR062/insuficent-response-codes.json create mode 100644 src/test/resources/checks/v32/operations/OAR062/insuficent-response-codes.yaml create mode 100644 src/test/resources/checks/v32/operations/OAR062/valid.json create mode 100644 src/test/resources/checks/v32/operations/OAR062/valid.yaml create mode 100644 src/test/resources/checks/v32/operations/OAR063/insuficent-response-codes.json create mode 100644 src/test/resources/checks/v32/operations/OAR063/insuficent-response-codes.yaml create mode 100644 src/test/resources/checks/v32/operations/OAR063/valid.json create mode 100644 src/test/resources/checks/v32/operations/OAR063/valid.yaml create mode 100644 src/test/resources/checks/v32/operations/OAR064/insuficent-response-codes.json create mode 100644 src/test/resources/checks/v32/operations/OAR064/insuficent-response-codes.yaml create mode 100644 src/test/resources/checks/v32/operations/OAR064/valid.json create mode 100644 src/test/resources/checks/v32/operations/OAR064/valid.yaml create mode 100644 src/test/resources/checks/v32/operations/OAR065/insuficent-response-codes.json create mode 100644 src/test/resources/checks/v32/operations/OAR065/insuficent-response-codes.yaml create mode 100644 src/test/resources/checks/v32/operations/OAR065/valid.json create mode 100644 src/test/resources/checks/v32/operations/OAR065/valid.yaml create mode 100644 src/test/resources/checks/v32/operations/OAR071/missing-query-params.json create mode 100644 src/test/resources/checks/v32/operations/OAR071/missing-query-params.yaml create mode 100644 src/test/resources/checks/v32/operations/OAR071/valid-query-params.json create mode 100644 src/test/resources/checks/v32/operations/OAR071/valid-query-params.yaml create mode 100644 src/test/resources/checks/v32/operations/OAR091/no-ref.json create mode 100644 src/test/resources/checks/v32/operations/OAR091/no-ref.yaml create mode 100644 src/test/resources/checks/v32/operations/OAR091/with-ref.json create mode 100644 src/test/resources/checks/v32/operations/OAR091/with-ref.yaml create mode 100644 src/test/resources/checks/v32/operations/OAR092/no-ref.json create mode 100644 src/test/resources/checks/v32/operations/OAR092/no-ref.yaml create mode 100644 src/test/resources/checks/v32/operations/OAR092/with-ref.json create mode 100644 src/test/resources/checks/v32/operations/OAR092/with-ref.yaml create mode 100644 src/test/resources/checks/v32/operations/OAR093/no-ref.json create mode 100644 src/test/resources/checks/v32/operations/OAR093/no-ref.yaml create mode 100644 src/test/resources/checks/v32/operations/OAR093/with-ref.json create mode 100644 src/test/resources/checks/v32/operations/OAR093/with-ref.yaml create mode 100644 src/test/resources/checks/v32/operations/OAR103/plain.json create mode 100644 src/test/resources/checks/v32/operations/OAR103/plain.yaml create mode 100644 src/test/resources/checks/v32/operations/OAR104/plain.yaml create mode 100644 src/test/resources/checks/v32/operations/OAR105/plain.json create mode 100644 src/test/resources/checks/v32/operations/OAR105/plain.yaml create mode 100644 src/test/resources/checks/v32/operations/OAR106/plain.json create mode 100644 src/test/resources/checks/v32/operations/OAR106/plain.yaml create mode 100644 src/test/resources/checks/v32/operations/OAR107/plain.json create mode 100644 src/test/resources/checks/v32/operations/OAR107/plain.yaml create mode 100644 src/test/resources/checks/v32/operations/OAR109/plain.json create mode 100644 src/test/resources/checks/v32/operations/OAR109/plain.yaml create mode 100644 src/test/resources/checks/v32/owasp/OAR070/no-numeric.json create mode 100644 src/test/resources/checks/v32/owasp/OAR070/no-numeric.yaml create mode 100644 src/test/resources/checks/v32/owasp/OAR070/numeric.json create mode 100644 src/test/resources/checks/v32/owasp/OAR070/numeric.yaml create mode 100644 src/test/resources/checks/v32/owasp/OAR073/no-rate-limit.json create mode 100644 src/test/resources/checks/v32/owasp/OAR073/no-rate-limit.yaml create mode 100644 src/test/resources/checks/v32/owasp/OAR073/no-responses.json create mode 100644 src/test/resources/checks/v32/owasp/OAR073/no-responses.yaml create mode 100644 src/test/resources/checks/v32/owasp/OAR073/rate-limit.json create mode 100644 src/test/resources/checks/v32/owasp/OAR073/rate-limit.yaml create mode 100644 src/test/resources/checks/v32/parameters/OAR019/excluded.json create mode 100644 src/test/resources/checks/v32/parameters/OAR019/excluded.yaml create mode 100644 src/test/resources/checks/v32/parameters/OAR019/plain-without.json create mode 100644 src/test/resources/checks/v32/parameters/OAR019/plain-without.yaml create mode 100644 src/test/resources/checks/v32/parameters/OAR019/plain.json create mode 100644 src/test/resources/checks/v32/parameters/OAR019/plain.yaml create mode 100644 src/test/resources/checks/v32/parameters/OAR019/with-$ref-without.json create mode 100644 src/test/resources/checks/v32/parameters/OAR019/with-$ref-without.yaml create mode 100644 src/test/resources/checks/v32/parameters/OAR019/with-$ref.json create mode 100644 src/test/resources/checks/v32/parameters/OAR019/with-$ref.yaml create mode 100644 src/test/resources/checks/v32/parameters/OAR019/with-param.json create mode 100644 src/test/resources/checks/v32/parameters/OAR019/with-param.yaml create mode 100644 src/test/resources/checks/v32/parameters/OAR019/with-ref.json create mode 100644 src/test/resources/checks/v32/parameters/OAR019/with-ref.yaml create mode 100644 src/test/resources/checks/v32/parameters/OAR019/without-parameters.json create mode 100644 src/test/resources/checks/v32/parameters/OAR019/without-parameters.yaml create mode 100644 src/test/resources/checks/v32/parameters/OAR020/excluded.json create mode 100644 src/test/resources/checks/v32/parameters/OAR020/excluded.yaml create mode 100644 src/test/resources/checks/v32/parameters/OAR020/excluded2.json create mode 100644 src/test/resources/checks/v32/parameters/OAR020/excluded2.yaml create mode 100644 src/test/resources/checks/v32/parameters/OAR020/plain-without.json create mode 100644 src/test/resources/checks/v32/parameters/OAR020/plain-without.yaml create mode 100644 src/test/resources/checks/v32/parameters/OAR020/plain-without2.json create mode 100644 src/test/resources/checks/v32/parameters/OAR020/plain-without2.yaml create mode 100644 src/test/resources/checks/v32/parameters/OAR020/plain.json create mode 100644 src/test/resources/checks/v32/parameters/OAR020/plain.yaml create mode 100644 src/test/resources/checks/v32/parameters/OAR020/plain2.json create mode 100644 src/test/resources/checks/v32/parameters/OAR020/plain2.yaml create mode 100644 src/test/resources/checks/v32/parameters/OAR020/with-$ref-without.json create mode 100644 src/test/resources/checks/v32/parameters/OAR020/with-$ref-without.yaml create mode 100644 src/test/resources/checks/v32/parameters/OAR020/with-$ref.json create mode 100644 src/test/resources/checks/v32/parameters/OAR020/with-$ref.yaml create mode 100644 src/test/resources/checks/v32/parameters/OAR020/with-param.json create mode 100644 src/test/resources/checks/v32/parameters/OAR020/with-param.yaml create mode 100644 src/test/resources/checks/v32/parameters/OAR020/with-ref.json create mode 100644 src/test/resources/checks/v32/parameters/OAR020/with-ref.yaml create mode 100644 src/test/resources/checks/v32/parameters/OAR020/without-parameters.json create mode 100644 src/test/resources/checks/v32/parameters/OAR020/without-parameters.yaml create mode 100644 src/test/resources/checks/v32/parameters/OAR021/excluded.json create mode 100644 src/test/resources/checks/v32/parameters/OAR021/excluded.yaml create mode 100644 src/test/resources/checks/v32/parameters/OAR021/plain-without.json create mode 100644 src/test/resources/checks/v32/parameters/OAR021/plain-without.yaml create mode 100644 src/test/resources/checks/v32/parameters/OAR021/plain.json create mode 100644 src/test/resources/checks/v32/parameters/OAR021/plain.yaml create mode 100644 src/test/resources/checks/v32/parameters/OAR021/with-$ref-without.json create mode 100644 src/test/resources/checks/v32/parameters/OAR021/with-$ref-without.yaml create mode 100644 src/test/resources/checks/v32/parameters/OAR021/with-$ref.json create mode 100644 src/test/resources/checks/v32/parameters/OAR021/with-$ref.yaml create mode 100644 src/test/resources/checks/v32/parameters/OAR021/with-param.json create mode 100644 src/test/resources/checks/v32/parameters/OAR021/with-param.yaml create mode 100644 src/test/resources/checks/v32/parameters/OAR021/with-ref.json create mode 100644 src/test/resources/checks/v32/parameters/OAR021/with-ref.yaml create mode 100644 src/test/resources/checks/v32/parameters/OAR021/without-parameters.json create mode 100644 src/test/resources/checks/v32/parameters/OAR021/without-parameters.yaml create mode 100644 src/test/resources/checks/v32/parameters/OAR022/excluded.json create mode 100644 src/test/resources/checks/v32/parameters/OAR022/excluded.yaml create mode 100644 src/test/resources/checks/v32/parameters/OAR022/plain-without.json create mode 100644 src/test/resources/checks/v32/parameters/OAR022/plain-without.yaml create mode 100644 src/test/resources/checks/v32/parameters/OAR022/plain.json create mode 100644 src/test/resources/checks/v32/parameters/OAR022/plain.yaml create mode 100644 src/test/resources/checks/v32/parameters/OAR022/with-$ref-without.json create mode 100644 src/test/resources/checks/v32/parameters/OAR022/with-$ref-without.yaml create mode 100644 src/test/resources/checks/v32/parameters/OAR022/with-$ref.json create mode 100644 src/test/resources/checks/v32/parameters/OAR022/with-$ref.yaml create mode 100644 src/test/resources/checks/v32/parameters/OAR022/without-parameters.json create mode 100644 src/test/resources/checks/v32/parameters/OAR022/without-parameters.yaml create mode 100644 src/test/resources/checks/v32/parameters/OAR023/excluded.json create mode 100644 src/test/resources/checks/v32/parameters/OAR023/excluded.yaml create mode 100644 src/test/resources/checks/v32/parameters/OAR023/plain-without.json create mode 100644 src/test/resources/checks/v32/parameters/OAR023/plain-without.yaml create mode 100644 src/test/resources/checks/v32/parameters/OAR023/plain.json create mode 100644 src/test/resources/checks/v32/parameters/OAR023/plain.yaml create mode 100644 src/test/resources/checks/v32/parameters/OAR023/with-$ref-without.json create mode 100644 src/test/resources/checks/v32/parameters/OAR023/with-$ref-without.yaml create mode 100644 src/test/resources/checks/v32/parameters/OAR023/with-$ref.json create mode 100644 src/test/resources/checks/v32/parameters/OAR023/with-$ref.yaml create mode 100644 src/test/resources/checks/v32/parameters/OAR023/without-parameters.json create mode 100644 src/test/resources/checks/v32/parameters/OAR023/without-parameters.yaml create mode 100644 src/test/resources/checks/v32/parameters/OAR024/excluded.json create mode 100644 src/test/resources/checks/v32/parameters/OAR024/excluded.yaml create mode 100644 src/test/resources/checks/v32/parameters/OAR024/plain-without.json create mode 100644 src/test/resources/checks/v32/parameters/OAR024/plain-without.yaml create mode 100644 src/test/resources/checks/v32/parameters/OAR024/plain.json create mode 100644 src/test/resources/checks/v32/parameters/OAR024/plain.yaml create mode 100644 src/test/resources/checks/v32/parameters/OAR024/with-$ref-without.json create mode 100644 src/test/resources/checks/v32/parameters/OAR024/with-$ref-without.yaml create mode 100644 src/test/resources/checks/v32/parameters/OAR024/with-$ref.json create mode 100644 src/test/resources/checks/v32/parameters/OAR024/with-$ref.yaml create mode 100644 src/test/resources/checks/v32/parameters/OAR024/without-parameters.json create mode 100644 src/test/resources/checks/v32/parameters/OAR024/without-parameters.yaml create mode 100644 src/test/resources/checks/v32/parameters/OAR025/excluded.json create mode 100644 src/test/resources/checks/v32/parameters/OAR025/excluded.yaml create mode 100644 src/test/resources/checks/v32/parameters/OAR025/plain-without.json create mode 100644 src/test/resources/checks/v32/parameters/OAR025/plain-without.yaml create mode 100644 src/test/resources/checks/v32/parameters/OAR025/plain.json create mode 100644 src/test/resources/checks/v32/parameters/OAR025/plain.yaml create mode 100644 src/test/resources/checks/v32/parameters/OAR025/with-$ref-without.json create mode 100644 src/test/resources/checks/v32/parameters/OAR025/with-$ref-without.yaml create mode 100644 src/test/resources/checks/v32/parameters/OAR025/with-$ref.json create mode 100644 src/test/resources/checks/v32/parameters/OAR025/with-$ref.yaml create mode 100644 src/test/resources/checks/v32/parameters/OAR025/without-parameters.json create mode 100644 src/test/resources/checks/v32/parameters/OAR025/without-parameters.yaml create mode 100644 src/test/resources/checks/v32/parameters/OAR026/plain-with-$total-with-defval-false.json create mode 100644 src/test/resources/checks/v32/parameters/OAR026/plain-with-$total-with-defval-false.yaml create mode 100644 src/test/resources/checks/v32/parameters/OAR026/plain-with-$total-with-defval-true.json create mode 100644 src/test/resources/checks/v32/parameters/OAR026/plain-with-$total-with-defval-true.yaml create mode 100644 src/test/resources/checks/v32/parameters/OAR026/plain-with-$total-without-defval.json create mode 100644 src/test/resources/checks/v32/parameters/OAR026/plain-with-$total-without-defval.yaml create mode 100644 src/test/resources/checks/v32/parameters/OAR026/plain-without-$total.json create mode 100644 src/test/resources/checks/v32/parameters/OAR026/plain-without-$total.yaml create mode 100644 src/test/resources/checks/v32/parameters/OAR026/with-$ref-with-$total-with-defval-false.json create mode 100644 src/test/resources/checks/v32/parameters/OAR026/with-$ref-with-$total-with-defval-false.yaml create mode 100644 src/test/resources/checks/v32/parameters/OAR026/with-$ref-with-$total-with-defval-true.json create mode 100644 src/test/resources/checks/v32/parameters/OAR026/with-$ref-with-$total-with-defval-true.yaml create mode 100644 src/test/resources/checks/v32/parameters/OAR026/with-$ref-with-$total-without-defval.json create mode 100644 src/test/resources/checks/v32/parameters/OAR026/with-$ref-with-$total-without-defval.yaml create mode 100644 src/test/resources/checks/v32/parameters/OAR026/with-$ref-without-$total.json create mode 100644 src/test/resources/checks/v32/parameters/OAR026/with-$ref-without-$total.yaml create mode 100644 src/test/resources/checks/v32/parameters/OAR026/without-parameters.json create mode 100644 src/test/resources/checks/v32/parameters/OAR026/without-parameters.yaml create mode 100644 src/test/resources/checks/v32/parameters/OAR028/components-param.json create mode 100644 src/test/resources/checks/v32/parameters/OAR028/components-param.yaml create mode 100644 src/test/resources/checks/v32/parameters/OAR028/exclude-noncompliant.json create mode 100644 src/test/resources/checks/v32/parameters/OAR028/exclude-noncompliant.yaml create mode 100644 src/test/resources/checks/v32/parameters/OAR028/excluded.json create mode 100644 src/test/resources/checks/v32/parameters/OAR028/excluded.yaml create mode 100644 src/test/resources/checks/v32/parameters/OAR028/plain-without.json create mode 100644 src/test/resources/checks/v32/parameters/OAR028/plain-without.yaml create mode 100644 src/test/resources/checks/v32/parameters/OAR028/plain.json create mode 100644 src/test/resources/checks/v32/parameters/OAR028/plain.yaml create mode 100644 src/test/resources/checks/v32/parameters/OAR028/with-$ref-without.json create mode 100644 src/test/resources/checks/v32/parameters/OAR028/with-$ref-without.yaml create mode 100644 src/test/resources/checks/v32/parameters/OAR028/with-$ref.json create mode 100644 src/test/resources/checks/v32/parameters/OAR028/with-$ref.yaml create mode 100644 src/test/resources/checks/v32/parameters/OAR028/without-parameters.json create mode 100644 src/test/resources/checks/v32/parameters/OAR028/without-parameters.yaml create mode 100644 src/test/resources/checks/v32/parameters/OAR060/required-false.json create mode 100644 src/test/resources/checks/v32/parameters/OAR060/required-false.yaml create mode 100644 src/test/resources/checks/v32/parameters/OAR060/required-true.json create mode 100644 src/test/resources/checks/v32/parameters/OAR060/required-true.yaml create mode 100644 src/test/resources/checks/v32/parameters/OAR069/bad-request400.json create mode 100644 src/test/resources/checks/v32/parameters/OAR069/bad-request400.yaml create mode 100644 src/test/resources/checks/v32/parameters/OAR069/no-bad-request400.json create mode 100644 src/test/resources/checks/v32/parameters/OAR069/no-bad-request400.yaml create mode 100644 src/test/resources/checks/v32/regex/OAR112/external-docs-invalid.json create mode 100644 src/test/resources/checks/v32/regex/OAR112/external-docs-invalid.yaml create mode 100644 src/test/resources/checks/v32/regex/OAR112/external-docs-valid.json create mode 100644 src/test/resources/checks/v32/regex/OAR112/external-docs-valid.yaml create mode 100644 src/test/resources/checks/v32/regex/OAR112/info-invalid.json create mode 100644 src/test/resources/checks/v32/regex/OAR112/info-invalid.yaml create mode 100644 src/test/resources/checks/v32/regex/OAR112/minimal.json create mode 100644 src/test/resources/checks/v32/regex/OAR112/minimal.yaml create mode 100644 src/test/resources/checks/v32/regex/OAR112/missing-description.json create mode 100644 src/test/resources/checks/v32/regex/OAR112/missing-description.yaml create mode 100644 src/test/resources/checks/v32/regex/OAR112/operation-invalid.json create mode 100644 src/test/resources/checks/v32/regex/OAR112/operation-invalid.yaml create mode 100644 src/test/resources/checks/v32/regex/OAR112/operation-valid.json create mode 100644 src/test/resources/checks/v32/regex/OAR112/operation-valid.yaml create mode 100644 src/test/resources/checks/v32/regex/OAR112/parameters-invalid.json create mode 100644 src/test/resources/checks/v32/regex/OAR112/parameters-invalid.yaml create mode 100644 src/test/resources/checks/v32/regex/OAR112/parameters-valid.json create mode 100644 src/test/resources/checks/v32/regex/OAR112/parameters-valid.yaml create mode 100644 src/test/resources/checks/v32/regex/OAR112/plain.json create mode 100644 src/test/resources/checks/v32/regex/OAR112/plain.yaml create mode 100644 src/test/resources/checks/v32/regex/OAR112/servers-invalid.json create mode 100644 src/test/resources/checks/v32/regex/OAR112/servers-invalid.yaml create mode 100644 src/test/resources/checks/v32/regex/OAR112/servers-valid.json create mode 100644 src/test/resources/checks/v32/regex/OAR112/servers-valid.yaml create mode 100644 src/test/resources/checks/v32/regex/OAR112/tags-invalid.json create mode 100644 src/test/resources/checks/v32/regex/OAR112/tags-invalid.yaml create mode 100644 src/test/resources/checks/v32/regex/OAR112/tags-valid.json create mode 100644 src/test/resources/checks/v32/regex/OAR112/tags-valid.yaml create mode 100644 src/test/resources/checks/v32/resources/OAR008/plain.json create mode 100644 src/test/resources/checks/v32/resources/OAR008/plain.yaml create mode 100644 src/test/resources/checks/v32/resources/OAR013/plain.json create mode 100644 src/test/resources/checks/v32/resources/OAR013/plain.yaml create mode 100644 src/test/resources/checks/v32/resources/OAR014/plain.json create mode 100644 src/test/resources/checks/v32/resources/OAR014/plain.yaml create mode 100644 src/test/resources/checks/v32/resources/OAR015/plain.json create mode 100644 src/test/resources/checks/v32/resources/OAR015/plain.yaml create mode 100644 src/test/resources/checks/v32/resources/OAR017/plain.json create mode 100644 src/test/resources/checks/v32/resources/OAR017/plain.yaml create mode 100644 src/test/resources/checks/v32/resources/OAR018/plain.json create mode 100644 src/test/resources/checks/v32/resources/OAR018/plain.yaml create mode 100644 src/test/resources/checks/v32/resources/OAR027/no-post.json create mode 100644 src/test/resources/checks/v32/resources/OAR027/no-post.yaml create mode 100644 src/test/resources/checks/v32/resources/OAR027/post-201-with-location.json create mode 100644 src/test/resources/checks/v32/resources/OAR027/post-201-with-location.yaml create mode 100644 src/test/resources/checks/v32/resources/OAR027/post-201-with-other-headers.json create mode 100644 src/test/resources/checks/v32/resources/OAR027/post-201-with-other-headers.yaml create mode 100644 src/test/resources/checks/v32/resources/OAR027/post-201-without-location.json create mode 100644 src/test/resources/checks/v32/resources/OAR027/post-201-without-location.yaml create mode 100644 src/test/resources/checks/v32/resources/OAR027/post-no-201.json create mode 100644 src/test/resources/checks/v32/resources/OAR027/post-no-201.yaml create mode 100644 src/test/resources/checks/v32/resources/OAR029/valid-all-of-md.json create mode 100644 src/test/resources/checks/v32/resources/OAR029/valid-all-of-md.yaml create mode 100644 src/test/resources/checks/v32/resources/OAR029/valid-all-of.json create mode 100644 src/test/resources/checks/v32/resources/OAR029/valid-all-of.yaml create mode 100644 src/test/resources/checks/v32/resources/OAR029/valid-md.json create mode 100644 src/test/resources/checks/v32/resources/OAR029/valid-md.yaml create mode 100644 src/test/resources/checks/v32/resources/OAR029/valid-r.json create mode 100644 src/test/resources/checks/v32/resources/OAR029/valid-r.yaml create mode 100644 src/test/resources/checks/v32/resources/OAR029/valid.json create mode 100644 src/test/resources/checks/v32/resources/OAR029/valid.yaml create mode 100644 src/test/resources/checks/v32/resources/OAR029/with-error-with-properties-wrong-type-r.json create mode 100644 src/test/resources/checks/v32/resources/OAR029/with-error-with-properties-wrong-type-r.yaml create mode 100644 src/test/resources/checks/v32/resources/OAR029/with-error-without-properties-r.json create mode 100644 src/test/resources/checks/v32/resources/OAR029/with-error-without-properties-r.yaml create mode 100644 src/test/resources/checks/v32/resources/OAR029/with-error-wrong-type-r.json create mode 100644 src/test/resources/checks/v32/resources/OAR029/with-error-wrong-type-r.yaml create mode 100644 src/test/resources/checks/v32/resources/OAR029/with-result-with-properties-wrong-type-md.json create mode 100644 src/test/resources/checks/v32/resources/OAR029/with-result-with-properties-wrong-type-md.yaml create mode 100644 src/test/resources/checks/v32/resources/OAR029/with-result-without-properties-md.json create mode 100644 src/test/resources/checks/v32/resources/OAR029/with-result-without-properties-md.yaml create mode 100644 src/test/resources/checks/v32/resources/OAR029/with-result-wrong-type-md.json create mode 100644 src/test/resources/checks/v32/resources/OAR029/with-result-wrong-type-md.yaml create mode 100644 src/test/resources/checks/v32/resources/OAR029/with-status-with-properties-wrong-type.json create mode 100644 src/test/resources/checks/v32/resources/OAR029/with-status-with-properties-wrong-type.yaml create mode 100644 src/test/resources/checks/v32/resources/OAR029/with-status-without-properties.json create mode 100644 src/test/resources/checks/v32/resources/OAR029/with-status-without-properties.yaml create mode 100644 src/test/resources/checks/v32/resources/OAR029/with-status-wrong-type.json create mode 100644 src/test/resources/checks/v32/resources/OAR029/with-status-wrong-type.yaml create mode 100644 src/test/resources/checks/v32/resources/OAR029/without-data-md.json create mode 100644 src/test/resources/checks/v32/resources/OAR029/without-data-md.yaml create mode 100644 src/test/resources/checks/v32/resources/OAR029/without-data.json create mode 100644 src/test/resources/checks/v32/resources/OAR029/without-data.yaml create mode 100644 src/test/resources/checks/v32/resources/OAR029/without-error-r.json create mode 100644 src/test/resources/checks/v32/resources/OAR029/without-error-r.yaml create mode 100644 src/test/resources/checks/v32/resources/OAR029/without-payload-r.json create mode 100644 src/test/resources/checks/v32/resources/OAR029/without-payload-r.yaml create mode 100644 src/test/resources/checks/v32/resources/OAR029/without-required-fields-md.json create mode 100644 src/test/resources/checks/v32/resources/OAR029/without-required-fields-md.yaml create mode 100644 src/test/resources/checks/v32/resources/OAR029/without-required-fields-r.json create mode 100644 src/test/resources/checks/v32/resources/OAR029/without-required-fields-r.yaml create mode 100644 src/test/resources/checks/v32/resources/OAR029/without-required-fields.json create mode 100644 src/test/resources/checks/v32/resources/OAR029/without-required-fields.yaml create mode 100644 src/test/resources/checks/v32/resources/OAR029/without-result-md.json create mode 100644 src/test/resources/checks/v32/resources/OAR029/without-result-md.yaml create mode 100644 src/test/resources/checks/v32/resources/OAR029/without-status.json create mode 100644 src/test/resources/checks/v32/resources/OAR029/without-status.yaml create mode 100644 src/test/resources/checks/v32/resources/OAR030/valid.json create mode 100644 src/test/resources/checks/v32/resources/OAR030/valid.yaml create mode 100644 src/test/resources/checks/v32/resources/OAR030/with-status-without-get.json create mode 100644 src/test/resources/checks/v32/resources/OAR030/with-status-without-get.yaml create mode 100644 src/test/resources/checks/v32/resources/OAR030/without-status.json create mode 100644 src/test/resources/checks/v32/resources/OAR030/without-status.yaml create mode 100644 src/test/resources/checks/v32/resources/OAR031/valid.json create mode 100644 src/test/resources/checks/v32/resources/OAR031/valid.yaml create mode 100644 src/test/resources/checks/v32/resources/OAR031/without-examples.json create mode 100644 src/test/resources/checks/v32/resources/OAR031/without-examples.yaml create mode 100644 src/test/resources/checks/v32/resources/OAR032/forbidden-names.json create mode 100644 src/test/resources/checks/v32/resources/OAR032/forbidden-names.yaml create mode 100644 src/test/resources/checks/v32/resources/OAR032/valid.json create mode 100644 src/test/resources/checks/v32/resources/OAR032/valid.yaml create mode 100644 src/test/resources/checks/v32/resources/OAR034/valid-all-of.json create mode 100644 src/test/resources/checks/v32/resources/OAR034/valid-all-of.yaml create mode 100644 src/test/resources/checks/v32/resources/OAR034/valid.json create mode 100644 src/test/resources/checks/v32/resources/OAR034/valid.yaml create mode 100644 src/test/resources/checks/v32/resources/OAR034/with-links-without-properties.json create mode 100644 src/test/resources/checks/v32/resources/OAR034/with-links-without-properties.yaml create mode 100644 src/test/resources/checks/v32/resources/OAR034/with-paging-with-properties-wrong-types.json create mode 100644 src/test/resources/checks/v32/resources/OAR034/with-paging-with-properties-wrong-types.yaml create mode 100644 src/test/resources/checks/v32/resources/OAR034/with-paging-without-properties.json create mode 100644 src/test/resources/checks/v32/resources/OAR034/with-paging-without-properties.yaml create mode 100644 src/test/resources/checks/v32/resources/OAR034/with-paging-wrong-type.json create mode 100644 src/test/resources/checks/v32/resources/OAR034/with-paging-wrong-type.yaml create mode 100644 src/test/resources/checks/v32/resources/OAR034/without-links-required-fields.json create mode 100644 src/test/resources/checks/v32/resources/OAR034/without-links-required-fields.yaml create mode 100644 src/test/resources/checks/v32/resources/OAR034/without-pagination-required-fields.json create mode 100644 src/test/resources/checks/v32/resources/OAR034/without-pagination-required-fields.yaml create mode 100644 src/test/resources/checks/v32/resources/OAR034/without-paging.json create mode 100644 src/test/resources/checks/v32/resources/OAR034/without-paging.yaml create mode 100644 src/test/resources/checks/v32/resources/OAR038/valid-multiple-properties.json create mode 100644 src/test/resources/checks/v32/resources/OAR038/valid-multiple-properties.yaml create mode 100644 src/test/resources/checks/v32/resources/OAR038/valid-one-property.json create mode 100644 src/test/resources/checks/v32/resources/OAR038/valid-one-property.yaml create mode 100644 src/test/resources/checks/v32/resources/OAR038/with-properties-empty.json create mode 100644 src/test/resources/checks/v32/resources/OAR038/with-properties-empty.yaml create mode 100644 src/test/resources/checks/v32/resources/OAR038/without-data.json create mode 100644 src/test/resources/checks/v32/resources/OAR038/without-data.yaml create mode 100644 src/test/resources/checks/v32/resources/OAR038/without-properties.json create mode 100644 src/test/resources/checks/v32/resources/OAR038/without-properties.yaml create mode 100644 src/test/resources/checks/v32/resources/OAR038/without-schema.json create mode 100644 src/test/resources/checks/v32/resources/OAR038/without-schema.yaml create mode 100644 src/test/resources/checks/v32/resources/OAR039/missing-codes.json create mode 100644 src/test/resources/checks/v32/resources/OAR039/missing-codes.yaml create mode 100644 src/test/resources/checks/v32/resources/OAR039/valid.json create mode 100644 src/test/resources/checks/v32/resources/OAR039/valid.yaml create mode 100644 src/test/resources/checks/v32/schemas/OAR080/empty-global-security.json create mode 100644 src/test/resources/checks/v32/schemas/OAR080/empty-global-security.yaml create mode 100644 src/test/resources/checks/v32/schemas/OAR080/empty-security.json create mode 100644 src/test/resources/checks/v32/schemas/OAR080/empty-security.yaml create mode 100644 src/test/resources/checks/v32/schemas/OAR080/global-security.json create mode 100644 src/test/resources/checks/v32/schemas/OAR080/global-security.yaml create mode 100644 src/test/resources/checks/v32/schemas/OAR080/with-security.json create mode 100644 src/test/resources/checks/v32/schemas/OAR080/with-security.yaml create mode 100644 src/test/resources/checks/v32/schemas/OAR080/without-security.json create mode 100644 src/test/resources/checks/v32/schemas/OAR080/without-security.yaml create mode 100644 src/test/resources/checks/v32/schemas/OAR080/wrong-scheme.json create mode 100644 src/test/resources/checks/v32/schemas/OAR080/wrong-scheme.yaml create mode 100644 src/test/resources/checks/v32/schemas/OAR108/invalid.json create mode 100644 src/test/resources/checks/v32/schemas/OAR108/invalid.yaml create mode 100644 src/test/resources/checks/v32/schemas/OAR108/valid.json create mode 100644 src/test/resources/checks/v32/schemas/OAR108/valid.yaml create mode 100644 src/test/resources/checks/v32/security/OAR001/with-servers.json create mode 100644 src/test/resources/checks/v32/security/OAR001/with-servers.yaml create mode 100644 src/test/resources/checks/v32/security/OAR001/without-servers.json create mode 100644 src/test/resources/checks/v32/security/OAR001/without-servers.yaml create mode 100644 src/test/resources/checks/v32/security/OAR033/valid.json create mode 100644 src/test/resources/checks/v32/security/OAR033/valid.yaml create mode 100644 src/test/resources/checks/v32/security/OAR033/with-forbidden-params.json create mode 100644 src/test/resources/checks/v32/security/OAR033/with-forbidden-params.yaml create mode 100644 src/test/resources/checks/v32/security/OAR033/without-required-params.json create mode 100644 src/test/resources/checks/v32/security/OAR033/without-required-params.yaml create mode 100644 src/test/resources/checks/v32/security/OAR035/valid.json create mode 100644 src/test/resources/checks/v32/security/OAR035/valid.yaml create mode 100644 src/test/resources/checks/v32/security/OAR035/without-authorization-responses.json create mode 100644 src/test/resources/checks/v32/security/OAR035/without-authorization-responses.yaml create mode 100644 src/test/resources/checks/v32/security/OAR036/valid.json create mode 100644 src/test/resources/checks/v32/security/OAR036/valid.yaml create mode 100644 src/test/resources/checks/v32/security/OAR036/with-cookie.json create mode 100644 src/test/resources/checks/v32/security/OAR036/with-cookie.yaml create mode 100644 src/test/resources/checks/v32/security/OAR045/defined-response.json create mode 100644 src/test/resources/checks/v32/security/OAR045/defined-response.yaml create mode 100644 src/test/resources/checks/v32/security/OAR053/valid.json create mode 100644 src/test/resources/checks/v32/security/OAR053/valid.yaml create mode 100644 src/test/resources/checks/v32/security/OAR054/valid.json create mode 100644 src/test/resources/checks/v32/security/OAR054/valid.yaml create mode 100644 src/test/resources/checks/v32/security/OAR072/no-stack-trace.json create mode 100644 src/test/resources/checks/v32/security/OAR072/no-stack-trace.yaml create mode 100644 src/test/resources/checks/v32/security/OAR072/with-stack-trace.json create mode 100644 src/test/resources/checks/v32/security/OAR072/with-stack-trace.yaml create mode 100644 src/test/resources/checks/v32/security/OAR074/no-restrictions.json create mode 100644 src/test/resources/checks/v32/security/OAR074/no-restrictions.yaml create mode 100644 src/test/resources/checks/v32/security/OAR074/with-restrictions.json create mode 100644 src/test/resources/checks/v32/security/OAR074/with-restrictions.yaml create mode 100644 src/test/resources/checks/v32/security/OAR075/no-restrictions.json create mode 100644 src/test/resources/checks/v32/security/OAR075/no-restrictions.yaml create mode 100644 src/test/resources/checks/v32/security/OAR075/with-restrictions.json create mode 100644 src/test/resources/checks/v32/security/OAR075/with-restrictions.yaml create mode 100644 src/test/resources/checks/v32/security/OAR076/nested.json create mode 100644 src/test/resources/checks/v32/security/OAR076/nested.yaml create mode 100644 src/test/resources/checks/v32/security/OAR076/plain.json create mode 100644 src/test/resources/checks/v32/security/OAR076/plain.yaml create mode 100644 src/test/resources/checks/v32/security/OAR076/with-$ref.json create mode 100644 src/test/resources/checks/v32/security/OAR076/with-$ref.yaml create mode 100644 src/test/resources/checks/v32/security/OAR078/no-security.json create mode 100644 src/test/resources/checks/v32/security/OAR078/no-security.yaml create mode 100644 src/test/resources/checks/v32/security/OAR078/with-security.json create mode 100644 src/test/resources/checks/v32/security/OAR078/with-security.yaml create mode 100644 src/test/resources/checks/v32/security/OAR079/bad-request404.json create mode 100644 src/test/resources/checks/v32/security/OAR079/bad-request404.yaml create mode 100644 src/test/resources/checks/v32/security/OAR079/no-bad-request404.json create mode 100644 src/test/resources/checks/v32/security/OAR079/no-bad-request404.yaml create mode 100644 src/test/resources/checks/v32/security/OAR079/no-parameters.json create mode 100644 src/test/resources/checks/v32/security/OAR079/no-parameters.yaml create mode 100644 src/test/resources/checks/v32/security/OAR079/query-param-only.json create mode 100644 src/test/resources/checks/v32/security/OAR079/query-param-only.yaml create mode 100644 src/test/resources/checks/v32/security/OAR081/.gitkeep create mode 100644 src/test/resources/checks/v32/security/OAR081/not-valid-password.json create mode 100644 src/test/resources/checks/v32/security/OAR081/not-valid-password.yaml create mode 100644 src/test/resources/checks/v32/security/OAR081/valid-password.json create mode 100644 src/test/resources/checks/v32/security/OAR081/valid-password.yaml create mode 100644 src/test/resources/checks/v32/security/OAR081/valid-with-components.json create mode 100644 src/test/resources/checks/v32/security/OAR081/valid-with-components.yaml create mode 100644 src/test/resources/checks/v32/security/OAR082/.gitkeep create mode 100644 src/test/resources/checks/v32/security/OAR082/valid-format.json create mode 100644 src/test/resources/checks/v32/security/OAR082/valid-format.yaml create mode 100644 src/test/resources/checks/v32/security/OAR083/forbidden-query-params.json create mode 100644 src/test/resources/checks/v32/security/OAR083/forbidden-query-params.yaml create mode 100644 src/test/resources/checks/v32/security/OAR083/no-parameters.json create mode 100644 src/test/resources/checks/v32/security/OAR083/no-parameters.yaml create mode 100644 src/test/resources/checks/v32/security/OAR083/null-name-param.json create mode 100644 src/test/resources/checks/v32/security/OAR083/null-name-param.yaml create mode 100644 src/test/resources/checks/v32/security/OAR083/options-operation.json create mode 100644 src/test/resources/checks/v32/security/OAR083/options-operation.yaml create mode 100644 src/test/resources/checks/v32/security/OAR083/valid-query-params.json create mode 100644 src/test/resources/checks/v32/security/OAR083/valid-query-params.yaml create mode 100644 src/test/resources/checks/v32/security/OAR084/forbidden-query-formats.json create mode 100644 src/test/resources/checks/v32/security/OAR084/forbidden-query-formats.yaml create mode 100644 src/test/resources/checks/v32/security/OAR084/no-parameters.json create mode 100644 src/test/resources/checks/v32/security/OAR084/no-parameters.yaml create mode 100644 src/test/resources/checks/v32/security/OAR084/non-query-param.json create mode 100644 src/test/resources/checks/v32/security/OAR084/non-query-param.yaml create mode 100644 src/test/resources/checks/v32/security/OAR084/null-format-param.json create mode 100644 src/test/resources/checks/v32/security/OAR084/null-format-param.yaml create mode 100644 src/test/resources/checks/v32/security/OAR084/valid-query-formats.json create mode 100644 src/test/resources/checks/v32/security/OAR084/valid-query-formats.yaml create mode 100644 src/test/resources/checks/v32/security/OAR085/invalid-openapi-version.json create mode 100644 src/test/resources/checks/v32/security/OAR085/invalid-openapi-version.yaml create mode 100644 src/test/resources/checks/v32/security/OAR085/valid-openapi-version.json create mode 100644 src/test/resources/checks/v32/security/OAR085/valid-openapi-version.yaml create mode 100644 src/test/resources/checks/v32/security/OAR096/valid.json create mode 100644 src/test/resources/checks/v32/security/OAR096/valid.yaml create mode 100644 src/test/resources/checks/v32/security/OAR096/without-authorization-responses.json create mode 100644 src/test/resources/checks/v32/security/OAR096/without-authorization-responses.yaml create mode 100644 src/test/resources/checks/v32/security/OAR114/valid.json create mode 100644 src/test/resources/checks/v32/security/OAR114/valid.yaml create mode 100644 src/test/resources/checks/v32/security/OAR114/with-forbidden-params.json create mode 100644 src/test/resources/checks/v32/security/OAR114/with-forbidden-params.yaml create mode 100644 src/test/resources/checks/v32/security/OAR114/without-required-params.json create mode 100644 src/test/resources/checks/v32/security/OAR114/without-required-params.yaml create mode 100644 src/test/resources/validation-test-all-violations.yaml diff --git a/src/test/java/apiaddicts/sonar/openapi/BaseCheckTest.java b/src/test/java/apiaddicts/sonar/openapi/BaseCheckTest.java index f68c63ca..82598e2e 100644 --- a/src/test/java/apiaddicts/sonar/openapi/BaseCheckTest.java +++ b/src/test/java/apiaddicts/sonar/openapi/BaseCheckTest.java @@ -29,6 +29,7 @@ public abstract class BaseCheckTest { protected String v2Path; protected String v3Path; protected String v31Path; + protected String v32Path; protected String getV2Path(String prefix) { return "src/test/resources/checks/v2/" + prefix + "/" + ruleName + "/"; @@ -42,24 +43,34 @@ protected String getV31Path(String prefix) { return "src/test/resources/checks/v31/" + prefix + "/" + ruleName + "/"; } + protected String getV32Path(String prefix) { + return "src/test/resources/checks/v32/" + prefix + "/" + ruleName + "/"; + } + protected void verifyV2(String file) { - verify(file, true, false, false); + verify(file, true, false, false, false); } protected void verifyV3(String file) { - verify(file, false, true, false); + verify(file, false, true, false, false); } protected void verifyV31(String file) { - verify(file, false, false, true); + verify(file, false, false, true, false); + } + + protected void verifyV32(String file) { + verify(file, false, false, false, true); } - private void verify(String file, boolean isV2, boolean isV3, boolean isV31) { + private void verify(String file, boolean isV2, boolean isV3, boolean isV31, boolean isV32) { String filePath; if (isV2) { filePath = v2Path + file; } else if (isV31) { filePath = v31Path + file; + } else if (isV32) { + filePath = v32Path + file; } else if (isV3) { filePath = v3Path + file; } else { @@ -68,12 +79,12 @@ private void verify(String file, boolean isV2, boolean isV3, boolean isV31) { if (filePath.contains(".")) { LOG.info("Testing file : " + filePath); - ExtendedOpenApiCheckVerifier.verify(filePath, check, isV2, isV3, isV31); + ExtendedOpenApiCheckVerifier.verify(filePath, check, isV2, isV3, isV31, isV32); } else { LOG.info("Testing file : " + filePath + ".yaml"); - ExtendedOpenApiCheckVerifier.verify(filePath + ".yaml", check, isV2, isV3, isV31); + ExtendedOpenApiCheckVerifier.verify(filePath + ".yaml", check, isV2, isV3, isV31, isV32); LOG.info("Testing file : " + filePath + ".json"); - ExtendedOpenApiCheckVerifier.verify(filePath + ".json", check, isV2, isV3, isV31); + ExtendedOpenApiCheckVerifier.verify(filePath + ".json", check, isV2, isV3, isV31, isV32); } } diff --git a/src/test/java/apiaddicts/sonar/openapi/ExtendedOpenApiCheckVerifier.java b/src/test/java/apiaddicts/sonar/openapi/ExtendedOpenApiCheckVerifier.java index 7867ff53..65205590 100644 --- a/src/test/java/apiaddicts/sonar/openapi/ExtendedOpenApiCheckVerifier.java +++ b/src/test/java/apiaddicts/sonar/openapi/ExtendedOpenApiCheckVerifier.java @@ -30,16 +30,16 @@ public ExtendedOpenApiCheckVerifier() { // Intentional blank } - public static List scanFileForIssues(File file, OpenApiCheck check, boolean isV2, boolean isV3, boolean isV31) { + public static List scanFileForIssues(File file, OpenApiCheck check, boolean isV2, boolean isV3, boolean isV31, boolean isV32) { return check.scanFileForIssues(TestOpenApiVisitorRunner.createContext(file, isV2, isV3, isV31)); } - public static void verify(String path, OpenApiCheck check, boolean isV2, boolean isV3, boolean isV31) { + public static void verify(String path, OpenApiCheck check, boolean isV2, boolean isV3, boolean isV31, boolean isV32) { ExtendedOpenApiCheckVerifier verifier = new ExtendedOpenApiCheckVerifier(); OpenApiVisitor collector = new ExtendedOpenApiCheckVerifier.ExpectedIssueCollector(verifier); File file = new File(path); TestOpenApiVisitorRunner.scanFileForComments(file, isV2, isV3, isV31, new OpenApiVisitor[]{collector}); - Iterator actualIssues = getActualIssues(file, check, isV2, isV3, isV31); + Iterator actualIssues = getActualIssues(file, check, isV2, isV3, isV31, isV32); verifier.checkIssues(actualIssues); if (actualIssues.hasNext()) { PreciseIssue issue = (PreciseIssue) actualIssues.next(); @@ -112,8 +112,8 @@ private static List secondary(PreciseIssue issue) { return Ordering.natural().sortedCopy(result); } - private static Iterator getActualIssues(File file, OpenApiCheck check, boolean isV2, boolean isV3, boolean isV31) { - List issues = scanFileForIssues(file, check, isV2, isV3, isV31); + private static Iterator getActualIssues(File file, OpenApiCheck check, boolean isV2, boolean isV3, boolean isV31, boolean isV32) { + List issues = scanFileForIssues(file, check, isV2, isV3, isV31, isV32); List sortedIssues = Ordering.natural().onResultOf(ExtendedOpenApiCheckVerifier::line).sortedCopy(issues); return sortedIssues.iterator(); } diff --git a/src/test/java/apiaddicts/sonar/openapi/checks/apim/wso2/OAR002ValidWso2ScopesCheckTest.java b/src/test/java/apiaddicts/sonar/openapi/checks/apim/wso2/OAR002ValidWso2ScopesCheckTest.java index 7a11a847..dbdc0cb9 100644 --- a/src/test/java/apiaddicts/sonar/openapi/checks/apim/wso2/OAR002ValidWso2ScopesCheckTest.java +++ b/src/test/java/apiaddicts/sonar/openapi/checks/apim/wso2/OAR002ValidWso2ScopesCheckTest.java @@ -14,6 +14,8 @@ public void init() { check = new OAR002ValidWso2ScopesCheck(); v2Path = getV2Path("apim/wso2"); v3Path = getV3Path("apim/wso2"); + v31Path = getV31Path("apim"); + v32Path = getV32Path("apim"); } @Test @@ -45,26 +47,66 @@ public void verifyInV2WithoutSecurity() { public void verifyInV3WithScopes() { verifyV3("with-scopes"); } + @Test + public void verifyInV31WithScopes() { + verifyV31("with-scopes"); + } + @Test + public void verifyInV32WithScopes() { + verifyV32("with-scopes"); + } @Test public void verifyInV3WithNullScopes() { verifyV3("with-null-scopes"); } + @Test + public void verifyInV31WithNullScopes() { + verifyV31("with-null-scopes"); + } + @Test + public void verifyInV32WithNullScopes() { + verifyV32("with-null-scopes"); + } @Test public void verifyInV3WithEmptyScopes() { verifyV3("with-empty-scopes"); } + @Test + public void verifyInV31WithEmptyScopes() { + verifyV31("with-empty-scopes"); + } + @Test + public void verifyInV32WithEmptyScopes() { + verifyV32("with-empty-scopes"); + } @Test public void verifyInV3WithoutScopes() { verifyV3("without-scopes"); } + @Test + public void verifyInV31WithoutScopes() { + verifyV31("without-scopes"); + } + @Test + public void verifyInV32WithoutScopes() { + verifyV32("without-scopes"); + } @Test public void verifyInV3WithoutSecurity() { verifyV3("without-security"); } + @Test + public void verifyInV31WithoutSecurity() { + verifyV31("without-security"); + } + @Test + public void verifyInV32WithoutSecurity() { + verifyV32("without-security"); + } @Override public void verifyRule() { diff --git a/src/test/java/apiaddicts/sonar/openapi/checks/apim/wso2/OAR003DefinedWso2ScopesDescriptionCheckTest.java b/src/test/java/apiaddicts/sonar/openapi/checks/apim/wso2/OAR003DefinedWso2ScopesDescriptionCheckTest.java index ea1eb22c..2cbf3ffb 100644 --- a/src/test/java/apiaddicts/sonar/openapi/checks/apim/wso2/OAR003DefinedWso2ScopesDescriptionCheckTest.java +++ b/src/test/java/apiaddicts/sonar/openapi/checks/apim/wso2/OAR003DefinedWso2ScopesDescriptionCheckTest.java @@ -14,6 +14,8 @@ public void init() { check = new OAR003DefinedWso2ScopesDescriptionCheck(); v2Path = getV2Path("apim/wso2"); v3Path = getV3Path("apim/wso2"); + v31Path = getV31Path("apim"); + v32Path = getV32Path("apim"); } @Test @@ -35,16 +37,40 @@ public void verifyInV2WithNullScopeDescription() { public void verifyInV3WithScopeDescription() { verifyV3("with-description"); } + @Test + public void verifyInV31WithScopeDescription() { + verifyV31("with-description"); + } + @Test + public void verifyInV32WithScopeDescription() { + verifyV32("with-description"); + } @Test public void verifyInV3WithoutScopeDescription() { verifyV3("without-description"); } + @Test + public void verifyInV31WithoutScopeDescription() { + verifyV31("without-description"); + } + @Test + public void verifyInV32WithoutScopeDescription() { + verifyV32("without-description"); + } @Test public void verifyInV3WithNullScopeDescription() { verifyV3("with-null-description"); } + @Test + public void verifyInV31WithNullScopeDescription() { + verifyV31("with-null-description"); + } + @Test + public void verifyInV32WithNullScopeDescription() { + verifyV32("with-null-description"); + } @Override public void verifyRule() { diff --git a/src/test/java/apiaddicts/sonar/openapi/checks/apim/wso2/OAR004ValidWso2ScopesRolesCheckTest.java b/src/test/java/apiaddicts/sonar/openapi/checks/apim/wso2/OAR004ValidWso2ScopesRolesCheckTest.java index 7db44d7f..e00e4a2f 100644 --- a/src/test/java/apiaddicts/sonar/openapi/checks/apim/wso2/OAR004ValidWso2ScopesRolesCheckTest.java +++ b/src/test/java/apiaddicts/sonar/openapi/checks/apim/wso2/OAR004ValidWso2ScopesRolesCheckTest.java @@ -15,6 +15,8 @@ public void init() { check = new OAR004ValidWso2ScopesRolesCheck(); v2Path = getV2Path("apim/wso2"); v3Path = getV3Path("apim/wso2"); + v31Path = getV31Path("apim"); + v32Path = getV32Path("apim"); } @Test @@ -31,11 +33,27 @@ public void verifyInV2WithInvalidRoles() { public void verifyInV3WithValidRoles() { verifyV3("with-valid-roles"); } + @Test + public void verifyInV31WithValidRoles() { + verifyV31("with-valid-roles"); + } + @Test + public void verifyInV32WithValidRoles() { + verifyV32("with-valid-roles"); + } @Test public void verifyInV3WithInvalidRoles() { verifyV3("with-invalid-roles"); } + @Test + public void verifyInV31WithInvalidRoles() { + verifyV31("with-invalid-roles"); + } + @Test + public void verifyInV32WithInvalidRoles() { + verifyV32("with-invalid-roles"); + } @Override public void verifyRule() { diff --git a/src/test/java/apiaddicts/sonar/openapi/checks/apim/wso2/OAR005UndefinedWso2ScopeUseCheckTest.java b/src/test/java/apiaddicts/sonar/openapi/checks/apim/wso2/OAR005UndefinedWso2ScopeUseCheckTest.java index cc684493..d569214d 100644 --- a/src/test/java/apiaddicts/sonar/openapi/checks/apim/wso2/OAR005UndefinedWso2ScopeUseCheckTest.java +++ b/src/test/java/apiaddicts/sonar/openapi/checks/apim/wso2/OAR005UndefinedWso2ScopeUseCheckTest.java @@ -14,6 +14,8 @@ public void init() { check = new OAR005UndefinedWso2ScopeUseCheck(); v2Path = getV2Path("apim/wso2"); v3Path = getV3Path("apim/wso2"); + v31Path = getV31Path("apim"); + v32Path = getV32Path("apim"); } @Test @@ -35,16 +37,40 @@ public void verifyInV2WithCorrectOperationScope() { public void verifyInV3WithNullOperationScope() { verifyV3("with-null-operation-scope"); } + @Test + public void verifyInV31WithNullOperationScope() { + verifyV31("with-null-operation-scope"); + } + @Test + public void verifyInV32WithNullOperationScope() { + verifyV32("with-null-operation-scope"); + } @Test public void verifyInV3WithWrongOperationScope() { verifyV3("with-wrong-operation-scope"); } + @Test + public void verifyInV31WithWrongOperationScope() { + verifyV31("with-wrong-operation-scope"); + } + @Test + public void verifyInV32WithWrongOperationScope() { + verifyV32("with-wrong-operation-scope"); + } @Test public void verifyInV3WithCorrectOperationScope() { verifyV3("with-correct-operation-scope"); } + @Test + public void verifyInV31WithCorrectOperationScope() { + verifyV31("with-correct-operation-scope"); + } + @Test + public void verifyInV32WithCorrectOperationScope() { + verifyV32("with-correct-operation-scope"); + } @Override public void verifyRule() { diff --git a/src/test/java/apiaddicts/sonar/openapi/checks/apim/wso2/OAR040StandardWso2ScopesNameCheckTest.java b/src/test/java/apiaddicts/sonar/openapi/checks/apim/wso2/OAR040StandardWso2ScopesNameCheckTest.java index 49c38eda..19ec1e90 100644 --- a/src/test/java/apiaddicts/sonar/openapi/checks/apim/wso2/OAR040StandardWso2ScopesNameCheckTest.java +++ b/src/test/java/apiaddicts/sonar/openapi/checks/apim/wso2/OAR040StandardWso2ScopesNameCheckTest.java @@ -15,6 +15,8 @@ public void init() { check = new OAR040StandardWso2ScopesNameCheck(); v2Path = getV2Path("apim/wso2"); v3Path = getV3Path("apim/wso2"); + v31Path = getV31Path("apim"); + v32Path = getV32Path("apim"); } @Test @@ -31,11 +33,27 @@ public void verifyInV2WithInvalidNames() { public void verifyInV3WithValidNames() { verifyV3("valid"); } + @Test + public void verifyInV31WithValidNames() { + verifyV31("valid"); + } + @Test + public void verifyInV32WithValidNames() { + verifyV32("valid"); + } @Test public void verifyInV3WithInvalidNames() { verifyV3("invalid"); } + @Test + public void verifyInV31WithInvalidNames() { + verifyV31("invalid"); + } + @Test + public void verifyInV32WithInvalidNames() { + verifyV32("invalid"); + } @Override public void verifyRule() { diff --git a/src/test/java/apiaddicts/sonar/openapi/checks/apim/wso2/OAR041UndefinedAuthTypeForWso2ScopeCheckTest.java b/src/test/java/apiaddicts/sonar/openapi/checks/apim/wso2/OAR041UndefinedAuthTypeForWso2ScopeCheckTest.java index 840c9835..101d2af6 100644 --- a/src/test/java/apiaddicts/sonar/openapi/checks/apim/wso2/OAR041UndefinedAuthTypeForWso2ScopeCheckTest.java +++ b/src/test/java/apiaddicts/sonar/openapi/checks/apim/wso2/OAR041UndefinedAuthTypeForWso2ScopeCheckTest.java @@ -14,6 +14,8 @@ public void init() { check = new OAR041UndefinedAuthTypeForWso2ScopeCheck(); v2Path = getV2Path("apim/wso2"); v3Path = getV3Path("apim/wso2"); + v31Path = getV31Path("apim"); + v32Path = getV32Path("apim"); } @Test @@ -35,16 +37,40 @@ public void verifyInV2WithoutScopeAndAuth() { public void verifyInV3WithScopeAndAuth() { verifyV3("with-scope-and-auth"); } + @Test + public void verifyInV31WithScopeAndAuth() { + verifyV31("with-scope-and-auth"); + } + @Test + public void verifyInV32WithScopeAndAuth() { + verifyV32("with-scope-and-auth"); + } @Test public void verifyInV3WithScopeWithoutAuth() { verifyV3("with-scope-without-auth"); } + @Test + public void verifyInV31WithScopeWithoutAuth() { + verifyV31("with-scope-without-auth"); + } + @Test + public void verifyInV32WithScopeWithoutAuth() { + verifyV32("with-scope-without-auth"); + } @Test public void verifyInV3WithoutScopeAndAuth() { verifyV3("without-scope-and-auth"); } + @Test + public void verifyInV31WithoutScopeAndAuth() { + verifyV31("without-scope-and-auth"); + } + @Test + public void verifyInV32WithoutScopeAndAuth() { + verifyV32("without-scope-and-auth"); + } @Override public void verifyRule() { diff --git a/src/test/java/apiaddicts/sonar/openapi/checks/examples/OAR031ExamplesCheckTest.java b/src/test/java/apiaddicts/sonar/openapi/checks/examples/OAR031ExamplesCheckTest.java index 92ac566b..5b1e4ce7 100644 --- a/src/test/java/apiaddicts/sonar/openapi/checks/examples/OAR031ExamplesCheckTest.java +++ b/src/test/java/apiaddicts/sonar/openapi/checks/examples/OAR031ExamplesCheckTest.java @@ -14,6 +14,8 @@ public void init() { check = new OAR031ExamplesCheck(); v2Path = getV2Path("examples"); v3Path = getV3Path("examples"); + v31Path = getV31Path("examples"); + v32Path = getV32Path("examples"); } @Test @@ -40,21 +42,53 @@ public void verifyInV2NestedProperties() { public void verifyInV3() { verifyV3("valid.yaml"); } + @Test + public void verifyInV31() { + verifyV31("valid.yaml"); + } + @Test + public void verifyInV32() { + verifyV32("valid.yaml"); + } @Test public void verifyInV3WithoutExamples() { verifyV3("without-examples.yaml"); } + @Test + public void verifyInV31WithoutExamples() { + verifyV31("without-examples.yaml"); + } + @Test + public void verifyInV32WithoutExamples() { + verifyV32("without-examples.yaml"); + } @Test public void verifyvalidV3ExternalRefs() { verifyV3("externalref.yaml"); } + @Test + public void verifyvalidV31ExternalRefs() { + verifyV31("externalref.yaml"); + } + @Test + public void verifyvalidV32ExternalRefs() { + verifyV32("externalref.yaml"); + } @Test public void verifyInV3NestedProperties() { verifyV3("nested-properties-examples.yaml"); } + @Test + public void verifyInV31NestedProperties() { + verifyV31("nested-properties-examples.yaml"); + } + @Test + public void verifyInV32NestedProperties() { + verifyV32("nested-properties-examples.yaml"); + } @Override public void verifyRule() { diff --git a/src/test/java/apiaddicts/sonar/openapi/checks/examples/OAR094UseExamplesCheckTest.java b/src/test/java/apiaddicts/sonar/openapi/checks/examples/OAR094UseExamplesCheckTest.java index 7a3c7438..6d923a60 100644 --- a/src/test/java/apiaddicts/sonar/openapi/checks/examples/OAR094UseExamplesCheckTest.java +++ b/src/test/java/apiaddicts/sonar/openapi/checks/examples/OAR094UseExamplesCheckTest.java @@ -14,6 +14,8 @@ public void init() { check = new OAR094UseExamplesCheck(); v2Path = getV2Path("examples"); v3Path = getV3Path("examples"); + v31Path = getV31Path("examples"); + v32Path = getV32Path("examples"); } @Test @@ -30,16 +32,40 @@ public void verifyvalidV2() { public void verifyInV3() { verifyV3("invalid-example"); } + @Test + public void verifyInV31() { + verifyV31("invalid-example"); + } + @Test + public void verifyInV32() { + verifyV32("invalid-example"); + } @Test public void verifyvalidV3() { verifyV3("valid-example"); } + @Test + public void verifyvalidV31() { + verifyV31("valid-example"); + } + @Test + public void verifyvalidV32() { + verifyV32("valid-example"); + } @Test public void verifyvalidV3ExternalRefs() { verifyV3("externalref.yaml"); } + @Test + public void verifyvalidV31ExternalRefs() { + verifyV31("externalref.yaml"); + } + @Test + public void verifyvalidV32ExternalRefs() { + verifyV32("externalref.yaml"); + } @Override public void verifyRule() { diff --git a/src/test/java/apiaddicts/sonar/openapi/checks/format/OAR006UndefinedRequestMediaTypeCheckTest.java b/src/test/java/apiaddicts/sonar/openapi/checks/format/OAR006UndefinedRequestMediaTypeCheckTest.java index e65a2e69..6fd54e4b 100644 --- a/src/test/java/apiaddicts/sonar/openapi/checks/format/OAR006UndefinedRequestMediaTypeCheckTest.java +++ b/src/test/java/apiaddicts/sonar/openapi/checks/format/OAR006UndefinedRequestMediaTypeCheckTest.java @@ -14,6 +14,8 @@ public void init() { check = new OAR006UndefinedRequestMediaTypeCheck(); v2Path = getV2Path("format"); v3Path = getV3Path("format"); + v31Path = getV31Path("format"); + v32Path = getV32Path("format"); } @Test @@ -40,6 +42,14 @@ public void verifyInV2WithoutAnything() { public void verifyInV3WithoutAnything() { verifyV3("without-anything"); } + @Test + public void verifyInV31WithoutAnything() { + verifyV31("without-anything"); + } + @Test + public void verifyInV32WithoutAnything() { + verifyV32("without-anything"); + } @Override public void verifyRule() { diff --git a/src/test/java/apiaddicts/sonar/openapi/checks/format/OAR007UndefinedResponseMediaTypeCheckTest.java b/src/test/java/apiaddicts/sonar/openapi/checks/format/OAR007UndefinedResponseMediaTypeCheckTest.java index 5f52a3dd..2b4eb51c 100644 --- a/src/test/java/apiaddicts/sonar/openapi/checks/format/OAR007UndefinedResponseMediaTypeCheckTest.java +++ b/src/test/java/apiaddicts/sonar/openapi/checks/format/OAR007UndefinedResponseMediaTypeCheckTest.java @@ -14,6 +14,8 @@ public void init() { check = new OAR007UndefinedResponseMediaTypeCheck(); v2Path = getV2Path("format"); v3Path = getV3Path("format"); + v31Path = getV31Path("format"); + v32Path = getV32Path("format"); } @Test @@ -40,6 +42,14 @@ public void verifyInV2WithoutAnything() { public void verifyInV3WithoutAnything() { verifyV3("without-anything"); } + @Test + public void verifyInV31WithoutAnything() { + verifyV31("without-anything"); + } + @Test + public void verifyInV32WithoutAnything() { + verifyV32("without-anything"); + } @Override public void verifyRule() { diff --git a/src/test/java/apiaddicts/sonar/openapi/checks/format/OAR009DefaultRequestMediaTypeCheckTest.java b/src/test/java/apiaddicts/sonar/openapi/checks/format/OAR009DefaultRequestMediaTypeCheckTest.java index a2075757..b42ae90f 100644 --- a/src/test/java/apiaddicts/sonar/openapi/checks/format/OAR009DefaultRequestMediaTypeCheckTest.java +++ b/src/test/java/apiaddicts/sonar/openapi/checks/format/OAR009DefaultRequestMediaTypeCheckTest.java @@ -15,6 +15,8 @@ public void init() { check = new OAR009DefaultRequestMediaTypeCheck(); v2Path = getV2Path("format"); v3Path = getV3Path("format"); + v31Path = getV31Path("format"); + v32Path = getV32Path("format"); } @Test @@ -51,36 +53,92 @@ public void verifyInV2WithoutAnything() { public void verifyInV3WithDefault() { verifyV3("with-default-and-$ref"); } + @Test + public void verifyInV31WithDefault() { + verifyV31("with-default-and-$ref"); + } + @Test + public void verifyInV32WithDefault() { + verifyV32("with-default-and-$ref"); + } @Test public void verifyInV3WithWrongDefault() { verifyV3("with-wrong-default"); } + @Test + public void verifyInV31WithWrongDefault() { + verifyV31("with-wrong-default"); + } + @Test + public void verifyInV32WithWrongDefault() { + verifyV32("with-wrong-default"); + } @Test public void verifyInV3WithSpecific() { verifyV3("with-specific"); } + @Test + public void verifyInV31WithSpecific() { + verifyV31("with-specific"); + } + @Test + public void verifyInV32WithSpecific() { + verifyV32("with-specific"); + } @Test public void verifyInV3WithWrongDefaultAndSpecific() { verifyV3("with-wrong-default-and-specific"); } + @Test + public void verifyInV31WithWrongDefaultAndSpecific() { + verifyV31("with-wrong-default-and-specific"); + } + @Test + public void verifyInV32WithWrongDefaultAndSpecific() { + verifyV32("with-wrong-default-and-specific"); + } @Test public void verifyInV3WithDefaultAndSpecific() { verifyV3("with-default-and-specific"); } + @Test + public void verifyInV31WithDefaultAndSpecific() { + verifyV31("with-default-and-specific"); + } + @Test + public void verifyInV32WithDefaultAndSpecific() { + verifyV32("with-default-and-specific"); + } @Test public void verifyInV3WithoutAnything() { verifyV3("without-anything"); } + @Test + public void verifyInV31WithoutAnything() { + verifyV31("without-anything"); + } + @Test + public void verifyInV32WithoutAnything() { + verifyV32("without-anything"); + } @Test public void verifyInV3OperationNotAllowsRequestBody() { verifyV3("operation-not-allows-request-body"); } + @Test + public void verifyInV31OperationNotAllowsRequestBody() { + verifyV31("operation-not-allows-request-body"); + } + @Test + public void verifyInV32OperationNotAllowsRequestBody() { + verifyV32("operation-not-allows-request-body"); + } @Override public void verifyRule() { diff --git a/src/test/java/apiaddicts/sonar/openapi/checks/format/OAR010DefaultResponseMediaTypeCheckTest.java b/src/test/java/apiaddicts/sonar/openapi/checks/format/OAR010DefaultResponseMediaTypeCheckTest.java index e9ed0112..f18c65a5 100644 --- a/src/test/java/apiaddicts/sonar/openapi/checks/format/OAR010DefaultResponseMediaTypeCheckTest.java +++ b/src/test/java/apiaddicts/sonar/openapi/checks/format/OAR010DefaultResponseMediaTypeCheckTest.java @@ -15,6 +15,8 @@ public void init() { check = new OAR010DefaultResponseMediaTypeCheck(); v2Path = getV2Path("format"); v3Path = getV3Path("format"); + v31Path = getV31Path("format"); + v32Path = getV32Path("format"); } @Test @@ -51,31 +53,79 @@ public void verifyInV2WithoutAnything() { public void verifyInV3WithDefault() { verifyV3("with-default-and-$ref"); } + @Test + public void verifyInV31WithDefault() { + verifyV31("with-default-and-$ref"); + } + @Test + public void verifyInV32WithDefault() { + verifyV32("with-default-and-$ref"); + } @Test public void verifyInV3WithWrongDefault() { verifyV3("with-wrong-default"); } + @Test + public void verifyInV31WithWrongDefault() { + verifyV31("with-wrong-default"); + } + @Test + public void verifyInV32WithWrongDefault() { + verifyV32("with-wrong-default"); + } @Test public void verifyInV3WithSpecific() { verifyV3("with-specific"); } + @Test + public void verifyInV31WithSpecific() { + verifyV31("with-specific"); + } + @Test + public void verifyInV32WithSpecific() { + verifyV32("with-specific"); + } @Test public void verifyInV3WithWrongDefaultAndSpecific() { verifyV3("with-wrong-default-and-specific"); } + @Test + public void verifyInV31WithWrongDefaultAndSpecific() { + verifyV31("with-wrong-default-and-specific"); + } + @Test + public void verifyInV32WithWrongDefaultAndSpecific() { + verifyV32("with-wrong-default-and-specific"); + } @Test public void verifyInV3WithDefaultAndSpecific() { verifyV3("with-default-and-specific"); } + @Test + public void verifyInV31WithDefaultAndSpecific() { + verifyV31("with-default-and-specific"); + } + @Test + public void verifyInV32WithDefaultAndSpecific() { + verifyV32("with-default-and-specific"); + } @Test public void verifyInV3WithoutAnything() { verifyV3("without-anything"); } + @Test + public void verifyInV31WithoutAnything() { + verifyV31("without-anything"); + } + @Test + public void verifyInV32WithoutAnything() { + verifyV32("without-anything"); + } @Override public void verifyRule() { diff --git a/src/test/java/apiaddicts/sonar/openapi/checks/format/OAR011UrlNamingConventionCheckTest.java b/src/test/java/apiaddicts/sonar/openapi/checks/format/OAR011UrlNamingConventionCheckTest.java index ebc51781..71ef8db9 100644 --- a/src/test/java/apiaddicts/sonar/openapi/checks/format/OAR011UrlNamingConventionCheckTest.java +++ b/src/test/java/apiaddicts/sonar/openapi/checks/format/OAR011UrlNamingConventionCheckTest.java @@ -15,6 +15,8 @@ public void init() { check = new OAR011UrlNamingConventionCheck(); v2Path = getV2Path("format"); v3Path = getV3Path("format"); + v31Path = getV31Path("format"); + v32Path = getV32Path("format"); } @Test @@ -36,16 +38,40 @@ public void verifyInV2BasePathWrong() { public void verifyInV3() { verifyV3("plain"); } + @Test + public void verifyInV31() { + verifyV31("plain"); + } + @Test + public void verifyInV32() { + verifyV32("plain"); + } @Test public void verifyInV3BasePathOk() { verifyV3("base-path-ok"); } + @Test + public void verifyInV31BasePathOk() { + verifyV31("base-path-ok"); + } + @Test + public void verifyInV32BasePathOk() { + verifyV32("base-path-ok"); + } @Test public void verifyInV3BasePathWrong() { verifyV3("base-path-wrong"); } + @Test + public void verifyInV31BasePathWrong() { + verifyV31("base-path-wrong"); + } + @Test + public void verifyInV32BasePathWrong() { + verifyV32("base-path-wrong"); + } @Override public void verifyParameters() { diff --git a/src/test/java/apiaddicts/sonar/openapi/checks/format/OAR012ParameterNamingConventionCheckTest.java b/src/test/java/apiaddicts/sonar/openapi/checks/format/OAR012ParameterNamingConventionCheckTest.java index edeaae0a..70b93b2c 100644 --- a/src/test/java/apiaddicts/sonar/openapi/checks/format/OAR012ParameterNamingConventionCheckTest.java +++ b/src/test/java/apiaddicts/sonar/openapi/checks/format/OAR012ParameterNamingConventionCheckTest.java @@ -14,6 +14,8 @@ public void init() { check = new OAR012ParameterNamingConventionCheck(); v2Path = getV2Path("format"); v3Path = getV3Path("format"); + v31Path = getV31Path("format"); + v32Path = getV32Path("format"); } @Test @@ -44,4 +46,14 @@ public void verifyParameters() { public void verifyRule() { assertRuleProperties("OAR012 - ParameterNamingConvention - Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention", RuleType.BUG, Severity.MINOR, tags("format")); } + + @Test + public void verifyCaseInV31() { + verifyV31("snake-case-plain"); + } + + @Test + public void verifyCaseInV32() { + verifyV32("snake-case-plain"); + } } diff --git a/src/test/java/apiaddicts/sonar/openapi/checks/format/OAR016NumericFormatCheckTest.java b/src/test/java/apiaddicts/sonar/openapi/checks/format/OAR016NumericFormatCheckTest.java index d25802a5..30d0745b 100644 --- a/src/test/java/apiaddicts/sonar/openapi/checks/format/OAR016NumericFormatCheckTest.java +++ b/src/test/java/apiaddicts/sonar/openapi/checks/format/OAR016NumericFormatCheckTest.java @@ -13,6 +13,8 @@ public void init() { check = new OAR016NumericFormatCheck(); v2Path = getV2Path("format"); v3Path = getV3Path("format"); + v31Path = getV31Path("format"); + v32Path = getV32Path("format"); } @Test @@ -39,11 +41,27 @@ public void verifyV3() { public void verifyNestedV3() { verifyV3("nested"); } + @Test + public void verifyNestedV31() { + verifyV31("nested"); + } + @Test + public void verifyNestedV32() { + verifyV32("nested"); + } @Test public void verifyWithRefV3() { verifyV3("with-$ref"); } + @Test + public void verifyWithRefV31() { + verifyV31("with-$ref"); + } + @Test + public void verifyWithRefV32() { + verifyV32("with-$ref"); + } @Override diff --git a/src/test/java/apiaddicts/sonar/openapi/checks/format/OAR037StringFormatCheckTest.java b/src/test/java/apiaddicts/sonar/openapi/checks/format/OAR037StringFormatCheckTest.java index a951832e..90a639a7 100644 --- a/src/test/java/apiaddicts/sonar/openapi/checks/format/OAR037StringFormatCheckTest.java +++ b/src/test/java/apiaddicts/sonar/openapi/checks/format/OAR037StringFormatCheckTest.java @@ -15,6 +15,8 @@ public void init() { check = new OAR037StringFormatCheck(); v2Path = getV2Path("format"); v3Path = getV3Path("format"); + v31Path = getV31Path("format"); + v32Path = getV32Path("format"); } @Test @@ -36,11 +38,27 @@ public void verifyInV2WithNested() { public void verifyInV3() { verifyV3("complete"); } + @Test + public void verifyInV31() { + verifyV31("complete"); + } + @Test + public void verifyInV32() { + verifyV32("complete"); + } @Test public void verifyInV3WithNested() { verifyV3("nested"); } + @Test + public void verifyInV31WithNested() { + verifyV31("nested"); + } + @Test + public void verifyInV32WithNested() { + verifyV32("nested"); + } @Test public void verifyInV3With$ref() { diff --git a/src/test/java/apiaddicts/sonar/openapi/checks/format/OAR042BasePathCheckTest.java b/src/test/java/apiaddicts/sonar/openapi/checks/format/OAR042BasePathCheckTest.java index c2f98370..3dcca42c 100644 --- a/src/test/java/apiaddicts/sonar/openapi/checks/format/OAR042BasePathCheckTest.java +++ b/src/test/java/apiaddicts/sonar/openapi/checks/format/OAR042BasePathCheckTest.java @@ -13,6 +13,8 @@ public void init() { check = new OAR042BasePathCheck(); v2Path = getV2Path("format"); v3Path = getV3Path("format"); + v31Path = getV31Path("format"); + v32Path = getV32Path("format"); } @Test @@ -44,16 +46,40 @@ public void verifyV3() { public void verifyIncorrectVersionV3() { verifyV3("incorrect-version"); } + @Test + public void verifyIncorrectVersionV31() { + verifyV31("incorrect-version"); + } + @Test + public void verifyIncorrectVersionV32() { + verifyV32("incorrect-version"); + } @Test public void verifyTooLongV3() { verifyV3("too-long"); } + @Test + public void verifyTooLongV31() { + verifyV31("too-long"); + } + @Test + public void verifyTooLongV32() { + verifyV32("too-long"); + } @Test public void verifyTooShortV3() { verifyV3("too-short"); } + @Test + public void verifyTooShortV31() { + verifyV31("too-short"); + } + @Test + public void verifyTooShortV32() { + verifyV32("too-short"); + } @Override diff --git a/src/test/java/apiaddicts/sonar/openapi/checks/format/OAR044MediaTypeCheckTest.java b/src/test/java/apiaddicts/sonar/openapi/checks/format/OAR044MediaTypeCheckTest.java index b991d5ac..ae71be53 100644 --- a/src/test/java/apiaddicts/sonar/openapi/checks/format/OAR044MediaTypeCheckTest.java +++ b/src/test/java/apiaddicts/sonar/openapi/checks/format/OAR044MediaTypeCheckTest.java @@ -14,6 +14,8 @@ public void init() { check = new OAR044MediaTypeCheck(); v2Path = getV2Path("format"); v3Path = getV3Path("format"); + v31Path = getV31Path("format"); + v32Path = getV32Path("format"); } @Test @@ -25,6 +27,14 @@ public void verifyInV2() { public void verifyInV3() { verifyV3("media-type"); } + @Test + public void verifyInV31() { + verifyV31("media-type"); + } + @Test + public void verifyInV32() { + verifyV32("media-type"); + } @Override public void verifyRule() { diff --git a/src/test/java/apiaddicts/sonar/openapi/checks/format/OAR050ProvideOpSummaryCheckTest.java b/src/test/java/apiaddicts/sonar/openapi/checks/format/OAR050ProvideOpSummaryCheckTest.java index 1a971af7..851abe03 100644 --- a/src/test/java/apiaddicts/sonar/openapi/checks/format/OAR050ProvideOpSummaryCheckTest.java +++ b/src/test/java/apiaddicts/sonar/openapi/checks/format/OAR050ProvideOpSummaryCheckTest.java @@ -15,6 +15,8 @@ public void init() { check = new OAR050ProvideOpSummaryCheck(); v2Path = getV2Path("format"); v3Path = getV3Path("format"); + v31Path = getV31Path("format"); + v32Path = getV32Path("format"); } @Test @@ -26,6 +28,14 @@ public void verifyInV2() { public void verifyInV3() { verifyV3("provide-summary"); } + @Test + public void verifyInV31() { + verifyV31("provide-summary"); + } + @Test + public void verifyInV32() { + verifyV32("provide-summary"); + } @Override public void verifyRule() { diff --git a/src/test/java/apiaddicts/sonar/openapi/checks/format/OAR051DescriptionDiffersSummaryCheckTest.java b/src/test/java/apiaddicts/sonar/openapi/checks/format/OAR051DescriptionDiffersSummaryCheckTest.java index 66c7a16b..db1e3326 100644 --- a/src/test/java/apiaddicts/sonar/openapi/checks/format/OAR051DescriptionDiffersSummaryCheckTest.java +++ b/src/test/java/apiaddicts/sonar/openapi/checks/format/OAR051DescriptionDiffersSummaryCheckTest.java @@ -14,6 +14,8 @@ public void init() { check = new OAR051DescriptionDiffersSummaryCheck(); v2Path = getV2Path("format"); v3Path = getV3Path("format"); + v31Path = getV31Path("format"); + v32Path = getV32Path("format"); } @Test @@ -25,6 +27,14 @@ public void verifyInV2() { public void verifyInV3() { verifyV3("different-description"); } + @Test + public void verifyInV31() { + verifyV31("different-description"); + } + @Test + public void verifyInV32() { + verifyV32("different-description"); + } @Override public void verifyRule() { diff --git a/src/test/java/apiaddicts/sonar/openapi/checks/format/OAR052UndefinedNumericFormatCheckTest.java b/src/test/java/apiaddicts/sonar/openapi/checks/format/OAR052UndefinedNumericFormatCheckTest.java index a7ca363b..a4a650d4 100644 --- a/src/test/java/apiaddicts/sonar/openapi/checks/format/OAR052UndefinedNumericFormatCheckTest.java +++ b/src/test/java/apiaddicts/sonar/openapi/checks/format/OAR052UndefinedNumericFormatCheckTest.java @@ -13,6 +13,8 @@ public void init() { check = new OAR052UndefinedNumericFormatCheck(); v2Path = getV2Path("format"); v3Path = getV3Path("format"); + v31Path = getV31Path("format"); + v32Path = getV32Path("format"); } @Test @@ -37,9 +39,25 @@ public void verifyNestedV3() { verifyV3("nested"); } @Test + public void verifyNestedV31() { + verifyV31("nested"); + } + @Test + public void verifyNestedV32() { + verifyV32("nested"); + } + @Test public void verifyWithRefV3() { verifyV3("with-$ref"); } + @Test + public void verifyWithRefV31() { + verifyV31("with-$ref"); + } + @Test + public void verifyWithRefV32() { + verifyV32("with-$ref"); + } @Override public void verifyRule() { diff --git a/src/test/java/apiaddicts/sonar/openapi/checks/format/OAR066SnakeCaseNamingConventionCheckTest.java b/src/test/java/apiaddicts/sonar/openapi/checks/format/OAR066SnakeCaseNamingConventionCheckTest.java index 146939cb..4f1d7dc0 100644 --- a/src/test/java/apiaddicts/sonar/openapi/checks/format/OAR066SnakeCaseNamingConventionCheckTest.java +++ b/src/test/java/apiaddicts/sonar/openapi/checks/format/OAR066SnakeCaseNamingConventionCheckTest.java @@ -14,6 +14,8 @@ public void init() { check = new OAR066SnakeCaseNamingConventionCheck(); v2Path = getV2Path("format"); v3Path = getV3Path("format"); + v31Path = getV31Path("format"); + v32Path = getV32Path("format"); } @Test @@ -30,9 +32,25 @@ public void verifyInV3() { verifyV3("snake-case-error"); } @Test + public void verifyInV31() { + verifyV31("snake-case-error"); + } + @Test + public void verifyInV32() { + verifyV32("snake-case-error"); + } + @Test public void verifyvalidV3() { verifyV3("valid"); } + @Test + public void verifyvalidV31() { + verifyV31("valid"); + } + @Test + public void verifyvalidV32() { + verifyV32("valid"); + } @Override public void verifyRule() { diff --git a/src/test/java/apiaddicts/sonar/openapi/checks/format/OAR067CamelCaseNamingConventionCheckTest.java b/src/test/java/apiaddicts/sonar/openapi/checks/format/OAR067CamelCaseNamingConventionCheckTest.java index d1e20f8e..17bd5caa 100644 --- a/src/test/java/apiaddicts/sonar/openapi/checks/format/OAR067CamelCaseNamingConventionCheckTest.java +++ b/src/test/java/apiaddicts/sonar/openapi/checks/format/OAR067CamelCaseNamingConventionCheckTest.java @@ -14,6 +14,8 @@ public void init() { check = new OAR067CamelCaseNamingConventionCheck(); v2Path = getV2Path("format"); v3Path = getV3Path("format"); + v31Path = getV31Path("format"); + v32Path = getV32Path("format"); } @Test @@ -30,9 +32,25 @@ public void verifyInV3() { verifyV3("camel-case-error"); } @Test + public void verifyInV31() { + verifyV31("camel-case-error"); + } + @Test + public void verifyInV32() { + verifyV32("camel-case-error"); + } + @Test public void verifyvalidV3() { verifyV3("valid"); } + @Test + public void verifyvalidV31() { + verifyV31("valid"); + } + @Test + public void verifyvalidV32() { + verifyV32("valid"); + } @Override public void verifyRule() { diff --git a/src/test/java/apiaddicts/sonar/openapi/checks/format/OAR068PascalCaseNamingConventionCheckTest.java b/src/test/java/apiaddicts/sonar/openapi/checks/format/OAR068PascalCaseNamingConventionCheckTest.java index e9c8b1fa..be37e12e 100644 --- a/src/test/java/apiaddicts/sonar/openapi/checks/format/OAR068PascalCaseNamingConventionCheckTest.java +++ b/src/test/java/apiaddicts/sonar/openapi/checks/format/OAR068PascalCaseNamingConventionCheckTest.java @@ -14,6 +14,8 @@ public void init() { check = new OAR068PascalCaseNamingConventionCheck(); v2Path = getV2Path("format"); v3Path = getV3Path("format"); + v31Path = getV31Path("format"); + v32Path = getV32Path("format"); } @Test @@ -30,14 +32,38 @@ public void verifyInV3() { verifyV3("pascal-case-error"); } @Test + public void verifyInV31() { + verifyV31("pascal-case-error"); + } + @Test + public void verifyInV32() { + verifyV32("pascal-case-error"); + } + @Test public void verifyvalidV3() { verifyV3("valid"); } + @Test + public void verifyvalidV31() { + verifyV31("valid"); + } + @Test + public void verifyvalidV32() { + verifyV32("valid"); + } @Test public void verifyvalidV3ExternalRefs() { verifyV3("externalref.yaml"); } + @Test + public void verifyvalidV31ExternalRefs() { + verifyV31("externalref.yaml"); + } + @Test + public void verifyvalidV32ExternalRefs() { + verifyV32("externalref.yaml"); + } @Override public void verifyRule() { diff --git a/src/test/java/apiaddicts/sonar/openapi/checks/format/OAR077ParametersInQuerySnakeCaseCheckTest.java b/src/test/java/apiaddicts/sonar/openapi/checks/format/OAR077ParametersInQuerySnakeCaseCheckTest.java index b6b57039..c163fd29 100644 --- a/src/test/java/apiaddicts/sonar/openapi/checks/format/OAR077ParametersInQuerySnakeCaseCheckTest.java +++ b/src/test/java/apiaddicts/sonar/openapi/checks/format/OAR077ParametersInQuerySnakeCaseCheckTest.java @@ -14,6 +14,8 @@ public void init() { check = new OAR077ParametersInQuerySnakeCaseCheck(); v2Path = getV2Path("format"); v3Path = getV3Path("format"); + v31Path = getV31Path("format"); + v32Path = getV32Path("format"); } @Test @@ -30,9 +32,25 @@ public void verifyInV3() { verifyV3("not-valid-in-query"); } @Test + public void verifyInV31() { + verifyV31("not-valid-in-query"); + } + @Test + public void verifyInV32() { + verifyV32("not-valid-in-query"); + } + @Test public void verifyvalidV3() { verifyV3("valid-in-query"); } + @Test + public void verifyvalidV31() { + verifyV31("valid-in-query"); + } + @Test + public void verifyvalidV32() { + verifyV32("valid-in-query"); + } @Override public void verifyRule() { diff --git a/src/test/java/apiaddicts/sonar/openapi/checks/format/OAR086DescriptionFormatCheckTest.java b/src/test/java/apiaddicts/sonar/openapi/checks/format/OAR086DescriptionFormatCheckTest.java index ed60f7fb..e26eefc1 100644 --- a/src/test/java/apiaddicts/sonar/openapi/checks/format/OAR086DescriptionFormatCheckTest.java +++ b/src/test/java/apiaddicts/sonar/openapi/checks/format/OAR086DescriptionFormatCheckTest.java @@ -14,6 +14,8 @@ public void init() { check = new OAR086DescriptionFormatCheck(); v2Path = getV2Path("format"); v3Path = getV3Path("format"); + v31Path = getV31Path("format"); + v32Path = getV32Path("format"); } @Test @@ -30,19 +32,51 @@ public void verifyInV3() { verifyV3("invalid-example"); } @Test + public void verifyInV31() { + verifyV31("invalid-example"); + } + @Test + public void verifyInV32() { + verifyV32("invalid-example"); + } + @Test public void verifyvalidV3() { verifyV3("valid-example"); } + @Test + public void verifyvalidV31() { + verifyV31("valid-example"); + } + @Test + public void verifyvalidV32() { + verifyV32("valid-example"); + } @Test public void verifyvalidV3internalRef() { verifyV3("internal-refexample.yaml"); } + @Test + public void verifyvalidV31internalRef() { + verifyV31("internal-refexample.yaml"); + } + @Test + public void verifyvalidV32internalRef() { + verifyV32("internal-refexample.yaml"); + } @Test public void verifyvalidV3externalRef() { verifyV3("external-refexample.yaml"); } + @Test + public void verifyvalidV31externalRef() { + verifyV31("external-refexample.yaml"); + } + @Test + public void verifyvalidV32externalRef() { + verifyV32("external-refexample.yaml"); + } @Override public void verifyRule() { diff --git a/src/test/java/apiaddicts/sonar/openapi/checks/format/OAR087SummaryFormatCheckTest.java b/src/test/java/apiaddicts/sonar/openapi/checks/format/OAR087SummaryFormatCheckTest.java index a14318d4..88074751 100644 --- a/src/test/java/apiaddicts/sonar/openapi/checks/format/OAR087SummaryFormatCheckTest.java +++ b/src/test/java/apiaddicts/sonar/openapi/checks/format/OAR087SummaryFormatCheckTest.java @@ -14,6 +14,8 @@ public void init() { check = new OAR087SummaryFormatCheck(); v2Path = getV2Path("format"); v3Path = getV3Path("format"); + v31Path = getV31Path("format"); + v32Path = getV32Path("format"); } @Test @@ -30,9 +32,25 @@ public void verifyInV3() { verifyV3("invalid-example"); } @Test + public void verifyInV31() { + verifyV31("invalid-example"); + } + @Test + public void verifyInV32() { + verifyV32("invalid-example"); + } + @Test public void verifyvalidV3() { verifyV3("valid-example"); } + @Test + public void verifyvalidV31() { + verifyV31("valid-example"); + } + @Test + public void verifyvalidV32() { + verifyV32("valid-example"); + } @Override public void verifyRule() { diff --git a/src/test/java/apiaddicts/sonar/openapi/checks/format/OAR088RefParamCheckTest.java b/src/test/java/apiaddicts/sonar/openapi/checks/format/OAR088RefParamCheckTest.java index aaf52b9c..4515b5b7 100644 --- a/src/test/java/apiaddicts/sonar/openapi/checks/format/OAR088RefParamCheckTest.java +++ b/src/test/java/apiaddicts/sonar/openapi/checks/format/OAR088RefParamCheckTest.java @@ -15,6 +15,8 @@ public void init() { check = new OAR088RefParamCheck(); v2Path = getV2Path("format"); v3Path = getV3Path("format"); + v31Path = getV31Path("format"); + v32Path = getV32Path("format"); } @Test @@ -31,9 +33,25 @@ public void verifyInV3() { verifyV3("invalid-ref"); } @Test + public void verifyInV31() { + verifyV31("invalid-ref"); + } + @Test + public void verifyInV32() { + verifyV32("invalid-ref"); + } + @Test public void verifyvalidV3() { verifyV3("valid-ref"); } + @Test + public void verifyvalidV31() { + verifyV31("valid-ref"); + } + @Test + public void verifyvalidV32() { + verifyV32("valid-ref"); + } @Override public void verifyRule() { diff --git a/src/test/java/apiaddicts/sonar/openapi/checks/format/OAR089RefRequestBodyCheckTest.java b/src/test/java/apiaddicts/sonar/openapi/checks/format/OAR089RefRequestBodyCheckTest.java index 31f787ce..44df8928 100644 --- a/src/test/java/apiaddicts/sonar/openapi/checks/format/OAR089RefRequestBodyCheckTest.java +++ b/src/test/java/apiaddicts/sonar/openapi/checks/format/OAR089RefRequestBodyCheckTest.java @@ -15,6 +15,8 @@ public void init() { check = new OAR089RefRequestBodyCheck(); v2Path = getV2Path("format"); v3Path = getV3Path("format"); + v31Path = getV31Path("format"); + v32Path = getV32Path("format"); } @Test @@ -22,9 +24,25 @@ public void verifyInV3() { verifyV3("invalid-ref"); } @Test + public void verifyInV31() { + verifyV31("invalid-ref"); + } + @Test + public void verifyInV32() { + verifyV32("invalid-ref"); + } + @Test public void verifyvalidV3() { verifyV3("valid-ref"); } + @Test + public void verifyvalidV31() { + verifyV31("valid-ref"); + } + @Test + public void verifyvalidV32() { + verifyV32("valid-ref"); + } @Override public void verifyRule() { diff --git a/src/test/java/apiaddicts/sonar/openapi/checks/format/OAR090RefResponseCheckTest.java b/src/test/java/apiaddicts/sonar/openapi/checks/format/OAR090RefResponseCheckTest.java index 4bc5b216..1fffe093 100644 --- a/src/test/java/apiaddicts/sonar/openapi/checks/format/OAR090RefResponseCheckTest.java +++ b/src/test/java/apiaddicts/sonar/openapi/checks/format/OAR090RefResponseCheckTest.java @@ -15,6 +15,8 @@ public void init() { check = new OAR090RefResponseCheck(); v2Path = getV2Path("format"); v3Path = getV3Path("format"); + v31Path = getV31Path("format"); + v32Path = getV32Path("format"); } @Test public void verifyInV2() { @@ -29,9 +31,25 @@ public void verifyInV3() { verifyV3("invalid-ref"); } @Test + public void verifyInV31() { + verifyV31("invalid-ref"); + } + @Test + public void verifyInV32() { + verifyV32("invalid-ref"); + } + @Test public void verifyvalidV3() { verifyV3("valid-ref"); } + @Test + public void verifyvalidV31() { + verifyV31("valid-ref"); + } + @Test + public void verifyvalidV32() { + verifyV32("valid-ref"); + } @Override public void verifyRule() { diff --git a/src/test/java/apiaddicts/sonar/openapi/checks/format/OAR097ShortBasePathCheckTest.java b/src/test/java/apiaddicts/sonar/openapi/checks/format/OAR097ShortBasePathCheckTest.java index 540c3168..ec3f7176 100644 --- a/src/test/java/apiaddicts/sonar/openapi/checks/format/OAR097ShortBasePathCheckTest.java +++ b/src/test/java/apiaddicts/sonar/openapi/checks/format/OAR097ShortBasePathCheckTest.java @@ -14,6 +14,8 @@ public void init() { check = new OAR097ShortBasePathCheck(); v2Path = getV2Path("format"); v3Path = getV3Path("format"); + v31Path = getV31Path("format"); + v32Path = getV32Path("format"); } @Test @@ -30,11 +32,27 @@ public void verifyInV2TooShort() { public void verifyInV3() { verifyV3("valid"); } + @Test + public void verifyInV31() { + verifyV31("valid"); + } + @Test + public void verifyInV32() { + verifyV32("valid"); + } @Test public void verifyInV3TooShort() { verifyV3("too-short"); } + @Test + public void verifyInV31TooShort() { + verifyV31("too-short"); + } + @Test + public void verifyInV32TooShort() { + verifyV32("too-short"); + } @Override public void verifyRule() { diff --git a/src/test/java/apiaddicts/sonar/openapi/checks/format/OAR098LongBasePathCheckTest.java b/src/test/java/apiaddicts/sonar/openapi/checks/format/OAR098LongBasePathCheckTest.java index 2c899df9..ecbe3062 100644 --- a/src/test/java/apiaddicts/sonar/openapi/checks/format/OAR098LongBasePathCheckTest.java +++ b/src/test/java/apiaddicts/sonar/openapi/checks/format/OAR098LongBasePathCheckTest.java @@ -15,6 +15,8 @@ public void init() { check = new OAR098LongBasePathCheck(); v2Path = getV2Path("format"); v3Path = getV3Path("format"); + v31Path = getV31Path("format"); + v32Path = getV32Path("format"); } @Test @@ -31,11 +33,27 @@ public void verifyInV2TooLong() { public void verifyInV3() { verifyV3("valid"); } + @Test + public void verifyInV31() { + verifyV31("valid"); + } + @Test + public void verifyInV32() { + verifyV32("valid"); + } @Test public void verifyInV3TooLong() { verifyV3("too-long"); } + @Test + public void verifyInV31TooLong() { + verifyV31("too-long"); + } + @Test + public void verifyInV32TooLong() { + verifyV32("too-long"); + } @Override public void verifyRule() { diff --git a/src/test/java/apiaddicts/sonar/openapi/checks/format/OAR099ApiPrefixBasePathCheckTest.java b/src/test/java/apiaddicts/sonar/openapi/checks/format/OAR099ApiPrefixBasePathCheckTest.java index aa80181b..f919a92e 100644 --- a/src/test/java/apiaddicts/sonar/openapi/checks/format/OAR099ApiPrefixBasePathCheckTest.java +++ b/src/test/java/apiaddicts/sonar/openapi/checks/format/OAR099ApiPrefixBasePathCheckTest.java @@ -14,6 +14,8 @@ public void init() { check = new OAR099ApiPrefixBasePathCheck(); v2Path = getV2Path("format"); v3Path = getV3Path("format"); + v31Path = getV31Path("format"); + v32Path = getV32Path("format"); } @Test @@ -30,11 +32,27 @@ public void verifyInV2WithoutApiPrefix() { public void verifyInV3() { verifyV3("valid"); } + @Test + public void verifyInV31() { + verifyV31("valid"); + } + @Test + public void verifyInV32() { + verifyV32("valid"); + } @Test public void verifyInV3WithoutApiPrefix() { verifyV3("without-api-prefix"); } + @Test + public void verifyInV31WithoutApiPrefix() { + verifyV31("without-api-prefix"); + } + @Test + public void verifyInV32WithoutApiPrefix() { + verifyV32("without-api-prefix"); + } @Override public void verifyRule() { diff --git a/src/test/java/apiaddicts/sonar/openapi/checks/format/OAR100LastPartBasePathCheckTest.java b/src/test/java/apiaddicts/sonar/openapi/checks/format/OAR100LastPartBasePathCheckTest.java index b2c74965..c6aef265 100644 --- a/src/test/java/apiaddicts/sonar/openapi/checks/format/OAR100LastPartBasePathCheckTest.java +++ b/src/test/java/apiaddicts/sonar/openapi/checks/format/OAR100LastPartBasePathCheckTest.java @@ -14,6 +14,8 @@ public void init() { check = new OAR100LastPartBasePathCheck(); v2Path = getV2Path("format"); v3Path = getV3Path("format"); + v31Path = getV31Path("format"); + v32Path = getV32Path("format"); } @Test @@ -30,11 +32,27 @@ public void verifyInV2IncorrectVersion() { public void verifyInV3() { verifyV3("valid"); } + @Test + public void verifyInV31() { + verifyV31("valid"); + } + @Test + public void verifyInV32() { + verifyV32("valid"); + } @Test public void verifyInV3IncorrectVersion() { verifyV3("incorrect-version"); } + @Test + public void verifyInV31IncorrectVersion() { + verifyV31("incorrect-version"); + } + @Test + public void verifyInV32IncorrectVersion() { + verifyV32("incorrect-version"); + } @Override public void verifyRule() { diff --git a/src/test/java/apiaddicts/sonar/openapi/checks/format/OAR101FirstPartBasePathCheckTest.java b/src/test/java/apiaddicts/sonar/openapi/checks/format/OAR101FirstPartBasePathCheckTest.java index b1024737..cf38e8ee 100644 --- a/src/test/java/apiaddicts/sonar/openapi/checks/format/OAR101FirstPartBasePathCheckTest.java +++ b/src/test/java/apiaddicts/sonar/openapi/checks/format/OAR101FirstPartBasePathCheckTest.java @@ -15,6 +15,8 @@ public void init() { check = new OAR101FirstPartBasePathCheck(); v2Path = getV2Path("format"); v3Path = getV3Path("format"); + v31Path = getV31Path("format"); + v32Path = getV32Path("format"); } @Test @@ -35,6 +37,14 @@ public void verifyFirstPartBasePathLogicInV2() { public void verifyInV3() { verifyV3("valid"); } + @Test + public void verifyInV31() { + verifyV31("valid"); + } + @Test + public void verifyInV32() { + verifyV32("valid"); + } @Test public void verifyFirstPartBasePathLogicInV3() { @@ -44,6 +54,14 @@ public void verifyFirstPartBasePathLogicInV3() { verifyV3("valid-with-values"); verifyV3("empty-path"); } + @Test + public void verifyFirstPartBasePathLogicInV31() { + verifyV31("empty-path"); + } + @Test + public void verifyFirstPartBasePathLogicInV32() { + verifyV32("empty-path"); + } @Override diff --git a/src/test/java/apiaddicts/sonar/openapi/checks/format/OAR102SecondPartBasePathCheckTest.java b/src/test/java/apiaddicts/sonar/openapi/checks/format/OAR102SecondPartBasePathCheckTest.java index 481acb92..cfb73eda 100644 --- a/src/test/java/apiaddicts/sonar/openapi/checks/format/OAR102SecondPartBasePathCheckTest.java +++ b/src/test/java/apiaddicts/sonar/openapi/checks/format/OAR102SecondPartBasePathCheckTest.java @@ -15,6 +15,8 @@ public void init() { check = new OAR102SecondPartBasePathCheck(); v2Path = getV2Path("format"); v3Path = getV3Path("format"); + v31Path = getV31Path("format"); + v32Path = getV32Path("format"); } @Test @@ -35,6 +37,14 @@ public void verifySecondPartBasePathLogicInV2() { public void verifyInV3() { verifyV3("valid"); } + @Test + public void verifyInV31() { + verifyV31("valid"); + } + @Test + public void verifyInV32() { + verifyV32("valid"); + } @Test public void verifySecondPartBasePathLogicInV3() { @@ -44,6 +54,14 @@ public void verifySecondPartBasePathLogicInV3() { verifyV3("valid-with-values"); verifyV3("one-part-path"); } + @Test + public void verifySecondPartBasePathLogicInV31() { + verifyV31("one-part-path"); + } + @Test + public void verifySecondPartBasePathLogicInV32() { + verifyV32("one-part-path"); + } @Override public void verifyRule() { diff --git a/src/test/java/apiaddicts/sonar/openapi/checks/format/OAR110LicenseInformationCheckTest.java b/src/test/java/apiaddicts/sonar/openapi/checks/format/OAR110LicenseInformationCheckTest.java index 2c8a2cbf..3dcbd6d9 100644 --- a/src/test/java/apiaddicts/sonar/openapi/checks/format/OAR110LicenseInformationCheckTest.java +++ b/src/test/java/apiaddicts/sonar/openapi/checks/format/OAR110LicenseInformationCheckTest.java @@ -14,6 +14,8 @@ public void init() { check = new OAR110LicenseInformationCheck(); v2Path = getV2Path("format"); v3Path = getV3Path("format"); + v31Path = getV31Path("format"); + v32Path = getV32Path("format"); } @Test @@ -25,6 +27,14 @@ public void verifyInV2() { public void verifyInV3() { verifyV3("valid"); } + @Test + public void verifyInV31() { + verifyV31("valid"); + } + @Test + public void verifyInV32() { + verifyV32("valid"); + } @Override diff --git a/src/test/java/apiaddicts/sonar/openapi/checks/format/OAR111ContactInformationCheckTest.java b/src/test/java/apiaddicts/sonar/openapi/checks/format/OAR111ContactInformationCheckTest.java index f8902dc7..f25ba899 100644 --- a/src/test/java/apiaddicts/sonar/openapi/checks/format/OAR111ContactInformationCheckTest.java +++ b/src/test/java/apiaddicts/sonar/openapi/checks/format/OAR111ContactInformationCheckTest.java @@ -14,6 +14,8 @@ public void init() { check = new OAR111ContactInformationCheck(); v2Path = getV2Path("format"); v3Path = getV3Path("format"); + v31Path = getV31Path("format"); + v32Path = getV32Path("format"); } @Test @@ -25,6 +27,14 @@ public void verifyInV2() { public void verifyInV3() { verifyV3("valid"); } + @Test + public void verifyInV31() { + verifyV31("valid"); + } + @Test + public void verifyInV32() { + verifyV32("valid"); + } @Override diff --git a/src/test/java/apiaddicts/sonar/openapi/checks/format/OAR113CustomFieldCheckTest.java b/src/test/java/apiaddicts/sonar/openapi/checks/format/OAR113CustomFieldCheckTest.java index c0104dd7..cac2d9ac 100644 --- a/src/test/java/apiaddicts/sonar/openapi/checks/format/OAR113CustomFieldCheckTest.java +++ b/src/test/java/apiaddicts/sonar/openapi/checks/format/OAR113CustomFieldCheckTest.java @@ -14,6 +14,8 @@ public void init() { check = new OAR113CustomFieldCheck(); v2Path = getV2Path("format"); v3Path = getV3Path("format"); + v31Path = getV31Path("format"); + v32Path = getV32Path("format"); } @@ -31,9 +33,25 @@ public void verifyValidCustomV3() { verifyV3("valid"); } @Test + public void verifyValidCustomV31() { + verifyV31("valid"); + } + @Test + public void verifyValidCustomV32() { + verifyV32("valid"); + } + @Test public void verifyInvalidCustomV3() { verifyV3("invalid"); } + @Test + public void verifyInvalidCustomV31() { + verifyV31("invalid"); + } + @Test + public void verifyInvalidCustomV32() { + verifyV32("invalid"); + } @Override public void verifyRule() { diff --git a/src/test/java/apiaddicts/sonar/openapi/checks/format/OAR115VerifyRequiredFieldsTest.java b/src/test/java/apiaddicts/sonar/openapi/checks/format/OAR115VerifyRequiredFieldsTest.java index 75cfbba4..964b1bbb 100644 --- a/src/test/java/apiaddicts/sonar/openapi/checks/format/OAR115VerifyRequiredFieldsTest.java +++ b/src/test/java/apiaddicts/sonar/openapi/checks/format/OAR115VerifyRequiredFieldsTest.java @@ -13,6 +13,8 @@ public void init() { check = new OAR115VerifyRequiredFields(); v2Path = getV2Path("format"); v3Path = getV3Path("format"); + v31Path = getV31Path("format"); + v32Path = getV32Path("format"); } @Test @@ -29,9 +31,25 @@ public void verifyValidRequiredFieldV3() { verifyV3("valid"); } @Test + public void verifyValidRequiredFieldV31() { + verifyV31("valid"); + } + @Test + public void verifyValidRequiredFieldV32() { + verifyV32("valid"); + } + @Test public void verifyInvalidRequiredFieldV3() { verifyV3("invalid"); } + @Test + public void verifyInvalidRequiredFieldV31() { + verifyV31("invalid"); + } + @Test + public void verifyInvalidRequiredFieldV32() { + verifyV32("invalid"); + } @Override diff --git a/src/test/java/apiaddicts/sonar/openapi/checks/operations/OAR008AllowedHttpVerbCheckTest.java b/src/test/java/apiaddicts/sonar/openapi/checks/operations/OAR008AllowedHttpVerbCheckTest.java index 4e130e38..6c2c9c6f 100644 --- a/src/test/java/apiaddicts/sonar/openapi/checks/operations/OAR008AllowedHttpVerbCheckTest.java +++ b/src/test/java/apiaddicts/sonar/openapi/checks/operations/OAR008AllowedHttpVerbCheckTest.java @@ -15,6 +15,8 @@ public void init() { check = new OAR008AllowedHttpVerbCheck(); v2Path = getV2Path("operations"); v3Path = getV3Path("operations"); + v31Path = getV31Path("operations"); + v32Path = getV32Path("operations"); } @Test @@ -26,6 +28,14 @@ public void verifyInV2() { public void verifyInV3() { verifyV3("plain"); } + @Test + public void verifyInV31() { + verifyV31("plain"); + } + @Test + public void verifyInV32() { + verifyV32("plain"); + } @Override public void verifyRule() { diff --git a/src/test/java/apiaddicts/sonar/openapi/checks/operations/OAR013DefaultResponseCheckTest.java b/src/test/java/apiaddicts/sonar/openapi/checks/operations/OAR013DefaultResponseCheckTest.java index 1ee49572..80d2f8bb 100644 --- a/src/test/java/apiaddicts/sonar/openapi/checks/operations/OAR013DefaultResponseCheckTest.java +++ b/src/test/java/apiaddicts/sonar/openapi/checks/operations/OAR013DefaultResponseCheckTest.java @@ -14,6 +14,8 @@ public void init() { check = new OAR013DefaultResponseCheck(); v2Path = getV2Path("operations"); v3Path = getV3Path("operations"); + v31Path = getV31Path("operations"); + v32Path = getV32Path("operations"); } @Test @@ -25,6 +27,14 @@ public void verifyInV2() { public void verifyInV3() { verifyV3("plain"); } + @Test + public void verifyInV31() { + verifyV31("plain"); + } + @Test + public void verifyInV32() { + verifyV32("plain"); + } @Override public void verifyRule() { diff --git a/src/test/java/apiaddicts/sonar/openapi/checks/operations/OAR014ResourceLevelWithinNonSuggestedRangeCheckTest.java b/src/test/java/apiaddicts/sonar/openapi/checks/operations/OAR014ResourceLevelWithinNonSuggestedRangeCheckTest.java index 3c970b3f..eb641c7d 100644 --- a/src/test/java/apiaddicts/sonar/openapi/checks/operations/OAR014ResourceLevelWithinNonSuggestedRangeCheckTest.java +++ b/src/test/java/apiaddicts/sonar/openapi/checks/operations/OAR014ResourceLevelWithinNonSuggestedRangeCheckTest.java @@ -15,6 +15,8 @@ public void init() { check = new OAR014ResourceLevelWithinNonSuggestedRangeCheck(); v2Path = getV2Path("operations"); v3Path = getV3Path("operations"); + v31Path = getV31Path("operations"); + v32Path = getV32Path("operations"); } @Test @@ -26,6 +28,14 @@ public void verifyInV2() { public void verifyInV3() { verifyV3("plain"); } + @Test + public void verifyInV31() { + verifyV31("plain"); + } + @Test + public void verifyInV32() { + verifyV32("plain"); + } @Override public void verifyRule() { diff --git a/src/test/java/apiaddicts/sonar/openapi/checks/operations/OAR015ResourceLevelMaxAllowedCheckTest.java b/src/test/java/apiaddicts/sonar/openapi/checks/operations/OAR015ResourceLevelMaxAllowedCheckTest.java index c6c62efc..4e5179d9 100644 --- a/src/test/java/apiaddicts/sonar/openapi/checks/operations/OAR015ResourceLevelMaxAllowedCheckTest.java +++ b/src/test/java/apiaddicts/sonar/openapi/checks/operations/OAR015ResourceLevelMaxAllowedCheckTest.java @@ -15,6 +15,8 @@ public void init() { check = new OAR015ResourceLevelMaxAllowedCheck(); v2Path = getV2Path("operations"); v3Path = getV3Path("operations"); + v31Path = getV31Path("operations"); + v32Path = getV32Path("operations"); } @Test @@ -26,6 +28,14 @@ public void verifyInV2() { public void verifyInV3() { verifyV3("plain"); } + @Test + public void verifyInV31() { + verifyV31("plain"); + } + @Test + public void verifyInV32() { + verifyV32("plain"); + } @Override public void verifyRule() { diff --git a/src/test/java/apiaddicts/sonar/openapi/checks/operations/OAR017ResourcePathCheckTest.java b/src/test/java/apiaddicts/sonar/openapi/checks/operations/OAR017ResourcePathCheckTest.java index 95db735d..a44b0219 100644 --- a/src/test/java/apiaddicts/sonar/openapi/checks/operations/OAR017ResourcePathCheckTest.java +++ b/src/test/java/apiaddicts/sonar/openapi/checks/operations/OAR017ResourcePathCheckTest.java @@ -15,6 +15,8 @@ public void init() { check = new OAR017ResourcePathCheck(); v2Path = getV2Path("operations"); v3Path = getV3Path("operations"); + v31Path = getV31Path("operations"); + v32Path = getV32Path("operations"); } @Test @@ -26,6 +28,14 @@ public void verifyInV2() { public void verifyInV3() { verifyV3("plain"); } + @Test + public void verifyInV31() { + verifyV31("plain"); + } + @Test + public void verifyInV32() { + verifyV32("plain"); + } @Override public void verifyRule() { diff --git a/src/test/java/apiaddicts/sonar/openapi/checks/operations/OAR018ResourcesByVerbCheckTest.java b/src/test/java/apiaddicts/sonar/openapi/checks/operations/OAR018ResourcesByVerbCheckTest.java index 4f2bfb4b..566aaa1e 100644 --- a/src/test/java/apiaddicts/sonar/openapi/checks/operations/OAR018ResourcesByVerbCheckTest.java +++ b/src/test/java/apiaddicts/sonar/openapi/checks/operations/OAR018ResourcesByVerbCheckTest.java @@ -17,6 +17,8 @@ public void init() { check = new OAR018ResourcesByVerbCheck(); v2Path = getV2Path("operations"); v3Path = getV3Path("operations"); + v31Path = getV31Path("operations"); + v32Path = getV32Path("operations"); } @@ -28,6 +30,14 @@ public void verifyInV2(){ public void verifyInV3(){ verifyV3("plain"); } + @Test + public void verifyInV31() { + verifyV31("plain"); + } + @Test + public void verifyInV32() { + verifyV32("plain"); + } @Override diff --git a/src/test/java/apiaddicts/sonar/openapi/checks/operations/OAR027PostResponseLocationHeaderCheckTest.java b/src/test/java/apiaddicts/sonar/openapi/checks/operations/OAR027PostResponseLocationHeaderCheckTest.java index fd61b5e7..a6e54eda 100644 --- a/src/test/java/apiaddicts/sonar/openapi/checks/operations/OAR027PostResponseLocationHeaderCheckTest.java +++ b/src/test/java/apiaddicts/sonar/openapi/checks/operations/OAR027PostResponseLocationHeaderCheckTest.java @@ -14,6 +14,8 @@ public void init() { check = new OAR027PostResponseLocationHeaderCheck(); v2Path = getV2Path("operations"); v3Path = getV3Path("operations"); + v31Path = getV31Path("operations"); + v32Path = getV32Path("operations"); } @Test @@ -45,26 +47,66 @@ public void verifyInV2Post201WithLocation() { public void verifyInV3NoPost() { verifyV3("no-post"); } + @Test + public void verifyInV31NoPost() { + verifyV31("no-post"); + } + @Test + public void verifyInV32NoPost() { + verifyV32("no-post"); + } @Test public void verifyInV3PostNo201() { verifyV3("post-no-201"); } + @Test + public void verifyInV31PostNo201() { + verifyV31("post-no-201"); + } + @Test + public void verifyInV32PostNo201() { + verifyV32("post-no-201"); + } @Test public void verifyInV3Post201WithoutLocation() { verifyV3("post-201-without-location"); } + @Test + public void verifyInV31Post201WithoutLocation() { + verifyV31("post-201-without-location"); + } + @Test + public void verifyInV32Post201WithoutLocation() { + verifyV32("post-201-without-location"); + } @Test public void verifyInV3Post201WithOtherHeaders() { verifyV3("post-201-with-other-headers"); } + @Test + public void verifyInV31Post201WithOtherHeaders() { + verifyV31("post-201-with-other-headers"); + } + @Test + public void verifyInV32Post201WithOtherHeaders() { + verifyV32("post-201-with-other-headers"); + } @Test public void verifyInV3Post201WithLocation() { verifyV3("post-201-with-location"); } + @Test + public void verifyInV31Post201WithLocation() { + verifyV31("post-201-with-location"); + } + @Test + public void verifyInV32Post201WithLocation() { + verifyV32("post-201-with-location"); + } @Override public void verifyRule() { diff --git a/src/test/java/apiaddicts/sonar/openapi/checks/operations/OAR030StatusEndpointCheckTest.java b/src/test/java/apiaddicts/sonar/openapi/checks/operations/OAR030StatusEndpointCheckTest.java index 999b0822..f1249565 100644 --- a/src/test/java/apiaddicts/sonar/openapi/checks/operations/OAR030StatusEndpointCheckTest.java +++ b/src/test/java/apiaddicts/sonar/openapi/checks/operations/OAR030StatusEndpointCheckTest.java @@ -15,6 +15,8 @@ public void init() { check = new OAR030StatusEndpointCheck(); v2Path = getV2Path("operations"); v3Path = getV3Path("operations"); + v31Path = getV31Path("operations"); + v32Path = getV32Path("operations"); } @Test @@ -36,16 +38,40 @@ public void verifyInV2WithStatusWithoutGet() { public void verifyInV3() { verifyV3("valid"); } + @Test + public void verifyInV31() { + verifyV31("valid"); + } + @Test + public void verifyInV32() { + verifyV32("valid"); + } @Test public void verifyInV3WithoutStatus() { verifyV3("without-status"); } + @Test + public void verifyInV31WithoutStatus() { + verifyV31("without-status"); + } + @Test + public void verifyInV32WithoutStatus() { + verifyV32("without-status"); + } @Test public void verifyInV3WithStatusWithoutGet() { verifyV3("with-status-without-get"); } + @Test + public void verifyInV31WithStatusWithoutGet() { + verifyV31("with-status-without-get"); + } + @Test + public void verifyInV32WithStatusWithoutGet() { + verifyV32("with-status-without-get"); + } @Override public void verifyRule() { diff --git a/src/test/java/apiaddicts/sonar/openapi/checks/operations/OAR032AmbiguousElementsPathCheckTest.java b/src/test/java/apiaddicts/sonar/openapi/checks/operations/OAR032AmbiguousElementsPathCheckTest.java index 7e6d0646..caf35009 100644 --- a/src/test/java/apiaddicts/sonar/openapi/checks/operations/OAR032AmbiguousElementsPathCheckTest.java +++ b/src/test/java/apiaddicts/sonar/openapi/checks/operations/OAR032AmbiguousElementsPathCheckTest.java @@ -15,6 +15,8 @@ public void init() { check = new OAR032AmbiguousElementsPathCheck(); v2Path = getV2Path("operations"); v3Path = getV3Path("operations"); + v31Path = getV31Path("operations"); + v32Path = getV32Path("operations"); } @Test @@ -31,11 +33,27 @@ public void verifyInV2WithForbiddenNames() { public void verifyInV3() { verifyV3("valid"); } + @Test + public void verifyInV31() { + verifyV31("valid"); + } + @Test + public void verifyInV32() { + verifyV32("valid"); + } @Test public void verifyInV3WithForbiddenNames() { verifyV3("forbidden-names"); } + @Test + public void verifyInV31WithForbiddenNames() { + verifyV31("forbidden-names"); + } + @Test + public void verifyInV32WithForbiddenNames() { + verifyV32("forbidden-names"); + } @Override public void verifyRule() { diff --git a/src/test/java/apiaddicts/sonar/openapi/checks/operations/OAR038StandardCreateResponseCheckTest.java b/src/test/java/apiaddicts/sonar/openapi/checks/operations/OAR038StandardCreateResponseCheckTest.java index 6411df68..68b6c83b 100644 --- a/src/test/java/apiaddicts/sonar/openapi/checks/operations/OAR038StandardCreateResponseCheckTest.java +++ b/src/test/java/apiaddicts/sonar/openapi/checks/operations/OAR038StandardCreateResponseCheckTest.java @@ -15,6 +15,8 @@ public void init() { check = new OAR038StandardCreateResponseCheck(); v2Path = getV2Path("operations"); v3Path = getV3Path("operations"); + v31Path = getV31Path("operations"); + v32Path = getV32Path("operations"); } @Test @@ -51,31 +53,79 @@ public void verifyInV2WithoutSchema() { public void verifyInV3WithOneProperty() { verifyV3("valid-one-property"); } + @Test + public void verifyInV31WithOneProperty() { + verifyV31("valid-one-property"); + } + @Test + public void verifyInV32WithOneProperty() { + verifyV32("valid-one-property"); + } @Test public void verifyInV3WithMultipleProperties() { verifyV3("valid-multiple-properties"); } + @Test + public void verifyInV31WithMultipleProperties() { + verifyV31("valid-multiple-properties"); + } + @Test + public void verifyInV32WithMultipleProperties() { + verifyV32("valid-multiple-properties"); + } @Test public void verifyInV3WithoutProperties() { verifyV3("without-properties"); } + @Test + public void verifyInV31WithoutProperties() { + verifyV31("without-properties"); + } + @Test + public void verifyInV32WithoutProperties() { + verifyV32("without-properties"); + } @Test public void verifyInV3WithPropertiesEmpty() { verifyV3("with-properties-empty"); } + @Test + public void verifyInV31WithPropertiesEmpty() { + verifyV31("with-properties-empty"); + } + @Test + public void verifyInV32WithPropertiesEmpty() { + verifyV32("with-properties-empty"); + } @Test public void verifyInV3WithoutData() { verifyV3("without-data"); } + @Test + public void verifyInV31WithoutData() { + verifyV31("without-data"); + } + @Test + public void verifyInV32WithoutData() { + verifyV32("without-data"); + } @Test public void verifyInV3WithoutSchema() { verifyV3("without-schema"); } + @Test + public void verifyInV31WithoutSchema() { + verifyV31("without-schema"); + } + @Test + public void verifyInV32WithoutSchema() { + verifyV32("without-schema"); + } @Override public void verifyRule() { diff --git a/src/test/java/apiaddicts/sonar/openapi/checks/operations/OAR039StandardResponseCodesCheckTest.java b/src/test/java/apiaddicts/sonar/openapi/checks/operations/OAR039StandardResponseCodesCheckTest.java index 98f833b9..028c498d 100644 --- a/src/test/java/apiaddicts/sonar/openapi/checks/operations/OAR039StandardResponseCodesCheckTest.java +++ b/src/test/java/apiaddicts/sonar/openapi/checks/operations/OAR039StandardResponseCodesCheckTest.java @@ -19,6 +19,8 @@ public void init() { check = new OAR039StandardResponseCodesCheck(); v2Path = getV2Path("operations"); v3Path = getV3Path("operations"); + v31Path = getV31Path("operations"); + v32Path = getV32Path("operations"); } @@ -36,9 +38,25 @@ public void verifyInV3(){ verifyV3("valid"); } @Test + public void verifyInV31() { + verifyV31("valid"); + } + @Test + public void verifyInV32() { + verifyV32("valid"); + } + @Test public void verifyMissingCodesV3(){ verifyV3("missing-codes"); } + @Test + public void verifyMissingCodesV31() { + verifyV31("missing-codes"); + } + @Test + public void verifyMissingCodesV32() { + verifyV32("missing-codes"); + } @Override diff --git a/src/test/java/apiaddicts/sonar/openapi/checks/operations/OAR046DeclaredTagCheckTest.java b/src/test/java/apiaddicts/sonar/openapi/checks/operations/OAR046DeclaredTagCheckTest.java index 5b9eafb6..86ba30f4 100644 --- a/src/test/java/apiaddicts/sonar/openapi/checks/operations/OAR046DeclaredTagCheckTest.java +++ b/src/test/java/apiaddicts/sonar/openapi/checks/operations/OAR046DeclaredTagCheckTest.java @@ -14,6 +14,8 @@ public void init() { check = new OAR046DeclaredTagCheck(); v2Path = getV2Path("operations"); v3Path = getV3Path("operations"); + v31Path = getV31Path("operations"); + v32Path = getV32Path("operations"); } @Test @@ -25,6 +27,14 @@ public void verifyInV2() { public void verifyInV3() { verifyV3("declared-tag"); } + @Test + public void verifyInV31() { + verifyV31("declared-tag"); + } + @Test + public void verifyInV32() { + verifyV32("declared-tag"); + } @Override public void verifyRule() { diff --git a/src/test/java/apiaddicts/sonar/openapi/checks/operations/OAR047DocumentedTagCheckTest.java b/src/test/java/apiaddicts/sonar/openapi/checks/operations/OAR047DocumentedTagCheckTest.java index aae75be4..aba52449 100644 --- a/src/test/java/apiaddicts/sonar/openapi/checks/operations/OAR047DocumentedTagCheckTest.java +++ b/src/test/java/apiaddicts/sonar/openapi/checks/operations/OAR047DocumentedTagCheckTest.java @@ -14,6 +14,8 @@ public void init() { check = new OAR047DocumentedTagCheck(); v2Path = getV2Path("operations"); v3Path = getV3Path("operations"); + v31Path = getV31Path("operations"); + v32Path = getV32Path("operations"); } @Test diff --git a/src/test/java/apiaddicts/sonar/openapi/checks/operations/OAR048AtMostOneBodyParameterCheckTest.java b/src/test/java/apiaddicts/sonar/openapi/checks/operations/OAR048AtMostOneBodyParameterCheckTest.java index 1215e575..880ce889 100644 --- a/src/test/java/apiaddicts/sonar/openapi/checks/operations/OAR048AtMostOneBodyParameterCheckTest.java +++ b/src/test/java/apiaddicts/sonar/openapi/checks/operations/OAR048AtMostOneBodyParameterCheckTest.java @@ -15,6 +15,8 @@ public void init() { check = new OAR048AtMostOneBodyParameterCheck(); v2Path = getV2Path("operations"); v3Path = getV3Path("operations"); + v31Path = getV31Path("operations"); + v32Path = getV32Path("operations"); } diff --git a/src/test/java/apiaddicts/sonar/openapi/checks/operations/OAR061GetMethodCheckTest.java b/src/test/java/apiaddicts/sonar/openapi/checks/operations/OAR061GetMethodCheckTest.java index eb7d2c1b..4fa46f72 100644 --- a/src/test/java/apiaddicts/sonar/openapi/checks/operations/OAR061GetMethodCheckTest.java +++ b/src/test/java/apiaddicts/sonar/openapi/checks/operations/OAR061GetMethodCheckTest.java @@ -15,6 +15,8 @@ public void init() { check = new OAR061GetMethodCheck(); v2Path = getV2Path("operations"); v3Path = getV3Path("operations"); + v31Path = getV31Path("operations"); + v32Path = getV32Path("operations"); } @Test @@ -31,11 +33,27 @@ public void verifyInV2InsufficentResponseCodes() { public void verifyInV3() { verifyV3("valid"); } + @Test + public void verifyInV31() { + verifyV31("valid"); + } + @Test + public void verifyInV32() { + verifyV32("valid"); + } @Test public void verifyInV3InsufficentResponseCodes() { verifyV3("insuficent-response-codes"); } + @Test + public void verifyInV31InsufficentResponseCodes() { + verifyV31("insuficent-response-codes"); + } + @Test + public void verifyInV32InsufficentResponseCodes() { + verifyV32("insuficent-response-codes"); + } @Override public void verifyRule() { diff --git a/src/test/java/apiaddicts/sonar/openapi/checks/operations/OAR062PostMethodCheckTest.java b/src/test/java/apiaddicts/sonar/openapi/checks/operations/OAR062PostMethodCheckTest.java index c3d1a8b5..862bd483 100644 --- a/src/test/java/apiaddicts/sonar/openapi/checks/operations/OAR062PostMethodCheckTest.java +++ b/src/test/java/apiaddicts/sonar/openapi/checks/operations/OAR062PostMethodCheckTest.java @@ -15,6 +15,8 @@ public void init() { check = new OAR062PostMethodCheck(); v2Path = getV2Path("operations"); v3Path = getV3Path("operations"); + v31Path = getV31Path("operations"); + v32Path = getV32Path("operations"); } @Test @@ -31,11 +33,27 @@ public void verifyInV2InsufficentResponseCodes() { public void verifyInV3() { verifyV3("valid"); } + @Test + public void verifyInV31() { + verifyV31("valid"); + } + @Test + public void verifyInV32() { + verifyV32("valid"); + } @Test public void verifyInV3InsufficentResponseCodes() { verifyV3("insuficent-response-codes"); } + @Test + public void verifyInV31InsufficentResponseCodes() { + verifyV31("insuficent-response-codes"); + } + @Test + public void verifyInV32InsufficentResponseCodes() { + verifyV32("insuficent-response-codes"); + } @Override public void verifyRule() { diff --git a/src/test/java/apiaddicts/sonar/openapi/checks/operations/OAR063PutMethodCheckTest.java b/src/test/java/apiaddicts/sonar/openapi/checks/operations/OAR063PutMethodCheckTest.java index a0387f15..4cf33392 100644 --- a/src/test/java/apiaddicts/sonar/openapi/checks/operations/OAR063PutMethodCheckTest.java +++ b/src/test/java/apiaddicts/sonar/openapi/checks/operations/OAR063PutMethodCheckTest.java @@ -15,6 +15,8 @@ public void init() { check = new OAR063PutMethodCheck(); v2Path = getV2Path("operations"); v3Path = getV3Path("operations"); + v31Path = getV31Path("operations"); + v32Path = getV32Path("operations"); } @Test @@ -31,11 +33,27 @@ public void verifyInV2InsufficentResponseCodes() { public void verifyInV3() { verifyV3("valid"); } + @Test + public void verifyInV31() { + verifyV31("valid"); + } + @Test + public void verifyInV32() { + verifyV32("valid"); + } @Test public void verifyInV3InsufficentResponseCodes() { verifyV3("insuficent-response-codes"); } + @Test + public void verifyInV31InsufficentResponseCodes() { + verifyV31("insuficent-response-codes"); + } + @Test + public void verifyInV32InsufficentResponseCodes() { + verifyV32("insuficent-response-codes"); + } @Override public void verifyRule() { diff --git a/src/test/java/apiaddicts/sonar/openapi/checks/operations/OAR064PatchMethodCheckTest.java b/src/test/java/apiaddicts/sonar/openapi/checks/operations/OAR064PatchMethodCheckTest.java index 9df783e6..3c60317f 100644 --- a/src/test/java/apiaddicts/sonar/openapi/checks/operations/OAR064PatchMethodCheckTest.java +++ b/src/test/java/apiaddicts/sonar/openapi/checks/operations/OAR064PatchMethodCheckTest.java @@ -15,6 +15,8 @@ public void init() { check = new OAR064PatchMethodCheck(); v2Path = getV2Path("operations"); v3Path = getV3Path("operations"); + v31Path = getV31Path("operations"); + v32Path = getV32Path("operations"); } @Test @@ -31,11 +33,27 @@ public void verifyInV2InsufficentResponseCodes() { public void verifyInV3() { verifyV3("valid"); } + @Test + public void verifyInV31() { + verifyV31("valid"); + } + @Test + public void verifyInV32() { + verifyV32("valid"); + } @Test public void verifyInV3InsufficentResponseCodes() { verifyV3("insuficent-response-codes"); } + @Test + public void verifyInV31InsufficentResponseCodes() { + verifyV31("insuficent-response-codes"); + } + @Test + public void verifyInV32InsufficentResponseCodes() { + verifyV32("insuficent-response-codes"); + } @Override public void verifyRule() { diff --git a/src/test/java/apiaddicts/sonar/openapi/checks/operations/OAR065DeleteMethodCheckTest.java b/src/test/java/apiaddicts/sonar/openapi/checks/operations/OAR065DeleteMethodCheckTest.java index 4005f3b7..6a4c3190 100644 --- a/src/test/java/apiaddicts/sonar/openapi/checks/operations/OAR065DeleteMethodCheckTest.java +++ b/src/test/java/apiaddicts/sonar/openapi/checks/operations/OAR065DeleteMethodCheckTest.java @@ -15,6 +15,8 @@ public void init() { check = new OAR065DeleteMethodCheck(); v2Path = getV2Path("operations"); v3Path = getV3Path("operations"); + v31Path = getV31Path("operations"); + v32Path = getV32Path("operations"); } @Test @@ -31,11 +33,27 @@ public void verifyInV2InsufficentResponseCodes() { public void verifyInV3() { verifyV3("valid"); } + @Test + public void verifyInV31() { + verifyV31("valid"); + } + @Test + public void verifyInV32() { + verifyV32("valid"); + } @Test public void verifyInV3InsufficentResponseCodes() { verifyV3("insuficent-response-codes"); } + @Test + public void verifyInV31InsufficentResponseCodes() { + verifyV31("insuficent-response-codes"); + } + @Test + public void verifyInV32InsufficentResponseCodes() { + verifyV32("insuficent-response-codes"); + } @Override public void verifyRule() { diff --git a/src/test/java/apiaddicts/sonar/openapi/checks/operations/OAR071GetQueryParamsDefinedCheckTest.java b/src/test/java/apiaddicts/sonar/openapi/checks/operations/OAR071GetQueryParamsDefinedCheckTest.java index 9ac755d7..8df34511 100644 --- a/src/test/java/apiaddicts/sonar/openapi/checks/operations/OAR071GetQueryParamsDefinedCheckTest.java +++ b/src/test/java/apiaddicts/sonar/openapi/checks/operations/OAR071GetQueryParamsDefinedCheckTest.java @@ -15,6 +15,8 @@ public void init() { check = new OAR071GetQueryParamsDefinedCheck(); v2Path = getV2Path("operations"); v3Path = getV3Path("operations"); + v31Path = getV31Path("operations"); + v32Path = getV32Path("operations"); } @Test @@ -31,11 +33,27 @@ public void verifyInV2MissingQueryParams() { public void verifyInV3() { verifyV3("valid-query-params"); } + @Test + public void verifyInV31() { + verifyV31("valid-query-params"); + } + @Test + public void verifyInV32() { + verifyV32("valid-query-params"); + } @Test public void verifyInV3MissingQueryParams() { verifyV3("missing-query-params"); } + @Test + public void verifyInV31MissingQueryParams() { + verifyV31("missing-query-params"); + } + @Test + public void verifyInV32MissingQueryParams() { + verifyV32("missing-query-params"); + } @Override public void verifyRule() { diff --git a/src/test/java/apiaddicts/sonar/openapi/checks/operations/OAR091ParamOnlyRefCheckTest.java b/src/test/java/apiaddicts/sonar/openapi/checks/operations/OAR091ParamOnlyRefCheckTest.java index d6f578d8..e15ff7e2 100644 --- a/src/test/java/apiaddicts/sonar/openapi/checks/operations/OAR091ParamOnlyRefCheckTest.java +++ b/src/test/java/apiaddicts/sonar/openapi/checks/operations/OAR091ParamOnlyRefCheckTest.java @@ -14,6 +14,8 @@ public void init() { check = new OAR091ParamOnlyRefCheck(); v2Path = getV2Path("operations"); v3Path = getV3Path("operations"); + v31Path = getV31Path("operations"); + v32Path = getV32Path("operations"); } @Test @@ -30,11 +32,27 @@ public void verifyInV2withref() { public void verifyInV3noref() { verifyV3("no-ref"); } + @Test + public void verifyInV31noref() { + verifyV31("no-ref"); + } + @Test + public void verifyInV32noref() { + verifyV32("no-ref"); + } @Test public void verifyInV3withref() { verifyV3("with-ref"); } + @Test + public void verifyInV31withref() { + verifyV31("with-ref"); + } + @Test + public void verifyInV32withref() { + verifyV32("with-ref"); + } @Override public void verifyRule() { diff --git a/src/test/java/apiaddicts/sonar/openapi/checks/operations/OAR092RequestBodyOnlyRefCheckTest.java b/src/test/java/apiaddicts/sonar/openapi/checks/operations/OAR092RequestBodyOnlyRefCheckTest.java index 77dd8d4d..5f74674d 100644 --- a/src/test/java/apiaddicts/sonar/openapi/checks/operations/OAR092RequestBodyOnlyRefCheckTest.java +++ b/src/test/java/apiaddicts/sonar/openapi/checks/operations/OAR092RequestBodyOnlyRefCheckTest.java @@ -14,16 +14,34 @@ public void init() { check = new OAR092RequestBodyOnlyRefCheck(); v2Path = getV2Path("operations"); v3Path = getV3Path("operations"); + v31Path = getV31Path("operations"); + v32Path = getV32Path("operations"); } @Test public void verifyInV3noref() { verifyV3("no-ref"); } + @Test + public void verifyInV31noref() { + verifyV31("no-ref"); + } + @Test + public void verifyInV32noref() { + verifyV32("no-ref"); + } @Test public void verifyInV3withref() { verifyV3("with-ref"); } + @Test + public void verifyInV31withref() { + verifyV31("with-ref"); + } + @Test + public void verifyInV32withref() { + verifyV32("with-ref"); + } @Override public void verifyRule() { diff --git a/src/test/java/apiaddicts/sonar/openapi/checks/operations/OAR093ResponseOnlyRefCheckTest.java b/src/test/java/apiaddicts/sonar/openapi/checks/operations/OAR093ResponseOnlyRefCheckTest.java index f448dfe4..8cdd56f5 100644 --- a/src/test/java/apiaddicts/sonar/openapi/checks/operations/OAR093ResponseOnlyRefCheckTest.java +++ b/src/test/java/apiaddicts/sonar/openapi/checks/operations/OAR093ResponseOnlyRefCheckTest.java @@ -14,6 +14,8 @@ public void init() { check = new OAR093ResponseOnlyRefCheck(); v2Path = getV2Path("operations"); v3Path = getV3Path("operations"); + v31Path = getV31Path("operations"); + v32Path = getV32Path("operations"); } @Test @@ -30,11 +32,27 @@ public void verifyInV2withref() { public void verifyInV3noref() { verifyV3("no-ref"); } + @Test + public void verifyInV31noref() { + verifyV31("no-ref"); + } + @Test + public void verifyInV32noref() { + verifyV32("no-ref"); + } @Test public void verifyInV3withref() { verifyV3("with-ref"); } + @Test + public void verifyInV31withref() { + verifyV31("with-ref"); + } + @Test + public void verifyInV32withref() { + verifyV32("with-ref"); + } @Override public void verifyRule() { diff --git a/src/test/java/apiaddicts/sonar/openapi/checks/operations/OAR103ResourcesByGetVerbCheckTest.java b/src/test/java/apiaddicts/sonar/openapi/checks/operations/OAR103ResourcesByGetVerbCheckTest.java index 021538cc..cf039503 100644 --- a/src/test/java/apiaddicts/sonar/openapi/checks/operations/OAR103ResourcesByGetVerbCheckTest.java +++ b/src/test/java/apiaddicts/sonar/openapi/checks/operations/OAR103ResourcesByGetVerbCheckTest.java @@ -15,6 +15,8 @@ public void init() { check = new OAR103ResourcesByGetVerbCheck(); v2Path = getV2Path("operations"); v3Path = getV3Path("operations"); + v31Path = getV31Path("operations"); + v32Path = getV32Path("operations"); } @Test @@ -26,6 +28,14 @@ public void verifyInV2() { public void verifyInV3() { verifyV3("plain"); } + @Test + public void verifyInV31() { + verifyV31("plain"); + } + @Test + public void verifyInV32() { + verifyV32("plain"); + } @Override public void verifyRule() { diff --git a/src/test/java/apiaddicts/sonar/openapi/checks/operations/OAR104ResourcesByPostVerbCheckTest.java b/src/test/java/apiaddicts/sonar/openapi/checks/operations/OAR104ResourcesByPostVerbCheckTest.java index ec981f9c..030e2a92 100644 --- a/src/test/java/apiaddicts/sonar/openapi/checks/operations/OAR104ResourcesByPostVerbCheckTest.java +++ b/src/test/java/apiaddicts/sonar/openapi/checks/operations/OAR104ResourcesByPostVerbCheckTest.java @@ -15,6 +15,8 @@ public void init() { check = new OAR104ResourcesByPostVerbCheck(); v2Path = getV2Path("operations"); v3Path = getV3Path("operations"); + v31Path = getV31Path("operations"); + v32Path = getV32Path("operations"); } @Test @@ -26,6 +28,14 @@ public void verifyInV2() { public void verifyInV3() { verifyV3("plain.yaml"); } + @Test + public void verifyInV31() { + verifyV31("plain.yaml"); + } + @Test + public void verifyInV32() { + verifyV32("plain.yaml"); + } @Override public void verifyRule() { diff --git a/src/test/java/apiaddicts/sonar/openapi/checks/operations/OAR105ResourcesByPutVerbCheckTest.java b/src/test/java/apiaddicts/sonar/openapi/checks/operations/OAR105ResourcesByPutVerbCheckTest.java index fcbc8bdc..358f5a95 100644 --- a/src/test/java/apiaddicts/sonar/openapi/checks/operations/OAR105ResourcesByPutVerbCheckTest.java +++ b/src/test/java/apiaddicts/sonar/openapi/checks/operations/OAR105ResourcesByPutVerbCheckTest.java @@ -15,6 +15,8 @@ public void init() { check = new OAR105ResourcesByPutVerbCheck(); v2Path = getV2Path("operations"); v3Path = getV3Path("operations"); + v31Path = getV31Path("operations"); + v32Path = getV32Path("operations"); } @Test @@ -26,6 +28,14 @@ public void verifyInV2() { public void verifyInV3() { verifyV3("plain"); } + @Test + public void verifyInV31() { + verifyV31("plain"); + } + @Test + public void verifyInV32() { + verifyV32("plain"); + } @Override public void verifyRule() { diff --git a/src/test/java/apiaddicts/sonar/openapi/checks/operations/OAR106ResourcesByPatchVerbCheckTest.java b/src/test/java/apiaddicts/sonar/openapi/checks/operations/OAR106ResourcesByPatchVerbCheckTest.java index fa5dde1b..eb30fa43 100644 --- a/src/test/java/apiaddicts/sonar/openapi/checks/operations/OAR106ResourcesByPatchVerbCheckTest.java +++ b/src/test/java/apiaddicts/sonar/openapi/checks/operations/OAR106ResourcesByPatchVerbCheckTest.java @@ -15,6 +15,8 @@ public void init() { check = new OAR106ResourcesByPatchVerbCheck(); v2Path = getV2Path("operations"); v3Path = getV3Path("operations"); + v31Path = getV31Path("operations"); + v32Path = getV32Path("operations"); } @Test @@ -26,6 +28,14 @@ public void verifyInV2() { public void verifyInV3() { verifyV3("plain"); } + @Test + public void verifyInV31() { + verifyV31("plain"); + } + @Test + public void verifyInV32() { + verifyV32("plain"); + } @Override public void verifyRule() { diff --git a/src/test/java/apiaddicts/sonar/openapi/checks/operations/OAR107ResourcesByDeleteVerbCheckTest.java b/src/test/java/apiaddicts/sonar/openapi/checks/operations/OAR107ResourcesByDeleteVerbCheckTest.java index c54fc046..1b80ed58 100644 --- a/src/test/java/apiaddicts/sonar/openapi/checks/operations/OAR107ResourcesByDeleteVerbCheckTest.java +++ b/src/test/java/apiaddicts/sonar/openapi/checks/operations/OAR107ResourcesByDeleteVerbCheckTest.java @@ -15,6 +15,8 @@ public void init() { check = new OAR107ResourcesByDeleteVerbCheck(); v2Path = getV2Path("operations"); v3Path = getV3Path("operations"); + v31Path = getV31Path("operations"); + v32Path = getV32Path("operations"); } @Test @@ -26,6 +28,14 @@ public void verifyInV2() { public void verifyInV3() { verifyV3("plain"); } + @Test + public void verifyInV31() { + verifyV31("plain"); + } + @Test + public void verifyInV32() { + verifyV32("plain"); + } @Override public void verifyRule() { diff --git a/src/test/java/apiaddicts/sonar/openapi/checks/operations/OAR109ForbiddenInternalServerErrorCheckTest.java b/src/test/java/apiaddicts/sonar/openapi/checks/operations/OAR109ForbiddenInternalServerErrorCheckTest.java index 32e99855..2602892b 100644 --- a/src/test/java/apiaddicts/sonar/openapi/checks/operations/OAR109ForbiddenInternalServerErrorCheckTest.java +++ b/src/test/java/apiaddicts/sonar/openapi/checks/operations/OAR109ForbiddenInternalServerErrorCheckTest.java @@ -14,6 +14,8 @@ public void init() { check = new OAR109ForbiddenInternalServerErrorCheck(); v2Path = getV2Path("operations"); v3Path = getV3Path("operations"); + v31Path = getV31Path("operations"); + v32Path = getV32Path("operations"); } @Test @@ -25,6 +27,14 @@ public void verifyInV2() { public void verifyInV3() { verifyV3("plain"); } + @Test + public void verifyInV31() { + verifyV31("plain"); + } + @Test + public void verifyInV32() { + verifyV32("plain"); + } @Override public void verifyRule() { diff --git a/src/test/java/apiaddicts/sonar/openapi/checks/owasp/OAR070BrokenAccessControlCheckTest.java b/src/test/java/apiaddicts/sonar/openapi/checks/owasp/OAR070BrokenAccessControlCheckTest.java index 5e16db2c..94a09031 100644 --- a/src/test/java/apiaddicts/sonar/openapi/checks/owasp/OAR070BrokenAccessControlCheckTest.java +++ b/src/test/java/apiaddicts/sonar/openapi/checks/owasp/OAR070BrokenAccessControlCheckTest.java @@ -14,6 +14,8 @@ public void init() { check = new OAR070BrokenAccessControlCheck(); v2Path = getV2Path("owasp"); v3Path = getV3Path("owasp"); + v31Path = getV31Path("owasp"); + v32Path = getV32Path("owasp"); } @Test @@ -29,9 +31,25 @@ public void verifyInV3numeric() { verifyV3("numeric"); } @Test + public void verifyInV31numeric() { + verifyV31("numeric"); + } + @Test + public void verifyInV32numeric() { + verifyV32("numeric"); + } + @Test public void verifyInV3noNumeric() { verifyV3("no-numeric"); } + @Test + public void verifyInV31noNumeric() { + verifyV31("no-numeric"); + } + @Test + public void verifyInV32noNumeric() { + verifyV32("no-numeric"); + } @Override public void verifyRule() { assertRuleProperties("OAR070 - BrokenAccessControl - Parameters in path shouldn't be numeric", RuleType.VULNERABILITY, Severity.MAJOR, tags("owasp")); diff --git a/src/test/java/apiaddicts/sonar/openapi/checks/owasp/OAR073RateLimitCheckTest.java b/src/test/java/apiaddicts/sonar/openapi/checks/owasp/OAR073RateLimitCheckTest.java index 0d9d672b..c622df05 100644 --- a/src/test/java/apiaddicts/sonar/openapi/checks/owasp/OAR073RateLimitCheckTest.java +++ b/src/test/java/apiaddicts/sonar/openapi/checks/owasp/OAR073RateLimitCheckTest.java @@ -15,6 +15,8 @@ public void init() { check = new OAR073RateLimitCheck(); v2Path = getV2Path("owasp"); v3Path = getV3Path("owasp"); + v31Path = getV31Path("owasp"); + v32Path = getV32Path("owasp"); } @Test @@ -31,11 +33,27 @@ public void verifyInV2NorateLimit() { public void verifyInV3rateLimit() { verifyV3("rate-limit"); } + @Test + public void verifyInV31rateLimit() { + verifyV31("rate-limit"); + } + @Test + public void verifyInV32rateLimit() { + verifyV32("rate-limit"); + } @Test public void verifyInV3NorateLimit() { verifyV3("no-rate-limit"); } + @Test + public void verifyInV31NorateLimit() { + verifyV31("no-rate-limit"); + } + @Test + public void verifyInV32NorateLimit() { + verifyV32("no-rate-limit"); + } @Override public void verifyRule() { diff --git a/src/test/java/apiaddicts/sonar/openapi/checks/parameters/OAR019SelectParameterCheckTest.java b/src/test/java/apiaddicts/sonar/openapi/checks/parameters/OAR019SelectParameterCheckTest.java index 4c6f5fac..49359130 100644 --- a/src/test/java/apiaddicts/sonar/openapi/checks/parameters/OAR019SelectParameterCheckTest.java +++ b/src/test/java/apiaddicts/sonar/openapi/checks/parameters/OAR019SelectParameterCheckTest.java @@ -16,6 +16,8 @@ public void init() { v2Path = getV2Path("parameters"); v3Path = getV3Path("parameters"); v31Path = getV31Path("parameters"); + v32Path = getV32Path("parameters"); + v31Path = getV31Path("parameters"); } @Test @@ -47,46 +49,66 @@ public void verifyInV2PathEndingWithParam() { public void verifyInV3() { verifyV3("plain"); } - - @Test - public void verifyInV3Excluded() { - verifyV3("excluded"); - } - @Test - public void verifyInV3Without() { - verifyV3("plain-without"); + public void verifyInV31() { + verifyV31("plain"); } - @Test - public void verifyInV3WithRef() { - verifyV3("with-ref"); + public void verifyInV32() { + verifyV32("plain"); } @Test - public void verifyInV31() { - verifyV31("plain"); + public void verifyInV3Excluded() { + verifyV3("excluded"); } - @Test public void verifyInV31Excluded() { verifyV31("excluded"); } + @Test + public void verifyInV32Excluded() { + verifyV32("excluded"); + } + @Test + public void verifyInV3Without() { + verifyV3("plain-without"); + } @Test public void verifyInV31Without() { verifyV31("plain-without"); } + @Test + public void verifyInV32Without() { + verifyV32("plain-without"); + } + @Test + public void verifyInV3WithRef() { + verifyV3("with-ref"); + } @Test public void verifyInV31WithRef() { verifyV31("with-ref"); } + @Test + public void verifyInV32WithRef() { + verifyV32("with-ref"); + } @Test public void verifyInV3PathEndingWithParam() { verifyV3("with-param"); } + @Test + public void verifyInV31PathEndingWithParam() { + verifyV31("with-param"); + } + @Test + public void verifyInV32PathEndingWithParam() { + verifyV32("with-param"); + } @Override public void verifyRule() { diff --git a/src/test/java/apiaddicts/sonar/openapi/checks/parameters/OAR020ExpandParameterCheckTest.java b/src/test/java/apiaddicts/sonar/openapi/checks/parameters/OAR020ExpandParameterCheckTest.java index 47efc473..1b40fb88 100644 --- a/src/test/java/apiaddicts/sonar/openapi/checks/parameters/OAR020ExpandParameterCheckTest.java +++ b/src/test/java/apiaddicts/sonar/openapi/checks/parameters/OAR020ExpandParameterCheckTest.java @@ -15,6 +15,8 @@ public void init() { check = new OAR020ExpandParameterCheck(); v2Path = getV2Path("parameters"); v3Path = getV3Path("parameters"); + v31Path = getV31Path("parameters"); + v32Path = getV32Path("parameters"); } @Test @@ -46,26 +48,66 @@ public void verifyInV2PathEndingWithParam() { public void verifyInV3() { verifyV3("plain2"); } + @Test + public void verifyInV31() { + verifyV31("plain2"); + } + @Test + public void verifyInV32() { + verifyV32("plain2"); + } @Test public void verifyInV3Excluded() { verifyV3("excluded2"); } + @Test + public void verifyInV31Excluded() { + verifyV31("excluded2"); + } + @Test + public void verifyInV32Excluded() { + verifyV32("excluded2"); + } @Test public void verifyInV3Without() { verifyV3("plain-without2"); } + @Test + public void verifyInV31Without() { + verifyV31("plain-without2"); + } + @Test + public void verifyInV32Without() { + verifyV32("plain-without2"); + } @Test public void verifyInV3WithRef() { verifyV3("with-ref"); } + @Test + public void verifyInV31WithRef() { + verifyV31("with-ref"); + } + @Test + public void verifyInV32WithRef() { + verifyV32("with-ref"); + } @Test public void verifyInV3PathEndingWithParam() { verifyV3("with-param"); } + @Test + public void verifyInV31PathEndingWithParam() { + verifyV31("with-param"); + } + @Test + public void verifyInV32PathEndingWithParam() { + verifyV32("with-param"); + } @Override public void verifyRule() { diff --git a/src/test/java/apiaddicts/sonar/openapi/checks/parameters/OAR021ExcludeParameterCheckTest.java b/src/test/java/apiaddicts/sonar/openapi/checks/parameters/OAR021ExcludeParameterCheckTest.java index 120b0834..b3a8a653 100644 --- a/src/test/java/apiaddicts/sonar/openapi/checks/parameters/OAR021ExcludeParameterCheckTest.java +++ b/src/test/java/apiaddicts/sonar/openapi/checks/parameters/OAR021ExcludeParameterCheckTest.java @@ -15,6 +15,8 @@ public void init() { check = new OAR021ExcludeParameterCheck(); v2Path = getV2Path("parameters"); v3Path = getV3Path("parameters"); + v31Path = getV31Path("parameters"); + v32Path = getV32Path("parameters"); } @Test @@ -46,26 +48,66 @@ public void verifyInV2PathEndingWithParam() { public void verifyInV3() { verifyV3("plain"); } + @Test + public void verifyInV31() { + verifyV31("plain"); + } + @Test + public void verifyInV32() { + verifyV32("plain"); + } @Test public void verifyInV3Excluded() { verifyV3("excluded"); } + @Test + public void verifyInV31Excluded() { + verifyV31("excluded"); + } + @Test + public void verifyInV32Excluded() { + verifyV32("excluded"); + } @Test public void verifyInV3Without() { verifyV3("plain-without"); } + @Test + public void verifyInV31Without() { + verifyV31("plain-without"); + } + @Test + public void verifyInV32Without() { + verifyV32("plain-without"); + } @Test public void verifyInV3WithRef() { verifyV3("with-ref"); } + @Test + public void verifyInV31WithRef() { + verifyV31("with-ref"); + } + @Test + public void verifyInV32WithRef() { + verifyV32("with-ref"); + } @Test public void verifyInV3PathEndingWithParam() { verifyV3("with-param"); } + @Test + public void verifyInV31PathEndingWithParam() { + verifyV31("with-param"); + } + @Test + public void verifyInV32PathEndingWithParam() { + verifyV32("with-param"); + } @Override public void verifyRule() { diff --git a/src/test/java/apiaddicts/sonar/openapi/checks/parameters/OAR022OrderbyParameterCheckTest.java b/src/test/java/apiaddicts/sonar/openapi/checks/parameters/OAR022OrderbyParameterCheckTest.java index 126f7c9f..e7fccdb3 100644 --- a/src/test/java/apiaddicts/sonar/openapi/checks/parameters/OAR022OrderbyParameterCheckTest.java +++ b/src/test/java/apiaddicts/sonar/openapi/checks/parameters/OAR022OrderbyParameterCheckTest.java @@ -15,6 +15,8 @@ public void init() { check = new OAR022OrderbyParameterCheck(); v2Path = getV2Path("parameters"); v3Path = getV3Path("parameters"); + v31Path = getV31Path("parameters"); + v32Path = getV32Path("parameters"); } @Test @@ -35,16 +37,40 @@ public void verifyInV2Without() { public void verifyInV3() { verifyV3("plain"); } + @Test + public void verifyInV31() { + verifyV31("plain"); + } + @Test + public void verifyInV32() { + verifyV32("plain"); + } @Test public void verifyInV3Excluded() { verifyV3("excluded"); } + @Test + public void verifyInV31Excluded() { + verifyV31("excluded"); + } + @Test + public void verifyInV32Excluded() { + verifyV32("excluded"); + } @Test public void verifyInV3Without() { verifyV3("plain-without"); } + @Test + public void verifyInV31Without() { + verifyV31("plain-without"); + } + @Test + public void verifyInV32Without() { + verifyV32("plain-without"); + } @Override public void verifyRule() { diff --git a/src/test/java/apiaddicts/sonar/openapi/checks/parameters/OAR023TotalParameterCheckTest.java b/src/test/java/apiaddicts/sonar/openapi/checks/parameters/OAR023TotalParameterCheckTest.java index 27a5f10d..20c0f437 100644 --- a/src/test/java/apiaddicts/sonar/openapi/checks/parameters/OAR023TotalParameterCheckTest.java +++ b/src/test/java/apiaddicts/sonar/openapi/checks/parameters/OAR023TotalParameterCheckTest.java @@ -15,6 +15,8 @@ public void init() { check = new OAR023TotalParameterCheck(); v2Path = getV2Path("parameters"); v3Path = getV3Path("parameters"); + v31Path = getV31Path("parameters"); + v32Path = getV32Path("parameters"); } @Test @@ -35,16 +37,40 @@ public void verifyInV2Without() { public void verifyInV3() { verifyV3("plain"); } + @Test + public void verifyInV31() { + verifyV31("plain"); + } + @Test + public void verifyInV32() { + verifyV32("plain"); + } @Test public void verifyInV3Excluded() { verifyV3("excluded"); } + @Test + public void verifyInV31Excluded() { + verifyV31("excluded"); + } + @Test + public void verifyInV32Excluded() { + verifyV32("excluded"); + } @Test public void verifyInV3Without() { verifyV3("plain-without"); } + @Test + public void verifyInV31Without() { + verifyV31("plain-without"); + } + @Test + public void verifyInV32Without() { + verifyV32("plain-without"); + } @Override public void verifyRule() { diff --git a/src/test/java/apiaddicts/sonar/openapi/checks/parameters/OAR024StartParameterCheckTest.java b/src/test/java/apiaddicts/sonar/openapi/checks/parameters/OAR024StartParameterCheckTest.java index d9b2be01..a619608b 100644 --- a/src/test/java/apiaddicts/sonar/openapi/checks/parameters/OAR024StartParameterCheckTest.java +++ b/src/test/java/apiaddicts/sonar/openapi/checks/parameters/OAR024StartParameterCheckTest.java @@ -15,6 +15,8 @@ public void init() { check = new OAR024StartParameterCheck(); v2Path = getV2Path("parameters"); v3Path = getV3Path("parameters"); + v31Path = getV31Path("parameters"); + v32Path = getV32Path("parameters"); } @Test @@ -35,16 +37,40 @@ public void verifyInV2Without() { public void verifyInV3() { verifyV3("plain"); } + @Test + public void verifyInV31() { + verifyV31("plain"); + } + @Test + public void verifyInV32() { + verifyV32("plain"); + } @Test public void verifyInV3Excluded() { verifyV3("excluded"); } + @Test + public void verifyInV31Excluded() { + verifyV31("excluded"); + } + @Test + public void verifyInV32Excluded() { + verifyV32("excluded"); + } @Test public void verifyInV3Without() { verifyV3("plain-without"); } + @Test + public void verifyInV31Without() { + verifyV31("plain-without"); + } + @Test + public void verifyInV32Without() { + verifyV32("plain-without"); + } @Override public void verifyRule() { diff --git a/src/test/java/apiaddicts/sonar/openapi/checks/parameters/OAR025LimitParameterCheckTest.java b/src/test/java/apiaddicts/sonar/openapi/checks/parameters/OAR025LimitParameterCheckTest.java index b3cbc022..e6562b9d 100644 --- a/src/test/java/apiaddicts/sonar/openapi/checks/parameters/OAR025LimitParameterCheckTest.java +++ b/src/test/java/apiaddicts/sonar/openapi/checks/parameters/OAR025LimitParameterCheckTest.java @@ -15,6 +15,8 @@ public void init() { check = new OAR025LimitParameterCheck(); v2Path = getV2Path("parameters"); v3Path = getV3Path("parameters"); + v31Path = getV31Path("parameters"); + v32Path = getV32Path("parameters"); } @Test @@ -35,16 +37,40 @@ public void verifyInV2Without() { public void verifyInV3() { verifyV3("plain"); } + @Test + public void verifyInV31() { + verifyV31("plain"); + } + @Test + public void verifyInV32() { + verifyV32("plain"); + } @Test public void verifyInV3Excluded() { verifyV3("excluded"); } + @Test + public void verifyInV31Excluded() { + verifyV31("excluded"); + } + @Test + public void verifyInV32Excluded() { + verifyV32("excluded"); + } @Test public void verifyInV3Without() { verifyV3("plain-without"); } + @Test + public void verifyInV31Without() { + verifyV31("plain-without"); + } + @Test + public void verifyInV32Without() { + verifyV32("plain-without"); + } @Override public void verifyRule() { diff --git a/src/test/java/apiaddicts/sonar/openapi/checks/parameters/OAR026TotalParameterDefaultValueCheckTest.java b/src/test/java/apiaddicts/sonar/openapi/checks/parameters/OAR026TotalParameterDefaultValueCheckTest.java index b4f195ac..c1c619a2 100644 --- a/src/test/java/apiaddicts/sonar/openapi/checks/parameters/OAR026TotalParameterDefaultValueCheckTest.java +++ b/src/test/java/apiaddicts/sonar/openapi/checks/parameters/OAR026TotalParameterDefaultValueCheckTest.java @@ -14,6 +14,8 @@ public void init() { check = new OAR026TotalParameterDefaultValueCheck(); v2Path = getV2Path("parameters"); v3Path = getV3Path("parameters"); + v31Path = getV31Path("parameters"); + v32Path = getV32Path("parameters"); } @Test @@ -105,6 +107,14 @@ public void verifyInV2WithoutParameters() { public void verifyInV3WithoutParameters() { verifyV3("without-parameters"); } + @Test + public void verifyInV31WithoutParameters() { + verifyV31("without-parameters"); + } + @Test + public void verifyInV32WithoutParameters() { + verifyV32("without-parameters"); + } @Override public void verifyRule() { diff --git a/src/test/java/apiaddicts/sonar/openapi/checks/parameters/OAR028FilterParameterCheckTest.java b/src/test/java/apiaddicts/sonar/openapi/checks/parameters/OAR028FilterParameterCheckTest.java index 765481d6..4502efd2 100644 --- a/src/test/java/apiaddicts/sonar/openapi/checks/parameters/OAR028FilterParameterCheckTest.java +++ b/src/test/java/apiaddicts/sonar/openapi/checks/parameters/OAR028FilterParameterCheckTest.java @@ -27,6 +27,8 @@ public void init() { check = new OAR028FilterParameterCheck(); v2Path = getV2Path("parameters"); v3Path = getV3Path("parameters"); + v31Path = getV31Path("parameters"); + v32Path = getV32Path("parameters"); } @Test @@ -47,16 +49,40 @@ public void verifyInV2Without() { public void verifyInV3() { verifyV3("plain"); } + @Test + public void verifyInV31() { + verifyV31("plain"); + } + @Test + public void verifyInV32() { + verifyV32("plain"); + } @Test public void verifyInV3Excluded() { verifyV3("excluded"); } + @Test + public void verifyInV31Excluded() { + verifyV31("excluded"); + } + @Test + public void verifyInV32Excluded() { + verifyV32("excluded"); + } @Test public void verifyInV3Without() { verifyV3("plain-without"); } + @Test + public void verifyInV31Without() { + verifyV31("plain-without"); + } + @Test + public void verifyInV32Without() { + verifyV32("plain-without"); + } @Test public void verifyInV2ExcludeStrategy() { @@ -71,6 +97,14 @@ public void verifyInV3ExcludeStrategy() { setField("pathsStr", "/examples"); verifyV3("exclude-noncompliant"); } + @Test + public void verifyInV31ExcludeStrategy() { + verifyV31("exclude-noncompliant"); + } + @Test + public void verifyInV32ExcludeStrategy() { + verifyV32("exclude-noncompliant"); + } @Test public void verifyInV2EmptyPaths() { @@ -83,11 +117,27 @@ public void verifyInV3EmptyPaths() { setField("pathsStr", ""); verifyV3("plain"); } + @Test + public void verifyInV31EmptyPaths() { + verifyV31("plain"); + } + @Test + public void verifyInV32EmptyPaths() { + verifyV32("plain"); + } @Test public void verifyInV3ComponentsParam() { verifyV3("components-param"); } + @Test + public void verifyInV31ComponentsParam() { + verifyV31("components-param"); + } + @Test + public void verifyInV32ComponentsParam() { + verifyV32("components-param"); + } private void setField(String name, String value) { try { diff --git a/src/test/java/apiaddicts/sonar/openapi/checks/parameters/OAR060QueryParametersOptionalCheckTest.java b/src/test/java/apiaddicts/sonar/openapi/checks/parameters/OAR060QueryParametersOptionalCheckTest.java index 480c0641..e9058dbb 100644 --- a/src/test/java/apiaddicts/sonar/openapi/checks/parameters/OAR060QueryParametersOptionalCheckTest.java +++ b/src/test/java/apiaddicts/sonar/openapi/checks/parameters/OAR060QueryParametersOptionalCheckTest.java @@ -14,6 +14,8 @@ public void init() { check = new OAR060QueryParametersOptionalCheck(); v2Path = getV2Path("parameters"); v3Path = getV3Path("parameters"); + v31Path = getV31Path("parameters"); + v32Path = getV32Path("parameters"); } @Test @@ -29,9 +31,25 @@ public void verifyInV3requiredFalse() { verifyV3("required-false"); } @Test + public void verifyInV31requiredFalse() { + verifyV31("required-false"); + } + @Test + public void verifyInV32requiredFalse() { + verifyV32("required-false"); + } + @Test public void verifyInV3requiredTrue() { verifyV3("required-true"); } + @Test + public void verifyInV31requiredTrue() { + verifyV31("required-true"); + } + @Test + public void verifyInV32requiredTrue() { + verifyV32("required-true"); + } @Override public void verifyRule() { assertRuleProperties("OAR060 - QueryParametersOptional - All parameters in query must be defined as optional", RuleType.BUG, Severity.CRITICAL, tags("parameters")); diff --git a/src/test/java/apiaddicts/sonar/openapi/checks/parameters/OAR069PathParamAndQueryCheckTest.java b/src/test/java/apiaddicts/sonar/openapi/checks/parameters/OAR069PathParamAndQueryCheckTest.java index a4b8c2f5..522343a8 100644 --- a/src/test/java/apiaddicts/sonar/openapi/checks/parameters/OAR069PathParamAndQueryCheckTest.java +++ b/src/test/java/apiaddicts/sonar/openapi/checks/parameters/OAR069PathParamAndQueryCheckTest.java @@ -14,6 +14,8 @@ public void init() { check = new OAR069PathParamAndQueryCheck(); v2Path = getV2Path("parameters"); v3Path = getV3Path("parameters"); + v31Path = getV31Path("parameters"); + v32Path = getV32Path("parameters"); } @Test @@ -30,11 +32,27 @@ public void verifyInV2NoBadRequest() { public void verifyInV3BadRequest() { verifyV3("bad-request400"); } + @Test + public void verifyInV31BadRequest() { + verifyV31("bad-request400"); + } + @Test + public void verifyInV32BadRequest() { + verifyV32("bad-request400"); + } @Test public void verifyInV3NoBadRequest() { verifyV3("no-bad-request400"); } + @Test + public void verifyInV31NoBadRequest() { + verifyV31("no-bad-request400"); + } + @Test + public void verifyInV32NoBadRequest() { + verifyV32("no-bad-request400"); + } @Override public void verifyRule() { diff --git a/src/test/java/apiaddicts/sonar/openapi/checks/regex/OAR112RegexCheckTest.java b/src/test/java/apiaddicts/sonar/openapi/checks/regex/OAR112RegexCheckTest.java index 924a317e..5974a8fd 100644 --- a/src/test/java/apiaddicts/sonar/openapi/checks/regex/OAR112RegexCheckTest.java +++ b/src/test/java/apiaddicts/sonar/openapi/checks/regex/OAR112RegexCheckTest.java @@ -17,6 +17,8 @@ public void init() { check = new OAR112RegexCheck(); v2Path = getV2Path("regex"); v3Path = getV3Path("regex"); + v31Path = getV31Path("regex"); + v32Path = getV32Path("regex"); } private void setField(String fieldName, String value) { @@ -38,6 +40,14 @@ public void verifyInV2() { public void verifyInV3() { verifyV3("plain"); } + @Test + public void verifyInV31() { + verifyV31("plain"); + } + @Test + public void verifyInV32() { + verifyV32("plain"); + } @Test public void verifyInfoDescriptionInvalidInV2() { @@ -48,30 +58,70 @@ public void verifyInfoDescriptionInvalidInV2() { public void verifyInfoDescriptionInvalidInV3() { verifyV3("info-invalid"); } + @Test + public void verifyInfoDescriptionInvalidInV31() { + verifyV31("info-invalid"); + } + @Test + public void verifyInfoDescriptionInvalidInV32() { + verifyV32("info-invalid"); + } @Test public void verifyServersDescriptionValidInV3() { setField("nodes", "servers/description"); verifyV3("servers-valid"); } + @Test + public void verifyServersDescriptionValidInV31() { + verifyV31("servers-valid"); + } + @Test + public void verifyServersDescriptionValidInV32() { + verifyV32("servers-valid"); + } @Test public void verifyServersDescriptionInvalidInV3() { setField("nodes", "servers/description"); verifyV3("servers-invalid"); } + @Test + public void verifyServersDescriptionInvalidInV31() { + verifyV31("servers-invalid"); + } + @Test + public void verifyServersDescriptionInvalidInV32() { + verifyV32("servers-invalid"); + } @Test public void verifyOperationSummaryValidInV3() { setField("nodes", "paths/get/summary"); verifyV3("operation-valid"); } + @Test + public void verifyOperationSummaryValidInV31() { + verifyV31("operation-valid"); + } + @Test + public void verifyOperationSummaryValidInV32() { + verifyV32("operation-valid"); + } @Test public void verifyOperationSummaryInvalidInV3() { setField("nodes", "paths/get/summary"); verifyV3("operation-invalid"); } + @Test + public void verifyOperationSummaryInvalidInV31() { + verifyV31("operation-invalid"); + } + @Test + public void verifyOperationSummaryInvalidInV32() { + verifyV32("operation-invalid"); + } @Test public void verifyOperationSummaryValidInV2() { @@ -90,12 +140,28 @@ public void verifyTagsNameValidInV3() { setField("nodes", "tags/name"); verifyV3("tags-valid"); } + @Test + public void verifyTagsNameValidInV31() { + verifyV31("tags-valid"); + } + @Test + public void verifyTagsNameValidInV32() { + verifyV32("tags-valid"); + } @Test public void verifyTagsNameInvalidInV3() { setField("nodes", "tags/name"); verifyV3("tags-invalid"); } + @Test + public void verifyTagsNameInvalidInV31() { + verifyV31("tags-invalid"); + } + @Test + public void verifyTagsNameInvalidInV32() { + verifyV32("tags-invalid"); + } @Test public void verifyTagsNameValidInV2() { @@ -114,12 +180,28 @@ public void verifyExternalDocsDescriptionValidInV3() { setField("nodes", "externalDocs/description"); verifyV3("external-docs-valid"); } + @Test + public void verifyExternalDocsDescriptionValidInV31() { + verifyV31("external-docs-valid"); + } + @Test + public void verifyExternalDocsDescriptionValidInV32() { + verifyV32("external-docs-valid"); + } @Test public void verifyExternalDocsDescriptionInvalidInV3() { setField("nodes", "externalDocs/description"); verifyV3("external-docs-invalid"); } + @Test + public void verifyExternalDocsDescriptionInvalidInV31() { + verifyV31("external-docs-invalid"); + } + @Test + public void verifyExternalDocsDescriptionInvalidInV32() { + verifyV32("external-docs-invalid"); + } @Test public void verifyExternalDocsDescriptionValidInV2() { @@ -138,12 +220,28 @@ public void verifyParametersDescriptionValidInV3() { setField("nodes", "paths/get/parameters/description"); verifyV3("parameters-valid"); } + @Test + public void verifyParametersDescriptionValidInV31() { + verifyV31("parameters-valid"); + } + @Test + public void verifyParametersDescriptionValidInV32() { + verifyV32("parameters-valid"); + } @Test public void verifyParametersDescriptionInvalidInV3() { setField("nodes", "paths/get/parameters/description"); verifyV3("parameters-invalid"); } + @Test + public void verifyParametersDescriptionInvalidInV31() { + verifyV31("parameters-invalid"); + } + @Test + public void verifyParametersDescriptionInvalidInV32() { + verifyV32("parameters-invalid"); + } @Test public void verifyBooleanTrueMissingFieldInV3() { @@ -155,6 +253,14 @@ public void verifyBooleanTrueMissingFieldInV3() { verifyV3("info-invalid"); verifyV3("minimal"); } + @Test + public void verifyBooleanTrueMissingFieldInV31() { + verifyV31("minimal"); + } + @Test + public void verifyBooleanTrueMissingFieldInV32() { + verifyV32("minimal"); + } @Test public void verifyBooleanTrueMissingFieldInV2() { @@ -173,6 +279,14 @@ public void verifyBooleanFalseFieldPresentInV3() { setField("valid", "false"); verifyV3("info-invalid"); } + @Test + public void verifyBooleanFalseFieldPresentInV31() { + verifyV31("info-invalid"); + } + @Test + public void verifyBooleanFalseFieldPresentInV32() { + verifyV32("info-invalid"); + } @Test public void verifyBooleanFalseFieldPresentInV2() { @@ -187,6 +301,14 @@ public void verifyBooleanFalseFieldAbsentInV3() { setField("valid", "false"); verifyV3("minimal"); } + @Test + public void verifyBooleanFalseFieldAbsentInV31() { + verifyV31("minimal"); + } + @Test + public void verifyBooleanFalseFieldAbsentInV32() { + verifyV32("minimal"); + } @Test public void verifyBooleanFalseFieldAbsentInV2() { @@ -207,4 +329,4 @@ public void verifyParameters() { assertParameterProperties("Error Message", "The field must start with an uppercase letter.", RuleParamType.STRING); assertParameterProperties("Validation", "^[A-Z].*", RuleParamType.STRING); } -} \ No newline at end of file +} diff --git a/src/test/java/apiaddicts/sonar/openapi/checks/schemas/OAR029StandardResponseSchemaCheckTest.java b/src/test/java/apiaddicts/sonar/openapi/checks/schemas/OAR029StandardResponseSchemaCheckTest.java index 48ce2096..bb31a6f2 100644 --- a/src/test/java/apiaddicts/sonar/openapi/checks/schemas/OAR029StandardResponseSchemaCheckTest.java +++ b/src/test/java/apiaddicts/sonar/openapi/checks/schemas/OAR029StandardResponseSchemaCheckTest.java @@ -24,6 +24,8 @@ public void init() { v2Path = getV2Path("schemas"); v3Path = getV3Path("schemas"); v31Path = getV31Path("schemas"); + v32Path = getV32Path("schemas"); + v31Path = getV31Path("schemas"); } @Test @@ -96,26 +98,66 @@ public void verifyV3NoJsonContent() { public void verifyInV3() { verifyV3("valid"); } + @Test + public void verifyInV31() { + verifyV31("valid"); + } + @Test + public void verifyInV32() { + verifyV32("valid"); + } @Test public void verifyInV3AllOf() { verifyV3("valid-all-of"); } + @Test + public void verifyInV31AllOf() { + verifyV31("valid-all-of"); + } + @Test + public void verifyInV32AllOf() { + verifyV32("valid-all-of"); + } @Test public void verifyInV3ValidAllOfMd() { verifyV3("valid-all-of-md"); } + @Test + public void verifyInV31ValidAllOfMd() { + verifyV31("valid-all-of-md"); + } + @Test + public void verifyInV32ValidAllOfMd() { + verifyV32("valid-all-of-md"); + } @Test public void verifyInV3ValidMd() { verifyV3("valid-md"); } + @Test + public void verifyInV31ValidMd() { + verifyV31("valid-md"); + } + @Test + public void verifyInV32ValidMd() { + verifyV32("valid-md"); + } @Test public void verifyInV3ValidR() { verifyV3("valid-r"); } + @Test + public void verifyInV31ValidR() { + verifyV31("valid-r"); + } + @Test + public void verifyInV32ValidR() { + verifyV32("valid-r"); + } @Test public void verifyV31Valid() { @@ -156,7 +198,7 @@ public void verifyV2WithArrayTypePrimitiveItems() throws Exception { public void verifyV2WithInvalidSchema() throws Exception { setResponseSchema("not valid json"); List issues = ExtendedOpenApiCheckVerifier.scanFileForIssues( - new File(v2Path + "valid.yaml"), check, true, false, false); + new File(v2Path + "valid.yaml"), check, true, false, false, false); assertThat(issues).isNotEmpty(); } diff --git a/src/test/java/apiaddicts/sonar/openapi/checks/schemas/OAR034StandardPagedResponseSchemaCheckTest.java b/src/test/java/apiaddicts/sonar/openapi/checks/schemas/OAR034StandardPagedResponseSchemaCheckTest.java index 0db4b1c2..91b760ee 100644 --- a/src/test/java/apiaddicts/sonar/openapi/checks/schemas/OAR034StandardPagedResponseSchemaCheckTest.java +++ b/src/test/java/apiaddicts/sonar/openapi/checks/schemas/OAR034StandardPagedResponseSchemaCheckTest.java @@ -22,6 +22,8 @@ public void init() { check = new OAR034StandardPagedResponseSchemaCheck(); v2Path = getV2Path("schemas"); v3Path = getV3Path("schemas"); + v31Path = getV31Path("schemas"); + v32Path = getV32Path("schemas"); } @Test @@ -73,51 +75,123 @@ public void verifyInV2WithoutPaginationRequiredFields() { public void verifyInV3() { verifyV3("valid"); } + @Test + public void verifyInV31() { + verifyV31("valid"); + } + @Test + public void verifyInV32() { + verifyV32("valid"); + } @Test public void verifyInV3AllOf() { verifyV3("valid-all-of"); } + @Test + public void verifyInV31AllOf() { + verifyV31("valid-all-of"); + } + @Test + public void verifyInV32AllOf() { + verifyV32("valid-all-of"); + } @Test public void verifyInV3WithoutPaging() { verifyV3("without-paging"); } + @Test + public void verifyInV31WithoutPaging() { + verifyV31("without-paging"); + } + @Test + public void verifyInV32WithoutPaging() { + verifyV32("without-paging"); + } @Test public void verifyInV3WithPagingWrongType() { verifyV3("with-paging-wrong-type"); } + @Test + public void verifyInV31WithPagingWrongType() { + verifyV31("with-paging-wrong-type"); + } + @Test + public void verifyInV32WithPagingWrongType() { + verifyV32("with-paging-wrong-type"); + } @Test public void verifyInV3WithPagingWithoutProperties() { verifyV3("with-paging-without-properties"); } + @Test + public void verifyInV31WithPagingWithoutProperties() { + verifyV31("with-paging-without-properties"); + } + @Test + public void verifyInV32WithPagingWithoutProperties() { + verifyV32("with-paging-without-properties"); + } @Test public void verifyInV3WithPagingWithPropertiesWrongTypes() { verifyV3("with-paging-with-properties-wrong-types"); } + @Test + public void verifyInV31WithPagingWithPropertiesWrongTypes() { + verifyV31("with-paging-with-properties-wrong-types"); + } + @Test + public void verifyInV32WithPagingWithPropertiesWrongTypes() { + verifyV32("with-paging-with-properties-wrong-types"); + } @Test public void verifyInV3WithLinksWithoutProperties() { verifyV3("with-links-without-properties"); } + @Test + public void verifyInV31WithLinksWithoutProperties() { + verifyV31("with-links-without-properties"); + } + @Test + public void verifyInV32WithLinksWithoutProperties() { + verifyV32("with-links-without-properties"); + } @Test public void verifyInV3WithoutLinksRequiredFields() { verifyV3("without-links-required-fields"); } + @Test + public void verifyInV31WithoutLinksRequiredFields() { + verifyV31("without-links-required-fields"); + } + @Test + public void verifyInV32WithoutLinksRequiredFields() { + verifyV32("without-links-required-fields"); + } @Test public void verifyInV3WithoutPaginationRequiredFields() { verifyV3("without-pagination-required-fields"); } + @Test + public void verifyInV31WithoutPaginationRequiredFields() { + verifyV31("without-pagination-required-fields"); + } + @Test + public void verifyInV32WithoutPaginationRequiredFields() { + verifyV32("without-pagination-required-fields"); + } @Test public void verifyInV2WithPagingNoType() { List issues = ExtendedOpenApiCheckVerifier.scanFileForIssues( - new File(v2Path + "with-paging-no-type.yaml"), check, true, false, false); + new File(v2Path + "with-paging-no-type.yaml"), check, true, false, false, false); assertThat(issues).isNotEmpty(); } @@ -126,13 +200,6 @@ public void verifyInV2WithPagingAllofWrongType() { verifyV2("with-paging-allof-wrong-type.yaml"); } - @Test - public void verifyInV2WithoutPagingRequiredKey() { - List issues = ExtendedOpenApiCheckVerifier.scanFileForIssues( - new File(v2Path + "without-paging-required-key.yaml"), check, true, false, false); - assertThat(issues).isNotEmpty(); - } - @Override public void verifyParameters() { assertNumberOfParameters(1); diff --git a/src/test/java/apiaddicts/sonar/openapi/checks/schemas/OAR080SecuritySchemasCheckTest.java b/src/test/java/apiaddicts/sonar/openapi/checks/schemas/OAR080SecuritySchemasCheckTest.java index 1f44678a..06cc991f 100644 --- a/src/test/java/apiaddicts/sonar/openapi/checks/schemas/OAR080SecuritySchemasCheckTest.java +++ b/src/test/java/apiaddicts/sonar/openapi/checks/schemas/OAR080SecuritySchemasCheckTest.java @@ -15,6 +15,8 @@ public void init() { check = new OAR080SecuritySchemasCheck(); v2Path = getV2Path("schemas"); v3Path = getV3Path("schemas"); + v31Path = getV31Path("schemas"); + v32Path = getV32Path("schemas"); } @Test diff --git a/src/test/java/apiaddicts/sonar/openapi/checks/schemas/OAR108SchemaValidatorCheckTest.java b/src/test/java/apiaddicts/sonar/openapi/checks/schemas/OAR108SchemaValidatorCheckTest.java index b8716e4a..66063382 100644 --- a/src/test/java/apiaddicts/sonar/openapi/checks/schemas/OAR108SchemaValidatorCheckTest.java +++ b/src/test/java/apiaddicts/sonar/openapi/checks/schemas/OAR108SchemaValidatorCheckTest.java @@ -14,6 +14,8 @@ public void init() { check = new OAR108SchemaValidatorCheck(); v2Path = getV2Path("schemas"); v3Path = getV3Path("schemas"); + v31Path = getV31Path("schemas"); + v32Path = getV32Path("schemas"); } @Test @@ -30,11 +32,27 @@ public void verifyInV2Invalid() { public void verifyInV3() { verifyV3("valid"); } + @Test + public void verifyInV31() { + verifyV31("valid"); + } + @Test + public void verifyInV32() { + verifyV32("valid"); + } @Test public void verifyInV3Invalid() { verifyV3("invalid"); } + @Test + public void verifyInV31Invalid() { + verifyV31("invalid"); + } + @Test + public void verifyInV32Invalid() { + verifyV32("invalid"); + } @Override public void verifyRule() { diff --git a/src/test/java/apiaddicts/sonar/openapi/checks/security/OAR001MandatoryHttpsProtocolCheckTest.java b/src/test/java/apiaddicts/sonar/openapi/checks/security/OAR001MandatoryHttpsProtocolCheckTest.java index de939b23..a0814cbc 100644 --- a/src/test/java/apiaddicts/sonar/openapi/checks/security/OAR001MandatoryHttpsProtocolCheckTest.java +++ b/src/test/java/apiaddicts/sonar/openapi/checks/security/OAR001MandatoryHttpsProtocolCheckTest.java @@ -14,6 +14,8 @@ public void init() { check = new OAR001MandatoryHttpsProtocolCheck(); v2Path = getV2Path("security"); v3Path = getV3Path("security"); + v31Path = getV31Path("security"); + v32Path = getV32Path("security"); } @Test @@ -30,11 +32,27 @@ public void verifyInV2WithoutSchemes() { public void verifyInV3WithServers() { verifyV3("with-servers"); } + @Test + public void verifyInV31WithServers() { + verifyV31("with-servers"); + } + @Test + public void verifyInV32WithServers() { + verifyV32("with-servers"); + } @Test public void verifyInV3WithoutServers() { verifyV3("without-servers"); } + @Test + public void verifyInV31WithoutServers() { + verifyV31("without-servers"); + } + @Test + public void verifyInV32WithoutServers() { + verifyV32("without-servers"); + } @Override public void verifyRule() { diff --git a/src/test/java/apiaddicts/sonar/openapi/checks/security/OAR033HttpHeadersCheckTest.java b/src/test/java/apiaddicts/sonar/openapi/checks/security/OAR033HttpHeadersCheckTest.java index c9c36162..50be7364 100644 --- a/src/test/java/apiaddicts/sonar/openapi/checks/security/OAR033HttpHeadersCheckTest.java +++ b/src/test/java/apiaddicts/sonar/openapi/checks/security/OAR033HttpHeadersCheckTest.java @@ -15,6 +15,8 @@ public void init() { check = new OAR033HttpHeadersCheck(); v2Path = getV2Path("security"); v3Path = getV3Path("security"); + v31Path = getV31Path("security"); + v32Path = getV32Path("security"); } @Test @@ -36,16 +38,40 @@ public void verifyInV2WithoutRequiredParams() { public void verifyInV3() { verifyV3("valid"); } + @Test + public void verifyInV31() { + verifyV31("valid"); + } + @Test + public void verifyInV32() { + verifyV32("valid"); + } @Test public void verifyInV3WithForbiddenParams() { verifyV3("with-forbidden-params"); } + @Test + public void verifyInV31WithForbiddenParams() { + verifyV31("with-forbidden-params"); + } + @Test + public void verifyInV32WithForbiddenParams() { + verifyV32("with-forbidden-params"); + } @Test public void verifyInV3WithoutRequiredParams() { verifyV3("without-required-params"); } + @Test + public void verifyInV31WithoutRequiredParams() { + verifyV31("without-required-params"); + } + @Test + public void verifyInV32WithoutRequiredParams() { + verifyV32("without-required-params"); + } @Override public void verifyRule() { diff --git a/src/test/java/apiaddicts/sonar/openapi/checks/security/OAR035AuthorizationResponsesCheckTest.java b/src/test/java/apiaddicts/sonar/openapi/checks/security/OAR035AuthorizationResponsesCheckTest.java index 9daca31d..cdd82acd 100644 --- a/src/test/java/apiaddicts/sonar/openapi/checks/security/OAR035AuthorizationResponsesCheckTest.java +++ b/src/test/java/apiaddicts/sonar/openapi/checks/security/OAR035AuthorizationResponsesCheckTest.java @@ -15,6 +15,8 @@ public void init() { check = new OAR035UnauthorizedResponseCheck(); v2Path = getV2Path("security"); v3Path = getV3Path("security"); + v31Path = getV31Path("security"); + v32Path = getV32Path("security"); } @Test @@ -31,11 +33,27 @@ public void verifyInV2WithoutAuthorizationResponses() { public void verifyInV3() { verifyV3("valid"); } + @Test + public void verifyInV31() { + verifyV31("valid"); + } + @Test + public void verifyInV32() { + verifyV32("valid"); + } @Test public void verifyInV3WithoutAuthorizationResponses() { verifyV3("without-authorization-responses"); } + @Test + public void verifyInV31WithoutAuthorizationResponses() { + verifyV31("without-authorization-responses"); + } + @Test + public void verifyInV32WithoutAuthorizationResponses() { + verifyV32("without-authorization-responses"); + } @Override public void verifyParameters() { diff --git a/src/test/java/apiaddicts/sonar/openapi/checks/security/OAR036SessionMechanismCheckTest.java b/src/test/java/apiaddicts/sonar/openapi/checks/security/OAR036SessionMechanismCheckTest.java index bc6d7bd0..d8a816b1 100644 --- a/src/test/java/apiaddicts/sonar/openapi/checks/security/OAR036SessionMechanismCheckTest.java +++ b/src/test/java/apiaddicts/sonar/openapi/checks/security/OAR036SessionMechanismCheckTest.java @@ -14,6 +14,8 @@ public void init() { check = new OAR036SessionMechanismsCheck(); v2Path = getV2Path("security"); v3Path = getV3Path("security"); + v31Path = getV31Path("security"); + v32Path = getV32Path("security"); } @Test @@ -30,11 +32,27 @@ public void verifyInV2WithForbiddenParams() { public void verifyInV3() { verifyV3("valid"); } + @Test + public void verifyInV31() { + verifyV31("valid"); + } + @Test + public void verifyInV32() { + verifyV32("valid"); + } @Test public void verifyInV3WithForbiddenParams() { verifyV3("with-cookie"); } + @Test + public void verifyInV31WithForbiddenParams() { + verifyV31("with-cookie"); + } + @Test + public void verifyInV32WithForbiddenParams() { + verifyV32("with-cookie"); + } @Override public void verifyRule() { diff --git a/src/test/java/apiaddicts/sonar/openapi/checks/security/OAR045DefinedResponseCheckTest.java b/src/test/java/apiaddicts/sonar/openapi/checks/security/OAR045DefinedResponseCheckTest.java index cc6f72fe..63474060 100644 --- a/src/test/java/apiaddicts/sonar/openapi/checks/security/OAR045DefinedResponseCheckTest.java +++ b/src/test/java/apiaddicts/sonar/openapi/checks/security/OAR045DefinedResponseCheckTest.java @@ -14,6 +14,8 @@ public void init() { check = new OAR045DefinedResponseCheck(); v2Path = getV2Path("security"); v3Path = getV3Path("security"); + v31Path = getV31Path("security"); + v32Path = getV32Path("security"); } @Test diff --git a/src/test/java/apiaddicts/sonar/openapi/checks/security/OAR049NoContentIn204CheckTest.java b/src/test/java/apiaddicts/sonar/openapi/checks/security/OAR049NoContentIn204CheckTest.java index 8b2b90f1..d4f34fd8 100644 --- a/src/test/java/apiaddicts/sonar/openapi/checks/security/OAR049NoContentIn204CheckTest.java +++ b/src/test/java/apiaddicts/sonar/openapi/checks/security/OAR049NoContentIn204CheckTest.java @@ -14,6 +14,8 @@ public void init() { check = new OAR049NoContentIn204Check(); v2Path = getV2Path("security"); v3Path = getV3Path("security"); + v31Path = getV31Path("security"); + v32Path = getV32Path("security"); } @Test @@ -25,6 +27,14 @@ public void verifyInV2() { public void verifyInV3() { verifyV3("no-content-in-204"); } + @Test + public void verifyInV31() { + verifyV31("no-content-in-204"); + } + @Test + public void verifyInV32() { + verifyV32("no-content-in-204"); + } @Override public void verifyRule() { diff --git a/src/test/java/apiaddicts/sonar/openapi/checks/security/OAR053ResponseHeadersCheckTest.java b/src/test/java/apiaddicts/sonar/openapi/checks/security/OAR053ResponseHeadersCheckTest.java index 6572c95a..692b01af 100644 --- a/src/test/java/apiaddicts/sonar/openapi/checks/security/OAR053ResponseHeadersCheckTest.java +++ b/src/test/java/apiaddicts/sonar/openapi/checks/security/OAR053ResponseHeadersCheckTest.java @@ -14,6 +14,8 @@ public void init() { check = new OAR053ResponseHeadersCheck(); v2Path = getV2Path("security"); v3Path = getV3Path("security"); + v31Path = getV31Path("security"); + v32Path = getV32Path("security"); } @@ -25,6 +27,14 @@ public void verifyInV2(){ public void verifyInV3(){ verifyV3("valid"); } + @Test + public void verifyInV31() { + verifyV31("valid"); + } + @Test + public void verifyInV32() { + verifyV32("valid"); + } @Override diff --git a/src/test/java/apiaddicts/sonar/openapi/checks/security/OAR054HostCheckTest.java b/src/test/java/apiaddicts/sonar/openapi/checks/security/OAR054HostCheckTest.java index 8cff1395..a268a78c 100644 --- a/src/test/java/apiaddicts/sonar/openapi/checks/security/OAR054HostCheckTest.java +++ b/src/test/java/apiaddicts/sonar/openapi/checks/security/OAR054HostCheckTest.java @@ -15,6 +15,8 @@ public void init() { check = new OAR054HostCheck(); v2Path = getV2Path("security"); v3Path = getV3Path("security"); + v31Path = getV31Path("security"); + v32Path = getV32Path("security"); } @Test @@ -26,6 +28,14 @@ public void verifyInV2() { public void verifyInV3() { verifyV3("valid"); } + @Test + public void verifyInV31() { + verifyV31("valid"); + } + @Test + public void verifyInV32() { + verifyV32("valid"); + } @Override public void verifyParameters() { diff --git a/src/test/java/apiaddicts/sonar/openapi/checks/security/OAR072NonOKModelResponseCheckTest.java b/src/test/java/apiaddicts/sonar/openapi/checks/security/OAR072NonOKModelResponseCheckTest.java index 976cbf19..d451e63c 100644 --- a/src/test/java/apiaddicts/sonar/openapi/checks/security/OAR072NonOKModelResponseCheckTest.java +++ b/src/test/java/apiaddicts/sonar/openapi/checks/security/OAR072NonOKModelResponseCheckTest.java @@ -14,6 +14,8 @@ public void init() { check = new OAR072NonOKModelResponseCheck(); v2Path = getV2Path("security"); v3Path = getV3Path("security"); + v31Path = getV31Path("security"); + v32Path = getV32Path("security"); } @Test @@ -30,11 +32,27 @@ public void verifyInV2NoStackTrace() { public void verifyInV3Compliant() { verifyV3("with-stack-trace"); } + @Test + public void verifyInV31Compliant() { + verifyV31("with-stack-trace"); + } + @Test + public void verifyInV32Compliant() { + verifyV32("with-stack-trace"); + } @Test public void verifyInV3WithStackTrace() { verifyV3("no-stack-trace"); } + @Test + public void verifyInV31WithStackTrace() { + verifyV31("no-stack-trace"); + } + @Test + public void verifyInV32WithStackTrace() { + verifyV32("no-stack-trace"); + } @Override public void verifyRule() { diff --git a/src/test/java/apiaddicts/sonar/openapi/checks/security/OAR074NumericParameterIntegrityCheckTest.java b/src/test/java/apiaddicts/sonar/openapi/checks/security/OAR074NumericParameterIntegrityCheckTest.java index ff7994d6..b72ae91f 100644 --- a/src/test/java/apiaddicts/sonar/openapi/checks/security/OAR074NumericParameterIntegrityCheckTest.java +++ b/src/test/java/apiaddicts/sonar/openapi/checks/security/OAR074NumericParameterIntegrityCheckTest.java @@ -14,6 +14,8 @@ public void init() { check = new OAR074NumericParameterIntegrityCheck(); v2Path = getV2Path("security"); v3Path = getV3Path("security"); + v31Path = getV31Path("security"); + v32Path = getV32Path("security"); } @Test @@ -30,11 +32,27 @@ public void verifyInV2noRestrictions() { public void verifyInV3withRestrictions() { verifyV3("with-restrictions"); } + @Test + public void verifyInV31withRestrictions() { + verifyV31("with-restrictions"); + } + @Test + public void verifyInV32withRestrictions() { + verifyV32("with-restrictions"); + } @Test public void verifyInV3noRestrictions() { verifyV3("no-restrictions"); } + @Test + public void verifyInV31noRestrictions() { + verifyV31("no-restrictions"); + } + @Test + public void verifyInV32noRestrictions() { + verifyV32("no-restrictions"); + } @Override public void verifyRule() { diff --git a/src/test/java/apiaddicts/sonar/openapi/checks/security/OAR075StringParameterIntegrityCheckTest.java b/src/test/java/apiaddicts/sonar/openapi/checks/security/OAR075StringParameterIntegrityCheckTest.java index 7f4723d7..35d3d780 100644 --- a/src/test/java/apiaddicts/sonar/openapi/checks/security/OAR075StringParameterIntegrityCheckTest.java +++ b/src/test/java/apiaddicts/sonar/openapi/checks/security/OAR075StringParameterIntegrityCheckTest.java @@ -15,6 +15,8 @@ public void init() { check = new OAR075StringParameterIntegrityCheck(); v2Path = getV2Path("security"); v3Path = getV3Path("security"); + v31Path = getV31Path("security"); + v32Path = getV32Path("security"); } @Test @@ -31,11 +33,27 @@ public void verifyInV2noRestrictions() { public void verifyInV3withRestrictions() { verifyV3("with-restrictions"); } + @Test + public void verifyInV31withRestrictions() { + verifyV31("with-restrictions"); + } + @Test + public void verifyInV32withRestrictions() { + verifyV32("with-restrictions"); + } @Test public void verifyInV3noRestrictions() { verifyV3("no-restrictions"); } + @Test + public void verifyInV31noRestrictions() { + verifyV31("no-restrictions"); + } + @Test + public void verifyInV32noRestrictions() { + verifyV32("no-restrictions"); + } @Override public void verifyParameters() { diff --git a/src/test/java/apiaddicts/sonar/openapi/checks/security/OAR076NumericFormatCheckTest.java b/src/test/java/apiaddicts/sonar/openapi/checks/security/OAR076NumericFormatCheckTest.java index e1b7468d..4ee87c58 100644 --- a/src/test/java/apiaddicts/sonar/openapi/checks/security/OAR076NumericFormatCheckTest.java +++ b/src/test/java/apiaddicts/sonar/openapi/checks/security/OAR076NumericFormatCheckTest.java @@ -14,6 +14,8 @@ public void init() { check = new OAR076NumericFormatCheck(); v2Path = getV2Path("security"); v3Path = getV3Path("security"); + v31Path = getV31Path("security"); + v32Path = getV32Path("security"); } @Test @@ -35,11 +37,27 @@ public void verifyInV2WithNested() { public void verifyInV3() { verifyV3("plain"); } + @Test + public void verifyInV31() { + verifyV31("plain"); + } + @Test + public void verifyInV32() { + verifyV32("plain"); + } @Test public void verifyInV3WithNested() { verifyV3("nested"); } + @Test + public void verifyInV31WithNested() { + verifyV31("nested"); + } + @Test + public void verifyInV32WithNested() { + verifyV32("nested"); + } @Test public void verifyInV3With$ref() { diff --git a/src/test/java/apiaddicts/sonar/openapi/checks/security/OAR078VerbsSecurityCheckTest.java b/src/test/java/apiaddicts/sonar/openapi/checks/security/OAR078VerbsSecurityCheckTest.java index 3712f645..ab5db038 100644 --- a/src/test/java/apiaddicts/sonar/openapi/checks/security/OAR078VerbsSecurityCheckTest.java +++ b/src/test/java/apiaddicts/sonar/openapi/checks/security/OAR078VerbsSecurityCheckTest.java @@ -14,6 +14,8 @@ public void init() { check = new OAR078VerbsSecurityCheck(); v2Path = getV2Path("security"); v3Path = getV3Path("security"); + v31Path = getV31Path("security"); + v32Path = getV32Path("security"); } @Test @@ -30,11 +32,27 @@ public void verifyInV2NoSecurity() { public void verifyInV3WithSecurity() { verifyV3("with-security"); } + @Test + public void verifyInV31WithSecurity() { + verifyV31("with-security"); + } + @Test + public void verifyInV32WithSecurity() { + verifyV32("with-security"); + } @Test public void verifyInV3NoSecurity() { verifyV3("no-security"); } + @Test + public void verifyInV31NoSecurity() { + verifyV31("no-security"); + } + @Test + public void verifyInV32NoSecurity() { + verifyV32("no-security"); + } @Override public void verifyRule() { diff --git a/src/test/java/apiaddicts/sonar/openapi/checks/security/OAR079PathParameter404CheckTest.java b/src/test/java/apiaddicts/sonar/openapi/checks/security/OAR079PathParameter404CheckTest.java index d621120d..852a9ca0 100644 --- a/src/test/java/apiaddicts/sonar/openapi/checks/security/OAR079PathParameter404CheckTest.java +++ b/src/test/java/apiaddicts/sonar/openapi/checks/security/OAR079PathParameter404CheckTest.java @@ -15,6 +15,8 @@ public void init() { check = new OAR079PathParameter404Check(); v2Path = getV2Path("security"); v3Path = getV3Path("security"); + v31Path = getV31Path("security"); + v32Path = getV32Path("security"); } @Test @@ -31,11 +33,27 @@ public void verifyInV2NoBadRequest() { public void verifyInV3BadRequest() { verifyV3("bad-request404"); } + @Test + public void verifyInV31BadRequest() { + verifyV31("bad-request404"); + } + @Test + public void verifyInV32BadRequest() { + verifyV32("bad-request404"); + } @Test public void verifyInV3NoBadRequest() { verifyV3("no-bad-request404"); } + @Test + public void verifyInV31NoBadRequest() { + verifyV31("no-bad-request404"); + } + @Test + public void verifyInV32NoBadRequest() { + verifyV32("no-bad-request404"); + } @Test public void verifyInV2NoParameters() { @@ -51,11 +69,27 @@ public void verifyInV2QueryParamOnly() { public void verifyInV3NoParameters() { verifyV3("no-parameters"); } + @Test + public void verifyInV31NoParameters() { + verifyV31("no-parameters"); + } + @Test + public void verifyInV32NoParameters() { + verifyV32("no-parameters"); + } @Test public void verifyInV3QueryParamOnly() { verifyV3("query-param-only"); } + @Test + public void verifyInV31QueryParamOnly() { + verifyV31("query-param-only"); + } + @Test + public void verifyInV32QueryParamOnly() { + verifyV32("query-param-only"); + } @Override public void verifyRule() { diff --git a/src/test/java/apiaddicts/sonar/openapi/checks/security/OAR081PasswordFormatCheckTest.java b/src/test/java/apiaddicts/sonar/openapi/checks/security/OAR081PasswordFormatCheckTest.java index 8bac7ac9..3354e4ee 100644 --- a/src/test/java/apiaddicts/sonar/openapi/checks/security/OAR081PasswordFormatCheckTest.java +++ b/src/test/java/apiaddicts/sonar/openapi/checks/security/OAR081PasswordFormatCheckTest.java @@ -14,6 +14,8 @@ public void init() { check = new OAR081PasswordFormatCheck(); v2Path = getV2Path("security"); v3Path = getV3Path("security"); + v31Path = getV31Path("security"); + v32Path = getV32Path("security"); } @Test @@ -30,10 +32,26 @@ public void verifyInV3notvalid() { verifyV3("not-valid-password"); } @Test + public void verifyInV31notvalid() { + verifyV31("not-valid-password"); + } + @Test + public void verifyInV32notvalid() { + verifyV32("not-valid-password"); + } + @Test public void verifyvalidV3() { verifyV3("valid-password"); } @Test + public void verifyvalidV31() { + verifyV31("valid-password"); + } + @Test + public void verifyvalidV32() { + verifyV32("valid-password"); + } + @Test public void verifyInV2Components() { verifyV2("valid-with-components"); } @@ -42,6 +60,14 @@ public void verifyInV2Components() { public void verifyInV3Components() { verifyV3("valid-with-components"); } + @Test + public void verifyInV31Components() { + verifyV31("valid-with-components"); + } + @Test + public void verifyInV32Components() { + verifyV32("valid-with-components"); + } @Override public void verifyRule() { diff --git a/src/test/java/apiaddicts/sonar/openapi/checks/security/OAR082BinaryOrByteFormatCheckTest.java b/src/test/java/apiaddicts/sonar/openapi/checks/security/OAR082BinaryOrByteFormatCheckTest.java index 11630b68..8efe8794 100644 --- a/src/test/java/apiaddicts/sonar/openapi/checks/security/OAR082BinaryOrByteFormatCheckTest.java +++ b/src/test/java/apiaddicts/sonar/openapi/checks/security/OAR082BinaryOrByteFormatCheckTest.java @@ -15,6 +15,8 @@ public void init() { check = new OAR082BinaryOrByteFormatCheck(); v2Path = getV2Path("security"); v3Path = getV3Path("security"); + v31Path = getV31Path("security"); + v32Path = getV32Path("security"); } @Test public void verifyvalidV2() { @@ -24,6 +26,14 @@ public void verifyvalidV2() { public void verifyvalidV3() { verifyV3("valid-format"); } + @Test + public void verifyvalidV31() { + verifyV31("valid-format"); + } + @Test + public void verifyvalidV32() { + verifyV32("valid-format"); + } @Override public void verifyRule() { diff --git a/src/test/java/apiaddicts/sonar/openapi/checks/security/OAR083ForbiddenQueryParamsCheckTest.java b/src/test/java/apiaddicts/sonar/openapi/checks/security/OAR083ForbiddenQueryParamsCheckTest.java index 9e6e6c72..feaa4291 100644 --- a/src/test/java/apiaddicts/sonar/openapi/checks/security/OAR083ForbiddenQueryParamsCheckTest.java +++ b/src/test/java/apiaddicts/sonar/openapi/checks/security/OAR083ForbiddenQueryParamsCheckTest.java @@ -15,6 +15,8 @@ public void init() { check = new OAR083ForbiddenQueryParamsCheck(); v2Path = getV2Path("security"); v3Path = getV3Path("security"); + v31Path = getV31Path("security"); + v32Path = getV32Path("security"); } @Test @@ -67,26 +69,66 @@ public void verifyInV2EmptyForbiddenQueryParams() { public void verifyInV3() { verifyV3("valid-query-params"); } + @Test + public void verifyInV31() { + verifyV31("valid-query-params"); + } + @Test + public void verifyInV32() { + verifyV32("valid-query-params"); + } @Test public void verifyInV3ForbiddenQueryParams() { verifyV3("forbidden-query-params"); } + @Test + public void verifyInV31ForbiddenQueryParams() { + verifyV31("forbidden-query-params"); + } + @Test + public void verifyInV32ForbiddenQueryParams() { + verifyV32("forbidden-query-params"); + } @Test public void verifyInV3NoParameters() { verifyV3("no-parameters"); } + @Test + public void verifyInV31NoParameters() { + verifyV31("no-parameters"); + } + @Test + public void verifyInV32NoParameters() { + verifyV32("no-parameters"); + } @Test public void verifyInV3NullNameParam() { verifyV3("null-name-param"); } + @Test + public void verifyInV31NullNameParam() { + verifyV31("null-name-param"); + } + @Test + public void verifyInV32NullNameParam() { + verifyV32("null-name-param"); + } @Test public void verifyInV3OptionsOperation() { verifyV3("options-operation"); } + @Test + public void verifyInV31OptionsOperation() { + verifyV31("options-operation"); + } + @Test + public void verifyInV32OptionsOperation() { + verifyV32("options-operation"); + } @Test public void verifyPathFilteringStrategiesInV3() { @@ -103,12 +145,28 @@ public void verifyPathFilteringStrategiesInV3() { c.pathsStr = "/other"; verifyV3("valid-query-params"); } + @Test + public void verifyPathFilteringStrategiesInV31() { + verifyV31("valid-query-params"); + } + @Test + public void verifyPathFilteringStrategiesInV32() { + verifyV32("valid-query-params"); + } @Test public void verifyInV3EmptyForbiddenQueryParams() { ((OAR083ForbiddenQueryParamsCheck) check).forbiddenQueryParamsStr = ""; verifyV3("valid-query-params"); } + @Test + public void verifyInV31EmptyForbiddenQueryParams() { + verifyV31("valid-query-params"); + } + @Test + public void verifyInV32EmptyForbiddenQueryParams() { + verifyV32("valid-query-params"); + } @Override public void verifyRule() { diff --git a/src/test/java/apiaddicts/sonar/openapi/checks/security/OAR084ForbiddenFormatsInQueryCheckTest.java b/src/test/java/apiaddicts/sonar/openapi/checks/security/OAR084ForbiddenFormatsInQueryCheckTest.java index bf863efc..023dba88 100644 --- a/src/test/java/apiaddicts/sonar/openapi/checks/security/OAR084ForbiddenFormatsInQueryCheckTest.java +++ b/src/test/java/apiaddicts/sonar/openapi/checks/security/OAR084ForbiddenFormatsInQueryCheckTest.java @@ -15,6 +15,8 @@ public void init() { check = new OAR084ForbiddenFormatsInQueryCheck(); v2Path = getV2Path("security"); v3Path = getV3Path("security"); + v31Path = getV31Path("security"); + v32Path = getV32Path("security"); } @Test @@ -67,26 +69,66 @@ public void verifyInV2EmptyForbiddenQueryFormats() { public void verifyInV3() { verifyV3("valid-query-formats"); } + @Test + public void verifyInV31() { + verifyV31("valid-query-formats"); + } + @Test + public void verifyInV32() { + verifyV32("valid-query-formats"); + } @Test public void verifyInV3ForbiddenQueryFormats() { verifyV3("forbidden-query-formats"); } + @Test + public void verifyInV31ForbiddenQueryFormats() { + verifyV31("forbidden-query-formats"); + } + @Test + public void verifyInV32ForbiddenQueryFormats() { + verifyV32("forbidden-query-formats"); + } @Test public void verifyInV3NoParameters() { verifyV3("no-parameters"); } + @Test + public void verifyInV31NoParameters() { + verifyV31("no-parameters"); + } + @Test + public void verifyInV32NoParameters() { + verifyV32("no-parameters"); + } @Test public void verifyInV3NonQueryParam() { verifyV3("non-query-param"); } + @Test + public void verifyInV31NonQueryParam() { + verifyV31("non-query-param"); + } + @Test + public void verifyInV32NonQueryParam() { + verifyV32("non-query-param"); + } @Test public void verifyInV3NullFormatParam() { verifyV3("null-format-param"); } + @Test + public void verifyInV31NullFormatParam() { + verifyV31("null-format-param"); + } + @Test + public void verifyInV32NullFormatParam() { + verifyV32("null-format-param"); + } @Test public void verifyPathFilteringStrategiesInV3() { @@ -102,12 +144,28 @@ public void verifyPathFilteringStrategiesInV3() { c.pathsStr = "/other"; verifyV3("valid-query-formats"); } + @Test + public void verifyPathFilteringStrategiesInV31() { + verifyV31("valid-query-formats"); + } + @Test + public void verifyPathFilteringStrategiesInV32() { + verifyV32("valid-query-formats"); + } @Test public void verifyInV3EmptyForbiddenQueryFormats() { ((OAR084ForbiddenFormatsInQueryCheck) check).forbiddenQueryFormatsStr = ""; verifyV3("valid-query-formats"); } + @Test + public void verifyInV31EmptyForbiddenQueryFormats() { + verifyV31("valid-query-formats"); + } + @Test + public void verifyInV32EmptyForbiddenQueryFormats() { + verifyV32("valid-query-formats"); + } @Override public void verifyRule() { diff --git a/src/test/java/apiaddicts/sonar/openapi/checks/security/OAR085OpenAPIVersionCheckTest.java b/src/test/java/apiaddicts/sonar/openapi/checks/security/OAR085OpenAPIVersionCheckTest.java index 34987eea..cf5e9875 100644 --- a/src/test/java/apiaddicts/sonar/openapi/checks/security/OAR085OpenAPIVersionCheckTest.java +++ b/src/test/java/apiaddicts/sonar/openapi/checks/security/OAR085OpenAPIVersionCheckTest.java @@ -16,6 +16,7 @@ public void init() { v2Path = getV2Path("security"); v3Path = getV3Path("security"); v31Path = getV31Path("security"); + v32Path = getV32Path("security"); } @Test @@ -32,15 +33,26 @@ public void verifyInvalidOpenApiVersionInV2() { public void verifyInV3() { verifyV3("valid-openapi-version"); } + @Test + public void verifyInV31() { + verifyV31("valid-openapi-version"); + } + @Test + public void verifyInV32() { + verifyV32("valid-openapi-version"); + } @Test public void verifyInvalidOpenApiVersionInV3() { verifyV3("invalid-openapi-version"); } - @Test - public void verifyInV31() { - verifyV31("valid-openapi-version.yaml"); + public void verifyInvalidOpenApiVersionInV31() { + verifyV31("invalid-openapi-version"); + } + @Test + public void verifyInvalidOpenApiVersionInV32() { + verifyV32("invalid-openapi-version"); } @Override diff --git a/src/test/java/apiaddicts/sonar/openapi/checks/security/OAR096ForbiddenResponseCheckTest.java b/src/test/java/apiaddicts/sonar/openapi/checks/security/OAR096ForbiddenResponseCheckTest.java index f921186a..7785ea2d 100644 --- a/src/test/java/apiaddicts/sonar/openapi/checks/security/OAR096ForbiddenResponseCheckTest.java +++ b/src/test/java/apiaddicts/sonar/openapi/checks/security/OAR096ForbiddenResponseCheckTest.java @@ -15,6 +15,8 @@ public void init() { check = new OAR096ForbiddenResponseCheck(); v2Path = getV2Path("security"); v3Path = getV3Path("security"); + v31Path = getV31Path("security"); + v32Path = getV32Path("security"); } @Test @@ -31,11 +33,27 @@ public void verifyInV2WithoutAuthorizationResponses() { public void verifyInV3() { verifyV3("valid"); } + @Test + public void verifyInV31() { + verifyV31("valid"); + } + @Test + public void verifyInV32() { + verifyV32("valid"); + } @Test public void verifyInV3WithoutAuthorizationResponses() { verifyV3("without-authorization-responses"); } + @Test + public void verifyInV31WithoutAuthorizationResponses() { + verifyV31("without-authorization-responses"); + } + @Test + public void verifyInV32WithoutAuthorizationResponses() { + verifyV32("without-authorization-responses"); + } @Override public void verifyParameters() { diff --git a/src/test/java/apiaddicts/sonar/openapi/checks/security/OAR114HttpResponseHeadersChecksTest.java b/src/test/java/apiaddicts/sonar/openapi/checks/security/OAR114HttpResponseHeadersChecksTest.java index d6f475c4..45f77caf 100644 --- a/src/test/java/apiaddicts/sonar/openapi/checks/security/OAR114HttpResponseHeadersChecksTest.java +++ b/src/test/java/apiaddicts/sonar/openapi/checks/security/OAR114HttpResponseHeadersChecksTest.java @@ -13,6 +13,8 @@ public void init() { check = new OAR114HttpResponseHeadersChecks(); v2Path = getV2Path("security"); v3Path = getV3Path("security"); + v31Path = getV31Path("security"); + v32Path = getV32Path("security"); } @Test @@ -34,16 +36,40 @@ public void verifyInV2WithoutRequiredParams() { public void verifyInV3() { verifyV3("valid"); } + @Test + public void verifyInV31() { + verifyV31("valid"); + } + @Test + public void verifyInV32() { + verifyV32("valid"); + } @Test public void verifyInV3WithForbiddenParams() { verifyV3("with-forbidden-params"); } + @Test + public void verifyInV31WithForbiddenParams() { + verifyV31("with-forbidden-params"); + } + @Test + public void verifyInV32WithForbiddenParams() { + verifyV32("with-forbidden-params"); + } @Test public void verifyInV3WithoutRequiredParams() { verifyV3("without-required-params"); } + @Test + public void verifyInV31WithoutRequiredParams() { + verifyV31("without-required-params"); + } + @Test + public void verifyInV32WithoutRequiredParams() { + verifyV32("without-required-params"); + } @Override public void verifyRule() { diff --git a/src/test/resources/checks/v3/core/OAR045/defined-response.json b/src/test/resources/checks/v3/core/OAR045/defined-response.json new file mode 100644 index 00000000..f86d6ac4 --- /dev/null +++ b/src/test/resources/checks/v3/core/OAR045/defined-response.json @@ -0,0 +1,78 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/pets": { + "get": { + "responses": { + "200": { + "description": "some response" // Noncompliant {{OAR045: Define the model of your response}} + }, + "202": { + "description": "some response", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + }, + "401": { // Noncompliant {{OAR045: Define the model of your response}} + "description": "error response", + "$ref": "#/components/responses/MyErroneousResponse" + } + } + }, + "post": { + "responses": {} // Noncompliant {{OAR045: Define the responses of your operations}} + }, + "put": { + "responses": { + "default": { + "description": "default response", + "content": { + "application/json": { + "schema": { + "type": "object" + } + } + } + }, + "200": { // Noncompliant {{OAR045: Define the model of your response}} + "description": "success response" + } + } + } + }, + "/other": { + "delete": { + "responses": { + "204": { + "description": "No content" + } + } + } + } + }, + "components": { + "responses": { + "MyErroneousResponse": { + "description": "an example response missing a model" + }, + "MyOtherResponse": { + "description": "some response", + "content": { + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } +} diff --git a/src/test/resources/checks/v3/core/OAR045/defined-response.yaml b/src/test/resources/checks/v3/core/OAR045/defined-response.yaml new file mode 100644 index 00000000..4370ac6c --- /dev/null +++ b/src/test/resources/checks/v3/core/OAR045/defined-response.yaml @@ -0,0 +1,48 @@ +openapi: 3.0.0 +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: + get: + responses: + # Noncompliant@+1 {{OAR045: Define the model of your response}} + '200': + description: some response + '202': + description: some response + content: + application/json: + schema: + type: string + '401': # Noncompliant {{OAR045: Define the model of your response}} + description: error response + $ref: '#/components/responses/MyErroneousResponse' + post: + # Noncompliant@+1 {{OAR045: Define the responses of your operations}} + responses: {} + put: + responses: + default: + description: default response + content: + application/json: + schema: + type: object + '200': # Noncompliant {{OAR045: Define the model of your response}} + description: success response + /other: + delete: + responses: + '204': + description: No content +components: + responses: + MyErroneousResponse: + description: an example response missing a model + MyOtherResponse: + description: some response + content: + application/json: + schema: + type: object diff --git a/src/test/resources/checks/v3/operations/OAR045/defined-response.json b/src/test/resources/checks/v3/operations/OAR045/defined-response.json new file mode 100644 index 00000000..f86d6ac4 --- /dev/null +++ b/src/test/resources/checks/v3/operations/OAR045/defined-response.json @@ -0,0 +1,78 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/pets": { + "get": { + "responses": { + "200": { + "description": "some response" // Noncompliant {{OAR045: Define the model of your response}} + }, + "202": { + "description": "some response", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + }, + "401": { // Noncompliant {{OAR045: Define the model of your response}} + "description": "error response", + "$ref": "#/components/responses/MyErroneousResponse" + } + } + }, + "post": { + "responses": {} // Noncompliant {{OAR045: Define the responses of your operations}} + }, + "put": { + "responses": { + "default": { + "description": "default response", + "content": { + "application/json": { + "schema": { + "type": "object" + } + } + } + }, + "200": { // Noncompliant {{OAR045: Define the model of your response}} + "description": "success response" + } + } + } + }, + "/other": { + "delete": { + "responses": { + "204": { + "description": "No content" + } + } + } + } + }, + "components": { + "responses": { + "MyErroneousResponse": { + "description": "an example response missing a model" + }, + "MyOtherResponse": { + "description": "some response", + "content": { + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } +} diff --git a/src/test/resources/checks/v3/operations/OAR045/defined-response.yaml b/src/test/resources/checks/v3/operations/OAR045/defined-response.yaml new file mode 100644 index 00000000..4370ac6c --- /dev/null +++ b/src/test/resources/checks/v3/operations/OAR045/defined-response.yaml @@ -0,0 +1,48 @@ +openapi: 3.0.0 +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: + get: + responses: + # Noncompliant@+1 {{OAR045: Define the model of your response}} + '200': + description: some response + '202': + description: some response + content: + application/json: + schema: + type: string + '401': # Noncompliant {{OAR045: Define the model of your response}} + description: error response + $ref: '#/components/responses/MyErroneousResponse' + post: + # Noncompliant@+1 {{OAR045: Define the responses of your operations}} + responses: {} + put: + responses: + default: + description: default response + content: + application/json: + schema: + type: object + '200': # Noncompliant {{OAR045: Define the model of your response}} + description: success response + /other: + delete: + responses: + '204': + description: No content +components: + responses: + MyErroneousResponse: + description: an example response missing a model + MyOtherResponse: + description: some response + content: + application/json: + schema: + type: object diff --git a/src/test/resources/checks/v3/security/OAR045/defined-response.json b/src/test/resources/checks/v3/security/OAR045/defined-response.json new file mode 100644 index 00000000..f86d6ac4 --- /dev/null +++ b/src/test/resources/checks/v3/security/OAR045/defined-response.json @@ -0,0 +1,78 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/pets": { + "get": { + "responses": { + "200": { + "description": "some response" // Noncompliant {{OAR045: Define the model of your response}} + }, + "202": { + "description": "some response", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + }, + "401": { // Noncompliant {{OAR045: Define the model of your response}} + "description": "error response", + "$ref": "#/components/responses/MyErroneousResponse" + } + } + }, + "post": { + "responses": {} // Noncompliant {{OAR045: Define the responses of your operations}} + }, + "put": { + "responses": { + "default": { + "description": "default response", + "content": { + "application/json": { + "schema": { + "type": "object" + } + } + } + }, + "200": { // Noncompliant {{OAR045: Define the model of your response}} + "description": "success response" + } + } + } + }, + "/other": { + "delete": { + "responses": { + "204": { + "description": "No content" + } + } + } + } + }, + "components": { + "responses": { + "MyErroneousResponse": { + "description": "an example response missing a model" + }, + "MyOtherResponse": { + "description": "some response", + "content": { + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } +} diff --git a/src/test/resources/checks/v3/security/OAR045/defined-response.yaml b/src/test/resources/checks/v3/security/OAR045/defined-response.yaml new file mode 100644 index 00000000..4370ac6c --- /dev/null +++ b/src/test/resources/checks/v3/security/OAR045/defined-response.yaml @@ -0,0 +1,48 @@ +openapi: 3.0.0 +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: + get: + responses: + # Noncompliant@+1 {{OAR045: Define the model of your response}} + '200': + description: some response + '202': + description: some response + content: + application/json: + schema: + type: string + '401': # Noncompliant {{OAR045: Define the model of your response}} + description: error response + $ref: '#/components/responses/MyErroneousResponse' + post: + # Noncompliant@+1 {{OAR045: Define the responses of your operations}} + responses: {} + put: + responses: + default: + description: default response + content: + application/json: + schema: + type: object + '200': # Noncompliant {{OAR045: Define the model of your response}} + description: success response + /other: + delete: + responses: + '204': + description: No content +components: + responses: + MyErroneousResponse: + description: an example response missing a model + MyOtherResponse: + description: some response + content: + application/json: + schema: + type: object diff --git a/src/test/resources/checks/v31/core/OAR044/media-type.json b/src/test/resources/checks/v31/core/OAR044/media-type.json new file mode 100644 index 00000000..992ea7bd --- /dev/null +++ b/src/test/resources/checks/v31/core/OAR044/media-type.json @@ -0,0 +1,45 @@ +{ + "openapi" : "3.0.1", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/pets" : { + "get" : { + "requestBody" : { + "content" : { + "application" : { }, # Noncompliant {{OAR044: Declared media type range should conform to RFC7231}} + "text/*" : { } + } + }, + "responses" : { + "200" : { + "description" : "some operation", + "content" : { + "application" : { } # Noncompliant {{OAR044: Declared media type range should conform to RFC7231}} + } + } + }, + "parameters" : [ { + "name" : "someParam", + "in" : "query", + "content" : { + "application" : { }, # Noncompliant {{OAR044: Declared mime type should conform to RFC6838}} + "text/plain" : { } + } + }, { + "name" : "otherParam", + "in" : "path" + } ] + }, + "post" : { + "responses" : { + "200" : { + "description" : "some operation" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/core/OAR044/media-type.yaml b/src/test/resources/checks/v31/core/OAR044/media-type.yaml new file mode 100644 index 00000000..80aba718 --- /dev/null +++ b/src/test/resources/checks/v31/core/OAR044/media-type.yaml @@ -0,0 +1,29 @@ +openapi: "3.0.1" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: + get: + requestBody: + content: + 'application': {} # Noncompliant {{OAR044: Declared media type range should conform to RFC7231}} +# ^^^^^^^^^^^^^ + 'text/*': {} + responses: + '200': + description: some operation + content: + 'application': {} # Noncompliant {{OAR044: Declared media type range should conform to RFC7231}} + parameters: + - name: someParam + in: query + content: + 'application': {} # Noncompliant {{OAR044: Declared mime type should conform to RFC6838}} + 'text/plain': {} # invalid (only 1 content allowed by spec), but should not be caught by this rule + - name: otherParam + in: path + post: + responses: + '200': + description: some operation diff --git a/src/test/resources/checks/v31/core/OAR045/defined-response.json b/src/test/resources/checks/v31/core/OAR045/defined-response.json new file mode 100644 index 00000000..f86d6ac4 --- /dev/null +++ b/src/test/resources/checks/v31/core/OAR045/defined-response.json @@ -0,0 +1,78 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/pets": { + "get": { + "responses": { + "200": { + "description": "some response" // Noncompliant {{OAR045: Define the model of your response}} + }, + "202": { + "description": "some response", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + }, + "401": { // Noncompliant {{OAR045: Define the model of your response}} + "description": "error response", + "$ref": "#/components/responses/MyErroneousResponse" + } + } + }, + "post": { + "responses": {} // Noncompliant {{OAR045: Define the responses of your operations}} + }, + "put": { + "responses": { + "default": { + "description": "default response", + "content": { + "application/json": { + "schema": { + "type": "object" + } + } + } + }, + "200": { // Noncompliant {{OAR045: Define the model of your response}} + "description": "success response" + } + } + } + }, + "/other": { + "delete": { + "responses": { + "204": { + "description": "No content" + } + } + } + } + }, + "components": { + "responses": { + "MyErroneousResponse": { + "description": "an example response missing a model" + }, + "MyOtherResponse": { + "description": "some response", + "content": { + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } +} diff --git a/src/test/resources/checks/v31/core/OAR045/defined-response.yaml b/src/test/resources/checks/v31/core/OAR045/defined-response.yaml new file mode 100644 index 00000000..4370ac6c --- /dev/null +++ b/src/test/resources/checks/v31/core/OAR045/defined-response.yaml @@ -0,0 +1,48 @@ +openapi: 3.0.0 +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: + get: + responses: + # Noncompliant@+1 {{OAR045: Define the model of your response}} + '200': + description: some response + '202': + description: some response + content: + application/json: + schema: + type: string + '401': # Noncompliant {{OAR045: Define the model of your response}} + description: error response + $ref: '#/components/responses/MyErroneousResponse' + post: + # Noncompliant@+1 {{OAR045: Define the responses of your operations}} + responses: {} + put: + responses: + default: + description: default response + content: + application/json: + schema: + type: object + '200': # Noncompliant {{OAR045: Define the model of your response}} + description: success response + /other: + delete: + responses: + '204': + description: No content +components: + responses: + MyErroneousResponse: + description: an example response missing a model + MyOtherResponse: + description: some response + content: + application/json: + schema: + type: object diff --git a/src/test/resources/checks/v31/core/OAR046/declared-tag.json b/src/test/resources/checks/v31/core/OAR046/declared-tag.json new file mode 100644 index 00000000..82549a89 --- /dev/null +++ b/src/test/resources/checks/v31/core/OAR046/declared-tag.json @@ -0,0 +1,26 @@ +{ + "openapi" : "3.0.1", + "tags" : [ { + "name" : "used-tag", + "description" : "a tag referenced in the operations" + } ], + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/pets" : { + "get" : { + "tags" : [ "used-tag" ], + "responses" : { } + }, + "post" : { # Noncompliant {{OAR046: Associate a tag to this operation}} + "responses" : { + "default" : { + "description" : "the default response" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/core/OAR046/declared-tag.yaml b/src/test/resources/checks/v31/core/OAR046/declared-tag.yaml new file mode 100644 index 00000000..2bf092e6 --- /dev/null +++ b/src/test/resources/checks/v31/core/OAR046/declared-tag.yaml @@ -0,0 +1,17 @@ +openapi: "3.0.1" +tags: +- name: used-tag + description: a tag referenced in the operations +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: + get: + tags: + - used-tag + responses: {} + post: # Noncompliant {{OAR046: Associate a tag to this operation}} + responses: + default: + description: the default response \ No newline at end of file diff --git a/src/test/resources/checks/v31/core/OAR047/documented-tag.json b/src/test/resources/checks/v31/core/OAR047/documented-tag.json new file mode 100644 index 00000000..12326a3a --- /dev/null +++ b/src/test/resources/checks/v31/core/OAR047/documented-tag.json @@ -0,0 +1,24 @@ +{ + "openapi" : "3.0.1", + "tags" : [ { + "name" : "used-tag", + "description" : "a tag referenced in the operations" + }, { + "name" : "undescribed-tag" # Noncompliant {{OAR047: Add a short description to this tag}} + }, { + "name" : "used-tag", # Noncompliant [[secondary=-3]] {{OAR047: Remove this duplicate tag}} + "description" : "another description" + } ], + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/pets" : { + "get" : { + "tags" : [ "used-tag", "undescribed-tag", "unlisted-tag" ], # Noncompliant {{OAR047: This tag should be declared in the tags section of the contract}} + "responses" : { } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/core/OAR047/documented-tag.yaml b/src/test/resources/checks/v31/core/OAR047/documented-tag.yaml new file mode 100644 index 00000000..197ffd50 --- /dev/null +++ b/src/test/resources/checks/v31/core/OAR047/documented-tag.yaml @@ -0,0 +1,18 @@ +openapi: "3.0.1" +tags: +- name: used-tag + description: a tag referenced in the operations +- name: undescribed-tag # Noncompliant {{OAR047: Add a short description to this tag}} +- name: used-tag # Noncompliant [[secondary=-3]] {{OAR047: Remove this duplicate tag}} + description: another description +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: + get: + tags: + - used-tag + - undescribed-tag + - unlisted-tag # Noncompliant {{OAR047: This tag should be declared in the tags section of the contract}} + responses: {} diff --git a/src/test/resources/checks/v31/core/OAR049/no-content-in-204.json b/src/test/resources/checks/v31/core/OAR049/no-content-in-204.json new file mode 100644 index 00000000..c27c9ad6 --- /dev/null +++ b/src/test/resources/checks/v31/core/OAR049/no-content-in-204.json @@ -0,0 +1,25 @@ +{ + "openapi" : "3.0.1", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/other-pets/{petId}" : { + "delete" : { + "responses" : { + "204" : { # Noncompliant {{OAR049: 204 No Content MUST NOT return anything}} + "description" : "delete pet", + "content" : { + "application/json" : { + "schema" : { + "type" : "object" + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/core/OAR049/no-content-in-204.yaml b/src/test/resources/checks/v31/core/OAR049/no-content-in-204.yaml new file mode 100644 index 00000000..8567c679 --- /dev/null +++ b/src/test/resources/checks/v31/core/OAR049/no-content-in-204.yaml @@ -0,0 +1,14 @@ +openapi: "3.0.1" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /other-pets/{petId}: + delete: + responses: + '204': # Noncompliant {{OAR049: 204 No Content MUST NOT return anything}} + description: delete pet + content: + 'application/json': + schema: + type: object diff --git a/src/test/resources/checks/v31/core/OAR050/provide-summary.json b/src/test/resources/checks/v31/core/OAR050/provide-summary.json new file mode 100644 index 00000000..a5b45a2a --- /dev/null +++ b/src/test/resources/checks/v31/core/OAR050/provide-summary.json @@ -0,0 +1,26 @@ +{ + "openapi" : "3.0.1", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/pets" : { + "post" : { # Noncompliant {{OAR050: Provide a summary for each operation}} + "responses" : { + "default" : { + "description" : "the default response" + } + } + }, + "get" : { + "summary" : "list all pets", + "responses" : { + "default" : { + "description" : "the default response" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/core/OAR050/provide-summary.yaml b/src/test/resources/checks/v31/core/OAR050/provide-summary.yaml new file mode 100644 index 00000000..8d19ba90 --- /dev/null +++ b/src/test/resources/checks/v31/core/OAR050/provide-summary.yaml @@ -0,0 +1,15 @@ +openapi: "3.0.1" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: + post: # Noncompliant {{OAR050: Provide a summary for each operation}} + responses: + default: + description: the default response + get: + summary: list all pets + responses: + default: + description: the default response \ No newline at end of file diff --git a/src/test/resources/checks/v31/core/OAR051/different-description.json b/src/test/resources/checks/v31/core/OAR051/different-description.json new file mode 100644 index 00000000..784c6b8b --- /dev/null +++ b/src/test/resources/checks/v31/core/OAR051/different-description.json @@ -0,0 +1,30 @@ +{ + "openapi" : "3.0.1", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/pets" : { + "post" : { + "summary" : "create a pet", + "description" : "Create a new pet. The pet type is assigned a new unique ID, and can then be referenced in other operations.", + "responses" : { + "default" : { + "description" : "the default response" + } + } + }, + "get" : { + "summary" : "list all pets", + # Noncompliant@+1 {{OAR051: Description must differ from summary}} + "description" : "List all pets", + "responses" : { + "default" : { + "description" : "the default response" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/core/OAR051/different-description.yaml b/src/test/resources/checks/v31/core/OAR051/different-description.yaml new file mode 100644 index 00000000..600efaff --- /dev/null +++ b/src/test/resources/checks/v31/core/OAR051/different-description.yaml @@ -0,0 +1,21 @@ +openapi: "3.0.1" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: + post: + summary: create a pet + description: Create a new pet. The pet type is assigned a new unique ID, and can then be referenced in other + operations. + responses: + default: + description: the default response + get: + summary: list all pets + # Noncompliant@+1 {{OAR051: Description must differ from summary}} + description: List all pets +# ^^^^^^^^^^^ + responses: + default: + description: the default response \ No newline at end of file diff --git a/src/test/resources/checks/v31/examples/OAR094/externalref.yaml b/src/test/resources/checks/v31/examples/OAR094/externalref.yaml new file mode 100644 index 00000000..d750e57a --- /dev/null +++ b/src/test/resources/checks/v31/examples/OAR094/externalref.yaml @@ -0,0 +1,62 @@ +openapi: 3.0.1 +info: + title: Sample-API_efc2b9f76813_V + contact: + name: Nombre del Contacto. + email: contact@mail.com + version: 1.0.12 +servers: + - url: https://api.example.es/api-sample/v1 +paths: + /datos-usuarios: + get: + summary: Listado de usuarios + parameters: + - name: desde + in: query + schema: + type: string + format: date + required: false + - name: hasta + in: query + schema: + type: string + format: date + required: false + responses: + '200': + description: OK. + headers: + X-Correlation-Id: + description: Cabecera 'X-Correlation-Id' + schema: + type: string + content: + application/json: + schema: + $ref: >- # Noncompliant {{OAR094: It is recommended to use examples instead of example as some tools like microcks use this section of the definition}} + https://raw.githubusercontent.com/apiaddicts/sonaropenapi-rules/refs/heads/master/src/test/resources/externalRef/OAR094.yaml#/components/schemas/Pet + '400': + description: Bad Request. + headers: + X-Correlation-Id: + description: Cabecera 'X-Correlation-Id' + schema: + type: string + content: + application/json: + schema: + $ref: >- # Noncompliant {{OAR094: It is recommended to use examples instead of example as some tools like microcks use this section of the definition}} + https://raw.githubusercontent.com/apiaddicts/sonaropenapi-rules/refs/heads/master/src/test/resources/externalRef/OAR094.yaml#/components/schemas/ErrorMessage + example: # Noncompliant {{OAR094: It is recommended to use examples instead of example as some tools like microcks use this section of the definition}} + error: + status: '400' + message: Bad Request + path: /datos-usuario + type: https://docs.example.es/x/A1D8Aw + operationId: '10004' + errors: + - code: '101' + message: Invalid format + location: desde \ No newline at end of file diff --git a/src/test/resources/checks/v31/examples/OAR094/invalid-example.json b/src/test/resources/checks/v31/examples/OAR094/invalid-example.json new file mode 100644 index 00000000..70dc0305 --- /dev/null +++ b/src/test/resources/checks/v31/examples/OAR094/invalid-example.json @@ -0,0 +1,54 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "API con Example", + "version": "1.0.0" + }, + "paths": { + "/pets": { + "get": { + "summary": "Devuelve una lista de mascotas", + "responses": { + "200": { + "description": "Lista exitosa de mascotas", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Pet" + } + }, + "example": [ # Noncompliant {{OAR094: It is recommended to use examples instead of example as some tools like microcks use this section of the definition}} + { + "name": "Whiskers", + "animalType": "Cat" + }, + { + "name": "Daisy", + "animalType": "Dog" + } + ] + } + } + } + } + } + } + }, + "components": { + "schemas": { + "Pet": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "animalType": { + "type": "string" + } + } + } + } + } + } \ No newline at end of file diff --git a/src/test/resources/checks/v31/examples/OAR094/invalid-example.yaml b/src/test/resources/checks/v31/examples/OAR094/invalid-example.yaml new file mode 100644 index 00000000..31628bcd --- /dev/null +++ b/src/test/resources/checks/v31/examples/OAR094/invalid-example.yaml @@ -0,0 +1,31 @@ +openapi: 3.0.0 +info: + title: API con Example + version: 1.0.0 +paths: + /pets: + get: + summary: Devuelve una lista de mascotas + responses: + '200': + description: Lista exitosa de mascotas + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Pet' + example: # Noncompliant {{OAR094: It is recommended to use examples instead of example as some tools like microcks use this section of the definition}} + - name: Whiskers + animalType: Cat + - name: Daisy + animalType: Dog +components: + schemas: + Pet: + type: object + properties: + name: + type: string + animalType: + type: string \ No newline at end of file diff --git a/src/test/resources/checks/v31/examples/OAR094/valid-example.json b/src/test/resources/checks/v31/examples/OAR094/valid-example.json new file mode 100644 index 00000000..c1cc5b38 --- /dev/null +++ b/src/test/resources/checks/v31/examples/OAR094/valid-example.json @@ -0,0 +1,62 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "API con Examples", + "version": "1.0.0" + }, + "paths": { + "/pets": { + "get": { + "summary": "Devuelve una lista de mascotas", + "responses": { + "200": { + "description": "Lista exitosa de mascotas", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Pet" + } + }, + "examples": { + "catExample": { + "value": [ + { + "name": "Whiskers", + "animalType": "Cat" + } + ] + }, + "dogExample": { + "value": [ + { + "name": "Daisy", + "animalType": "Dog" + } + ] + } + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "Pet": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "animalType": { + "type": "string" + } + } + } + } + } + } \ No newline at end of file diff --git a/src/test/resources/checks/v31/examples/OAR094/valid-example.yaml b/src/test/resources/checks/v31/examples/OAR094/valid-example.yaml new file mode 100644 index 00000000..ab2b5d5a --- /dev/null +++ b/src/test/resources/checks/v31/examples/OAR094/valid-example.yaml @@ -0,0 +1,35 @@ +openapi: 3.0.0 +info: + title: API con Examples + version: 1.0.0 +paths: + /pets: + get: + summary: Devuelve una lista de mascotas + responses: + '200': + description: Lista exitosa de mascotas + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Pet' + examples: + catExample: + value: + - name: Whiskers + animalType: Cat + dogExample: + value: + - name: Daisy + animalType: Dog +components: + schemas: + Pet: + type: object + properties: + name: + type: string + animalType: + type: string \ No newline at end of file diff --git a/src/test/resources/checks/v31/format/OAR006/without-anything.json b/src/test/resources/checks/v31/format/OAR006/without-anything.json new file mode 100644 index 00000000..e7eb8518 --- /dev/null +++ b/src/test/resources/checks/v31/format/OAR006/without-anything.json @@ -0,0 +1,18 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/pets": { + "post": { # Noncompliant {{OAR006: Section requestBody is mandatory}} + "responses": { + "200": { + "description": "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/format/OAR006/without-anything.yaml b/src/test/resources/checks/v31/format/OAR006/without-anything.yaml new file mode 100644 index 00000000..88d684f0 --- /dev/null +++ b/src/test/resources/checks/v31/format/OAR006/without-anything.yaml @@ -0,0 +1,10 @@ +openapi: 3.0.0 +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: + post: # Noncompliant {{OAR006: Section requestBody is mandatory}} + responses: + 200: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v31/format/OAR007/without-anything.json b/src/test/resources/checks/v31/format/OAR007/without-anything.json new file mode 100644 index 00000000..805f9d37 --- /dev/null +++ b/src/test/resources/checks/v31/format/OAR007/without-anything.json @@ -0,0 +1,18 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/pets": { + "get": { + "responses": { + "200": { # Noncompliant {{OAR007: Section content is mandatory}} + "description": "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/format/OAR007/without-anything.yaml b/src/test/resources/checks/v31/format/OAR007/without-anything.yaml new file mode 100644 index 00000000..ad6533a3 --- /dev/null +++ b/src/test/resources/checks/v31/format/OAR007/without-anything.yaml @@ -0,0 +1,10 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: + get: + responses: + 200: # Noncompliant {{OAR007: Section content is mandatory}} + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v31/format/OAR009/operation-not-allows-request-body.json b/src/test/resources/checks/v31/format/OAR009/operation-not-allows-request-body.json new file mode 100644 index 00000000..87c3e35c --- /dev/null +++ b/src/test/resources/checks/v31/format/OAR009/operation-not-allows-request-body.json @@ -0,0 +1,23 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/pets": { + "get": { # Noncompliant {{OAR009: requestBody not allowed with operation 'GET'}} + "requestBody": { + "content": { + "application/json": {} + } + }, + "responses": { + "200": { + "description": "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/format/OAR009/operation-not-allows-request-body.yaml b/src/test/resources/checks/v31/format/OAR009/operation-not-allows-request-body.yaml new file mode 100644 index 00000000..7a0f59fa --- /dev/null +++ b/src/test/resources/checks/v31/format/OAR009/operation-not-allows-request-body.yaml @@ -0,0 +1,14 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore + +paths: + /pets: + get: # Noncompliant {{OAR009: requestBody not allowed with operation 'GET'}} + requestBody: + content: + application/json: {} + responses: + 200: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v31/format/OAR009/with-default-and-$ref.json b/src/test/resources/checks/v31/format/OAR009/with-default-and-$ref.json new file mode 100644 index 00000000..55f22b21 --- /dev/null +++ b/src/test/resources/checks/v31/format/OAR009/with-default-and-$ref.json @@ -0,0 +1,43 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "components": { + "requestBodies": { + "PetsPostRequest": { + "content": { + "application/json": {}, + "application/xml": {} + } + } + } + }, + "paths": { + "/pets": { + "post": { + "requestBody": { + "$ref": "#/components/requestBodies/PetsPostRequest" + }, + "responses": { + "200": { + "description": "Ok" + } + } + }, + "put": { + "requestBody": { + "content": { + "application/json": {} + } + }, + "responses": { + "200": { + "description": "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/format/OAR009/with-default-and-$ref.yaml b/src/test/resources/checks/v31/format/OAR009/with-default-and-$ref.yaml new file mode 100644 index 00000000..19eb54b9 --- /dev/null +++ b/src/test/resources/checks/v31/format/OAR009/with-default-and-$ref.yaml @@ -0,0 +1,25 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +components: + requestBodies: + PetsPostRequest: + content: + application/json: {} + application/xml: {} +paths: + /pets: + post: + requestBody: + $ref: '#/components/requestBodies/PetsPostRequest' + responses: + 200: + description: Ok + put: + requestBody: + content: + application/json: {} + responses: + 200: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v31/format/OAR009/with-default-and-specific.json b/src/test/resources/checks/v31/format/OAR009/with-default-and-specific.json new file mode 100644 index 00000000..5c1ec6af --- /dev/null +++ b/src/test/resources/checks/v31/format/OAR009/with-default-and-specific.json @@ -0,0 +1,38 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/pets": { + "post": { + "requestBody": { + "content": { # Noncompliant {{OAR009: Should indicate the default request media type}} + "application/xml": {} + } + }, + "responses": { + "200": { + "description": "Ok" + } + } + } + }, + "/owners": { + "post": { + "requestBody": { + "content": { + "application/xml": {}, + "application/json": {} + } + }, + "responses": { + "200": { + "description": "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/format/OAR009/with-default-and-specific.yaml b/src/test/resources/checks/v31/format/OAR009/with-default-and-specific.yaml new file mode 100644 index 00000000..7cb1533a --- /dev/null +++ b/src/test/resources/checks/v31/format/OAR009/with-default-and-specific.yaml @@ -0,0 +1,22 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: + post: + requestBody: + content: # Noncompliant {{OAR009: Should indicate the default request media type}} + application/xml: {} + responses: + 200: + description: Ok + /owners: + post: + requestBody: + content: + application/xml: {} + application/json: {} + responses: + 200: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v31/format/OAR009/with-specific.json b/src/test/resources/checks/v31/format/OAR009/with-specific.json new file mode 100644 index 00000000..e2f86e06 --- /dev/null +++ b/src/test/resources/checks/v31/format/OAR009/with-specific.json @@ -0,0 +1,37 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/pets": { + "post": { + "requestBody": { + "content": { + "application/json": {} + } + }, + "responses": { + "200": { + "description": "Ok" + } + } + } + }, + "/owners": { + "post": { + "requestBody": { + "content": { # Noncompliant {{OAR009: Should indicate the default request media type}} + "application/xml": {} + } + }, + "responses": { + "200": { + "description": "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/format/OAR009/with-specific.yaml b/src/test/resources/checks/v31/format/OAR009/with-specific.yaml new file mode 100644 index 00000000..8275c170 --- /dev/null +++ b/src/test/resources/checks/v31/format/OAR009/with-specific.yaml @@ -0,0 +1,22 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore + +paths: + /pets: + post: + requestBody: + content: + application/json: {} + responses: + 200: + description: Ok + /owners: + post: + requestBody: + content: # Noncompliant {{OAR009: Should indicate the default request media type}} + application/xml: {} + responses: + 200: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v31/format/OAR009/with-wrong-default-and-specific.json b/src/test/resources/checks/v31/format/OAR009/with-wrong-default-and-specific.json new file mode 100644 index 00000000..717e2ce1 --- /dev/null +++ b/src/test/resources/checks/v31/format/OAR009/with-wrong-default-and-specific.json @@ -0,0 +1,37 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/pets": { + "post": { + "requestBody": { + "content": { # Noncompliant {{OAR009: Should indicate the default request media type}} + "application/xml": {} + } + }, + "responses": { + "200": { + "description": "Ok" + } + } + } + }, + "/owners": { + "post": { + "requestBody": { + "content": { # Noncompliant {{OAR009: Should indicate the default request media type}} + "application/text": {} + } + }, + "responses": { + "200": { + "description": "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/format/OAR009/with-wrong-default-and-specific.yaml b/src/test/resources/checks/v31/format/OAR009/with-wrong-default-and-specific.yaml new file mode 100644 index 00000000..5f5a2c42 --- /dev/null +++ b/src/test/resources/checks/v31/format/OAR009/with-wrong-default-and-specific.yaml @@ -0,0 +1,21 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: + post: + requestBody: + content: # Noncompliant {{OAR009: Should indicate the default request media type}} + application/xml: {} + responses: + 200: + description: Ok + /owners: + post: + requestBody: + content: # Noncompliant {{OAR009: Should indicate the default request media type}} + application/text: {} + responses: + 200: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v31/format/OAR009/with-wrong-default.json b/src/test/resources/checks/v31/format/OAR009/with-wrong-default.json new file mode 100644 index 00000000..8858d3f7 --- /dev/null +++ b/src/test/resources/checks/v31/format/OAR009/with-wrong-default.json @@ -0,0 +1,23 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/pets": { + "post": { + "requestBody": { + "content": { # Noncompliant {{OAR009: Should indicate the default request media type}} + "application/text": {} + } + }, + "responses": { + "200": { + "description": "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/format/OAR009/with-wrong-default.yaml b/src/test/resources/checks/v31/format/OAR009/with-wrong-default.yaml new file mode 100644 index 00000000..d318d68c --- /dev/null +++ b/src/test/resources/checks/v31/format/OAR009/with-wrong-default.yaml @@ -0,0 +1,13 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: + post: + requestBody: + content: # Noncompliant {{OAR009: Should indicate the default request media type}} + application/text: {} + responses: + 200: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v31/format/OAR009/without-anything.json b/src/test/resources/checks/v31/format/OAR009/without-anything.json new file mode 100644 index 00000000..75ad9f22 --- /dev/null +++ b/src/test/resources/checks/v31/format/OAR009/without-anything.json @@ -0,0 +1,18 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/pets": { + "post": { # Noncompliant {{OAR009: Should indicate the default request media type}} + "responses": { + "200": { + "description": "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/format/OAR009/without-anything.yaml b/src/test/resources/checks/v31/format/OAR009/without-anything.yaml new file mode 100644 index 00000000..a7e26847 --- /dev/null +++ b/src/test/resources/checks/v31/format/OAR009/without-anything.yaml @@ -0,0 +1,10 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: + post: # Noncompliant {{OAR009: Should indicate the default request media type}} + responses: + 200: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v31/format/OAR010/with-default-and-$ref.json b/src/test/resources/checks/v31/format/OAR010/with-default-and-$ref.json new file mode 100644 index 00000000..93c56075 --- /dev/null +++ b/src/test/resources/checks/v31/format/OAR010/with-default-and-$ref.json @@ -0,0 +1,29 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "components": { + "responses": { + "PetsResponse": { + "description": "OK", + "content": { + "application/json": {}, + "application/xml": {} + } + } + } + }, + "paths": { + "/pets": { + "get": { + "responses": { + "200": { + "$ref": "#/components/responses/PetsResponse" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/format/OAR010/with-default-and-$ref.yaml b/src/test/resources/checks/v31/format/OAR010/with-default-and-$ref.yaml new file mode 100644 index 00000000..37260cd9 --- /dev/null +++ b/src/test/resources/checks/v31/format/OAR010/with-default-and-$ref.yaml @@ -0,0 +1,17 @@ +openapi: 3.0.0 +info: + version: 1.0.0 + title: Swagger Petstore +components: + responses: + PetsResponse: + description: OK + content: + application/json: {} + application/xml: {} +paths: + /pets: + get: + responses: + '200': + $ref: '#/components/responses/PetsResponse' diff --git a/src/test/resources/checks/v31/format/OAR010/with-default-and-specific.json b/src/test/resources/checks/v31/format/OAR010/with-default-and-specific.json new file mode 100644 index 00000000..714dc3e9 --- /dev/null +++ b/src/test/resources/checks/v31/format/OAR010/with-default-and-specific.json @@ -0,0 +1,34 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/pets": { + "get": { + "responses": { + "200": { + "description": "Ok", + "content": { # Noncompliant {{OAR010: Should indicate the default response media type}} + "application/xml": {} + } + } + } + } + }, + "/owners": { + "get": { + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": {}, + "application/xml": {} + } + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/format/OAR010/with-default-and-specific.yaml b/src/test/resources/checks/v31/format/OAR010/with-default-and-specific.yaml new file mode 100644 index 00000000..1059a75d --- /dev/null +++ b/src/test/resources/checks/v31/format/OAR010/with-default-and-specific.yaml @@ -0,0 +1,20 @@ +openapi: 3.0.0 +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: + get: + responses: + '200': + description: Ok + content: # Noncompliant {{OAR010: Should indicate the default response media type}} + application/xml: {} + /owners: + get: + responses: + '200': + description: Ok + content: + application/json: {} + application/xml: {} \ No newline at end of file diff --git a/src/test/resources/checks/v31/format/OAR010/with-specific.json b/src/test/resources/checks/v31/format/OAR010/with-specific.json new file mode 100644 index 00000000..59a2ee24 --- /dev/null +++ b/src/test/resources/checks/v31/format/OAR010/with-specific.json @@ -0,0 +1,33 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/pets": { + "get": { + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": {} + } + } + } + } + }, + "/owners": { + "get": { + "responses": { + "200": { + "description": "Ok", + "content": { # Noncompliant {{OAR010: Should indicate the default response media type}} + "application/xml": {} + } + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/format/OAR010/with-specific.yaml b/src/test/resources/checks/v31/format/OAR010/with-specific.yaml new file mode 100644 index 00000000..0026c70d --- /dev/null +++ b/src/test/resources/checks/v31/format/OAR010/with-specific.yaml @@ -0,0 +1,20 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore + +paths: + /pets: + get: + responses: + 200: + description: Ok + content: + application/json: {} + /owners: + get: + responses: + 200: + description: Ok + content: # Noncompliant {{OAR010: Should indicate the default response media type}} + application/xml: {} \ No newline at end of file diff --git a/src/test/resources/checks/v31/format/OAR010/with-wrong-default-and-specific.json b/src/test/resources/checks/v31/format/OAR010/with-wrong-default-and-specific.json new file mode 100644 index 00000000..fb05f275 --- /dev/null +++ b/src/test/resources/checks/v31/format/OAR010/with-wrong-default-and-specific.json @@ -0,0 +1,33 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/pets": { + "get": { + "responses": { + "200": { + "description": "Ok", + "content": { # Noncompliant {{OAR010: Should indicate the default response media type}} + "application/xml": {} + } + } + } + } + }, + "/owners": { + "get": { + "responses": { + "200": { + "description": "Ok", + "content": { # Noncompliant {{OAR010: Should indicate the default response media type}} + "application/text": {} + } + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/format/OAR010/with-wrong-default-and-specific.yaml b/src/test/resources/checks/v31/format/OAR010/with-wrong-default-and-specific.yaml new file mode 100644 index 00000000..561511e4 --- /dev/null +++ b/src/test/resources/checks/v31/format/OAR010/with-wrong-default-and-specific.yaml @@ -0,0 +1,19 @@ +openapi: 3.0.0 +info: + version: 1.0.0 + title: Swagger Petstore +paths: + "/pets": + get: + responses: + '200': + description: Ok + content: # Noncompliant {{OAR010: Should indicate the default response media type}} + application/xml: {} + "/owners": + get: + responses: + '200': + description: Ok + content: # Noncompliant {{OAR010: Should indicate the default response media type}} + application/text: {} \ No newline at end of file diff --git a/src/test/resources/checks/v31/format/OAR010/with-wrong-default.json b/src/test/resources/checks/v31/format/OAR010/with-wrong-default.json new file mode 100644 index 00000000..345e4ba0 --- /dev/null +++ b/src/test/resources/checks/v31/format/OAR010/with-wrong-default.json @@ -0,0 +1,21 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/pets": { + "get": { + "responses": { + "200": { + "description": "Ok", + "content": { # Noncompliant {{OAR010: Should indicate the default response media type}} + "application/text": {} + } + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/format/OAR010/with-wrong-default.yaml b/src/test/resources/checks/v31/format/OAR010/with-wrong-default.yaml new file mode 100644 index 00000000..d0513d3e --- /dev/null +++ b/src/test/resources/checks/v31/format/OAR010/with-wrong-default.yaml @@ -0,0 +1,12 @@ +openapi: 3.0.0 +info: + version: 1.0.0 + title: Swagger Petstore +paths: + "/pets": + get: + responses: + '200': + description: Ok + content: # Noncompliant {{OAR010: Should indicate the default response media type}} + application/text: {} \ No newline at end of file diff --git a/src/test/resources/checks/v31/format/OAR010/without-anything.json b/src/test/resources/checks/v31/format/OAR010/without-anything.json new file mode 100644 index 00000000..fe401526 --- /dev/null +++ b/src/test/resources/checks/v31/format/OAR010/without-anything.json @@ -0,0 +1,18 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/pets": { + "get": { + "responses": { + "200": { # Noncompliant {{OAR010: Should indicate the default response media type}} + "description": "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/format/OAR010/without-anything.yaml b/src/test/resources/checks/v31/format/OAR010/without-anything.yaml new file mode 100644 index 00000000..2a4bf55e --- /dev/null +++ b/src/test/resources/checks/v31/format/OAR010/without-anything.yaml @@ -0,0 +1,10 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: + get: + responses: + 200: # Noncompliant {{OAR010: Should indicate the default response media type}} + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v31/format/OAR011/base-path-ok.json b/src/test/resources/checks/v31/format/OAR011/base-path-ok.json new file mode 100644 index 00000000..56dd4fa1 --- /dev/null +++ b/src/test/resources/checks/v31/format/OAR011/base-path-ok.json @@ -0,0 +1,13 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "servers" : [ + { + "url": "https://petstore.swagger.io/api-store/v1" + } + ], + "paths": {} +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/format/OAR011/base-path-ok.yaml b/src/test/resources/checks/v31/format/OAR011/base-path-ok.yaml new file mode 100644 index 00000000..6e24d7c7 --- /dev/null +++ b/src/test/resources/checks/v31/format/OAR011/base-path-ok.yaml @@ -0,0 +1,7 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +servers: + - url: https://petstore.swagger.io/api-store/v1 +paths: {} \ No newline at end of file diff --git a/src/test/resources/checks/v31/format/OAR011/base-path-wrong.json b/src/test/resources/checks/v31/format/OAR011/base-path-wrong.json new file mode 100644 index 00000000..535e82b4 --- /dev/null +++ b/src/test/resources/checks/v31/format/OAR011/base-path-wrong.json @@ -0,0 +1,13 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "servers" : [ + { + "url": "https://petstore.swagger.io/APIStore/v1" # Noncompliant {{OAR011: The base path and resource names with more than two words must be compliant with the standard naming convention: kebab-case}} + } + ], + "paths": {} +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/format/OAR011/base-path-wrong.yaml b/src/test/resources/checks/v31/format/OAR011/base-path-wrong.yaml new file mode 100644 index 00000000..6833d3fc --- /dev/null +++ b/src/test/resources/checks/v31/format/OAR011/base-path-wrong.yaml @@ -0,0 +1,7 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +servers: + - url: https://petstore.swagger.io/APIStore/v1 # Noncompliant {{OAR011: The base path and resource names with more than two words must be compliant with the standard naming convention: kebab-case}} +paths: {} \ No newline at end of file diff --git a/src/test/resources/checks/v31/format/OAR011/plain.json b/src/test/resources/checks/v31/format/OAR011/plain.json new file mode 100644 index 00000000..cf5279d9 --- /dev/null +++ b/src/test/resources/checks/v31/format/OAR011/plain.json @@ -0,0 +1,90 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/pets": { + "get": { + "responses": { + "200": { + "description": "Ok" + } + } + } + }, + "/Pets": { # Noncompliant {{OAR011: The base path and resource names with more than two words must be compliant with the standard naming convention: kebab-case}} + "get": { + "responses": { + "200": { + "description": "Ok" + } + } + } + }, + "/PETS": { # Noncompliant {{OAR011: The base path and resource names with more than two words must be compliant with the standard naming convention: kebab-case}} + "get": { + "responses": { + "200": { + "description": "Ok" + } + } + } + }, + "/pets/{id}": { + "get": { + "responses": { + "200": { + "description": "Ok" + } + } + } + }, + "/Pets/{id}": { # Noncompliant {{OAR011: The base path and resource names with more than two words must be compliant with the standard naming convention: kebab-case}} + "get": { + "responses": { + "200": { + "description": "Ok" + } + } + } + }, + "/PETS/{id}": { # Noncompliant {{OAR011: The base path and resource names with more than two words must be compliant with the standard naming convention: kebab-case}} + "get": { + "responses": { + "200": { + "description": "Ok" + } + } + } + }, + "/pets/{id}/external-info": { + "get": { + "responses": { + "200": { + "description": "Ok" + } + } + } + }, + "/Pets/{id}/EXternal_INFO": { # Noncompliant {{OAR011: The base path and resource names with more than two words must be compliant with the standard naming convention: kebab-case}} + "get": { + "responses": { + "200": { + "description": "Ok" + } + } + } + }, + "/PETS/{id}/externalInfo": { # Noncompliant {{OAR011: The base path and resource names with more than two words must be compliant with the standard naming convention: kebab-case}} + "get": { + "responses": { + "200": { + "description": "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/format/OAR011/plain.yaml b/src/test/resources/checks/v31/format/OAR011/plain.yaml new file mode 100644 index 00000000..7b13396a --- /dev/null +++ b/src/test/resources/checks/v31/format/OAR011/plain.yaml @@ -0,0 +1,50 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: + get: + responses: + 200: + description: Ok + /Pets: # Noncompliant {{OAR011: The base path and resource names with more than two words must be compliant with the standard naming convention: kebab-case}} + get: + responses: + 200: + description: Ok + /PETS: # Noncompliant {{OAR011: The base path and resource names with more than two words must be compliant with the standard naming convention: kebab-case}} + get: + responses: + 200: + description: Ok + /pets/{id}: + get: + responses: + 200: + description: Ok + /Pets/{id}: # Noncompliant {{OAR011: The base path and resource names with more than two words must be compliant with the standard naming convention: kebab-case}} + get: + responses: + 200: + description: Ok + /PETS/{id}: # Noncompliant {{OAR011: The base path and resource names with more than two words must be compliant with the standard naming convention: kebab-case}} + get: + responses: + 200: + description: Ok + /pets/{id}/external-info: + get: + responses: + 200: + description: Ok + /Pets/{id}/EXternal_INFO: # Noncompliant {{OAR011: The base path and resource names with more than two words must be compliant with the standard naming convention: kebab-case}} + get: + responses: + 200: + description: Ok + /PETS/{id}/externalInfo: # Noncompliant {{OAR011: The base path and resource names with more than two words must be compliant with the standard naming convention: kebab-case}} + get: + responses: + 200: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v31/format/OAR012/camel-case-plain.json b/src/test/resources/checks/v31/format/OAR012/camel-case-plain.json new file mode 100644 index 00000000..bb26e131 --- /dev/null +++ b/src/test/resources/checks/v31/format/OAR012/camel-case-plain.json @@ -0,0 +1,136 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/pets": { + "parameters": [ + { + "in": "path", + "name": "pet_id", # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: camelCase}} + "schema": { + "type": "integer" + } + }, + { + "in": "path", + "name": "petId", + "schema": { + "type": "integer" + } + }, + { + "in": "path", + "name": "PET-ID", # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: camelCase}} + "schema": { + "type": "integer" + } + }, + { + "in": "query", + "name": "expand_info", # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: camelCase}} + "schema": { + "type": "integer" + } + }, + { + "in": "query", + "name": "expandInfo", + "schema": { + "type": "integer" + } + }, + { + "in": "query", + "name": "EXPAND-INFO", # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: camelCase}} + "schema": { + "type": "integer" + } + }, + { + "in": "query", + "name": "expandInfo3", # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: camelCase}} + "schema": { + "type": "integer" + } + }, + { + "in": "header", + "name": "X-Request-ID", + "schema": { + "type": "string" + }, + "required": true + } + ], + "get": { + "parameters": [ + { + "in": "path", + "name": "pet_id", # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: camelCase}} + "schema": { + "type": "integer" + } + }, + { + "in": "path", + "name": "petId", + "schema": { + "type": "integer" + } + }, + { + "in": "path", + "name": "PET-ID", # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: camelCase}} + "schema": { + "type": "integer" + } + }, + { + "in": "query", + "name": "expand_info", # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: camelCase}} + "schema": { + "type": "integer" + } + }, + { + "in": "query", + "name": "expandInfo", + "schema": { + "type": "integer" + } + }, + { + "in": "query", + "name": "EXPAND-INFO", # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: camelCase}} + "schema": { + "type": "integer" + } + }, + { + "in": "query", + "name": "expandInfo3", # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: camelCase}} + "schema": { + "type": "integer" + } + }, + { + "in": "header", + "name": "X-Request-ID", + "schema": { + "type": "string" + }, + "required": true + } + ], + "responses": { + "200": { + "description": "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/format/OAR012/camel-case-plain.yaml b/src/test/resources/checks/v31/format/OAR012/camel-case-plain.yaml new file mode 100644 index 00000000..ccbabec1 --- /dev/null +++ b/src/test/resources/checks/v31/format/OAR012/camel-case-plain.yaml @@ -0,0 +1,78 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: + parameters: + - in: path + name: pet_id # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: camelCase}} + schema: + type: integer + - in: path + name: petId + schema: + type: integer + - in: path + name: PET-ID # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: camelCase}} + schema: + type: integer + - in: query + name: expand_info # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: camelCase}} + schema: + type: integer + - in: query + name: expandInfo + schema: + type: integer + - in: query + name: EXPAND-INFO # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: camelCase}} + schema: + type: integer + - in: query + name: expandInfo3 # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: camelCase}} + schema: + type: integer + - in: header + name: X-Request-ID + schema: + type: string + required: true + get: + parameters: + - in: path + name: pet_id # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: camelCase}} + schema: + type: integer + - in: path + name: petId + schema: + type: integer + - in: path + name: PET-ID # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: camelCase}} + schema: + type: integer + - in: query + name: expand_info # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: camelCase}} + schema: + type: integer + - in: query + name: expandInfo + schema: + type: integer + - in: query + name: EXPAND-INFO # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: camelCase}} + schema: + type: integer + - in: query + name: expandInfo3 # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: camelCase}} + schema: + type: integer + - in: header + name: X-Request-ID + schema: + type: string + required: true + responses: + 200: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v31/format/OAR012/camel-case-with-$ref.json b/src/test/resources/checks/v31/format/OAR012/camel-case-with-$ref.json new file mode 100644 index 00000000..8a695818 --- /dev/null +++ b/src/test/resources/checks/v31/format/OAR012/camel-case-with-$ref.json @@ -0,0 +1,209 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "components": { + "parameters": { + "petType": { + "in": "path", + "name": "pet-Type", # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: camelCase}} + "schema": { + "type": "integer" + } + }, + "pathParamOk": { + "in": "path", + "name": "petId", + "schema": { + "type": "integer" + } + }, + "pathParamWrong1": { + "in": "path", + "name": "pet_id", # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: camelCase}} + "schema": { + "type": "integer" + } + }, + "pathParamWrong2": { + "in": "path", + "name": "PET-ID", # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: camelCase}} + "schema": { + "type": "integer" + } + }, + "queryParamOk": { + "in": "query", + "name": "expandInfo", + "schema": { + "type": "integer" + } + }, + "queryParamWrong1": { + "in": "query", + "name": "expand_info", # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: camelCase}} + "schema": { + "type": "integer" + } + }, + "queryParamWrong2": { + "in": "query", + "name": "expand-info", # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: camelCase}} + "schema": { + "type": "integer" + } + }, + "headerParam": { + "in": "header", + "name": "X-Request-ID", + "schema": { + "type": "string" + }, + "required": true + } + }, + "schemas": { + "Pet": { + "type": "object", + "properties": { + "pet-type": { # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: camelCase}} + "type": "string" + }, + "petAge": { + "type": "number" + }, + "pet_name": { # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: camelCase}} + "type": "string" + } + } + } + }, + "requestBodies": { + "PetsPostRequest": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "pet_name": { # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: camelCase}} + "type": "string" + } + } + } + } + } + } + }, + "responses": { + "PetsResponse": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "pet_name": { # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: camelCase}} + "type": "string" + } + } + } + } + } + } + } + }, + "paths": { + "/pets": { + "parameters": [ + { + "$ref": "#/components/parameters/petType" + }, + { + "in": "path", + "name": "petName", + "schema": { + "type": "string" + } + } + ], + "post": { + "parameters": [ + { + "$ref": "#/components/parameters/pathParamOk" + }, + { + "$ref": "#/components/parameters/pathParamWrong1" + }, + { + "$ref": "#/components/parameters/pathParamWrong2" + }, + { + "$ref": "#/components/parameters/queryParamOk" + }, + { + "$ref": "#/components/parameters/queryParamWrong1" + }, + { + "$ref": "#/components/parameters/queryParamWrong2" + }, + { + "$ref": "#/components/parameters/headerParam" + } + ], + "requestBody": { + "$ref": "#/components/requestBodies/PetsPostRequest" + }, + "responses": { + "200": { + "$ref": "#/components/responses/PetsResponse" + } + } + }, + "put": { + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "pet_name": { # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: camelCase}} + "type": "string" + } + } + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/Pet" + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "pet_name": { # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: camelCase}} + "type": "string" + } + } + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/Pet" + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/format/OAR012/camel-case-with-$ref.yaml b/src/test/resources/checks/v31/format/OAR012/camel-case-with-$ref.yaml new file mode 100644 index 00000000..7cca23f2 --- /dev/null +++ b/src/test/resources/checks/v31/format/OAR012/camel-case-with-$ref.yaml @@ -0,0 +1,130 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +components: + parameters: + petType: + in: path + name: pet-Type # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: camelCase}} + schema: + type: integer + pathParamOk: + in: path + name: petId + schema: + type: integer + pathParamWrong1: + in: path + name: pet_id # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: camelCase}} + schema: + type: integer + pathParamWrong2: + in: path + name: PET-ID # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: camelCase}} + schema: + type: integer + queryParamOk: + in: query + name: expandInfo + schema: + type: integer + queryParamWrong1: + in: query + name: expand_info # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: camelCase}} + schema: + type: integer + queryParamWrong2: + in: query + name: expand-info # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: camelCase}} + schema: + type: integer + headerParam: + in: header + name: X-Request-ID + schema: + type: string + required: true + schemas: + Pet: + type: object + properties: + pet-type: # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: camelCase}} + type: string + petAge: + type: number + pet_name: # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: camelCase}} + type: string + requestBodies: + PetsPostRequest: + content: + application/json: + schema: + type: object + properties: + pet_name: # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: camelCase}} + type: string + petAge: + type: number + responses: + PetsResponse: + description: OK + content: + application/json: + schema: + type: object + properties: + pet_name: # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: camelCase}} + type: string + +paths: + /pets: + parameters: + - $ref: "#/components/parameters/petType" + - in: path + name: petName + schema: + type: string + post: + parameters: + - $ref: '#/components/parameters/pathParamOk' + - $ref: '#/components/parameters/pathParamWrong1' + - $ref: '#/components/parameters/pathParamWrong2' + - $ref: '#/components/parameters/queryParamOk' + - $ref: '#/components/parameters/queryParamWrong1' + - $ref: '#/components/parameters/queryParamWrong2' + - $ref: '#/components/parameters/headerParam' + requestBody: + $ref: '#/components/requestBodies/PetsPostRequest' + responses: + 200: + $ref: '#/components/responses/PetsResponse' + put: + requestBody: + content: + application/json: + schema: + type: object + properties: + pet_name: # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: camelCase}} + type: string + petAge: + type: number + application/xml: + schema: + $ref: '#/components/schemas/Pet' + responses: + 200: + description: OK + content: + application/json: + schema: + type: object + properties: + pet_name: # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: camelCase}} + type: string + petAge: + type: number + application/xml: + schema: + $ref: '#/components/schemas/Pet' \ No newline at end of file diff --git a/src/test/resources/checks/v31/format/OAR012/kebab-case-plain.json b/src/test/resources/checks/v31/format/OAR012/kebab-case-plain.json new file mode 100644 index 00000000..8d726a20 --- /dev/null +++ b/src/test/resources/checks/v31/format/OAR012/kebab-case-plain.json @@ -0,0 +1,136 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/pets": { + "parameters": [ + { + "in": "path", + "name": "pet_id", # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: kebab-case}} + "schema": { + "type": "integer" + } + }, + { + "in": "path", + "name": "petId", # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: kebab-case}} + "schema": { + "type": "integer" + } + }, + { + "in": "path", + "name": "PET-ID", # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: kebab-case}} + "schema": { + "type": "integer" + } + }, + { + "in": "query", + "name": "expand_info", # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: kebab-case}} + "schema": { + "type": "integer" + } + }, + { + "in": "query", + "name": "expandInfo", # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: kebab-case}} + "schema": { + "type": "integer" + } + }, + { + "in": "query", + "name": "EXPAND-INFO", # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: kebab-case}} + "schema": { + "type": "integer" + } + }, + { + "in": "query", + "name": "expandInfo3", # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: kebab-case}} + "schema": { + "type": "integer" + } + }, + { + "in": "header", + "name": "X-Request-ID", + "schema": { + "type": "string" + }, + "required": true + } + ], + "get": { + "parameters": [ + { + "in": "path", + "name": "pet_id", # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: kebab-case}} + "schema": { + "type": "integer" + } + }, + { + "in": "path", + "name": "petId", # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: kebab-case}} + "schema": { + "type": "integer" + } + }, + { + "in": "path", + "name": "PET-ID", # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: kebab-case}} + "schema": { + "type": "integer" + } + }, + { + "in": "query", + "name": "expand_info", # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: kebab-case}} + "schema": { + "type": "integer" + } + }, + { + "in": "query", + "name": "expandInfo", # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: kebab-case}} + "schema": { + "type": "integer" + } + }, + { + "in": "query", + "name": "EXPAND-INFO", # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: kebab-case}} + "schema": { + "type": "integer" + } + }, + { + "in": "query", + "name": "expandInfo3", # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: kebab-case}} + "schema": { + "type": "integer" + } + }, + { + "in": "header", + "name": "X-Request-ID", + "schema": { + "type": "string" + }, + "required": true + } + ], + "responses": { + "200": { + "description": "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/format/OAR012/kebab-case-plain.yaml b/src/test/resources/checks/v31/format/OAR012/kebab-case-plain.yaml new file mode 100644 index 00000000..a1b924e6 --- /dev/null +++ b/src/test/resources/checks/v31/format/OAR012/kebab-case-plain.yaml @@ -0,0 +1,78 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: + parameters: + - in: path + name: pet_id # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: kebab-case}} + schema: + type: integer + - in: path + name: petId # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: kebab-case}} + schema: + type: integer + - in: path + name: PET-ID # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: kebab-case}} + schema: + type: integer + - in: query + name: expand_info # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: kebab-case}} + schema: + type: integer + - in: query + name: expandInfo # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: kebab-case}} + schema: + type: integer + - in: query + name: EXPAND-INFO # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: kebab-case}} + schema: + type: integer + - in: query + name: expandInfo3 # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: kebab-case}} + schema: + type: integer + - in: header + name: X-Request-ID + schema: + type: string + required: true + get: + parameters: + - in: path + name: pet_id # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: kebab-case}} + schema: + type: integer + - in: path + name: petId # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: kebab-case}} + schema: + type: integer + - in: path + name: PET-ID # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: kebab-case}} + schema: + type: integer + - in: query + name: expand_info # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: kebab-case}} + schema: + type: integer + - in: query + name: expandInfo # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: kebab-case}} + schema: + type: integer + - in: query + name: EXPAND-INFO # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: kebab-case}} + schema: + type: integer + - in: query + name: expandInfo3 # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: kebab-case}} + schema: + type: integer + - in: header + name: X-Request-ID + schema: + type: string + required: true + responses: + 200: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v31/format/OAR012/kebab-case-with-$ref.json b/src/test/resources/checks/v31/format/OAR012/kebab-case-with-$ref.json new file mode 100644 index 00000000..bedb4b36 --- /dev/null +++ b/src/test/resources/checks/v31/format/OAR012/kebab-case-with-$ref.json @@ -0,0 +1,209 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "components": { + "parameters": { + "petType": { + "in": "path", + "name": "pet-type", + "schema": { + "type": "integer" + } + }, + "pathParamOk": { + "in": "path", + "name": "petId", # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: kebab-case}} + "schema": { + "type": "integer" + } + }, + "pathParamWrong1": { + "in": "path", + "name": "pet_id", # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: kebab-case}} + "schema": { + "type": "integer" + } + }, + "pathParamWrong2": { + "in": "path", + "name": "PET-ID", # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: kebab-case}} + "schema": { + "type": "integer" + } + }, + "queryParamOk": { + "in": "query", + "name": "expandInfo", # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: kebab-case}} + "schema": { + "type": "integer" + } + }, + "queryParamWrong1": { + "in": "query", + "name": "expand_info", # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: kebab-case}} + "schema": { + "type": "integer" + } + }, + "queryParamWrong2": { + "in": "query", + "name": "expand-info", + "schema": { + "type": "integer" + } + }, + "headerParam": { + "in": "header", + "name": "X-Request-ID", + "schema": { + "type": "string" + }, + "required": true + } + }, + "schemas": { + "Pet": { + "type": "object", + "properties": { + "pet-type": { + "type": "string" + }, + "petAge": { # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: kebab-case}} + "type": "number" + }, + "pet_name": { # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: kebab-case}} + "type": "string" + } + } + } + }, + "requestBodies": { + "PetsPostRequest": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "pet_name": { # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: kebab-case}} + "type": "string" + } + } + } + } + } + } + }, + "responses": { + "PetsResponse": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "pet_name": { # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: kebab-case}} + "type": "string" + } + } + } + } + } + } + } + }, + "paths": { + "/pets": { + "parameters": [ + { + "$ref": "#/components/parameters/petType" + }, + { + "in": "path", + "name": "petName", # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: kebab-case}} + "schema": { + "type": "string" + } + } + ], + "post": { + "parameters": [ + { + "$ref": "#/components/parameters/pathParamOk" + }, + { + "$ref": "#/components/parameters/pathParamWrong1" + }, + { + "$ref": "#/components/parameters/pathParamWrong2" + }, + { + "$ref": "#/components/parameters/queryParamOk" + }, + { + "$ref": "#/components/parameters/queryParamWrong1" + }, + { + "$ref": "#/components/parameters/queryParamWrong2" + }, + { + "$ref": "#/components/parameters/headerParam" + } + ], + "requestBody": { + "$ref": "#/components/requestBodies/PetsPostRequest" + }, + "responses": { + "200": { + "$ref": "#/components/responses/PetsResponse" + } + } + }, + "put": { + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "pet_name": { # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: kebab-case}} + "type": "string" + } + } + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/Pet" + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "pet_name": { # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: kebab-case}} + "type": "string" + } + } + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/Pet" + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/format/OAR012/kebab-case-with-$ref.yaml b/src/test/resources/checks/v31/format/OAR012/kebab-case-with-$ref.yaml new file mode 100644 index 00000000..73975f4f --- /dev/null +++ b/src/test/resources/checks/v31/format/OAR012/kebab-case-with-$ref.yaml @@ -0,0 +1,130 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +components: + parameters: + petType: + in: path + name: pet-Type # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: kebab-case}} + schema: + type: integer + pathParamOk: + in: path + name: petId # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: kebab-case}} + schema: + type: integer + pathParamWrong1: + in: path + name: pet_id # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: kebab-case}} + schema: + type: integer + pathParamWrong2: + in: path + name: PET-ID # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: kebab-case}} + schema: + type: integer + queryParamOk: + in: query + name: expandInfo # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: kebab-case}} + schema: + type: integer + queryParamWrong1: + in: query + name: expand_info # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: kebab-case}} + schema: + type: integer + queryParamWrong2: + in: query + name: expand-info + schema: + type: integer + headerParam: + in: header + name: X-Request-ID + schema: + type: string + required: true + schemas: + Pet: + type: object + properties: + pet-type: + type: string + petAge: # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: kebab-case}} + type: number + pet_name: # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: kebab-case}} + type: string + requestBodies: + PetsPostRequest: + content: + application/json: + schema: + type: object + properties: + pet_name: # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: kebab-case}} + type: string + petAge: # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: kebab-case}} + type: number + responses: + PetsResponse: + description: OK + content: + application/json: + schema: + type: object + properties: + pet_name: # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: kebab-case}} + type: string + +paths: + /pets: + parameters: + - $ref: "#/components/parameters/petType" + - in: path + name: petName # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: kebab-case}} + schema: + type: string + post: + parameters: + - $ref: '#/components/parameters/pathParamOk' + - $ref: '#/components/parameters/pathParamWrong1' + - $ref: '#/components/parameters/pathParamWrong2' + - $ref: '#/components/parameters/queryParamOk' + - $ref: '#/components/parameters/queryParamWrong1' + - $ref: '#/components/parameters/queryParamWrong2' + - $ref: '#/components/parameters/headerParam' + requestBody: + $ref: '#/components/requestBodies/PetsPostRequest' + responses: + 200: + $ref: '#/components/responses/PetsResponse' + put: + requestBody: + content: + application/json: + schema: + type: object + properties: + pet_name: # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: kebab-case}} + type: string + petAge: # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: kebab-case}} + type: number + application/xml: + schema: + $ref: '#/components/schemas/Pet' + responses: + 200: + description: OK + content: + application/json: + schema: + type: object + properties: + pet_name: # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: kebab-case}} + type: string + petAge: # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: kebab-case}} + type: number + application/xml: + schema: + $ref: '#/components/schemas/Pet' \ No newline at end of file diff --git a/src/test/resources/checks/v31/format/OAR012/snake-case-plain.json b/src/test/resources/checks/v31/format/OAR012/snake-case-plain.json new file mode 100644 index 00000000..48e07f45 --- /dev/null +++ b/src/test/resources/checks/v31/format/OAR012/snake-case-plain.json @@ -0,0 +1,136 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/pets": { + "parameters": [ + { + "in": "path", + "name": "pet_id", + "schema": { + "type": "integer" + } + }, + { + "in": "path", + "name": "petId", # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: snake_case}} + "schema": { + "type": "integer" + } + }, + { + "in": "path", + "name": "PET-ID", # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: snake_case}} + "schema": { + "type": "integer" + } + }, + { + "in": "query", + "name": "expand_info", + "schema": { + "type": "integer" + } + }, + { + "in": "query", + "name": "expandInfo", # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: snake_case}} + "schema": { + "type": "integer" + } + }, + { + "in": "query", + "name": "EXPAND-INFO", # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: snake_case}} + "schema": { + "type": "integer" + } + }, + { + "in": "query", + "name": "expandInfo3", # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: snake_case}} + "schema": { + "type": "integer" + } + }, + { + "in": "header", + "name": "X-Request-ID", + "schema": { + "type": "string" + }, + "required": true + } + ], + "get": { + "parameters": [ + { + "in": "path", + "name": "pet_id", + "schema": { + "type": "integer" + } + }, + { + "in": "path", + "name": "petId", # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: snake_case}} + "schema": { + "type": "integer" + } + }, + { + "in": "path", + "name": "PET-ID", # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: snake_case}} + "schema": { + "type": "integer" + } + }, + { + "in": "query", + "name": "expand_info", + "schema": { + "type": "integer" + } + }, + { + "in": "query", + "name": "expandInfo", # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: snake_case}} + "schema": { + "type": "integer" + } + }, + { + "in": "query", + "name": "EXPAND-INFO", # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: snake_case}} + "schema": { + "type": "integer" + } + }, + { + "in": "query", + "name": "expandInfo3", # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: snake_case}} + "schema": { + "type": "integer" + } + }, + { + "in": "header", + "name": "X-Request-ID", + "schema": { + "type": "string" + }, + "required": true + } + ], + "responses": { + "200": { + "description": "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/format/OAR012/snake-case-plain.yaml b/src/test/resources/checks/v31/format/OAR012/snake-case-plain.yaml new file mode 100644 index 00000000..20bfa7f7 --- /dev/null +++ b/src/test/resources/checks/v31/format/OAR012/snake-case-plain.yaml @@ -0,0 +1,78 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: + parameters: + - in: path + name: pet_id + schema: + type: integer + - in: path + name: petId # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: snake_case}} + schema: + type: integer + - in: path + name: PET-ID # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: snake_case}} + schema: + type: integer + - in: query + name: expand_info + schema: + type: integer + - in: query + name: expandInfo # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: snake_case}} + schema: + type: integer + - in: query + name: EXPAND-INFO # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: snake_case}} + schema: + type: integer + - in: query + name: expandInfo3 # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: snake_case}} + schema: + type: integer + - in: header + name: X-Request-ID + schema: + type: string + required: true + get: + parameters: + - in: path + name: pet_id + schema: + type: integer + - in: path + name: petId # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: snake_case}} + schema: + type: integer + - in: path + name: PET-ID # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: snake_case}} + schema: + type: integer + - in: query + name: expand_info + schema: + type: integer + - in: query + name: expandInfo # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: snake_case}} + schema: + type: integer + - in: query + name: EXPAND-INFO # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: snake_case}} + schema: + type: integer + - in: query + name: expandInfo3 # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: snake_case}} + schema: + type: integer + - in: header + name: X-Request-ID + schema: + type: string + required: true + responses: + 200: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v31/format/OAR012/snake-case-with-$ref.json b/src/test/resources/checks/v31/format/OAR012/snake-case-with-$ref.json new file mode 100644 index 00000000..21c21650 --- /dev/null +++ b/src/test/resources/checks/v31/format/OAR012/snake-case-with-$ref.json @@ -0,0 +1,209 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "components": { + "parameters": { + "petType": { + "in": "path", + "name": "pet-Type", # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: snake_case}} + "schema": { + "type": "integer" + } + }, + "pathParamOk": { + "in": "path", + "name": "petId", # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: snake_case}} + "schema": { + "type": "integer" + } + }, + "pathParamWrong1": { + "in": "path", + "name": "pet_id", + "schema": { + "type": "integer" + } + }, + "pathParamWrong2": { + "in": "path", + "name": "PET-ID", # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: snake_case}} + "schema": { + "type": "integer" + } + }, + "queryParamOk": { + "in": "query", + "name": "expandInfo", # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: snake_case}} + "schema": { + "type": "integer" + } + }, + "queryParamWrong1": { + "in": "query", + "name": "expand_info", + "schema": { + "type": "integer" + } + }, + "queryParamWrong2": { + "in": "query", + "name": "expand-info", # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: snake_case}} + "schema": { + "type": "integer" + } + }, + "headerParam": { + "in": "header", + "name": "X-Request-ID", + "schema": { + "type": "string" + }, + "required": true + } + }, + "schemas": { + "Pet": { + "type": "object", + "properties": { + "pet-type": { # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: snake_case}} + "type": "string" + }, + "petAge": { # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: snake_case}} + "type": "number" + }, + "pet_name": { + "type": "string" + } + } + } + }, + "requestBodies": { + "PetsPostRequest": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "petName": { # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: snake_case}} + "type": "string" + } + } + } + } + } + } + }, + "responses": { + "PetsResponse": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "petName": { # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: snake_case}} + "type": "string" + } + } + } + } + } + } + } + }, + "paths": { + "/pets": { + "parameters": [ + { + "$ref": "#/components/parameters/petType" + }, + { + "in": "path", + "name": "petName", # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: snake_case}} + "schema": { + "type": "string" + } + } + ], + "post": { + "parameters": [ + { + "$ref": "#/components/parameters/pathParamOk" + }, + { + "$ref": "#/components/parameters/pathParamWrong1" + }, + { + "$ref": "#/components/parameters/pathParamWrong2" + }, + { + "$ref": "#/components/parameters/queryParamOk" + }, + { + "$ref": "#/components/parameters/queryParamWrong1" + }, + { + "$ref": "#/components/parameters/queryParamWrong2" + }, + { + "$ref": "#/components/parameters/headerParam" + } + ], + "requestBody": { + "$ref": "#/components/requestBodies/PetsPostRequest" + }, + "responses": { + "200": { + "$ref": "#/components/responses/PetsResponse" + } + } + }, + "put": { + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "pet_name": { + "type": "string" + } + } + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/Pet" + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "petName": { # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: snake_case}} + "type": "string" + } + } + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/Pet" + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/format/OAR012/snake-case-with-$ref.yaml b/src/test/resources/checks/v31/format/OAR012/snake-case-with-$ref.yaml new file mode 100644 index 00000000..c453758f --- /dev/null +++ b/src/test/resources/checks/v31/format/OAR012/snake-case-with-$ref.yaml @@ -0,0 +1,130 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +components: + parameters: + petType: + in: path + name: pet-Type # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: snake_case}} + schema: + type: integer + pathParamOk: + in: path + name: petId # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: snake_case}} + schema: + type: integer + pathParamWrong1: + in: path + name: pet_id + schema: + type: integer + pathParamWrong2: + in: path + name: PET-ID # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: snake_case}} + schema: + type: integer + queryParamOk: + in: query + name: expandInfo # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: snake_case}} + schema: + type: integer + queryParamWrong1: + in: query + name: expand_info + schema: + type: integer + queryParamWrong2: + in: query + name: expand-info # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: snake_case}} + schema: + type: integer + headerParam: + in: header + name: X-Request-ID + schema: + type: string + required: true + schemas: + Pet: + type: object + properties: + pet-type: # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: snake_case}} + type: string + petAge: # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: snake_case}} + type: number + pet_name: + type: string + requestBodies: + PetsPostRequest: + content: + application/json: + schema: + type: object + properties: + pet_name: + type: string + petAge: # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: snake_case}} + type: number + responses: + PetsResponse: + description: OK + content: + application/json: + schema: + type: object + properties: + petName: # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: snake_case}} + type: string + +paths: + /pets: + parameters: + - $ref: "#/components/parameters/petType" + - in: path + name: petName # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: snake_case}} + schema: + type: string + post: + parameters: + - $ref: '#/components/parameters/pathParamOk' + - $ref: '#/components/parameters/pathParamWrong1' + - $ref: '#/components/parameters/pathParamWrong2' + - $ref: '#/components/parameters/queryParamOk' + - $ref: '#/components/parameters/queryParamWrong1' + - $ref: '#/components/parameters/queryParamWrong2' + - $ref: '#/components/parameters/headerParam' + requestBody: + $ref: '#/components/requestBodies/PetsPostRequest' + responses: + 200: + $ref: '#/components/responses/PetsResponse' + put: + requestBody: + content: + application/json: + schema: + type: object + properties: + pet_name: + type: string + petAge: # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: snake_case}} + type: number + application/xml: + schema: + $ref: '#/components/schemas/Pet' + responses: + 200: + description: OK + content: + application/json: + schema: + type: object + properties: + pet_name: + type: string + petAge: # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: snake_case}} + type: number + application/xml: + schema: + $ref: '#/components/schemas/Pet' \ No newline at end of file diff --git a/src/test/resources/checks/v31/format/OAR016/nested.json b/src/test/resources/checks/v31/format/OAR016/nested.json new file mode 100644 index 00000000..3e10ecf6 --- /dev/null +++ b/src/test/resources/checks/v31/format/OAR016/nested.json @@ -0,0 +1,40 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/invoices": { + "get": { + "responses": { + "200": { + "description": "A invoice.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "price": { + "type": "number", + "format": "double" + }, + "nested": { + "type": "object", + "properties": { + "value": { + "type": "number", # Noncompliant {{OAR016: Numeric types requires a valid format}} + "format": "int64" + } + } + } + } + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/format/OAR016/nested.yaml b/src/test/resources/checks/v31/format/OAR016/nested.yaml new file mode 100644 index 00000000..99858ae1 --- /dev/null +++ b/src/test/resources/checks/v31/format/OAR016/nested.yaml @@ -0,0 +1,25 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /invoices: + get: + responses: + 200: + description: A invoice. + content: + application/json: + schema: + type: object + properties: + price: + type: number + format: double + nested: + type: object + properties: + value: + type: number # Noncompliant {{OAR016: Numeric types requires a valid format}} + format: int64 + diff --git a/src/test/resources/checks/v31/format/OAR016/plain.json b/src/test/resources/checks/v31/format/OAR016/plain.json new file mode 100644 index 00000000..d49aef02 --- /dev/null +++ b/src/test/resources/checks/v31/format/OAR016/plain.json @@ -0,0 +1,42 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/invoices": { + "get": { + "responses": { + "200": { + "description": "A invoice.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "product_id": { + "type": "integer", # Noncompliant {{OAR016: Numeric types requires a valid format}} + "format": "int128" + }, + "line": { + "type": "number", # Noncompliant {{OAR016: Numeric types requires a valid format}} + "format": "int32" + }, + "price": { + "type": "number", + "format": "double" + } + } + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/format/OAR016/plain.yaml b/src/test/resources/checks/v31/format/OAR016/plain.yaml new file mode 100644 index 00000000..004e61d7 --- /dev/null +++ b/src/test/resources/checks/v31/format/OAR016/plain.yaml @@ -0,0 +1,27 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /invoices: + get: + responses: + 200: + description: A invoice. + content: + application/json: + schema: + type: object + properties: + id: + type: integer + product_id: + type: integer # Noncompliant {{OAR016: Numeric types requires a valid format}} + format: int128 + line: + type: number # Noncompliant {{OAR016: Numeric types requires a valid format}} + format: int32 + price: + type: number + format: double + diff --git a/src/test/resources/checks/v31/format/OAR016/with-$ref.json b/src/test/resources/checks/v31/format/OAR016/with-$ref.json new file mode 100644 index 00000000..44d77260 --- /dev/null +++ b/src/test/resources/checks/v31/format/OAR016/with-$ref.json @@ -0,0 +1,47 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/invoices": { + "get": { + "responses": { + "200": { + "description": "A invoice.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "price": { + "type": "number", + "format": "double" + }, + "nested": { + "$ref": "#/components/schemas/nested" + } + } + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "nested": { + "type": "object", + "properties": { + "value": { + "type": "number", # Noncompliant {{OAR016: Numeric types requires a valid format}} + "format": "int64" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/format/OAR016/with-$ref.yaml b/src/test/resources/checks/v31/format/OAR016/with-$ref.yaml new file mode 100644 index 00000000..32be02fd --- /dev/null +++ b/src/test/resources/checks/v31/format/OAR016/with-$ref.yaml @@ -0,0 +1,29 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /invoices: + get: + responses: + 200: + description: A invoice. + content: + application/json: + schema: + type: object + properties: + price: + type: number + format: double + nested: + $ref: '#/components/schemas/nested' + +components: + schemas: + nested: + type: object + properties: + value: + type: number # Noncompliant {{OAR016: Numeric types requires a valid format}} + format: int64 diff --git a/src/test/resources/checks/v31/format/OAR037/complete.json b/src/test/resources/checks/v31/format/OAR037/complete.json new file mode 100644 index 00000000..dfefdf0b --- /dev/null +++ b/src/test/resources/checks/v31/format/OAR037/complete.json @@ -0,0 +1,116 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "components": { + "parameters": { + "paramOne": { + "in": "header", + "name": "paramOne", + "schema": { + "type": "string", # Noncompliant {{OAR037: String types requires a valid format}} + "format": "YYYY-MM-DD" + } + }, + "paramTwo": { + "in": "header", + "name": "paramTwo", + "schema": { + "type": "string", # Noncompliant {{OAR037: String types requires a valid format}} + "format": "YYYY-MM-DD" + } + } + } + }, + "paths": { + "/invoices": { + "parameters": [ + { + "$ref": "#/components/parameters/paramTwo" + }, + { + "in": "header", + "name": "paramThree", + "schema": { + "type": "string", # Noncompliant {{OAR037: String types requires a valid format}} + "format": "YYYY-MM-DD" + } + } + ], + "get": { + "parameters": [ + { + "$ref": "#/components/parameters/paramOne" + } + ], + "responses": { + "200": { + "description": "A invoice.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "without": { + "type": "string" + }, + "date": { + "type": "string", + "format": "date" + }, + "date-time": { + "type": "string", + "format": "date-time" + }, + "password": { + "type": "string", + "format": "password" + }, + "byte": { + "type": "string", + "format": "byte" + }, + "binary": { + "type": "string", + "format": "binary" + }, + "email": { + "type": "string", + "format": "email" + }, + "uuid": { + "type": "string", + "format": "uuid" + }, + "uri": { + "type": "string", + "format": "uri" + }, + "hostname": { + "type": "string", + "format": "hostname" + }, + "ipv4": { + "type": "string", + "format": "ipv4" + }, + "ipv6": { + "type": "string", + "format": "ipv6" + }, + "other": { + "type": "string", # Noncompliant {{OAR037: String types requires a valid format}} + "format": "YYYY-MM-DD" + } + } + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/format/OAR037/complete.yaml b/src/test/resources/checks/v31/format/OAR037/complete.yaml new file mode 100644 index 00000000..2e7b6f3f --- /dev/null +++ b/src/test/resources/checks/v31/format/OAR037/complete.yaml @@ -0,0 +1,76 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +components: + parameters: + paramOne: + in: header + name: paramOne + schema: + type: string # Noncompliant {{OAR037: String types requires a valid format}} + format: YYYY-MM-DD + paramTwo: + in: header + name: paramTwo + schema: + type: string # Noncompliant {{OAR037: String types requires a valid format}} + format: YYYY-MM-DD +paths: + /invoices: + parameters: + - $ref: '#/components/parameters/paramTwo' + - in: header + name: paramThree + schema: + type: string # Noncompliant {{OAR037: String types requires a valid format}} + format: YYYY-MM-DD + get: + parameters: + - $ref: '#/components/parameters/paramOne' + responses: + 200: + description: A invoice. + content: + application/json: + schema: + type: object + properties: + without: + type: string + date: + type: string + format: date + date-time: + type: string + format: date-time + password: + type: string + format: password + byte: + type: string + format: byte + binary: + type: string + format: binary + email: + type: string + format: email + uuid: + type: string + format: uuid + uri: + type: string + format: uri + hostname: + type: string + format: hostname + ipv4: + type: string + format: ipv4 + ipv6: + type: string + format: ipv6 + other: + type: string # Noncompliant {{OAR037: String types requires a valid format}} + format: YYYY-MM-DD diff --git a/src/test/resources/checks/v31/format/OAR037/nested.json b/src/test/resources/checks/v31/format/OAR037/nested.json new file mode 100644 index 00000000..4b6316e6 --- /dev/null +++ b/src/test/resources/checks/v31/format/OAR037/nested.json @@ -0,0 +1,36 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/invoices": { + "get": { + "responses": { + "200": { + "description": "A invoice.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "nested": { + "type": "object", + "properties": { + "value": { + "type": "string", # Noncompliant {{OAR037: String types requires a valid format}} + "format": "YYYY-MM-DD" + } + } + } + } + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/format/OAR037/nested.yaml b/src/test/resources/checks/v31/format/OAR037/nested.yaml new file mode 100644 index 00000000..e2ba0a91 --- /dev/null +++ b/src/test/resources/checks/v31/format/OAR037/nested.yaml @@ -0,0 +1,22 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /invoices: + get: + responses: + 200: + description: A invoice. + content: + application/json: + schema: + type: object + properties: + nested: + type: object + properties: + value: + type: string # Noncompliant {{OAR037: String types requires a valid format}} + format: YYYY-MM-DD + diff --git a/src/test/resources/checks/v31/format/OAR037/with-$ref.json b/src/test/resources/checks/v31/format/OAR037/with-$ref.json new file mode 100644 index 00000000..5707bfcb --- /dev/null +++ b/src/test/resources/checks/v31/format/OAR037/with-$ref.json @@ -0,0 +1,47 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/invoices": { + "get": { + "responses": { + "200": { + "description": "A invoice.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "price": { + "type": "number", + "format": "double" + }, + "nested": { + "$ref": "#/components/schemas/nested" + } + } + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "nested": { + "type": "object", + "properties": { + "value": { + "type": "string", # Noncompliant {{OAR037: String types requires a valid format}} + "format": "YYYY-MM-DD" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/format/OAR037/with-$ref.yaml b/src/test/resources/checks/v31/format/OAR037/with-$ref.yaml new file mode 100644 index 00000000..c7d2f1f4 --- /dev/null +++ b/src/test/resources/checks/v31/format/OAR037/with-$ref.yaml @@ -0,0 +1,29 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /invoices: + get: + responses: + 200: + description: A invoice. + content: + application/json: + schema: + type: object + properties: + price: + type: number + format: double + nested: + $ref: '#/components/schemas/nested' + +components: + schemas: + nested: + type: object + properties: + value: + type: string # Noncompliant {{OAR037: String types requires a valid format}} + format: YYYY-MM-DD diff --git a/src/test/resources/checks/v31/format/OAR042/incorrect-version.json b/src/test/resources/checks/v31/format/OAR042/incorrect-version.json new file mode 100644 index 00000000..74006c75 --- /dev/null +++ b/src/test/resources/checks/v31/format/OAR042/incorrect-version.json @@ -0,0 +1,13 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "servers" : [ + { + "url": "http://petstore.swagger.io/api-seguros/v1.0" # Noncompliant {{OAR042: Last path part must be the API version, indicated with the prefix 'v' and the version number as integer}} + } + ], + "paths" : { } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/format/OAR042/incorrect-version.yaml b/src/test/resources/checks/v31/format/OAR042/incorrect-version.yaml new file mode 100644 index 00000000..1a3a569a --- /dev/null +++ b/src/test/resources/checks/v31/format/OAR042/incorrect-version.yaml @@ -0,0 +1,7 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +servers: + - url: https://petstore.swagger.io/api-seguros/v1.0 # Noncompliant {{OAR042: Last path part must be the API version, indicated with the prefix 'v' and the version number as integer}} +paths: {} \ No newline at end of file diff --git a/src/test/resources/checks/v31/format/OAR042/too-long.json b/src/test/resources/checks/v31/format/OAR042/too-long.json new file mode 100644 index 00000000..8e22a1a2 --- /dev/null +++ b/src/test/resources/checks/v31/format/OAR042/too-long.json @@ -0,0 +1,13 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "servers" : [ + { + "url": "http://petstore.swagger.io/api-seguros/v1/vida" # Noncompliant {{OAR042: Path has to many parts}} + } + ], + "paths" : { } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/format/OAR042/too-long.yaml b/src/test/resources/checks/v31/format/OAR042/too-long.yaml new file mode 100644 index 00000000..a8df7af5 --- /dev/null +++ b/src/test/resources/checks/v31/format/OAR042/too-long.yaml @@ -0,0 +1,7 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +servers: + - url: https://petstore.swagger.io/api-seguros/v1/vida # Noncompliant {{OAR042: Path has to many parts}} +paths: {} \ No newline at end of file diff --git a/src/test/resources/checks/v31/format/OAR042/too-short.json b/src/test/resources/checks/v31/format/OAR042/too-short.json new file mode 100644 index 00000000..9f25cf4a --- /dev/null +++ b/src/test/resources/checks/v31/format/OAR042/too-short.json @@ -0,0 +1,13 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "servers" : [ + { + "url": "http://petstore.swagger.io/api-seguros" # Noncompliant {{OAR042: Path has to few parts}} + } + ], + "paths" : { } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/format/OAR042/too-short.yaml b/src/test/resources/checks/v31/format/OAR042/too-short.yaml new file mode 100644 index 00000000..cb29e522 --- /dev/null +++ b/src/test/resources/checks/v31/format/OAR042/too-short.yaml @@ -0,0 +1,7 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +servers: + - url: https://petstore.swagger.io/api-seguros # Noncompliant {{OAR042: Path has to few parts}} +paths: {} \ No newline at end of file diff --git a/src/test/resources/checks/v31/format/OAR042/valid.json b/src/test/resources/checks/v31/format/OAR042/valid.json new file mode 100644 index 00000000..6d48f8b4 --- /dev/null +++ b/src/test/resources/checks/v31/format/OAR042/valid.json @@ -0,0 +1,13 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "servers": [ + { + "url": "http://petstore.swagger.io/api-seguros/v1" + } + ], + "paths": { } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/format/OAR042/valid.yaml b/src/test/resources/checks/v31/format/OAR042/valid.yaml new file mode 100644 index 00000000..89bfccfb --- /dev/null +++ b/src/test/resources/checks/v31/format/OAR042/valid.yaml @@ -0,0 +1,7 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +servers: + - url: https://petstore.swagger.io/api-seguros/v1 +paths: {} \ No newline at end of file diff --git a/src/test/resources/checks/v31/format/OAR042/without-api-prefix.json b/src/test/resources/checks/v31/format/OAR042/without-api-prefix.json new file mode 100644 index 00000000..0f7cf628 --- /dev/null +++ b/src/test/resources/checks/v31/format/OAR042/without-api-prefix.json @@ -0,0 +1,13 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "servers" : [ + { + "url": "http://petstore.swagger.io/seguros/v1" # Noncompliant {{OAR042: API name must start with prefix 'api-'}} + } + ], + "paths" : { } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/format/OAR042/without-api-prefix.yaml b/src/test/resources/checks/v31/format/OAR042/without-api-prefix.yaml new file mode 100644 index 00000000..e026b5a3 --- /dev/null +++ b/src/test/resources/checks/v31/format/OAR042/without-api-prefix.yaml @@ -0,0 +1,7 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +servers: + - url: https://petstore.swagger.io/seguros/v1 # Noncompliant {{OAR042: API name must start with prefix 'api-'}} +paths: {} \ No newline at end of file diff --git a/src/test/resources/checks/v31/format/OAR052/nested.json b/src/test/resources/checks/v31/format/OAR052/nested.json new file mode 100644 index 00000000..42d01c17 --- /dev/null +++ b/src/test/resources/checks/v31/format/OAR052/nested.json @@ -0,0 +1,39 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/invoices": { + "get": { + "responses": { + "200": { + "description": "A invoice.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "price": { + "type": "number", + "format": "double" + }, + "nested": { + "type": "object", + "properties": { + "value": { + "type": "number" # Noncompliant {{OAR052: Numeric types requires a format}} + } + } + } + } + } + } + } + } + } + } + } + } +} diff --git a/src/test/resources/checks/v31/format/OAR052/nested.yaml b/src/test/resources/checks/v31/format/OAR052/nested.yaml new file mode 100644 index 00000000..9d3b88ee --- /dev/null +++ b/src/test/resources/checks/v31/format/OAR052/nested.yaml @@ -0,0 +1,24 @@ +openapi: 3.0.0 +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /invoices: + get: + responses: + '200': + description: A invoice. + content: + application/json: + schema: + type: object + properties: + price: + type: number + format: double + nested: + type: object + properties: + value: + type: number # Noncompliant {{OAR052: Numeric types requires a format}} + diff --git a/src/test/resources/checks/v31/format/OAR052/plain.json b/src/test/resources/checks/v31/format/OAR052/plain.json new file mode 100644 index 00000000..e1189a6e --- /dev/null +++ b/src/test/resources/checks/v31/format/OAR052/plain.json @@ -0,0 +1,40 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/invoices": { + "get": { + "responses": { + "200": { + "description": "A invoice.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int32" + }, + "product_id": { + "type": "integer" # Noncompliant {{OAR052: Numeric types requires a format}} + }, + "line": { + "type": "integer" # Noncompliant {{OAR052: Numeric types requires a format}} + }, + "price": { + "type": "number" # Noncompliant {{OAR052: Numeric types requires a format}} + } + } + } + } + } + } + } + } + } + } +} diff --git a/src/test/resources/checks/v31/format/OAR052/plain.yaml b/src/test/resources/checks/v31/format/OAR052/plain.yaml new file mode 100644 index 00000000..498442a5 --- /dev/null +++ b/src/test/resources/checks/v31/format/OAR052/plain.yaml @@ -0,0 +1,24 @@ +openapi: 3.0.0 +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /invoices: + get: + responses: + '200': + description: A invoice. + content: + application/json: + schema: + type: object + properties: + id: + type: integer + format: int32 + product_id: + type: integer # Noncompliant {{OAR052: Numeric types requires a format}} + line: + type: integer # Noncompliant {{OAR052: Numeric types requires a format}} + price: + type: number # Noncompliant {{OAR052: Numeric types requires a format}} diff --git a/src/test/resources/checks/v31/format/OAR052/with-$ref.json b/src/test/resources/checks/v31/format/OAR052/with-$ref.json new file mode 100644 index 00000000..f6d48586 --- /dev/null +++ b/src/test/resources/checks/v31/format/OAR052/with-$ref.json @@ -0,0 +1,46 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/invoices": { + "get": { + "responses": { + "200": { + "description": "A invoice.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "price": { + "type": "number", + "format": "double" + }, + "nested": { + "$ref": "#/components/schemas/nested" + } + } + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "nested": { + "type": "object", + "properties": { + "value": { + "type": "number" # Noncompliant {{OAR052: Numeric types requires a format}} + } + } + } + } + } +} diff --git a/src/test/resources/checks/v31/format/OAR052/with-$ref.yaml b/src/test/resources/checks/v31/format/OAR052/with-$ref.yaml new file mode 100644 index 00000000..5db4e652 --- /dev/null +++ b/src/test/resources/checks/v31/format/OAR052/with-$ref.yaml @@ -0,0 +1,28 @@ +openapi: 3.0.0 +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /invoices: + get: + responses: + '200': + description: A invoice. + content: + application/json: + schema: + type: object + properties: + price: + type: number + format: double + nested: + $ref: '#/components/schemas/nested' + +components: + schemas: + nested: + type: object + properties: + value: + type: number # Noncompliant {{OAR052: Numeric types requires a format}} diff --git a/src/test/resources/checks/v31/format/OAR066/snake-case-error.json b/src/test/resources/checks/v31/format/OAR066/snake-case-error.json new file mode 100644 index 00000000..5362c7f2 --- /dev/null +++ b/src/test/resources/checks/v31/format/OAR066/snake-case-error.json @@ -0,0 +1,42 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/user": { + "post": { + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "firstName": { "type": "string" }, # Noncompliant {{OAR066: RequestBody and Responses schema property names must be compliant with the snake_case naming convention}} + "last_name": { "type": "string" } + } + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "userID": { "type": "integer" }, # Noncompliant {{OAR066: RequestBody and Responses schema property names must be compliant with the snake_case naming convention}} + "user_name": { "type": "string" } + } + } + } + } + } + } + } + } + } + } \ No newline at end of file diff --git a/src/test/resources/checks/v31/format/OAR066/snake-case-error.yaml b/src/test/resources/checks/v31/format/OAR066/snake-case-error.yaml new file mode 100644 index 00000000..6bf327fb --- /dev/null +++ b/src/test/resources/checks/v31/format/OAR066/snake-case-error.yaml @@ -0,0 +1,29 @@ +openapi: 3.0.0 +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /user: + post: + requestBody: + content: + application/json: + schema: + type: object + properties: + firstName: # Noncompliant {{OAR066: RequestBody and Responses schema property names must be compliant with the snake_case naming convention}} + type: string + last_name: + type: string + responses: + '200': + description: Success + content: + application/json: + schema: + type: object + properties: + userID: # Noncompliant {{OAR066: RequestBody and Responses schema property names must be compliant with the snake_case naming convention}} + type: integer + user_name: + type: string \ No newline at end of file diff --git a/src/test/resources/checks/v31/format/OAR066/valid.json b/src/test/resources/checks/v31/format/OAR066/valid.json new file mode 100644 index 00000000..67217b92 --- /dev/null +++ b/src/test/resources/checks/v31/format/OAR066/valid.json @@ -0,0 +1,40 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/user": { + "post": { + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "last_name": { "type": "string" } + } + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "user_name": { "type": "string" } + } + } + } + } + } + } + } + } + } + } \ No newline at end of file diff --git a/src/test/resources/checks/v31/format/OAR066/valid.yaml b/src/test/resources/checks/v31/format/OAR066/valid.yaml new file mode 100644 index 00000000..04c50530 --- /dev/null +++ b/src/test/resources/checks/v31/format/OAR066/valid.yaml @@ -0,0 +1,25 @@ +openapi: 3.0.0 +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /user: + post: + requestBody: + content: + application/json: + schema: + type: object + properties: + last_name: + type: string + responses: + '200': + description: Success + content: + application/json: + schema: + type: object + properties: + user_name: + type: string \ No newline at end of file diff --git a/src/test/resources/checks/v31/format/OAR067/camel-case-error.json b/src/test/resources/checks/v31/format/OAR067/camel-case-error.json new file mode 100644 index 00000000..4307fccb --- /dev/null +++ b/src/test/resources/checks/v31/format/OAR067/camel-case-error.json @@ -0,0 +1,42 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/user": { + "post": { + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "first_name": { "type": "string" }, # Noncompliant {{OAR067: RequestBody and Responses schema property names must be compliant with the camelCase naming convention}} + "lastName": { "type": "string" } + } + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "user_id": { "type": "integer" }, # Noncompliant {{OAR067: RequestBody and Responses schema property names must be compliant with the camelCase naming convention}} + "userName": { "type": "string" } + } + } + } + } + } + } + } + } + } + } \ No newline at end of file diff --git a/src/test/resources/checks/v31/format/OAR067/camel-case-error.yaml b/src/test/resources/checks/v31/format/OAR067/camel-case-error.yaml new file mode 100644 index 00000000..ff6ba5c0 --- /dev/null +++ b/src/test/resources/checks/v31/format/OAR067/camel-case-error.yaml @@ -0,0 +1,29 @@ +openapi: 3.0.0 +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /user: + post: + requestBody: + content: + application/json: + schema: + type: object + properties: + first_name: # Noncompliant {{OAR067: RequestBody and Responses schema property names must be compliant with the camelCase naming convention}} + type: string + lastName: + type: string + responses: + '200': + description: Success + content: + application/json: + schema: + type: object + properties: + user_id: # Noncompliant {{OAR067: RequestBody and Responses schema property names must be compliant with the camelCase naming convention}} + type: integer + userName: + type: string \ No newline at end of file diff --git a/src/test/resources/checks/v31/format/OAR067/valid.json b/src/test/resources/checks/v31/format/OAR067/valid.json new file mode 100644 index 00000000..337a2f9b --- /dev/null +++ b/src/test/resources/checks/v31/format/OAR067/valid.json @@ -0,0 +1,40 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/user": { + "post": { + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "lastName": { "type": "string" } + } + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "userName": { "type": "string" } + } + } + } + } + } + } + } + } + } + } \ No newline at end of file diff --git a/src/test/resources/checks/v31/format/OAR067/valid.yaml b/src/test/resources/checks/v31/format/OAR067/valid.yaml new file mode 100644 index 00000000..8c80f35d --- /dev/null +++ b/src/test/resources/checks/v31/format/OAR067/valid.yaml @@ -0,0 +1,25 @@ +openapi: 3.0.0 +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /user: + post: + requestBody: + content: + application/json: + schema: + type: object + properties: + lastName: + type: string + responses: + '200': + description: Success + content: + application/json: + schema: + type: object + properties: + userName: + type: string \ No newline at end of file diff --git a/src/test/resources/checks/v31/format/OAR068/externalref.yaml b/src/test/resources/checks/v31/format/OAR068/externalref.yaml new file mode 100644 index 00000000..5035f52c --- /dev/null +++ b/src/test/resources/checks/v31/format/OAR068/externalref.yaml @@ -0,0 +1,62 @@ +openapi: 3.0.1 +info: + title: Sample-API_efc2b9f76813_V + contact: + name: Nombre del Contacto. + email: contact@mail.com + version: 1.0.12 +servers: + - url: https://api.example.es/api-sample/v1 +paths: + /datos-usuarios: + get: + summary: Listado de usuarios + parameters: + - name: desde + in: query + schema: + type: string + format: date + required: false + - name: hasta + in: query + schema: + type: string + format: date + required: false + responses: + '200': + description: OK. + headers: + X-Correlation-Id: + description: Cabecera 'X-Correlation-Id' + schema: + type: string + content: + application/json: + schema: # Noncompliant {{OAR068: RequestBody and Responses schema property names must be compliant with the PascalCase naming convention}} + $ref: >- + https://raw.githubusercontent.com/apiaddicts/sonaropenapi-rules/refs/heads/master/src/test/resources/externalRef/OAR068.yaml#/components/schemas/datosUsuario + '400': + description: Bad Request. + headers: + X-Correlation-Id: + description: Cabecera 'X-Correlation-Id' + schema: + type: string + content: + application/json: + schema: # Noncompliant {{OAR068: RequestBody and Responses schema property names must be compliant with the PascalCase naming convention}} + $ref: >- + https://raw.githubusercontent.com/apiaddicts/sonaropenapi-rules/refs/heads/master/src/test/resources/externalRef/OAR086.yaml#/components/schemas/ErrorMessage + example: + error: + status: '400' + message: Bad Request + path: /datos-usuario + type: https://docs.example.es/x/A1D8Aw + operationId: '10004' + errors: + - code: '101' + message: Invalid format + location: desde \ No newline at end of file diff --git a/src/test/resources/checks/v31/format/OAR068/pascal-case-error.json b/src/test/resources/checks/v31/format/OAR068/pascal-case-error.json new file mode 100644 index 00000000..b5f9521e --- /dev/null +++ b/src/test/resources/checks/v31/format/OAR068/pascal-case-error.json @@ -0,0 +1,41 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/user": { + "post": { + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "first_name": { "type": "string" }, # Noncompliant {{OAR068: RequestBody and Responses schema property names must be compliant with the PascalCase naming convention}} + } + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "user_id": { "type": "integer" }, # Noncompliant {{OAR068: RequestBody and Responses schema property names must be compliant with the PascalCase naming convention}} + "UserName": { "type": "string" } + } + } + } + } + } + } + } + } + } + } \ No newline at end of file diff --git a/src/test/resources/checks/v31/format/OAR068/pascal-case-error.yaml b/src/test/resources/checks/v31/format/OAR068/pascal-case-error.yaml new file mode 100644 index 00000000..eed1491d --- /dev/null +++ b/src/test/resources/checks/v31/format/OAR068/pascal-case-error.yaml @@ -0,0 +1,29 @@ +openapi: 3.0.0 +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /user: + post: + requestBody: + content: + application/json: + schema: + type: object + properties: + first_name: # Noncompliant {{OAR068: RequestBody and Responses schema property names must be compliant with the PascalCase naming convention}} + type: string + LastName: + type: string + responses: + '200': + description: Success + content: + application/json: + schema: + type: object + properties: + user_Id: # Noncompliant {{OAR068: RequestBody and Responses schema property names must be compliant with the PascalCase naming convention}} + type: integer + UserName: + type: string \ No newline at end of file diff --git a/src/test/resources/checks/v31/format/OAR068/valid.json b/src/test/resources/checks/v31/format/OAR068/valid.json new file mode 100644 index 00000000..f6204f15 --- /dev/null +++ b/src/test/resources/checks/v31/format/OAR068/valid.json @@ -0,0 +1,40 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/user": { + "post": { + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "LastName": { "type": "string" } + } + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "UserName": { "type": "string" } + } + } + } + } + } + } + } + } + } + } \ No newline at end of file diff --git a/src/test/resources/checks/v31/format/OAR068/valid.yaml b/src/test/resources/checks/v31/format/OAR068/valid.yaml new file mode 100644 index 00000000..b99b3dcc --- /dev/null +++ b/src/test/resources/checks/v31/format/OAR068/valid.yaml @@ -0,0 +1,25 @@ +openapi: 3.0.0 +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /user: + post: + requestBody: + content: + application/json: + schema: + type: object + properties: + LastName: + type: string + responses: + '200': + description: Success + content: + application/json: + schema: + type: object + properties: + UserName: + type: string \ No newline at end of file diff --git a/src/test/resources/checks/v31/format/OAR077/not-valid-in-query.json b/src/test/resources/checks/v31/format/OAR077/not-valid-in-query.json new file mode 100644 index 00000000..29dddea3 --- /dev/null +++ b/src/test/resources/checks/v31/format/OAR077/not-valid-in-query.json @@ -0,0 +1,34 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "API que cumple" + }, + "paths": { + "/usuarios": { + "get": { + "parameters": [ + { + "name": "username", + "in": "query", + "schema": { + "type": "string" + } + }, + { + "name": "userFirstName", # Noncompliant {{OAR077: All parameters in query must be snake_case}} + "in": "query", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/format/OAR077/not-valid-in-query.yaml b/src/test/resources/checks/v31/format/OAR077/not-valid-in-query.yaml new file mode 100644 index 00000000..6c43154d --- /dev/null +++ b/src/test/resources/checks/v31/format/OAR077/not-valid-in-query.yaml @@ -0,0 +1,19 @@ + openapi: "3.0.0" + info: + version: "1.0.0" + title: "API que cumple" + paths: + /usuarios: + get: + parameters: + - name: username + in: query + schema: + type: string + - name: userFirstName # Noncompliant {{OAR077: All parameters in query must be snake_case}} + in: query + schema: + type: string + responses: + 200: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v31/format/OAR077/valid-in-query.json b/src/test/resources/checks/v31/format/OAR077/valid-in-query.json new file mode 100644 index 00000000..bd383fd9 --- /dev/null +++ b/src/test/resources/checks/v31/format/OAR077/valid-in-query.json @@ -0,0 +1,34 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "API que cumple" + }, + "paths": { + "/usuarios": { + "get": { + "parameters": [ + { + "name": "username", + "in": "query", + "schema": { + "type": "string" + } + }, + { + "name": "user_first_name", + "in": "query", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/format/OAR077/valid-in-query.yaml b/src/test/resources/checks/v31/format/OAR077/valid-in-query.yaml new file mode 100644 index 00000000..286bf500 --- /dev/null +++ b/src/test/resources/checks/v31/format/OAR077/valid-in-query.yaml @@ -0,0 +1,19 @@ + openapi: "3.0.0" + info: + version: "1.0.0" + title: "API que cumple" + paths: + /usuarios: + get: + parameters: + - name: username + in: query + schema: + type: string + - name: hola_hola + in: query + schema: + type: string + responses: + 200: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v31/format/OAR086/external-refexample.yaml b/src/test/resources/checks/v31/format/OAR086/external-refexample.yaml new file mode 100644 index 00000000..942a056b --- /dev/null +++ b/src/test/resources/checks/v31/format/OAR086/external-refexample.yaml @@ -0,0 +1,62 @@ +openapi: 3.0.1 +info: + title: Sample-API_efc2b9f76813_V + contact: + name: Nombre del Contacto. + email: contact@mail.com + version: 1.0.12 +servers: + - url: https://api.example.es/api-sample/v1 +paths: + /datos-usuarios: + get: + summary: Listado de usuarios + parameters: + - name: desde + in: query + schema: + type: string + format: date + required: false + - name: hasta + in: query + schema: + type: string + format: date + required: false + responses: + '200': + description: OK. + headers: + X-Correlation-Id: + description: Cabecera 'X-Correlation-Id' + schema: + type: string + content: + application/json: + schema: + $ref: >- # Noncompliant {{OAR086: Descriptions must begin with a capital letter, end with a period and not be empty}} + https://raw.githubusercontent.com/apiaddicts/sonaropenapi-rules/refs/heads/master/src/test/resources/externalRef/OAR086.yaml#/components/schemas/datosUsuario + '400': + description: Bad Request. + headers: + X-Correlation-Id: + description: Cabecera 'X-Correlation-Id' + schema: + type: string + content: + application/json: + schema: + $ref: >- # Noncompliant {{OAR086: Descriptions must begin with a capital letter, end with a period and not be empty}} + https://raw.githubusercontent.com/apiaddicts/sonaropenapi-rules/refs/heads/master/src/test/resources/externalRef/OAR086.yaml#/components/schemas/ErrorMessage + example: + error: + status: '400' + message: Bad Request + path: /datos-usuario + type: https://docs.example.es/x/A1D8Aw + operationId: '10004' + errors: + - code: '101' + message: Invalid format + location: desde \ No newline at end of file diff --git a/src/test/resources/checks/v31/format/OAR086/internal-refexample.yaml b/src/test/resources/checks/v31/format/OAR086/internal-refexample.yaml new file mode 100644 index 00000000..940aa7ce --- /dev/null +++ b/src/test/resources/checks/v31/format/OAR086/internal-refexample.yaml @@ -0,0 +1,66 @@ +openapi: 3.0.1 +info: + title: Sample-API_efc2b9f76813_V + contact: + name: Nombre del Contacto. + email: contact@mail.com + version: 1.0.12 +servers: + - url: https://api.example.es/api-sample/v1 +paths: + /datos-usuarios: + get: + summary: Listado de usuarios. + description: Método que permite obtener un listado con datos básicos de un usuario. + parameters: + - name: desde + in: query + schema: + type: string + format: date + required: false + - name: hasta + in: query + schema: + type: string + format: date + required: false + responses: + '200': + description: OK. + headers: + X-Correlation-Id: + description: Cabecera 'X-Correlation-Id' + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/errorMessage' +components: + schemas: + errorMessage: + required: + - message + - status + type: object + properties: + status: + type: string + description: Especifica el status code HTTP al que se traducirá la excepción # Noncompliant {{OAR086: Descriptions must begin with a capital letter, end with a period and not be empty}} + message: + type: string + description: Mensaje descriptivo del error. + path: + type: string + description: URL path de la petición que originó el error. + type: + type: string + description: URL que apunta a una descripción de los códigos de error. + operationId: + type: string + description: Id de negocio de la operación realizada. + errors: + type: array + description: Listado de suberrores usado para dar información más detallada, + como en el caso de errores de validación. diff --git a/src/test/resources/checks/v31/format/OAR086/invalid-example.json b/src/test/resources/checks/v31/format/OAR086/invalid-example.json new file mode 100644 index 00000000..8321f08a --- /dev/null +++ b/src/test/resources/checks/v31/format/OAR086/invalid-example.json @@ -0,0 +1,60 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "Sample API", + "version": "1.0.0", + "description": "esta es la descripción de la API." # Noncompliant {{OAR086: Descriptions must begin with a capital letter, end with a period and not be empty}} + }, + "paths": { + "/pets": { + "get": { + "summary": "lista de mascotas.", + "description": "", # Noncompliant {{OAR086: Descriptions must begin with a capital letter, end with a period and not be empty}} + "parameters": [ + { + "name": "desde", + "in": "query", + "schema": { + "type": "string", + "format": "date" + }, + "required": false, + "description": "describe init time" # Noncompliant {{OAR086: Descriptions must begin with a capital letter, end with a period and not be empty}} + }, + { + "name": "hasta", + "in": "query", + "schema": { + "type": "string", + "format": "date" + }, + "required": false, + "description": "descibe parameter" # Noncompliant {{OAR086: Descriptions must begin with a capital letter, end with a period and not be empty}} + } + ], + "responses": { + "200": { + "description": "una lista de mascotas." # Noncompliant {{OAR086: Descriptions must begin with a capital letter, end with a period and not be empty}} + } + } + } + } + }, + "components": { + "schemas": { + "Pet": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "name": { + "type": "string" + } + }, + "description": "Representa una mascota" # Noncompliant {{OAR086: Descriptions must begin with a capital letter, end with a period and not be empty}} + } + } + } + } \ No newline at end of file diff --git a/src/test/resources/checks/v31/format/OAR086/invalid-example.yaml b/src/test/resources/checks/v31/format/OAR086/invalid-example.yaml new file mode 100644 index 00000000..6c04e09d --- /dev/null +++ b/src/test/resources/checks/v31/format/OAR086/invalid-example.yaml @@ -0,0 +1,41 @@ +openapi: 3.0.0 +info: + title: Sample API + version: 1.0.0 + description: Esta es la descripción de la API # Noncompliant {{OAR086: Descriptions must begin with a capital letter, end with a period and not be empty}} + +paths: + /pets: + get: + summary: lista de mascotas. + description: esta ruta devuelve una lista de mascotas # Noncompliant {{OAR086: Descriptions must begin with a capital letter, end with a period and not be empty}} + parameters: + - name: desde + in: query + schema: + type: string + format: date + required: false + description: describe init time # Noncompliant {{OAR086: Descriptions must begin with a capital letter, end with a period and not be empty}} + - name: hasta + in: query + schema: + type: string + format: date + required: false + description: descibe parameter # Noncompliant {{OAR086: Descriptions must begin with a capital letter, end with a period and not be empty}} + responses: + '200': + description: Una lista de mascotas # Noncompliant {{OAR086: Descriptions must begin with a capital letter, end with a period and not be empty}} + +components: + schemas: + Pet: + type: object + properties: + id: + type: integer + format: int64 + name: + type: string + description: Representa una mascota # Noncompliant {{OAR086: Descriptions must begin with a capital letter, end with a period and not be empty}} \ No newline at end of file diff --git a/src/test/resources/checks/v31/format/OAR086/valid-example.json b/src/test/resources/checks/v31/format/OAR086/valid-example.json new file mode 100644 index 00000000..01e82101 --- /dev/null +++ b/src/test/resources/checks/v31/format/OAR086/valid-example.json @@ -0,0 +1,60 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "Sample API", + "version": "1.0.0", + "description": "Esta es la descripción de la API." + }, + "paths": { + "/pets": { + "get": { + "summary": "Lista de mascotas.", + "description": "Esta ruta devuelve una lista de mascotas.", + "parameters": [ + { + "name": "desde", + "in": "query", + "schema": { + "type": "string", + "format": "date" + }, + "required": false, + "description": "Especifica el parámetro." + }, + { + "name": "hasta", + "in": "query", + "schema": { + "type": "string", + "format": "date" + }, + "required": false, + "description": "Especifica el parámetro." + } + ], + "responses": { + "200": { + "description": "Una lista de mascotas." + } + } + } + } + }, + "components": { + "schemas": { + "Pet": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "name": { + "type": "string" + } + }, + "description": "Representa una mascota." + } + } + } + } \ No newline at end of file diff --git a/src/test/resources/checks/v31/format/OAR086/valid-example.yaml b/src/test/resources/checks/v31/format/OAR086/valid-example.yaml new file mode 100644 index 00000000..ef4ed2a8 --- /dev/null +++ b/src/test/resources/checks/v31/format/OAR086/valid-example.yaml @@ -0,0 +1,69 @@ +openapi: 3.0.1 +info: + title: Sample-API_efc2b9f76813_V + description: API de ejemplo para pruebas. + contact: + name: Nombre del Contacto. + email: contact@mail.com + version: 1.0.12 +servers: + - url: https://api.example.es/api-sample/v1 +paths: + /datos-usuarios: + get: + summary: Listado de usuarios. + description: Método que permite obtener un listado con datos básicos de un usuario. + parameters: + - name: desde + in: query + schema: + type: string + format: date + required: false + description: Especifica el parámetro. + - name: hasta + in: query + schema: + type: string + format: date + required: false + description: Especifica el parámetro. + responses: + '200': + description: OK. + headers: + X-Correlation-Id: + description: Cabecera 'X-Correlation-Id' + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/errorMessage' +components: + schemas: + errorMessage: + required: + - message + - status + type: object + properties: + status: + type: string + description: Especifica el status code HTTP al que se traducirá la excepción. + message: + type: string + description: Mensaje descriptivo del error. + path: + type: string + description: URL path de la petición que originó el error. + type: + type: string + description: URL que apunta a una descripción de los códigos de error. + operationId: + type: string + description: Id de negocio de la operación realizada. + errors: + type: array + description: Listado de suberrores usado para dar información más detallada, + como en el caso de errores de validación. diff --git a/src/test/resources/checks/v31/format/OAR087/invalid-example.json b/src/test/resources/checks/v31/format/OAR087/invalid-example.json new file mode 100644 index 00000000..afcb9b95 --- /dev/null +++ b/src/test/resources/checks/v31/format/OAR087/invalid-example.json @@ -0,0 +1,38 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "Sample API", + "version": "1.0.0", + "description": "Esta es la descripción de la API.", + }, + "paths": { + "/pets": { + "get": { + "summary": "Lista de mascotas", # Noncompliant {{OAR087: Summaries must begin with a capital letter, end with a period and not be empty}} + "description": "Esta ruta devuelve una lista de mascotas.", + "responses": { + "200": { + "description": "Una lista de mascotas retornada con éxito." + } + } + } + } + }, + "components": { + "schemas": { + "Pet": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "name": { + "type": "string" + } + }, + "description": "Representa una mascota.", + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/format/OAR087/invalid-example.yaml b/src/test/resources/checks/v31/format/OAR087/invalid-example.yaml new file mode 100644 index 00000000..32d303bf --- /dev/null +++ b/src/test/resources/checks/v31/format/OAR087/invalid-example.yaml @@ -0,0 +1,26 @@ +openapi: 3.0.0 +info: + title: Sample API + version: 1.0.0 + description: Esta es la descripción de la API. + +paths: + /pets: + get: + summary: lista de mascotas. # Noncompliant {{OAR087: Summaries must begin with a capital letter, end with a period and not be empty}} + description: Esta ruta devuelve una lista de mascotas. + responses: + '200': + description: Una lista de mascotas retornada con éxito. + +components: + schemas: + Pet: + type: object + properties: + id: + type: integer + format: int64 + name: + type: string + description: Representa una mascota. diff --git a/src/test/resources/checks/v31/format/OAR087/valid-example.json b/src/test/resources/checks/v31/format/OAR087/valid-example.json new file mode 100644 index 00000000..e5974b79 --- /dev/null +++ b/src/test/resources/checks/v31/format/OAR087/valid-example.json @@ -0,0 +1,38 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "Sample API", + "version": "1.0.0", + "description": "Esta es la descripción de la API.", + }, + "paths": { + "/pets": { + "get": { + "summary": "Lista de mascotas.", + "description": "Esta ruta devuelve una lista de mascotas.", + "responses": { + "200": { + "description": "Una lista de mascotas retornada con éxito." + } + } + } + } + }, + "components": { + "schemas": { + "Pet": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "name": { + "type": "string" + } + }, + "description": "Representa una mascota.", + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/format/OAR087/valid-example.yaml b/src/test/resources/checks/v31/format/OAR087/valid-example.yaml new file mode 100644 index 00000000..640a360c --- /dev/null +++ b/src/test/resources/checks/v31/format/OAR087/valid-example.yaml @@ -0,0 +1,26 @@ +openapi: 3.0.0 +info: + title: Sample API + version: 1.0.0 + description: Esta es la descripción de la API. + +paths: + /pets: + get: + summary: Lista de mascotas. + description: Esta ruta devuelve una lista de mascotas. + responses: + '200': + description: Una lista de mascotas retornada con éxito. + +components: + schemas: + Pet: + type: object + properties: + id: + type: integer + format: int64 + name: + type: string + description: Representa una mascota. diff --git a/src/test/resources/checks/v31/format/OAR088/invalid-ref.json b/src/test/resources/checks/v31/format/OAR088/invalid-ref.json new file mode 100644 index 00000000..0c64ff1b --- /dev/null +++ b/src/test/resources/checks/v31/format/OAR088/invalid-ref.json @@ -0,0 +1,35 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "API de ejemplo", + "version": "1.0" + }, + "paths": { + "/mascotas": { + "get": { + "parameters": [ + { + "$ref": "#/components/parameters/idMascotaRef" # Noncompliant {{OAR088: The $ref of a parameter must end with the suffix Param}} + } + ], + "responses": { + "200": { + "description": "Lista de mascotas" + } + } + } + } + }, + "components": { + "parameters": { + "idMascotaRef": { + "name": "idMascota", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + } + } + } + } \ No newline at end of file diff --git a/src/test/resources/checks/v31/format/OAR088/invalid-ref.yaml b/src/test/resources/checks/v31/format/OAR088/invalid-ref.yaml new file mode 100644 index 00000000..1fcb570d --- /dev/null +++ b/src/test/resources/checks/v31/format/OAR088/invalid-ref.yaml @@ -0,0 +1,20 @@ +openapi: 3.0.0 +info: + title: API de ejemplo + version: "1.0" +paths: + /mascotas: + get: + parameters: + - $ref: '#/components/parameters/idMascotaRef' # Noncompliant {{OAR088: The $ref of a parameter must end with the suffix Param}} + responses: + '200': + description: Lista de mascotas +components: + parameters: + idMascotaRef: + name: idMascota + in: query + required: true + schema: + type: string \ No newline at end of file diff --git a/src/test/resources/checks/v31/format/OAR088/valid-ref.json b/src/test/resources/checks/v31/format/OAR088/valid-ref.json new file mode 100644 index 00000000..c113399f --- /dev/null +++ b/src/test/resources/checks/v31/format/OAR088/valid-ref.json @@ -0,0 +1,35 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "API de ejemplo", + "version": "1.0" + }, + "paths": { + "/mascotas": { + "get": { + "parameters": [ + { + "$ref": "#/components/parameters/idMascotaParam" + } + ], + "responses": { + "200": { + "description": "Lista de mascotas" + } + } + } + } + }, + "components": { + "parameters": { + "idMascotaParam": { + "name": "idMascota", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + } + } + } + } \ No newline at end of file diff --git a/src/test/resources/checks/v31/format/OAR088/valid-ref.yaml b/src/test/resources/checks/v31/format/OAR088/valid-ref.yaml new file mode 100644 index 00000000..3a2d8abe --- /dev/null +++ b/src/test/resources/checks/v31/format/OAR088/valid-ref.yaml @@ -0,0 +1,20 @@ +openapi: 3.0.0 +info: + title: API de ejemplo + version: "1.0" +paths: + /mascotas: + get: + parameters: + - $ref: '#/components/parameters/idMascotaParam' + responses: + '200': + description: Lista de mascotas +components: + parameters: + idMascotaParam: + name: idMascota + in: query + required: true + schema: + type: string \ No newline at end of file diff --git a/src/test/resources/checks/v31/format/OAR089/invalid-ref.json b/src/test/resources/checks/v31/format/OAR089/invalid-ref.json new file mode 100644 index 00000000..9c316602 --- /dev/null +++ b/src/test/resources/checks/v31/format/OAR089/invalid-ref.json @@ -0,0 +1,49 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "API Sample", + "version": "1.0.0" + }, + "paths": { + "/pets": { + "get": { + "parameters": [ + { + "name": "petId", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Successful response" + } + }, + "requestBody": { + "$ref": "#/components/requestBodies/PetDetailsIncorrect" # Noncompliant {{OAR089: The $ref of a request body must end with the suffix Body}} + } + } + } + }, + "components": { + "requestBodies": { + "PetDetailsIncorrect": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string" + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/format/OAR089/invalid-ref.yaml b/src/test/resources/checks/v31/format/OAR089/invalid-ref.yaml new file mode 100644 index 00000000..21fe46df --- /dev/null +++ b/src/test/resources/checks/v31/format/OAR089/invalid-ref.yaml @@ -0,0 +1,28 @@ +openapi: '3.0.0' +info: + title: API Sample + version: '1.0.0' +paths: + /pets: + get: + parameters: + - name: petId + in: path + required: true + schema: + type: string + responses: + '200': + description: Successful response + requestBody: + $ref: '#/components/requestBodies/PetDetailsIncorrect' # Noncompliant {{OAR089: The $ref of a request body must end with the suffix Body}} +components: + requestBodies: + PetDetailsIncorrect: + content: + application/json: + schema: + type: object + properties: + name: + type: string \ No newline at end of file diff --git a/src/test/resources/checks/v31/format/OAR089/valid-ref.json b/src/test/resources/checks/v31/format/OAR089/valid-ref.json new file mode 100644 index 00000000..0dcbcfa9 --- /dev/null +++ b/src/test/resources/checks/v31/format/OAR089/valid-ref.json @@ -0,0 +1,49 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "API Sample", + "version": "1.0.0" + }, + "paths": { + "/pets": { + "get": { + "parameters": [ + { + "name": "petId", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Successful response" + } + }, + "requestBody": { + "$ref": "#/components/requestBodies/PetDetailsBody" + } + } + } + }, + "components": { + "requestBodies": { + "PetDetailsBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string" + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/format/OAR089/valid-ref.yaml b/src/test/resources/checks/v31/format/OAR089/valid-ref.yaml new file mode 100644 index 00000000..df379934 --- /dev/null +++ b/src/test/resources/checks/v31/format/OAR089/valid-ref.yaml @@ -0,0 +1,28 @@ +openapi: '3.0.0' +info: + title: API Sample + version: '1.0.0' +paths: + /pets: + get: + parameters: + - name: petId + in: path + required: true + schema: + type: string + responses: + '200': + description: Successful response + requestBody: + $ref: '#/components/requestBodies/PetDetailsBody' +components: + requestBodies: + PetDetailsBody: + content: + application/json: + schema: + type: object + properties: + name: + type: string \ No newline at end of file diff --git a/src/test/resources/checks/v31/format/OAR090/invalid-ref.json b/src/test/resources/checks/v31/format/OAR090/invalid-ref.json new file mode 100644 index 00000000..497987b9 --- /dev/null +++ b/src/test/resources/checks/v31/format/OAR090/invalid-ref.json @@ -0,0 +1,25 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "Sample API", + "version": "1.0.0" + }, + "paths": { + "/sample": { + "get": { + "responses": { + "200": { + "$ref": "#/components/responses/InvalidRef" # Noncompliant {{OAR090: The $ref of a response must end with the suffix Response}} + } + } + } + } + }, + "components": { + "responses": { + "InvalidRef": { + "description": "Successful response" + } + } + } + } \ No newline at end of file diff --git a/src/test/resources/checks/v31/format/OAR090/invalid-ref.yaml b/src/test/resources/checks/v31/format/OAR090/invalid-ref.yaml new file mode 100644 index 00000000..8bcdbea7 --- /dev/null +++ b/src/test/resources/checks/v31/format/OAR090/invalid-ref.yaml @@ -0,0 +1,14 @@ +openapi: 3.0.0 +info: + title: Sample API + version: 1.0.0 +paths: + /sample: + get: + responses: + '200': + $ref: '#/components/responses/InvalidRef' # Noncompliant {{OAR090: The $ref of a response must end with the suffix Response}} +components: + responses: + InvalidRef: + description: Successful response \ No newline at end of file diff --git a/src/test/resources/checks/v31/format/OAR090/valid-ref.json b/src/test/resources/checks/v31/format/OAR090/valid-ref.json new file mode 100644 index 00000000..304be99f --- /dev/null +++ b/src/test/resources/checks/v31/format/OAR090/valid-ref.json @@ -0,0 +1,25 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "Sample API", + "version": "1.0.0" + }, + "paths": { + "/sample": { + "get": { + "responses": { + "200": { + "$ref": "#/components/responses/SuccessResponse" + } + } + } + } + }, + "components": { + "responses": { + "SuccessResponse": { + "description": "Successful response" + } + } + } + } \ No newline at end of file diff --git a/src/test/resources/checks/v31/format/OAR090/valid-ref.yaml b/src/test/resources/checks/v31/format/OAR090/valid-ref.yaml new file mode 100644 index 00000000..a93e0313 --- /dev/null +++ b/src/test/resources/checks/v31/format/OAR090/valid-ref.yaml @@ -0,0 +1,14 @@ +openapi: 3.0.0 +info: + title: Sample API + version: 1.0.0 +paths: + /sample: + get: + responses: + '200': + $ref: '#/components/responses/SuccessResponse' +components: + responses: + SuccessResponse: + description: Successful response \ No newline at end of file diff --git a/src/test/resources/checks/v31/format/OAR097/too-short.json b/src/test/resources/checks/v31/format/OAR097/too-short.json new file mode 100644 index 00000000..aefcb581 --- /dev/null +++ b/src/test/resources/checks/v31/format/OAR097/too-short.json @@ -0,0 +1,13 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "servers" : [ + { + "url": "http://petstore.swagger.io/api-seguros" # Noncompliant {{OAR097: Path has to few parts}} + } + ], + "paths" : { } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/format/OAR097/too-short.yaml b/src/test/resources/checks/v31/format/OAR097/too-short.yaml new file mode 100644 index 00000000..8ace3d73 --- /dev/null +++ b/src/test/resources/checks/v31/format/OAR097/too-short.yaml @@ -0,0 +1,7 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +servers: + - url: https://petstore.swagger.io/api-seguros # Noncompliant {{OAR097: Path has to few parts}} +paths: {} \ No newline at end of file diff --git a/src/test/resources/checks/v31/format/OAR097/valid.json b/src/test/resources/checks/v31/format/OAR097/valid.json new file mode 100644 index 00000000..6d48f8b4 --- /dev/null +++ b/src/test/resources/checks/v31/format/OAR097/valid.json @@ -0,0 +1,13 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "servers": [ + { + "url": "http://petstore.swagger.io/api-seguros/v1" + } + ], + "paths": { } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/format/OAR097/valid.yaml b/src/test/resources/checks/v31/format/OAR097/valid.yaml new file mode 100644 index 00000000..89bfccfb --- /dev/null +++ b/src/test/resources/checks/v31/format/OAR097/valid.yaml @@ -0,0 +1,7 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +servers: + - url: https://petstore.swagger.io/api-seguros/v1 +paths: {} \ No newline at end of file diff --git a/src/test/resources/checks/v31/format/OAR098/too-long.json b/src/test/resources/checks/v31/format/OAR098/too-long.json new file mode 100644 index 00000000..c142c217 --- /dev/null +++ b/src/test/resources/checks/v31/format/OAR098/too-long.json @@ -0,0 +1,13 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "servers" : [ + { + "url": "http://petstore.swagger.io/api-seguros/v1/vida" # Noncompliant {{OAR098: Path has to many parts}} + } + ], + "paths" : { } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/format/OAR098/too-long.yaml b/src/test/resources/checks/v31/format/OAR098/too-long.yaml new file mode 100644 index 00000000..a24776c2 --- /dev/null +++ b/src/test/resources/checks/v31/format/OAR098/too-long.yaml @@ -0,0 +1,7 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +servers: + - url: https://petstore.swagger.io/api-seguros/v1/vida # Noncompliant {{OAR098: Path has to many parts}} +paths: {} \ No newline at end of file diff --git a/src/test/resources/checks/v31/format/OAR098/valid.json b/src/test/resources/checks/v31/format/OAR098/valid.json new file mode 100644 index 00000000..6d48f8b4 --- /dev/null +++ b/src/test/resources/checks/v31/format/OAR098/valid.json @@ -0,0 +1,13 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "servers": [ + { + "url": "http://petstore.swagger.io/api-seguros/v1" + } + ], + "paths": { } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/format/OAR098/valid.yaml b/src/test/resources/checks/v31/format/OAR098/valid.yaml new file mode 100644 index 00000000..89bfccfb --- /dev/null +++ b/src/test/resources/checks/v31/format/OAR098/valid.yaml @@ -0,0 +1,7 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +servers: + - url: https://petstore.swagger.io/api-seguros/v1 +paths: {} \ No newline at end of file diff --git a/src/test/resources/checks/v31/format/OAR099/valid.json b/src/test/resources/checks/v31/format/OAR099/valid.json new file mode 100644 index 00000000..6d48f8b4 --- /dev/null +++ b/src/test/resources/checks/v31/format/OAR099/valid.json @@ -0,0 +1,13 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "servers": [ + { + "url": "http://petstore.swagger.io/api-seguros/v1" + } + ], + "paths": { } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/format/OAR099/valid.yaml b/src/test/resources/checks/v31/format/OAR099/valid.yaml new file mode 100644 index 00000000..89bfccfb --- /dev/null +++ b/src/test/resources/checks/v31/format/OAR099/valid.yaml @@ -0,0 +1,7 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +servers: + - url: https://petstore.swagger.io/api-seguros/v1 +paths: {} \ No newline at end of file diff --git a/src/test/resources/checks/v31/format/OAR099/without-api-prefix.json b/src/test/resources/checks/v31/format/OAR099/without-api-prefix.json new file mode 100644 index 00000000..f3940f84 --- /dev/null +++ b/src/test/resources/checks/v31/format/OAR099/without-api-prefix.json @@ -0,0 +1,13 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "servers" : [ + { + "url": "http://petstore.swagger.io/seguros/v1" # Noncompliant {{OAR099: API name must start with prefix 'api-'}} + } + ], + "paths" : { } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/format/OAR099/without-api-prefix.yaml b/src/test/resources/checks/v31/format/OAR099/without-api-prefix.yaml new file mode 100644 index 00000000..f774c12e --- /dev/null +++ b/src/test/resources/checks/v31/format/OAR099/without-api-prefix.yaml @@ -0,0 +1,7 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +servers: + - url: https://petstore.swagger.io/seguros/v1 # Noncompliant {{OAR099: API name must start with prefix 'api-'}} +paths: {} \ No newline at end of file diff --git a/src/test/resources/checks/v31/format/OAR100/incorrect-version.json b/src/test/resources/checks/v31/format/OAR100/incorrect-version.json new file mode 100644 index 00000000..c2673393 --- /dev/null +++ b/src/test/resources/checks/v31/format/OAR100/incorrect-version.json @@ -0,0 +1,13 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "servers" : [ + { + "url": "http://petstore.swagger.io/api-seguros/v1.0" # Noncompliant {{OAR100: Last path part must be the API version, indicated with the prefix 'v' and the version number as integer}} + } + ], + "paths" : { } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/format/OAR100/incorrect-version.yaml b/src/test/resources/checks/v31/format/OAR100/incorrect-version.yaml new file mode 100644 index 00000000..9c20380c --- /dev/null +++ b/src/test/resources/checks/v31/format/OAR100/incorrect-version.yaml @@ -0,0 +1,7 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +servers: + - url: https://petstore.swagger.io/api-seguros/v1.0 # Noncompliant {{OAR100: Last path part must be the API version, indicated with the prefix 'v' and the version number as integer}} +paths: {} \ No newline at end of file diff --git a/src/test/resources/checks/v31/format/OAR100/valid.json b/src/test/resources/checks/v31/format/OAR100/valid.json new file mode 100644 index 00000000..6d48f8b4 --- /dev/null +++ b/src/test/resources/checks/v31/format/OAR100/valid.json @@ -0,0 +1,13 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "servers": [ + { + "url": "http://petstore.swagger.io/api-seguros/v1" + } + ], + "paths": { } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/format/OAR100/valid.yaml b/src/test/resources/checks/v31/format/OAR100/valid.yaml new file mode 100644 index 00000000..89bfccfb --- /dev/null +++ b/src/test/resources/checks/v31/format/OAR100/valid.yaml @@ -0,0 +1,7 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +servers: + - url: https://petstore.swagger.io/api-seguros/v1 +paths: {} \ No newline at end of file diff --git a/src/test/resources/checks/v31/format/OAR101/empty-path.json b/src/test/resources/checks/v31/format/OAR101/empty-path.json new file mode 100644 index 00000000..6341fc10 --- /dev/null +++ b/src/test/resources/checks/v31/format/OAR101/empty-path.json @@ -0,0 +1,13 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "servers": [ + { + "url": "http://petstore.swagger.io/" + } + ], + "paths": {} +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/format/OAR101/empty-path.yaml b/src/test/resources/checks/v31/format/OAR101/empty-path.yaml new file mode 100644 index 00000000..8925b6e8 --- /dev/null +++ b/src/test/resources/checks/v31/format/OAR101/empty-path.yaml @@ -0,0 +1,7 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +servers: + - url: https://petstore.swagger.io/ +paths: {} \ No newline at end of file diff --git a/src/test/resources/checks/v31/format/OAR101/invalid.json b/src/test/resources/checks/v31/format/OAR101/invalid.json new file mode 100644 index 00000000..0ab8f8ab --- /dev/null +++ b/src/test/resources/checks/v31/format/OAR101/invalid.json @@ -0,0 +1,13 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "servers": [ + { + "url": "http://petstore.swagger.io/wrong/v1" # Noncompliant {{OAR101: The first part of the path is not allowed. Allowed values are: wrong}} + } + ], + "paths": {} +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/format/OAR101/invalid.yaml b/src/test/resources/checks/v31/format/OAR101/invalid.yaml new file mode 100644 index 00000000..d06571ea --- /dev/null +++ b/src/test/resources/checks/v31/format/OAR101/invalid.yaml @@ -0,0 +1,7 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +servers: + - url: https://petstore.swagger.io/wrong/v1 # Noncompliant {{OAR101: The first part of the path is not allowed. Allowed values are: wrong}} +paths: {} \ No newline at end of file diff --git a/src/test/resources/checks/v31/format/OAR101/valid-with-values.json b/src/test/resources/checks/v31/format/OAR101/valid-with-values.json new file mode 100644 index 00000000..3ea07fc5 --- /dev/null +++ b/src/test/resources/checks/v31/format/OAR101/valid-with-values.json @@ -0,0 +1,13 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "servers": [ + { + "url": "http://petstore.swagger.io/api-seguros/v1" + } + ], + "paths": {} +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/format/OAR101/valid-with-values.yaml b/src/test/resources/checks/v31/format/OAR101/valid-with-values.yaml new file mode 100644 index 00000000..89bfccfb --- /dev/null +++ b/src/test/resources/checks/v31/format/OAR101/valid-with-values.yaml @@ -0,0 +1,7 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +servers: + - url: https://petstore.swagger.io/api-seguros/v1 +paths: {} \ No newline at end of file diff --git a/src/test/resources/checks/v31/format/OAR101/valid.json b/src/test/resources/checks/v31/format/OAR101/valid.json new file mode 100644 index 00000000..6d48f8b4 --- /dev/null +++ b/src/test/resources/checks/v31/format/OAR101/valid.json @@ -0,0 +1,13 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "servers": [ + { + "url": "http://petstore.swagger.io/api-seguros/v1" + } + ], + "paths": { } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/format/OAR101/valid.yaml b/src/test/resources/checks/v31/format/OAR101/valid.yaml new file mode 100644 index 00000000..89bfccfb --- /dev/null +++ b/src/test/resources/checks/v31/format/OAR101/valid.yaml @@ -0,0 +1,7 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +servers: + - url: https://petstore.swagger.io/api-seguros/v1 +paths: {} \ No newline at end of file diff --git a/src/test/resources/checks/v31/format/OAR102/invalid.json b/src/test/resources/checks/v31/format/OAR102/invalid.json new file mode 100644 index 00000000..ee51dd65 --- /dev/null +++ b/src/test/resources/checks/v31/format/OAR102/invalid.json @@ -0,0 +1,13 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "servers": [ + { + "url": "http://petstore.swagger.io/api-seguros/wrong" # Noncompliant {{OAR102: The second part of the path is not allowed. Allowed values are: wrong}} + } + ], + "paths": {} +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/format/OAR102/invalid.yaml b/src/test/resources/checks/v31/format/OAR102/invalid.yaml new file mode 100644 index 00000000..ca2c1240 --- /dev/null +++ b/src/test/resources/checks/v31/format/OAR102/invalid.yaml @@ -0,0 +1,7 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +servers: + - url: https://petstore.swagger.io/api-seguros/wrong # Noncompliant {{OAR102: The second part of the path is not allowed. Allowed values are: wrong}} +paths: {} \ No newline at end of file diff --git a/src/test/resources/checks/v31/format/OAR102/one-part-path.json b/src/test/resources/checks/v31/format/OAR102/one-part-path.json new file mode 100644 index 00000000..3679b681 --- /dev/null +++ b/src/test/resources/checks/v31/format/OAR102/one-part-path.json @@ -0,0 +1,13 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "servers": [ + { + "url": "http://petstore.swagger.io/api-seguros" + } + ], + "paths": {} +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/format/OAR102/one-part-path.yaml b/src/test/resources/checks/v31/format/OAR102/one-part-path.yaml new file mode 100644 index 00000000..84c7df71 --- /dev/null +++ b/src/test/resources/checks/v31/format/OAR102/one-part-path.yaml @@ -0,0 +1,7 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +servers: + - url: https://petstore.swagger.io/api-seguros +paths: {} \ No newline at end of file diff --git a/src/test/resources/checks/v31/format/OAR102/valid-with-values.json b/src/test/resources/checks/v31/format/OAR102/valid-with-values.json new file mode 100644 index 00000000..3ea07fc5 --- /dev/null +++ b/src/test/resources/checks/v31/format/OAR102/valid-with-values.json @@ -0,0 +1,13 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "servers": [ + { + "url": "http://petstore.swagger.io/api-seguros/v1" + } + ], + "paths": {} +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/format/OAR102/valid-with-values.yaml b/src/test/resources/checks/v31/format/OAR102/valid-with-values.yaml new file mode 100644 index 00000000..89bfccfb --- /dev/null +++ b/src/test/resources/checks/v31/format/OAR102/valid-with-values.yaml @@ -0,0 +1,7 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +servers: + - url: https://petstore.swagger.io/api-seguros/v1 +paths: {} \ No newline at end of file diff --git a/src/test/resources/checks/v31/format/OAR102/valid.json b/src/test/resources/checks/v31/format/OAR102/valid.json new file mode 100644 index 00000000..6d48f8b4 --- /dev/null +++ b/src/test/resources/checks/v31/format/OAR102/valid.json @@ -0,0 +1,13 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "servers": [ + { + "url": "http://petstore.swagger.io/api-seguros/v1" + } + ], + "paths": { } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/format/OAR102/valid.yaml b/src/test/resources/checks/v31/format/OAR102/valid.yaml new file mode 100644 index 00000000..89bfccfb --- /dev/null +++ b/src/test/resources/checks/v31/format/OAR102/valid.yaml @@ -0,0 +1,7 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +servers: + - url: https://petstore.swagger.io/api-seguros/v1 +paths: {} \ No newline at end of file diff --git a/src/test/resources/checks/v31/format/OAR110/valid.json b/src/test/resources/checks/v31/format/OAR110/valid.json new file mode 100644 index 00000000..0828cc2f --- /dev/null +++ b/src/test/resources/checks/v31/format/OAR110/valid.json @@ -0,0 +1,19 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "API de Ejemplo", + "version": "1.0.0", + "description": "Esta es una API de ejemplo.", + "termsOfService": "http://ejemplo.com/terminos/", + "contact": { + "name": "Soporte de API", + "url": "http://ejemplo.com/contacto", + "email": "contacto@ejemplo.com" + }, + "license": { + "name": "Apache 2.0", + "url": "https://www.apache.org/licenses/LICENSE-2.0.html" + } + }, + "paths": {} + } \ No newline at end of file diff --git a/src/test/resources/checks/v31/format/OAR110/valid.yaml b/src/test/resources/checks/v31/format/OAR110/valid.yaml new file mode 100644 index 00000000..0185cb17 --- /dev/null +++ b/src/test/resources/checks/v31/format/OAR110/valid.yaml @@ -0,0 +1,14 @@ +openapi: 3.0.0 +info: + title: API de Ejemplo + version: 1.0.0 + description: Esta es una API de ejemplo. + termsOfService: http://ejemplo.com/terminos/ + contact: + name: Soporte de API + url: http://ejemplo.com/contacto + email: contacto@ejemplo.com + license: + name: aaa + url: awss +paths: {} \ No newline at end of file diff --git a/src/test/resources/checks/v31/format/OAR111/valid.json b/src/test/resources/checks/v31/format/OAR111/valid.json new file mode 100644 index 00000000..0828cc2f --- /dev/null +++ b/src/test/resources/checks/v31/format/OAR111/valid.json @@ -0,0 +1,19 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "API de Ejemplo", + "version": "1.0.0", + "description": "Esta es una API de ejemplo.", + "termsOfService": "http://ejemplo.com/terminos/", + "contact": { + "name": "Soporte de API", + "url": "http://ejemplo.com/contacto", + "email": "contacto@ejemplo.com" + }, + "license": { + "name": "Apache 2.0", + "url": "https://www.apache.org/licenses/LICENSE-2.0.html" + } + }, + "paths": {} + } \ No newline at end of file diff --git a/src/test/resources/checks/v31/format/OAR111/valid.yaml b/src/test/resources/checks/v31/format/OAR111/valid.yaml new file mode 100644 index 00000000..5b95c019 --- /dev/null +++ b/src/test/resources/checks/v31/format/OAR111/valid.yaml @@ -0,0 +1,14 @@ +openapi: 3.0.0 +info: + title: API de Ejemplo + version: 1.0.0 + description: Esta es una API de ejemplo. + termsOfService: http://ejemplo.com/terminos/ + contact: + name: Soporte de API + url: http://ejemplo.com/contacto + email: contacto@ejemplo.com + license: + name: Apache 2.0 + url: https://www.apache.org/licenses/LICENSE-2.0.html +paths: {} \ No newline at end of file diff --git a/src/test/resources/checks/v31/format/OAR113/invalid.json b/src/test/resources/checks/v31/format/OAR113/invalid.json new file mode 100644 index 00000000..8fc8181f --- /dev/null +++ b/src/test/resources/checks/v31/format/OAR113/invalid.json @@ -0,0 +1,26 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Sample API" + }, + "paths": { + "/example": { # Noncompliant {{OAR113: Field or extension x-custom-example must be at the assigned location}} + "get": { # Noncompliant {{OAR113: Field or extension x-custom-example must be at the assigned location}} + "description": "Get example", + "responses": { + "200": { # Noncompliant {{OAR113: Field or extension x-custom-example must be at the assigned location}} + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExampleObject" + } + } + } + } + } + } + } + } +} diff --git a/src/test/resources/checks/v31/format/OAR113/invalid.yaml b/src/test/resources/checks/v31/format/OAR113/invalid.yaml new file mode 100644 index 00000000..eaab54bb --- /dev/null +++ b/src/test/resources/checks/v31/format/OAR113/invalid.yaml @@ -0,0 +1,16 @@ +openapi: "3.0.0" +info: + version: "1.0.0" + title: "Sample API" +paths: + /example: # Noncompliant {{OAR113: Field or extension x-custom-example must be at the assigned location}} + get: # Noncompliant {{OAR113: Field or extension x-custom-example must be at the assigned location}} + description: "Get example" + responses: + "200": # Noncompliant {{OAR113: Field or extension x-custom-example must be at the assigned location}} + description: "Successful response" + content: + application/json: + schema: + $ref: "#/components/schemas/ExampleObject" + diff --git a/src/test/resources/checks/v31/format/OAR113/valid.json b/src/test/resources/checks/v31/format/OAR113/valid.json new file mode 100644 index 00000000..3c078dc6 --- /dev/null +++ b/src/test/resources/checks/v31/format/OAR113/valid.json @@ -0,0 +1,45 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Sample API", + }, + "paths": { + "/example": { + "get": { + "x-custom-example": "example value", + "description": "Get example", + "responses": { + "200": { + "x-custom-example": "example value", + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExampleObject" + } + } + } + } + } + }, + "x-custom-example": "example value" + } + }, + "components": { + "schemas": { + "ExampleObject": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + } + } + + } + } + } +} diff --git a/src/test/resources/checks/v31/format/OAR113/valid.yaml b/src/test/resources/checks/v31/format/OAR113/valid.yaml new file mode 100644 index 00000000..be171009 --- /dev/null +++ b/src/test/resources/checks/v31/format/OAR113/valid.yaml @@ -0,0 +1,27 @@ +openapi: "3.0.0" +info: + version: "1.0.0" + title: "Sample API" +paths: + /example: + get: + x-custom-example: "example" + description: "Get example" + responses: + "200": + x-custom-example: "example" + description: "Successful response" + content: + application/json: + schema: + $ref: "#/components/schemas/ExampleObject" + x-custom-example: "example" +components: + schemas: + ExampleObject: + type: object + properties: + id: + type: string + name: + type: string diff --git a/src/test/resources/checks/v31/format/OAR115/invalid.json b/src/test/resources/checks/v31/format/OAR115/invalid.json new file mode 100644 index 00000000..5b686976 --- /dev/null +++ b/src/test/resources/checks/v31/format/OAR115/invalid.json @@ -0,0 +1,45 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "API de ejemplo", + "version": "1.0.0" + }, + "paths": { + "/users": { + "get": { + "summary": "Obtener lista de usuarios", + "responses": { + "200": { + "description": "OK" + }, + "400": { + "description": "Error de validación", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "ErrorResponse": { + "type": "object", + "properties": { + "code": { "type": "integer" }, + "message": { "type": "string" } + }, + "required":[ + "code", + "message", + "otherfield" # Noncompliant {{OAR115: This value does not exist, it must be defined in the schema properties}} + ] + } + } + } +} diff --git a/src/test/resources/checks/v31/format/OAR115/invalid.yaml b/src/test/resources/checks/v31/format/OAR115/invalid.yaml new file mode 100644 index 00000000..5f3876b2 --- /dev/null +++ b/src/test/resources/checks/v31/format/OAR115/invalid.yaml @@ -0,0 +1,30 @@ +openapi: 3.0.0 +info: + title: API de ejemplo + version: "1.0.0" +paths: + /users: + get: + summary: Obtener lista de usuarios + responses: + '200': + description: OK + '400': + description: Error de validación + content: + application/json: + schema: + $ref: "#/components/schemas/ErrorResponse" +components: + schemas: + ErrorResponse: + type: object + properties: + code: + type: integer + message: + type: string + required: + - code + - message + - otherfield # Noncompliant {{OAR115: This value does not exist, it must be defined in the schema properties}} diff --git a/src/test/resources/checks/v31/format/OAR115/valid.json b/src/test/resources/checks/v31/format/OAR115/valid.json new file mode 100644 index 00000000..1574947e --- /dev/null +++ b/src/test/resources/checks/v31/format/OAR115/valid.json @@ -0,0 +1,44 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "API de ejemplo", + "version": "1.0.0" + }, + "paths": { + "/users": { + "get": { + "summary": "Obtener lista de usuarios", + "responses": { + "200": { + "description": "OK" + }, + "400": { + "description": "Error de validación", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "ErrorResponse": { + "type": "object", + "properties": { + "code": { "type": "integer" }, + "message": { "type": "string" } + }, + "required":[ + "code", + "message" + ] + } + } + } +} diff --git a/src/test/resources/checks/v31/format/OAR115/valid.yaml b/src/test/resources/checks/v31/format/OAR115/valid.yaml new file mode 100644 index 00000000..c97cfb50 --- /dev/null +++ b/src/test/resources/checks/v31/format/OAR115/valid.yaml @@ -0,0 +1,29 @@ +openapi: 3.0.0 +info: + title: API de ejemplo + version: "1.0.0" +paths: + /users: + get: + summary: Obtener lista de usuarios + responses: + '200': + description: OK + '400': + description: Error de validación + content: + application/json: + schema: + $ref: "#/components/schemas/ErrorResponse" +components: + schemas: + ErrorResponse: + type: object + properties: + code: + type: integer + message: + type: string + required: + - code + - message diff --git a/src/test/resources/checks/v31/operations/OAR045/defined-response.json b/src/test/resources/checks/v31/operations/OAR045/defined-response.json new file mode 100644 index 00000000..f86d6ac4 --- /dev/null +++ b/src/test/resources/checks/v31/operations/OAR045/defined-response.json @@ -0,0 +1,78 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/pets": { + "get": { + "responses": { + "200": { + "description": "some response" // Noncompliant {{OAR045: Define the model of your response}} + }, + "202": { + "description": "some response", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + }, + "401": { // Noncompliant {{OAR045: Define the model of your response}} + "description": "error response", + "$ref": "#/components/responses/MyErroneousResponse" + } + } + }, + "post": { + "responses": {} // Noncompliant {{OAR045: Define the responses of your operations}} + }, + "put": { + "responses": { + "default": { + "description": "default response", + "content": { + "application/json": { + "schema": { + "type": "object" + } + } + } + }, + "200": { // Noncompliant {{OAR045: Define the model of your response}} + "description": "success response" + } + } + } + }, + "/other": { + "delete": { + "responses": { + "204": { + "description": "No content" + } + } + } + } + }, + "components": { + "responses": { + "MyErroneousResponse": { + "description": "an example response missing a model" + }, + "MyOtherResponse": { + "description": "some response", + "content": { + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } +} diff --git a/src/test/resources/checks/v31/operations/OAR045/defined-response.yaml b/src/test/resources/checks/v31/operations/OAR045/defined-response.yaml new file mode 100644 index 00000000..4370ac6c --- /dev/null +++ b/src/test/resources/checks/v31/operations/OAR045/defined-response.yaml @@ -0,0 +1,48 @@ +openapi: 3.0.0 +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: + get: + responses: + # Noncompliant@+1 {{OAR045: Define the model of your response}} + '200': + description: some response + '202': + description: some response + content: + application/json: + schema: + type: string + '401': # Noncompliant {{OAR045: Define the model of your response}} + description: error response + $ref: '#/components/responses/MyErroneousResponse' + post: + # Noncompliant@+1 {{OAR045: Define the responses of your operations}} + responses: {} + put: + responses: + default: + description: default response + content: + application/json: + schema: + type: object + '200': # Noncompliant {{OAR045: Define the model of your response}} + description: success response + /other: + delete: + responses: + '204': + description: No content +components: + responses: + MyErroneousResponse: + description: an example response missing a model + MyOtherResponse: + description: some response + content: + application/json: + schema: + type: object diff --git a/src/test/resources/checks/v31/operations/OAR048/many-body-params.json b/src/test/resources/checks/v31/operations/OAR048/many-body-params.json new file mode 100644 index 00000000..6efb018b --- /dev/null +++ b/src/test/resources/checks/v31/operations/OAR048/many-body-params.json @@ -0,0 +1,75 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/pets": { + "get": { + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + }, + "responses": { + "default": { + "description": "the default response" + } + } + }, + "post": { # Noncompliant {{OAR048: An operation can have at most one body parameter}} + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "otherParam": { + "type": "string" + } + }, + "required": ["otherParam"] + } + } + } + }, + "x-extraRequestBody": { + "description": "Simulated second body param (invalid by spec)", + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "toto": { + "type": "string" + } + }, + "required": ["toto"] + } + } + } + }, + "responses": { + "default": { + "description": "the default response" + } + } + } + } + }, + "components": { + "schemas": { + "Used": { + "type": "string" + } + } + } +} diff --git a/src/test/resources/checks/v31/operations/OAR048/many-body-params.yaml b/src/test/resources/checks/v31/operations/OAR048/many-body-params.yaml new file mode 100644 index 00000000..6e4df5b8 --- /dev/null +++ b/src/test/resources/checks/v31/operations/OAR048/many-body-params.yaml @@ -0,0 +1,47 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: + get: + requestBody: + required: true + content: + application/json: + schema: + type: string + responses: + default: + description: the default response + post: # Noncompliant {{OAR048: An operation can have at most one body parameter}} + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + otherParam: + type: string + required: + - otherParam + x-extraRequestBody: + description: Simulated second body param (invalid by spec) + required: true + content: + application/json: + schema: + type: object + properties: + toto: + type: string + required: + - toto + responses: + default: + description: the default response +components: + schemas: + Used: + type: string diff --git a/src/test/resources/checks/v31/operations/OAR061/insuficent-response-codes.json b/src/test/resources/checks/v31/operations/OAR061/insuficent-response-codes.json new file mode 100644 index 00000000..d6afd0b7 --- /dev/null +++ b/src/test/resources/checks/v31/operations/OAR061/insuficent-response-codes.json @@ -0,0 +1,39 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/status": { + "get": { + "summary": "Get API status", + "responses": { + "400": { + "description": "error" + } + } + } + }, + "/another": { + "get": { + "summary": "Get another API status", + "responses": { + "400": { + "description": "error" + } + } + } + }, + "/users": { + "get": { + "summary": "Get all users", + "responses": { # Noncompliant {{OAR061: Response code 200, 202, 206 must be defined}} + "400": { + "description": "Error" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/operations/OAR061/insuficent-response-codes.yaml b/src/test/resources/checks/v31/operations/OAR061/insuficent-response-codes.yaml new file mode 100644 index 00000000..be4253c1 --- /dev/null +++ b/src/test/resources/checks/v31/operations/OAR061/insuficent-response-codes.yaml @@ -0,0 +1,23 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /status: + get: + summary: Get API status + responses: + 400: + description: error + /another: + get: + summary: Get another API status + responses: + 400: + description: error + /users: + get: + summary: Get all users + responses: # Noncompliant {{OAR061: Response code 200, 202, 206 must be defined}} + 400: + description: Error \ No newline at end of file diff --git a/src/test/resources/checks/v31/operations/OAR061/valid.json b/src/test/resources/checks/v31/operations/OAR061/valid.json new file mode 100644 index 00000000..eebb26a9 --- /dev/null +++ b/src/test/resources/checks/v31/operations/OAR061/valid.json @@ -0,0 +1,41 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/status": { + "get": { + "summary": "Get API status", + "responses": { + "200": { + "description": "OK" + }, + "202": { + "description": "Accepted" + }, + "206": { + "description": "Partial Content" + } + } + } + }, + "/users": { + "get": { + "summary": "Get all users", + "responses": { + "200": { + "description": "OK" + }, + "202": { + "description": "Accepted" + }, + "206": { + "description": "Partial Content" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/operations/OAR061/valid.yaml b/src/test/resources/checks/v31/operations/OAR061/valid.yaml new file mode 100644 index 00000000..46fd051f --- /dev/null +++ b/src/test/resources/checks/v31/operations/OAR061/valid.yaml @@ -0,0 +1,25 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /status: + get: + summary: Get API status + responses: + 200: + description: OK + 202: + description: Accepted + 206: + description: Partial Content + /users: + get: + summary: Get all users + responses: + 200: + description: OK + 202: + description: Accepted + 206: + description: Partial Content diff --git a/src/test/resources/checks/v31/operations/OAR062/insuficent-response-codes.json b/src/test/resources/checks/v31/operations/OAR062/insuficent-response-codes.json new file mode 100644 index 00000000..5c5c07f3 --- /dev/null +++ b/src/test/resources/checks/v31/operations/OAR062/insuficent-response-codes.json @@ -0,0 +1,39 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/status": { + "post": { + "summary": "Get API status", + "responses": { + "400": { + "description": "error" + } + } + } + }, + "/another": { + "post": { + "summary": "Get another API status", + "responses": { + "400": { + "description": "error" + } + } + } + }, + "/users": { + "post": { + "summary": "Get all users", + "responses": { # Noncompliant {{OAR062: Response code 200, 201, 202, 204, 206 must be defined}} + "400": { + "description": "Error" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/operations/OAR062/insuficent-response-codes.yaml b/src/test/resources/checks/v31/operations/OAR062/insuficent-response-codes.yaml new file mode 100644 index 00000000..b6afd0f4 --- /dev/null +++ b/src/test/resources/checks/v31/operations/OAR062/insuficent-response-codes.yaml @@ -0,0 +1,23 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /status: + post: + summary: Get API status + responses: + 400: + description: error + /another: + post: + summary: Get another API status + responses: + 400: + description: error + /users: + post: + summary: Get all users + responses: # Noncompliant {{OAR062: Response code 200, 201, 202, 204, 206 must be defined}} + 400: + description: Error \ No newline at end of file diff --git a/src/test/resources/checks/v31/operations/OAR062/valid.json b/src/test/resources/checks/v31/operations/OAR062/valid.json new file mode 100644 index 00000000..41369536 --- /dev/null +++ b/src/test/resources/checks/v31/operations/OAR062/valid.json @@ -0,0 +1,41 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/status": { + "post": { + "summary": "Get API status", + "responses": { + "200": { + "description": "OK" + }, + "202": { + "description": "Accepted" + }, + "206": { + "description": "Partial Content" + } + } + } + }, + "/users": { + "post": { + "summary": "Get all users", + "responses": { + "200": { + "description": "OK" + }, + "202": { + "description": "Accepted" + }, + "206": { + "description": "Partial Content" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/operations/OAR062/valid.yaml b/src/test/resources/checks/v31/operations/OAR062/valid.yaml new file mode 100644 index 00000000..cbd378fe --- /dev/null +++ b/src/test/resources/checks/v31/operations/OAR062/valid.yaml @@ -0,0 +1,25 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /status: + post: + summary: Get API status + responses: + 200: + description: OK + 202: + description: Accepted + 206: + description: Partial Content + /users: + post: + summary: Get all users + responses: + 200: + description: OK + 202: + description: Accepted + 206: + description: Partial Content diff --git a/src/test/resources/checks/v31/operations/OAR063/insuficent-response-codes.json b/src/test/resources/checks/v31/operations/OAR063/insuficent-response-codes.json new file mode 100644 index 00000000..fd50ba37 --- /dev/null +++ b/src/test/resources/checks/v31/operations/OAR063/insuficent-response-codes.json @@ -0,0 +1,39 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/status": { + "put": { + "summary": "Get API status", + "responses": { + "400": { + "description": "error" + } + } + } + }, + "/another": { + "put": { + "summary": "Get another API status", + "responses": { + "400": { + "description": "error" + } + } + } + }, + "/users": { + "put": { + "summary": "Get all users", + "responses": { # Noncompliant {{OAR063: Response code 200, 202, 204, 206 must be defined}} + "400": { + "description": "Error" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/operations/OAR063/insuficent-response-codes.yaml b/src/test/resources/checks/v31/operations/OAR063/insuficent-response-codes.yaml new file mode 100644 index 00000000..46cb15dd --- /dev/null +++ b/src/test/resources/checks/v31/operations/OAR063/insuficent-response-codes.yaml @@ -0,0 +1,23 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /status: + put: + summary: Get API status + responses: + 400: + description: error + /another: + put: + summary: Get another API status + responses: + 400: + description: error + /users: + put: + summary: Get all users + responses: # Noncompliant {{OAR063: Response code 200, 202, 204, 206 must be defined}} + 400: + description: Error \ No newline at end of file diff --git a/src/test/resources/checks/v31/operations/OAR063/valid.json b/src/test/resources/checks/v31/operations/OAR063/valid.json new file mode 100644 index 00000000..5f3a20ed --- /dev/null +++ b/src/test/resources/checks/v31/operations/OAR063/valid.json @@ -0,0 +1,41 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/status": { + "put": { + "summary": "Get API status", + "responses": { + "200": { + "description": "OK" + }, + "202": { + "description": "Accepted" + }, + "206": { + "description": "Partial Content" + } + } + } + }, + "/users": { + "put": { + "summary": "Get all users", + "responses": { + "200": { + "description": "OK" + }, + "202": { + "description": "Accepted" + }, + "206": { + "description": "Partial Content" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/operations/OAR063/valid.yaml b/src/test/resources/checks/v31/operations/OAR063/valid.yaml new file mode 100644 index 00000000..d61b7b23 --- /dev/null +++ b/src/test/resources/checks/v31/operations/OAR063/valid.yaml @@ -0,0 +1,25 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /status: + put: + summary: Get API status + responses: + 200: + description: OK + 202: + description: Accepted + 206: + description: Partial Content + /users: + put: + summary: Get all users + responses: + 200: + description: OK + 202: + description: Accepted + 206: + description: Partial Content diff --git a/src/test/resources/checks/v31/operations/OAR064/insuficent-response-codes.json b/src/test/resources/checks/v31/operations/OAR064/insuficent-response-codes.json new file mode 100644 index 00000000..d72c819c --- /dev/null +++ b/src/test/resources/checks/v31/operations/OAR064/insuficent-response-codes.json @@ -0,0 +1,39 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/status": { + "patch": { + "summary": "Get API status", + "responses": { + "400": { + "description": "error" + } + } + } + }, + "/another": { + "patch": { + "summary": "Get another API status", + "responses": { + "400": { + "description": "error" + } + } + } + }, + "/users": { + "patch": { + "summary": "Get all users", + "responses": { # Noncompliant {{OAR064: Response code 200, 202, 204, 206 must be defined}} + "400": { + "description": "Error" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/operations/OAR064/insuficent-response-codes.yaml b/src/test/resources/checks/v31/operations/OAR064/insuficent-response-codes.yaml new file mode 100644 index 00000000..84beaded --- /dev/null +++ b/src/test/resources/checks/v31/operations/OAR064/insuficent-response-codes.yaml @@ -0,0 +1,23 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /status: + patch: + summary: Get API status + responses: + 400: + description: error + /another: + patch: + summary: Get another API status + responses: + 400: + description: error + /users: + patch: + summary: Get all users + responses: # Noncompliant {{OAR064: Response code 200, 202, 204, 206 must be defined}} + 400: + description: Error \ No newline at end of file diff --git a/src/test/resources/checks/v31/operations/OAR064/valid.json b/src/test/resources/checks/v31/operations/OAR064/valid.json new file mode 100644 index 00000000..4109a3e7 --- /dev/null +++ b/src/test/resources/checks/v31/operations/OAR064/valid.json @@ -0,0 +1,41 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/status": { + "patch": { + "summary": "Get API status", + "responses": { + "200": { + "description": "OK" + }, + "202": { + "description": "Accepted" + }, + "206": { + "description": "Partial Content" + } + } + } + }, + "/users": { + "patch": { + "summary": "Get all users", + "responses": { + "200": { + "description": "OK" + }, + "202": { + "description": "Accepted" + }, + "206": { + "description": "Partial Content" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/operations/OAR064/valid.yaml b/src/test/resources/checks/v31/operations/OAR064/valid.yaml new file mode 100644 index 00000000..fb387b6e --- /dev/null +++ b/src/test/resources/checks/v31/operations/OAR064/valid.yaml @@ -0,0 +1,25 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /status: + patch: + summary: Get API status + responses: + 200: + description: OK + 202: + description: Accepted + 206: + description: Partial Content + /users: + patch: + summary: Get all users + responses: + 200: + description: OK + 202: + description: Accepted + 206: + description: Partial Content diff --git a/src/test/resources/checks/v31/operations/OAR065/insuficent-response-codes.json b/src/test/resources/checks/v31/operations/OAR065/insuficent-response-codes.json new file mode 100644 index 00000000..e246e5a4 --- /dev/null +++ b/src/test/resources/checks/v31/operations/OAR065/insuficent-response-codes.json @@ -0,0 +1,39 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/status": { + "delete": { + "summary": "Get API status", + "responses": { + "400": { + "description": "error" + } + } + } + }, + "/another": { + "delete": { + "summary": "Get another API status", + "responses": { + "400": { + "description": "error" + } + } + } + }, + "/users": { + "delete": { + "summary": "Get all users", + "responses": { # Noncompliant {{OAR065: Response code 200, 202, 204 must be defined}} + "400": { + "description": "Error" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/operations/OAR065/insuficent-response-codes.yaml b/src/test/resources/checks/v31/operations/OAR065/insuficent-response-codes.yaml new file mode 100644 index 00000000..9ef40629 --- /dev/null +++ b/src/test/resources/checks/v31/operations/OAR065/insuficent-response-codes.yaml @@ -0,0 +1,24 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /status: + delete: + summary: Get API status + responses: + 400: + description: error + /another: + delete: + summary: Get another API status + responses: + 400: + description: error + /users: + delete: + summary: Get all users + responses: # Noncompliant {{OAR065: Response code 200, 202, 204 must be defined}} + 400: + description: Error + diff --git a/src/test/resources/checks/v31/operations/OAR065/valid.json b/src/test/resources/checks/v31/operations/OAR065/valid.json new file mode 100644 index 00000000..f4e0b010 --- /dev/null +++ b/src/test/resources/checks/v31/operations/OAR065/valid.json @@ -0,0 +1,41 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/status": { + "delete": { + "summary": "Get API status", + "responses": { + "200": { + "description": "OK" + }, + "202": { + "description": "Accepted" + }, + "206": { + "description": "Partial Content" + } + } + } + }, + "/users": { + "delete": { + "summary": "Get all users", + "responses": { + "200": { + "description": "OK" + }, + "202": { + "description": "Accepted" + }, + "206": { + "description": "Partial Content" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/operations/OAR065/valid.yaml b/src/test/resources/checks/v31/operations/OAR065/valid.yaml new file mode 100644 index 00000000..5b7b3230 --- /dev/null +++ b/src/test/resources/checks/v31/operations/OAR065/valid.yaml @@ -0,0 +1,25 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /status: + delete: + summary: Get API status + responses: + 200: + description: OK + 202: + description: Accepted + 206: + description: Partial Content + /users: + delete: + summary: Get all users + responses: + 200: + description: OK + 202: + description: Accepted + 206: + description: Partial Content diff --git a/src/test/resources/checks/v31/operations/OAR071/missing-query-params.json b/src/test/resources/checks/v31/operations/OAR071/missing-query-params.json new file mode 100644 index 00000000..a3c5fe59 --- /dev/null +++ b/src/test/resources/checks/v31/operations/OAR071/missing-query-params.json @@ -0,0 +1,59 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "My API" + }, + "paths": { + "/examples": { + "get": { + "summary": "Get a list of items", + "parameters": [ # Noncompliant {{OAR071: Query parameters param3 must be defined}} + { + "name": "param1", + "in": "query", + "schema": { + "type": "string" + } + }, + { + "name": "param2", + "in": "query", + "schema": { + "type": "integer" + } + }, + { + "name": "param4", + "in": "query", + "schema": { + "type": "string" + } + }, + { + "name": "param5", + "in": "query", + "schema": { + "type": "number" + } + } + ], + "responses": { + "200": { + "description": "A list of items", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/operations/OAR071/missing-query-params.yaml b/src/test/resources/checks/v31/operations/OAR071/missing-query-params.yaml new file mode 100644 index 00000000..fef15e36 --- /dev/null +++ b/src/test/resources/checks/v31/operations/OAR071/missing-query-params.yaml @@ -0,0 +1,34 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: My API +paths: + /examples: + get: + summary: Get a list of items + parameters: # Noncompliant {{OAR071: Query parameters param3 must be defined}} + - name: param1 + in: query + schema: + type: string + - name: param2 + in: query + schema: + type: integer + - name: param4 + in: query + schema: + type: string + - name: param5 + in: query + schema: + type: number + responses: + 200: + description: A list of items + content: + application/json: + schema: + type: array + items: + type: string \ No newline at end of file diff --git a/src/test/resources/checks/v31/operations/OAR071/valid-query-params.json b/src/test/resources/checks/v31/operations/OAR071/valid-query-params.json new file mode 100644 index 00000000..5dcdf248 --- /dev/null +++ b/src/test/resources/checks/v31/operations/OAR071/valid-query-params.json @@ -0,0 +1,66 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "My API" + }, + "paths": { + "/items": { + "get": { + "summary": "Get a list of items", + "parameters": [ + { + "name": "param1", + "in": "query", + "schema": { + "type": "string" + } + }, + { + "name": "param2", + "in": "query", + "schema": { + "type": "integer" + } + }, + { + "name": "param3", + "in": "query", + "schema": { + "type": "boolean" + } + }, + { + "name": "param4", + "in": "query", + "schema": { + "type": "string" + } + }, + { + "name": "param5", + "in": "query", + "schema": { + "type": "number" + } + } + ], + "responses": { + "200": { + "description": "A list of items", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/operations/OAR071/valid-query-params.yaml b/src/test/resources/checks/v31/operations/OAR071/valid-query-params.yaml new file mode 100644 index 00000000..7a8d8899 --- /dev/null +++ b/src/test/resources/checks/v31/operations/OAR071/valid-query-params.yaml @@ -0,0 +1,38 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: My API +paths: + /items: + get: + summary: Get a list of items + parameters: + - name: param1 + in: query + schema: + type: string + - name: param2 + in: query + schema: + type: integer + - name: param3 + in: query + schema: + type: boolean + - name: param4 + in: query + schema: + type: string + - name: param5 + in: query + schema: + type: number + responses: + 200: + description: A list of items + content: + application/json: + schema: + type: array + items: + type: string \ No newline at end of file diff --git a/src/test/resources/checks/v31/operations/OAR091/no-ref.json b/src/test/resources/checks/v31/operations/OAR091/no-ref.json new file mode 100644 index 00000000..0a13ec43 --- /dev/null +++ b/src/test/resources/checks/v31/operations/OAR091/no-ref.json @@ -0,0 +1,37 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "Sample API", + "version": "1.0.0" + }, + "paths": { + "/sample": { + "get": { + "parameters": [ # Noncompliant {{OAR091: Parameters must contain only references ($ref)}} + { + "name": "user", + "in": "query", + "description": "User information", + "required": true, + "schema": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "name": { + "type": "string" + } + } + } + } + ], + "responses": { + "200": { + "description": "Successful response" + } + } + } + } + } + } \ No newline at end of file diff --git a/src/test/resources/checks/v31/operations/OAR091/no-ref.yaml b/src/test/resources/checks/v31/operations/OAR091/no-ref.yaml new file mode 100644 index 00000000..cf71ac9a --- /dev/null +++ b/src/test/resources/checks/v31/operations/OAR091/no-ref.yaml @@ -0,0 +1,22 @@ +openapi: 3.0.0 +info: + title: Sample API + version: 1.0.0 +paths: + /sample: + get: + parameters: # Noncompliant {{OAR091: Parameters must contain only references ($ref)}} + - name: user + in: query + description: User information + required: true + schema: + type: object + properties: + id: + type: integer + name: + type: string + responses: + '200': + description: Successful response \ No newline at end of file diff --git a/src/test/resources/checks/v31/operations/OAR091/with-ref.json b/src/test/resources/checks/v31/operations/OAR091/with-ref.json new file mode 100644 index 00000000..262538cd --- /dev/null +++ b/src/test/resources/checks/v31/operations/OAR091/with-ref.json @@ -0,0 +1,44 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "Sample API", + "version": "1.0.0" + }, + "paths": { + "/sample": { + "get": { + "parameters": [ + { + "$ref": "#/components/parameters/UserParam" + } + ], + "responses": { + "200": { + "description": "Successful response" + } + } + } + } + }, + "components": { + "parameters": { + "UserParam": { + "name": "user", + "in": "query", + "description": "User information", + "required": true, + "schema": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "name": { + "type": "string" + } + } + } + } + } + } + } \ No newline at end of file diff --git a/src/test/resources/checks/v31/operations/OAR091/with-ref.yaml b/src/test/resources/checks/v31/operations/OAR091/with-ref.yaml new file mode 100644 index 00000000..ad4061d5 --- /dev/null +++ b/src/test/resources/checks/v31/operations/OAR091/with-ref.yaml @@ -0,0 +1,26 @@ +openapi: 3.0.0 +info: + title: Sample API + version: 1.0.0 +paths: + /sample: + get: + parameters: + - $ref: '#/components/parameters/UserParam' + responses: + '200': + description: Successful response +components: + parameters: + UserParam: + name: user + in: query + description: User information + required: true + schema: + type: object + properties: + id: + type: integer + name: + type: string \ No newline at end of file diff --git a/src/test/resources/checks/v31/operations/OAR092/no-ref.json b/src/test/resources/checks/v31/operations/OAR092/no-ref.json new file mode 100644 index 00000000..b46235db --- /dev/null +++ b/src/test/resources/checks/v31/operations/OAR092/no-ref.json @@ -0,0 +1,52 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "Sample API", + "version": "1.0.0" + }, + "paths": { + "/pets": { + "post": { + "summary": "Create a pet", + "requestBody": { # Noncompliant {{OAR092: Request body must contain only references ($ref)}} + "description": "The pet to create", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "name": { + "type": "string" + } + } + } + } + } + }, + "responses": { + "201": { + "description": "Pet created successfully", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "name": { + "type": "string" + } + } + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/operations/OAR092/no-ref.yaml b/src/test/resources/checks/v31/operations/OAR092/no-ref.yaml new file mode 100644 index 00000000..a44925c1 --- /dev/null +++ b/src/test/resources/checks/v31/operations/OAR092/no-ref.yaml @@ -0,0 +1,579 @@ +openapi: 3.0.1 +info: + title: Sample-API_efc2b9f76813_V + description: API de ejemplo para pruebas + contact: + name: Nombre del Contacto + email: contact@mail.com + version: 1.0.0 +servers: + - url: https://api.example.es/api-sample/v1 +paths: + /datos-usuarios: + get: + summary: Listado de usuarios + description: Método que permite obtener un listado con datos básicos de un usuario + parameters: + - name: desde + in: query + schema: + type: string + format: date + required: false + - name: hasta + in: query + schema: + type: string + format: date + required: false + responses: + '200': + description: OK + headers: + X-Correlation-Id: + description: Cabecera 'X-Correlation-Id' + schema: + type: string + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/datosUsuario' + '400': + description: Bad Request + headers: + X-Correlation-Id: + description: Cabecera 'X-Correlation-Id' + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/errorMessage' + example: + error: + status: '400' + message: Bad Request + path: /datos-usuario + type: https://docs.example.es/x/A1D8Aw + operationId: '10004' + errors: + - code: '101' + message: Invalid format + location: desde + '429': + description: Too many requests + headers: + X-Correlation-Id: + description: Cabecera 'X-Correlation-Id' + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/errorMessage' + example: + error: + status: '429' + message: Too many requests + path: /datos-usuario + type: https://docs.example.es/x/A1D8Aw + operationId: '10005' + errors: + - code: '105' + message: >- + The user has sent too many requests in a given amount of + time + default: + description: Server Error (50X) + headers: + X-Correlation-Id: + description: Cabecera 'X-Correlation-Id' + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/errorMessage' + example: + error: + status: '500' + message: Internal server error + path: /datos-usuario + type: https://docs.example.es/x/5008Aw + operationId: '10004' + errors: + - code: '501' + message: Internal server error + post: + summary: Alta de los datos de un usuario + description: Método que permite dar de alta los datos básicos de un usuario + requestBody: # Noncompliant {{OAR092: Request body must contain only references ($ref)}} + description: Datos del usuario + content: + application/json: + schema: + $ref: '#/components/schemas/datosUsuario' + responses: + '201': + description: OK + headers: + location: + description: RFC 7231 - The new resource which was created by the request. + schema: + type: string + example: /datos-usuarios/a2649c29-48c6-4c48-b64d-0455346efbbd + X-Correlation-Id: + description: Cabecera 'X-Correlation-Id' + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/datosUsuario' + '400': + description: Bad Request + headers: + X-Correlation-Id: + description: Cabecera 'X-Correlation-Id' + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/errorMessage' + example: + error: + status: '400' + message: Bad Request + path: /datos-usuario + type: https://docs.example.es/x/A1D8Aw + operationId: '10004' + errors: + - code: '101' + message: Invalid format + location: emailUsuario + '429': + description: Too many requests + headers: + X-Correlation-Id: + description: Cabecera 'X-Correlation-Id' + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/errorMessage' + example: + error: + status: '429' + message: Too many requests + path: /datos-usuario + type: https://docs.example.es/x/A1D8Aw + operationId: '10005' + errors: + - code: '105' + message: >- + The user has sent too many requests in a given amount of + time + default: + description: Server Error (50X) + headers: + X-Correlation-Id: + description: Cabecera 'X-Correlation-Id' + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/errorMessage' + example: + error: + status: '500' + message: Internal server error + path: /datos-usuario + type: https://docs.example.es/x/5008Aw + operationId: '10004' + errors: + - code: '501' + message: Internal server error + x-codegen-request-body-name: body + /datos-usuarios/{idUsuario}: + get: + summary: Recuperación de los datos de un usuario por su id + description: >- + Método que permite recuperar la información básica de un usuario por su + id + parameters: + - name: idUsuario + in: path + description: Identificador del usuario + required: true + schema: + type: string + minLength: 5 + maxLength: 255 + format: ^[0-9]*$ + responses: + '200': + description: OK + headers: + X-Correlation-Id: + description: Cabecera 'X-Correlation-Id' + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/datosUsuario' + '400': + description: Bad Request + headers: + X-Correlation-Id: + description: Cabecera 'X-Correlation-Id' + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/errorMessage' + example: + error: + status: '400' + message: Bad Request + path: /datos-usuario/0 + type: https://docs.example.es/x/A1D8Aw + operationId: '10001' + errors: + - code: '101' + message: Invalid format + location: idUsuario + '404': + description: Not found (404) + headers: + X-Correlation-Id: + description: Cabecera 'X-Correlation-Id' + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/errorMessage' + example: + error: + status: '404' + message: Not found + path: /datos-usuario/0 + type: https://docs.example.es/x/A1D8Aw + operationId: '10002' + errors: + - code: '102' + message: Entity not found + location: idUsuario + '429': + description: Too many requests + headers: + X-Correlation-Id: + description: Cabecera 'X-Correlation-Id' + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/errorMessage' + example: + error: + status: '429' + message: Too many requests + path: /datos-usuario + type: https://docs.example.es/x/A1D8Aw + operationId: '10005' + errors: + - code: '105' + message: >- + The user has sent too many requests in a given amount of + time + default: + description: Server Error (50X) + headers: + X-Correlation-Id: + description: Cabecera 'X-Correlation-Id' + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/errorMessage' + put: + summary: Modificación de los datos de un usuario + description: Método que permite modificar los datos básicos de un usuario + parameters: + - name: idUsuario + in: path + description: Identificador del usuario + required: true + schema: + type: string + minLength: 5 + maxLength: 255 + format: ^[0-9]*$ + requestBody: # Noncompliant {{OAR092: Request body must contain only references ($ref)}} + description: Datos del usuario + content: + application/json: + schema: + $ref: '#/components/schemas/datosUsuario' + responses: + '200': + description: OK + headers: + X-Correlation-Id: + description: Cabecera 'X-Correlation-Id' + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/datosUsuario' + '400': + description: Bad Request + headers: + X-Correlation-Id: + description: Cabecera 'X-Correlation-Id' + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/errorMessage' + example: + error: + status: '400' + message: Bad Request + path: /datos-usuario/0 + type: https://docs.example.es/x/A1D8Aw + operationId: '10002' + errors: + - code: '101' + message: Invalid format + location: idUsuario + '404': + description: Not found (404) + headers: + X-Correlation-Id: + description: Cabecera 'X-Correlation-Id' + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/errorMessage' + '429': + description: Too many requests + headers: + X-Correlation-Id: + description: Cabecera 'X-Correlation-Id' + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/errorMessage' + example: + error: + status: '429' + message: Too many requests + path: /datos-usuario + type: https://docs.example.es/x/A1D8Aw + operationId: '10005' + errors: + - code: '105' + message: >- + The user has sent too many requests in a given amount of + time + default: + description: Server Error (50X) + headers: + X-Correlation-Id: + description: Cabecera 'X-Correlation-Id' + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/errorMessage' + x-codegen-request-body-name: body + delete: + summary: Borrado de los datos de un usuario + description: Método que permite borrar los datos básicos de un usuario + parameters: + - name: idUsuario + in: path + description: Identificador del usuario + required: true + schema: + type: string + minLength: 5 + maxLength: 255 + format: ^[0-9]*$ + responses: + '204': + description: No content + headers: + X-Correlation-Id: + description: Cabecera 'X-Correlation-Id' + schema: + type: string + '400': + description: Bad Request + headers: + X-Correlation-Id: + description: Cabecera 'X-Correlation-Id' + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/errorMessage' + example: + error: + status: '400' + message: Bad Request + path: /datos-usuario/0 + type: https://docs.example.es/x/A1D8Aw + operationId: '10003' + errors: + - code: '101' + message: Invalid format + location: idUsuario + '404': + description: Not found (404) + headers: + X-Correlation-Id: + description: Cabecera 'X-Correlation-Id' + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/errorMessage' + '429': + description: Too many requests + headers: + X-Correlation-Id: + description: Cabecera 'X-Correlation-Id' + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/errorMessage' + example: + error: + status: '429' + message: Too many requests + path: /datos-usuario + type: https://docs.example.es/x/A1D8Aw + operationId: '10005' + errors: + - code: '105' + message: >- + The user has sent too many requests in a given amount of + time + default: + description: Server Error (50X) + headers: + X-Correlation-Id: + description: Cabecera 'X-Correlation-Id' + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/errorMessage' +components: + schemas: + datosUsuario: + title: datosUsuario + type: object + required: + - nombreUsuario + - emailUsuario + properties: + idUsuario: + type: string + description: ID del usuario + example: '12' + readOnly: true + nombreUsuario: + type: string + description: Nombre del usuario + minLength: 5 + maxLength: 255 + example: Pedro + emailUsuario: + type: string + description: Email del usuario + minLength: 5 + maxLength: 255 + example: pedro@mail.com + fechaNacimiento: + type: string + description: Fecha de nacimiento + format: date + example: 1980-10-11T00:00:00.000Z + alta: + type: string + description: Fecha de alta + format: date-time + example: 2022-05-10T12:00:27.870Z + description: Datos básicos de un usuario + errorMessage: + required: + - message + - status + type: object + properties: + status: + type: string + description: Especifica el status code HTTP al que se traducirá la excepción. + message: + type: string + description: Mensaje descriptivo del error. + path: + type: string + description: URL path de la petición que originó el error. + type: + type: string + description: URL que apunta a una descripción de los códigos de error. + operationId: + type: string + description: Id de negocio de la operación realizada. + errors: + type: array + description: >- + Listado de suberrores usado para dar información más detallada, como + en el caso de errores de validación. + items: + $ref: '#/components/schemas/errors' + description: Datamodel refleja el formato de respuesta de error + errors: + required: + - message + type: object + properties: + message: + type: string + description: Detalle del suberror. + code: + type: string + description: Código de error (en errores de validación indica el tipo de error). + location: + type: string + description: >- + Localización del error (en errores de validación indica el campo + donde se produce el error). + description: >- + Listado de suberrores usado para dar información más detallada, como en + el caso de errores de validación. diff --git a/src/test/resources/checks/v31/operations/OAR092/with-ref.json b/src/test/resources/checks/v31/operations/OAR092/with-ref.json new file mode 100644 index 00000000..bfda972c --- /dev/null +++ b/src/test/resources/checks/v31/operations/OAR092/with-ref.json @@ -0,0 +1,44 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "Sample API", + "version": "1.0.0" + }, + "paths": { + "/pets": { + "post": { + "summary": "Create a pet", + "requestBody": { + "$ref": "#/components/requestBodies/Pet" + }, + "responses": { + "201": { + "description": "Pet created successfully" + } + } + } + } + }, + "components": { + "requestBodies": { + "Pet": { + "description": "The pet to create", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "name": { + "type": "string" + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/operations/OAR092/with-ref.yaml b/src/test/resources/checks/v31/operations/OAR092/with-ref.yaml new file mode 100644 index 00000000..aa5503ab --- /dev/null +++ b/src/test/resources/checks/v31/operations/OAR092/with-ref.yaml @@ -0,0 +1,33 @@ +openapi: 3.0.0 +info: + title: Sample API + version: '1.0.0' +paths: + /pets: + post: + summary: Create a pet + requestBody: + $ref: '#/components/requestBodies/PetBody' + responses: + '201': + description: Pet created successfully + content: + application/json: + schema: + $ref: '#/components/schemas/Pet' +components: + requestBodies: + PetBody: + description: The pet to create + content: + application/json: + schema: + $ref: '#/components/schemas/Pet' + schemas: + Pet: + type: object + properties: + id: + type: integer + name: + type: string \ No newline at end of file diff --git a/src/test/resources/checks/v31/operations/OAR093/no-ref.json b/src/test/resources/checks/v31/operations/OAR093/no-ref.json new file mode 100644 index 00000000..a03de219 --- /dev/null +++ b/src/test/resources/checks/v31/operations/OAR093/no-ref.json @@ -0,0 +1,37 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "Sample API", + "version": "1.0.0" + }, + "paths": { + "/pets": { + "get": { + "summary": "Get all pets", + "responses": { # Noncompliant {{OAR093: Responses must contain only references ($ref)}} + "200": { + "description": "A list of pets", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "name": { + "type": "string" + } + } + } + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/operations/OAR093/no-ref.yaml b/src/test/resources/checks/v31/operations/OAR093/no-ref.yaml new file mode 100644 index 00000000..ba07aaf3 --- /dev/null +++ b/src/test/resources/checks/v31/operations/OAR093/no-ref.yaml @@ -0,0 +1,22 @@ +openapi: 3.0.0 +info: + title: Sample API + version: 1.0.0 +paths: + /pets: + get: + summary: Get all pets + responses: # Noncompliant {{OAR093: Responses must contain only references ($ref)}} + '200': + description: A list of pets + content: + application/json: + schema: + type: array + items: + type: object + properties: + id: + type: integer + name: + type: string \ No newline at end of file diff --git a/src/test/resources/checks/v31/operations/OAR093/with-ref.json b/src/test/resources/checks/v31/operations/OAR093/with-ref.json new file mode 100644 index 00000000..1a4fa488 --- /dev/null +++ b/src/test/resources/checks/v31/operations/OAR093/with-ref.json @@ -0,0 +1,44 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "Sample API", + "version": "1.0.0" + }, + "paths": { + "/pets": { + "get": { + "summary": "Get all pets", + "responses": { + "200": { + "$ref": "#/components/responses/AllPets" + } + } + } + } + }, + "components": { + "responses": { + "AllPets": { + "description": "A list of pets", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "name": { + "type": "string" + } + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/operations/OAR093/with-ref.yaml b/src/test/resources/checks/v31/operations/OAR093/with-ref.yaml new file mode 100644 index 00000000..44518a95 --- /dev/null +++ b/src/test/resources/checks/v31/operations/OAR093/with-ref.yaml @@ -0,0 +1,26 @@ +openapi: 3.0.0 +info: + title: Sample API + version: 1.0.0 +paths: + /pets: + get: + summary: Get all pets + responses: + '200': + $ref: '#/components/responses/AllPets' +components: + responses: + AllPets: + description: A list of pets + content: + application/json: + schema: + type: array + items: + type: object + properties: + id: + type: integer + name: + type: string \ No newline at end of file diff --git a/src/test/resources/checks/v31/operations/OAR103/plain.json b/src/test/resources/checks/v31/operations/OAR103/plain.json new file mode 100644 index 00000000..2d2671b6 --- /dev/null +++ b/src/test/resources/checks/v31/operations/OAR103/plain.json @@ -0,0 +1,63 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore (GETs only)" + }, + "paths": { + "/resources": { + "get": { + "responses": { + "200": { + "description": "Ok" + } + } + } + }, + "/resources/{r_id}": { + "get": { + "responses": { + "200": { + "description": "Ok" + } + } + } + }, + "/resources/get": { + "get": { # Noncompliant {{OAR103: Operation not recommended for resource path: resources/get}} + "responses": { + "200": { + "description": "Ok" + } + } + } + }, + "/resources/delete": { + "get": { # Noncompliant {{OAR103: Operation not recommended for resource path: resources/delete}} + "responses": { + "200": { + "description": "Ok" + } + } + } + }, + "/resources/{r_id}/other": { + "get": { + "responses": { + "200": { + "description": "Ok" + } + } + } + }, + "/resources/me": { + "get": { + "responses": { + "200": { + "description": "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/operations/OAR103/plain.yaml b/src/test/resources/checks/v31/operations/OAR103/plain.yaml new file mode 100644 index 00000000..a06d2246 --- /dev/null +++ b/src/test/resources/checks/v31/operations/OAR103/plain.yaml @@ -0,0 +1,35 @@ +openapi: 3.0.0 +info: + version: '1.0.0' + title: Swagger Petstore (GETs only) +paths: + /resources: + get: + responses: + '200': + description: Ok + /resources/{r_id}: + get: + responses: + '200': + description: Ok + /resources/get: + get: # Noncompliant {{OAR103: Operation not recommended for resource path: resources/get}} + responses: + '200': + description: Ok + /resources/{delete}: + get: # Noncompliant {{OAR103: Operation not recommended for resource path: resources/{delete}}} + responses: + '200': + description: Ok + /hola/{r_id}/other: + get: + responses: + '200': + description: Ok + /resources/me: + get: + responses: + '200': + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v31/operations/OAR104/plain.yaml b/src/test/resources/checks/v31/operations/OAR104/plain.yaml new file mode 100644 index 00000000..521a52ca --- /dev/null +++ b/src/test/resources/checks/v31/operations/OAR104/plain.yaml @@ -0,0 +1,40 @@ +openapi: 3.0.0 +info: + version: '1.0.0' + title: Swagger Petstore (Posts only) +paths: + /resources: + post: + responses: + '200': + description: Ok + /resources/me/cars: + post: + responses: + '200': + description: Ok + /resources/get: + post: # Noncompliant {{OAR104: Operation not recommended for resource path: resources/get}} + responses: + '200': + description: Ok + /resources/hello: + post: # Noncompliant {{OAR104: Operation not recommended for resource path: resources/hello}} + responses: + '200': + description: Ok + /resources/{r_id}/other: + post: + responses: + '200': + description: Ok + /resources/me: + post: + responses: + '200': + description: Ok + /resources/search: + post: + responses: + '200': + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v31/operations/OAR105/plain.json b/src/test/resources/checks/v31/operations/OAR105/plain.json new file mode 100644 index 00000000..ff990d20 --- /dev/null +++ b/src/test/resources/checks/v31/operations/OAR105/plain.json @@ -0,0 +1,63 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore (POSTs only)" + }, + "paths": { + "/resources": { + "put": { + "responses": { + "200": { + "description": "Ok" + } + } + } + }, + "/resources/{r_id}": { + "put": { + "responses": { + "200": { + "description": "Ok" + } + } + } + }, + "/resources/get": { + "put": { # Noncompliant {{OAR105: Operation not recommended for resource path: resources/get}} + "responses": { + "200": { + "description": "Ok" + } + } + } + }, + "/resources/delete": { + "put": { # Noncompliant {{OAR105: Operation not recommended for resource path: resources/delete}} + "responses": { + "200": { + "description": "Ok" + } + } + } + }, + "/resources/{r_id}/other": { + "put": { + "responses": { + "200": { + "description": "Ok" + } + } + } + }, + "/resources/me": { + "put": { + "responses": { + "200": { + "description": "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/operations/OAR105/plain.yaml b/src/test/resources/checks/v31/operations/OAR105/plain.yaml new file mode 100644 index 00000000..0708ff20 --- /dev/null +++ b/src/test/resources/checks/v31/operations/OAR105/plain.yaml @@ -0,0 +1,35 @@ +openapi: 3.0.0 +info: + version: '1.0.0' + title: Swagger Petstore (Posts only) +paths: + /resources: + put: + responses: + '200': + description: Ok + /resources/{r_id}: + put: + responses: + '200': + description: Ok + /resources/get: + put: # Noncompliant {{OAR105: Operation not recommended for resource path: resources/get}} + responses: + '200': + description: Ok + /resources/delete: + put: # Noncompliant {{OAR105: Operation not recommended for resource path: resources/delete}} + responses: + '200': + description: Ok + /resources/{r_id}/other: + put: + responses: + '200': + description: Ok + /resources/me: + put: + responses: + '200': + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v31/operations/OAR106/plain.json b/src/test/resources/checks/v31/operations/OAR106/plain.json new file mode 100644 index 00000000..7cf21ad0 --- /dev/null +++ b/src/test/resources/checks/v31/operations/OAR106/plain.json @@ -0,0 +1,63 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore (POSTs only)" + }, + "paths": { + "/resources": { + "patch": { + "responses": { + "200": { + "description": "Ok" + } + } + } + }, + "/resources/{r_id}": { + "patch": { + "responses": { + "200": { + "description": "Ok" + } + } + } + }, + "/resources/get": { + "patch": { # Noncompliant {{OAR106: Operation not recommended for resource path: resources/get}} + "responses": { + "200": { + "description": "Ok" + } + } + } + }, + "/resources/delete": { + "patch": { # Noncompliant {{OAR106: Operation not recommended for resource path: resources/delete}} + "responses": { + "200": { + "description": "Ok" + } + } + } + }, + "/resources/{r_id}/other": { + "patch": { + "responses": { + "200": { + "description": "Ok" + } + } + } + }, + "/resources/me": { + "patch": { + "responses": { + "200": { + "description": "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/operations/OAR106/plain.yaml b/src/test/resources/checks/v31/operations/OAR106/plain.yaml new file mode 100644 index 00000000..7072bd07 --- /dev/null +++ b/src/test/resources/checks/v31/operations/OAR106/plain.yaml @@ -0,0 +1,35 @@ +openapi: 3.0.0 +info: + version: '1.0.0' + title: Swagger Petstore (Posts only) +paths: + /resources: + patch: + responses: + '200': + description: Ok + /resources/{r_id}: + patch: + responses: + '200': + description: Ok + /resources/get: + patch: # Noncompliant {{OAR106: Operation not recommended for resource path: resources/get}} + responses: + '200': + description: Ok + /resources/delete: + patch: # Noncompliant {{OAR106: Operation not recommended for resource path: resources/delete}} + responses: + '200': + description: Ok + /resources/{r_id}/other: + patch: + responses: + '200': + description: Ok + /resources/me: + patch: + responses: + '200': + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v31/operations/OAR107/plain.json b/src/test/resources/checks/v31/operations/OAR107/plain.json new file mode 100644 index 00000000..6bd61a1d --- /dev/null +++ b/src/test/resources/checks/v31/operations/OAR107/plain.json @@ -0,0 +1,63 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore (POSTs only)" + }, + "paths": { + "/resources": { + "delete": { + "responses": { + "200": { + "description": "Ok" + } + } + } + }, + "/resources/{r_id}": { + "delete": { + "responses": { + "200": { + "description": "Ok" + } + } + } + }, + "/resources/get": { + "delete": { # Noncompliant {{OAR107: Operation not recommended for resource path: resources/get}} + "responses": { + "200": { + "description": "Ok" + } + } + } + }, + "/resources/delete": { + "delete": { # Noncompliant {{OAR107: Operation not recommended for resource path: resources/delete}} + "responses": { + "200": { + "description": "Ok" + } + } + } + }, + "/resources/{r_id}/other": { + "delete": { + "responses": { + "200": { + "description": "Ok" + } + } + } + }, + "/resources/me": { + "delete": { + "responses": { + "200": { + "description": "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/operations/OAR107/plain.yaml b/src/test/resources/checks/v31/operations/OAR107/plain.yaml new file mode 100644 index 00000000..7b87298e --- /dev/null +++ b/src/test/resources/checks/v31/operations/OAR107/plain.yaml @@ -0,0 +1,35 @@ +openapi: 3.0.0 +info: + version: '1.0.0' + title: Swagger Petstore (Posts only) +paths: + /resources: + delete: + responses: + '200': + description: Ok + /resources/{r_id}: + delete: + responses: + '200': + description: Ok + /resources/get: + delete: # Noncompliant {{OAR107: Operation not recommended for resource path: resources/get}} + responses: + '200': + description: Ok + /resources/delete: + delete: # Noncompliant {{OAR107: Operation not recommended for resource path: resources/delete}} + responses: + '200': + description: Ok + /resources/{r_id}/other: + delete: + responses: + '200': + description: Ok + /resources/me: + delete: + responses: + '200': + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v31/operations/OAR109/plain.json b/src/test/resources/checks/v31/operations/OAR109/plain.json new file mode 100644 index 00000000..1d2a84df --- /dev/null +++ b/src/test/resources/checks/v31/operations/OAR109/plain.json @@ -0,0 +1,42 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/status": { + "delete": { + "summary": "Get API status", + "responses": { + "400": { + "description": "error" + } + } + } + }, + "/another": { + "delete": { + "summary": "Get another API status", + "responses": { + "400": { + "description": "error" + } + } + } + }, + "/users": { + "delete": { + "summary": "Get all users", + "responses": { # Noncompliant {{OAR109: Use default instead of directly specifying 5XX codes}} + "400": { + "description": "Error" + }, + "500": { + "description": "Internal Server Error" + } + } + } + } + } + } \ No newline at end of file diff --git a/src/test/resources/checks/v31/operations/OAR109/plain.yaml b/src/test/resources/checks/v31/operations/OAR109/plain.yaml new file mode 100644 index 00000000..97cdd572 --- /dev/null +++ b/src/test/resources/checks/v31/operations/OAR109/plain.yaml @@ -0,0 +1,25 @@ +openapi: 3.0.0 +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /status: + delete: + summary: Get API status + responses: + '400': + description: error + /another: + delete: + summary: Get another API status + responses: + '400': + description: error + /users: + delete: + summary: Get all users + responses: # Noncompliant {{OAR109: Use default instead of directly specifying 5XX codes}} + '400': + description: Error + '500': + description: Internal Server Error \ No newline at end of file diff --git a/src/test/resources/checks/v31/owasp/OAR070/no-numeric.json b/src/test/resources/checks/v31/owasp/OAR070/no-numeric.json new file mode 100644 index 00000000..6c4d7036 --- /dev/null +++ b/src/test/resources/checks/v31/owasp/OAR070/no-numeric.json @@ -0,0 +1,42 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/items/{param1}": { + "get": { + "summary": "Get a list of items", + "parameters": [ + { + "name": "param1", + "in": "path", + "required": false, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "A list of items", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + }, + "400": { + "description": "error" + } + } + } + } + } + } \ No newline at end of file diff --git a/src/test/resources/checks/v31/owasp/OAR070/no-numeric.yaml b/src/test/resources/checks/v31/owasp/OAR070/no-numeric.yaml new file mode 100644 index 00000000..b561d78e --- /dev/null +++ b/src/test/resources/checks/v31/owasp/OAR070/no-numeric.yaml @@ -0,0 +1,25 @@ + openapi: "3.0.0" + info: + version: 1.0.0 + title: Swagger Petstore + paths: + /items/{param1}: + get: + summary: Get a list of items + parameters: + - name: param1 + in: path + required: false + schema: + type: string + responses: + 200: + description: A list of items + content: + application/json: + schema: + type: array + items: + type: string + 400: + description: error \ No newline at end of file diff --git a/src/test/resources/checks/v31/owasp/OAR070/numeric.json b/src/test/resources/checks/v31/owasp/OAR070/numeric.json new file mode 100644 index 00000000..95833d45 --- /dev/null +++ b/src/test/resources/checks/v31/owasp/OAR070/numeric.json @@ -0,0 +1,42 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/items/{param1}": { + "get": { + "summary": "Get a list of items", + "parameters": [ + { + "name": "param1", + "in": "path", + "required": false, + "schema": { + "type": "integer" # Noncompliant {{OAR070: Parameters in path shouldnt be numeric}} + } + } + ], + "responses": { + "200": { + "description": "A list of items", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + }, + "400": { + "description": "error" + } + } + } + } + } + } \ No newline at end of file diff --git a/src/test/resources/checks/v31/owasp/OAR070/numeric.yaml b/src/test/resources/checks/v31/owasp/OAR070/numeric.yaml new file mode 100644 index 00000000..c71f0c38 --- /dev/null +++ b/src/test/resources/checks/v31/owasp/OAR070/numeric.yaml @@ -0,0 +1,25 @@ + openapi: "3.0.0" + info: + version: 1.0.0 + title: Swagger Petstore + paths: + /items/{param1}: + get: + summary: Get a list of items + parameters: + - name: param1 + in: path + required: false + schema: + type: integer # Noncompliant {{OAR070: Parameters in path shouldnt be numeric}} + responses: + 200: + description: A list of items + content: + application/json: + schema: + type: array + items: + type: string + 400: + description: error \ No newline at end of file diff --git a/src/test/resources/checks/v31/owasp/OAR073/no-rate-limit.json b/src/test/resources/checks/v31/owasp/OAR073/no-rate-limit.json new file mode 100644 index 00000000..6416f160 --- /dev/null +++ b/src/test/resources/checks/v31/owasp/OAR073/no-rate-limit.json @@ -0,0 +1,29 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Non-compliant API" + }, + "paths": { + "/items": { + "get": { + "summary": "Get a list of items", + "responses": { # Noncompliant {{OAR073: API should include a 429 response to indicate rate limiting}} + "200": { + "description": "A list of items", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/owasp/OAR073/no-rate-limit.yaml b/src/test/resources/checks/v31/owasp/OAR073/no-rate-limit.yaml new file mode 100644 index 00000000..e8cf9dae --- /dev/null +++ b/src/test/resources/checks/v31/owasp/OAR073/no-rate-limit.yaml @@ -0,0 +1,17 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Non-compliant API +paths: + /param2: + get: + summary: Get a list of items + responses: # Noncompliant {{OAR073: API should include a 429 response to indicate rate limiting}} + 200: + description: A list of items + content: + application/json: + schema: + type: array + items: + type: string \ No newline at end of file diff --git a/src/test/resources/checks/v31/owasp/OAR073/no-responses.json b/src/test/resources/checks/v31/owasp/OAR073/no-responses.json new file mode 100644 index 00000000..e0294c8b --- /dev/null +++ b/src/test/resources/checks/v31/owasp/OAR073/no-responses.json @@ -0,0 +1,14 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Compliant API" + }, + "paths": { + "/items": { + "get": { + "summary": "Get a list of items with no responses key" + } + } + } +} diff --git a/src/test/resources/checks/v31/owasp/OAR073/no-responses.yaml b/src/test/resources/checks/v31/owasp/OAR073/no-responses.yaml new file mode 100644 index 00000000..2575f439 --- /dev/null +++ b/src/test/resources/checks/v31/owasp/OAR073/no-responses.yaml @@ -0,0 +1,8 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Compliant API +paths: + /items: + get: + summary: Get a list of items with no responses key diff --git a/src/test/resources/checks/v31/owasp/OAR073/rate-limit.json b/src/test/resources/checks/v31/owasp/OAR073/rate-limit.json new file mode 100644 index 00000000..3103396f --- /dev/null +++ b/src/test/resources/checks/v31/owasp/OAR073/rate-limit.json @@ -0,0 +1,39 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Compliant API" + }, + "paths": { + "/items": { + "get": { + "summary": "Get a list of items", + "responses": { + "200": { + "description": "A list of items", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + }, + "429": { + "description": "Too Many Requests", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error_response" + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/owasp/OAR073/rate-limit.yaml b/src/test/resources/checks/v31/owasp/OAR073/rate-limit.yaml new file mode 100644 index 00000000..d01f36ad --- /dev/null +++ b/src/test/resources/checks/v31/owasp/OAR073/rate-limit.yaml @@ -0,0 +1,23 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Compliant API +paths: + /items: + get: + summary: Get a list of items + responses: + 200: + description: A list of items + content: + application/json: + schema: + type: array + items: + type: string + 429: + description: Too Many Requests + content: + application/json: + schema: + $ref: '#/components/schemas/error_response' \ No newline at end of file diff --git a/src/test/resources/checks/v31/parameters/OAR019/excluded.json b/src/test/resources/checks/v31/parameters/OAR019/excluded.json index 7d8ea3ca..7b77042f 100644 --- a/src/test/resources/checks/v31/parameters/OAR019/excluded.json +++ b/src/test/resources/checks/v31/parameters/OAR019/excluded.json @@ -1,5 +1,5 @@ { - "openapi" : "3.1.0", + "openapi" : "3.0.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v31/parameters/OAR019/excluded.yaml b/src/test/resources/checks/v31/parameters/OAR019/excluded.yaml index 8a1c820c..7758deac 100644 --- a/src/test/resources/checks/v31/parameters/OAR019/excluded.yaml +++ b/src/test/resources/checks/v31/parameters/OAR019/excluded.yaml @@ -1,4 +1,4 @@ -openapi: "3.1.0" +openapi: "3.0.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/parameters/OAR019/plain-without.json b/src/test/resources/checks/v31/parameters/OAR019/plain-without.json index de97027f..2e628a27 100644 --- a/src/test/resources/checks/v31/parameters/OAR019/plain-without.json +++ b/src/test/resources/checks/v31/parameters/OAR019/plain-without.json @@ -1,5 +1,5 @@ { - "openapi" : "3.1.0", + "openapi" : "3.0.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v31/parameters/OAR019/plain-without.yaml b/src/test/resources/checks/v31/parameters/OAR019/plain-without.yaml index 3fbbb5e2..2f1bd5d6 100644 --- a/src/test/resources/checks/v31/parameters/OAR019/plain-without.yaml +++ b/src/test/resources/checks/v31/parameters/OAR019/plain-without.yaml @@ -1,4 +1,4 @@ -openapi: "3.1.0" +openapi: "3.0.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/parameters/OAR019/plain.json b/src/test/resources/checks/v31/parameters/OAR019/plain.json index dec31428..18138264 100644 --- a/src/test/resources/checks/v31/parameters/OAR019/plain.json +++ b/src/test/resources/checks/v31/parameters/OAR019/plain.json @@ -1,5 +1,5 @@ { - "openapi" : "3.1.0", + "openapi" : "3.0.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v31/parameters/OAR019/plain.yaml b/src/test/resources/checks/v31/parameters/OAR019/plain.yaml index 13d61bd4..af676143 100644 --- a/src/test/resources/checks/v31/parameters/OAR019/plain.yaml +++ b/src/test/resources/checks/v31/parameters/OAR019/plain.yaml @@ -1,4 +1,4 @@ -openapi: "3.1.0" +openapi: "3.0.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/parameters/OAR019/with-$ref-without.json b/src/test/resources/checks/v31/parameters/OAR019/with-$ref-without.json new file mode 100644 index 00000000..4b111e51 --- /dev/null +++ b/src/test/resources/checks/v31/parameters/OAR019/with-$ref-without.json @@ -0,0 +1,47 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "components": { + "parameters" : { + "other" : { + "in" : "query", + "name" : "other", + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + }, + "select" : { + "in" : "query", + "name" : "select", + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + } + } + }, + "paths" : { + "/pets" : { + "get" : { + "parameters" : [ { # Noncompliant {{OAR019: $select must be defined as a parameter in this operation}} + "$ref" : "#/components/parameters/other" + }, { + "$ref" : "#/components/parameters/select" + } ], + "responses" : { + "206" : { + "description" : "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/parameters/OAR019/with-$ref-without.yaml b/src/test/resources/checks/v31/parameters/OAR019/with-$ref-without.yaml new file mode 100644 index 00000000..40bd84a8 --- /dev/null +++ b/src/test/resources/checks/v31/parameters/OAR019/with-$ref-without.yaml @@ -0,0 +1,29 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +components: + parameters: + other: + in: query + name: other + schema: + type: array + items: + type: string + select: + in: query + name: select + schema: + type: array + items: + type: string +paths: + /pets: + get: + parameters: # Noncompliant {{OAR019: $select must be defined as a parameter in this operation}} + - $ref: '#/components/parameters/other' + - $ref: '#/components/parameters/select' + responses: + 206: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v31/parameters/OAR019/with-$ref.json b/src/test/resources/checks/v31/parameters/OAR019/with-$ref.json new file mode 100644 index 00000000..44519b76 --- /dev/null +++ b/src/test/resources/checks/v31/parameters/OAR019/with-$ref.json @@ -0,0 +1,47 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "components": { + "parameters" : { + "other" : { + "in" : "query", + "name" : "other", + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + }, + "select" : { + "in" : "query", + "name" : "$select", + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + } + } + }, + "paths" : { + "/pets" : { + "get" : { + "parameters" : [ { + "$ref" : "#/components/parameters/other" + }, { + "$ref" : "#/components/parameters/select" + } ], + "responses" : { + "206" : { + "description" : "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/parameters/OAR019/with-$ref.yaml b/src/test/resources/checks/v31/parameters/OAR019/with-$ref.yaml new file mode 100644 index 00000000..8144cd2f --- /dev/null +++ b/src/test/resources/checks/v31/parameters/OAR019/with-$ref.yaml @@ -0,0 +1,29 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +components: + parameters: + other: + in: query + name: other + schema: + type: array + items: + type: string + select: + in: query + name: $select + schema: + type: array + items: + type: string +paths: + /pets: + get: + parameters: + - $ref: '#/components/parameters/other' + - $ref: '#/components/parameters/select' + responses: + 206: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v31/parameters/OAR019/with-param.json b/src/test/resources/checks/v31/parameters/OAR019/with-param.json new file mode 100644 index 00000000..1097b436 --- /dev/null +++ b/src/test/resources/checks/v31/parameters/OAR019/with-param.json @@ -0,0 +1,27 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "Swagger Petstore", + "version": "1.0.0" + }, + "paths": { + "/examples/{id}": { + "get": { + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/examples/{id}/items/{id}": { + "get": { + "responses": { + "200": { + "description": "OK" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/parameters/OAR019/with-param.yaml b/src/test/resources/checks/v31/parameters/OAR019/with-param.yaml new file mode 100644 index 00000000..8b012753 --- /dev/null +++ b/src/test/resources/checks/v31/parameters/OAR019/with-param.yaml @@ -0,0 +1,15 @@ +openapi: 3.0.0 +info: + title: Swagger Petstore + version: 1.0.0 +paths: + /examples/{id}: + get: + responses: + '200': + description: OK + /examples/{id}/items/{id}: + get: + responses: + '200': + description: OK \ No newline at end of file diff --git a/src/test/resources/checks/v31/parameters/OAR019/with-ref.json b/src/test/resources/checks/v31/parameters/OAR019/with-ref.json index 6cc45fd4..e6772a42 100644 --- a/src/test/resources/checks/v31/parameters/OAR019/with-ref.json +++ b/src/test/resources/checks/v31/parameters/OAR019/with-ref.json @@ -1,5 +1,5 @@ { - "openapi": "3.1.0", + "openapi": "3.0.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v31/parameters/OAR019/with-ref.yaml b/src/test/resources/checks/v31/parameters/OAR019/with-ref.yaml index ae167749..dfc1b239 100644 --- a/src/test/resources/checks/v31/parameters/OAR019/with-ref.yaml +++ b/src/test/resources/checks/v31/parameters/OAR019/with-ref.yaml @@ -1,4 +1,4 @@ -openapi: 3.1.0 +openapi: 3.0.0 info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/parameters/OAR019/without-parameters.json b/src/test/resources/checks/v31/parameters/OAR019/without-parameters.json new file mode 100644 index 00000000..5fc9f4c1 --- /dev/null +++ b/src/test/resources/checks/v31/parameters/OAR019/without-parameters.json @@ -0,0 +1,18 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/pets" : { + "get" : { # Noncompliant {{OAR019: $select must be defined as a parameter in this operation}} + "responses" : { + "206" : { + "description" : "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/parameters/OAR019/without-parameters.yaml b/src/test/resources/checks/v31/parameters/OAR019/without-parameters.yaml new file mode 100644 index 00000000..7d1f1941 --- /dev/null +++ b/src/test/resources/checks/v31/parameters/OAR019/without-parameters.yaml @@ -0,0 +1,10 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: + get: # Noncompliant {{OAR019: $select must be defined as a parameter in this operation}} + responses: + 206: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v31/parameters/OAR020/excluded.json b/src/test/resources/checks/v31/parameters/OAR020/excluded.json new file mode 100644 index 00000000..abb1867f --- /dev/null +++ b/src/test/resources/checks/v31/parameters/OAR020/excluded.json @@ -0,0 +1,37 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/status" : { + "get" : { + "parameters" : [ { + "in" : "query", + "name" : "other", + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + }, { + "in" : "query", + "name" : "$expand", + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + } ], + "responses" : { + "206" : { + "description" : "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/parameters/OAR020/excluded.yaml b/src/test/resources/checks/v31/parameters/OAR020/excluded.yaml new file mode 100644 index 00000000..528f119e --- /dev/null +++ b/src/test/resources/checks/v31/parameters/OAR020/excluded.yaml @@ -0,0 +1,23 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /status: + get: + parameters: + - in: query + name: other + schema: + type: array + items: + type: string + - in: query + name: $expand + schema: + type: array + items: + type: string + responses: + 206: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v31/parameters/OAR020/excluded2.json b/src/test/resources/checks/v31/parameters/OAR020/excluded2.json new file mode 100644 index 00000000..7b77042f --- /dev/null +++ b/src/test/resources/checks/v31/parameters/OAR020/excluded2.json @@ -0,0 +1,37 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/status" : { + "get" : { + "parameters" : [ { + "in" : "query", + "name" : "other", + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + }, { + "in" : "query", + "name" : "select", + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + } ], + "responses" : { + "206" : { + "description" : "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/parameters/OAR020/excluded2.yaml b/src/test/resources/checks/v31/parameters/OAR020/excluded2.yaml new file mode 100644 index 00000000..5bb25ac8 --- /dev/null +++ b/src/test/resources/checks/v31/parameters/OAR020/excluded2.yaml @@ -0,0 +1,23 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /status: + get: + parameters: + - in: query + name: other + schema: + type: array + items: + type: string + - in: query + name: select + schema: + type: array + items: + type: string + responses: + 206: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v31/parameters/OAR020/plain-without.json b/src/test/resources/checks/v31/parameters/OAR020/plain-without.json new file mode 100644 index 00000000..ac05e24d --- /dev/null +++ b/src/test/resources/checks/v31/parameters/OAR020/plain-without.json @@ -0,0 +1,37 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/pets" : { + "get" : { + "parameters" : [ { # Noncompliant {{OAR020: $expand must be defined as a parameter in this operation}} + "in" : "query", + "name" : "other", + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + }, { + "in" : "query", + "name" : "expand", + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + } ], + "responses" : { + "206" : { + "description" : "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/parameters/OAR020/plain-without.yaml b/src/test/resources/checks/v31/parameters/OAR020/plain-without.yaml new file mode 100644 index 00000000..aadbb6e3 --- /dev/null +++ b/src/test/resources/checks/v31/parameters/OAR020/plain-without.yaml @@ -0,0 +1,23 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: + get: + parameters: # Noncompliant {{OAR020: $expand must be defined as a parameter in this operation}} + - in: query + name: other + schema: + type: array + items: + type: string + - in: query + name: expand + schema: + type: array + items: + type: string + responses: + 206: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v31/parameters/OAR020/plain-without2.json b/src/test/resources/checks/v31/parameters/OAR020/plain-without2.json new file mode 100644 index 00000000..96bdfe49 --- /dev/null +++ b/src/test/resources/checks/v31/parameters/OAR020/plain-without2.json @@ -0,0 +1,37 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/examples" : { + "get" : { # Noncompliant {{OAR020: $expand must be defined as a parameter in this operation}} + "parameters" : [ { + "in" : "query", + "name" : "other", + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + }, { + "in" : "query", + "name" : "select", + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + } ], + "responses" : { + "206" : { + "description" : "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/parameters/OAR020/plain-without2.yaml b/src/test/resources/checks/v31/parameters/OAR020/plain-without2.yaml new file mode 100644 index 00000000..798c326e --- /dev/null +++ b/src/test/resources/checks/v31/parameters/OAR020/plain-without2.yaml @@ -0,0 +1,23 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /examples: + get: # Noncompliant {{OAR020: $expand must be defined as a parameter in this operation}} + parameters: + - in: query + name: other + schema: + type: array + items: + type: string + - in: query + name: select + schema: + type: array + items: + type: string + responses: + 206: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v31/parameters/OAR020/plain.json b/src/test/resources/checks/v31/parameters/OAR020/plain.json new file mode 100644 index 00000000..bdb3c7d1 --- /dev/null +++ b/src/test/resources/checks/v31/parameters/OAR020/plain.json @@ -0,0 +1,37 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/pets" : { + "get" : { + "parameters" : [ { + "in" : "query", + "name" : "other", + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + }, { + "in" : "query", + "name" : "$expand", + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + } ], + "responses" : { + "206" : { + "description" : "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/parameters/OAR020/plain.yaml b/src/test/resources/checks/v31/parameters/OAR020/plain.yaml new file mode 100644 index 00000000..ad2fc836 --- /dev/null +++ b/src/test/resources/checks/v31/parameters/OAR020/plain.yaml @@ -0,0 +1,23 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: + get: + parameters: + - in: query + name: other + schema: + type: array + items: + type: string + - in: query + name: $expand + schema: + type: array + items: + type: string + responses: + 206: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v31/parameters/OAR020/plain2.json b/src/test/resources/checks/v31/parameters/OAR020/plain2.json new file mode 100644 index 00000000..b349d610 --- /dev/null +++ b/src/test/resources/checks/v31/parameters/OAR020/plain2.json @@ -0,0 +1,37 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/examples" : { + "get" : { + "parameters" : [ { + "in" : "query", + "name" : "$expand", + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + }, { + "in" : "query", + "name" : "$expand", + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + } ], + "responses" : { + "206" : { + "description" : "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/parameters/OAR020/plain2.yaml b/src/test/resources/checks/v31/parameters/OAR020/plain2.yaml new file mode 100644 index 00000000..d6c6860b --- /dev/null +++ b/src/test/resources/checks/v31/parameters/OAR020/plain2.yaml @@ -0,0 +1,23 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /examples: + get: + parameters: + - in: query + name: $expand + schema: + type: array + items: + type: string + - in: query + name: $expand + schema: + type: array + items: + type: string + responses: + 206: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v31/parameters/OAR020/with-$ref-without.json b/src/test/resources/checks/v31/parameters/OAR020/with-$ref-without.json new file mode 100644 index 00000000..33a10da9 --- /dev/null +++ b/src/test/resources/checks/v31/parameters/OAR020/with-$ref-without.json @@ -0,0 +1,47 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "components": { + "parameters" : { + "other" : { + "in" : "query", + "name" : "other", + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + }, + "expand" : { + "in" : "query", + "name" : "expand", + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + } + } + }, + "paths" : { + "/pets" : { + "get" : { + "parameters" : [ { # Noncompliant {{OAR020: $expand must be defined as a parameter in this operation}} + "$ref" : "#/components/parameters/other" + }, { + "$ref" : "#/components/parameters/expand" + } ], + "responses" : { + "206" : { + "description" : "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/parameters/OAR020/with-$ref-without.yaml b/src/test/resources/checks/v31/parameters/OAR020/with-$ref-without.yaml new file mode 100644 index 00000000..6080512e --- /dev/null +++ b/src/test/resources/checks/v31/parameters/OAR020/with-$ref-without.yaml @@ -0,0 +1,29 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +components: + parameters: + other: + in: query + name: other + schema: + type: array + items: + type: string + expand: + in: query + name: expand + schema: + type: array + items: + type: string +paths: + /pets: + get: + parameters: # Noncompliant {{OAR020: $expand must be defined as a parameter in this operation}} + - $ref: '#/components/parameters/other' + - $ref: '#/components/parameters/expand' + responses: + 206: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v31/parameters/OAR020/with-$ref.json b/src/test/resources/checks/v31/parameters/OAR020/with-$ref.json new file mode 100644 index 00000000..1354ddee --- /dev/null +++ b/src/test/resources/checks/v31/parameters/OAR020/with-$ref.json @@ -0,0 +1,47 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "components": { + "parameters" : { + "other" : { + "in" : "query", + "name" : "other", + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + }, + "expand" : { + "in" : "query", + "name" : "$expand", + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + } + } + }, + "paths" : { + "/pets" : { + "get" : { + "parameters" : [ { + "$ref" : "#/components/parameters/other" + }, { + "$ref" : "#/components/parameters/expand" + } ], + "responses" : { + "206" : { + "description" : "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/parameters/OAR020/with-$ref.yaml b/src/test/resources/checks/v31/parameters/OAR020/with-$ref.yaml new file mode 100644 index 00000000..04c46fa9 --- /dev/null +++ b/src/test/resources/checks/v31/parameters/OAR020/with-$ref.yaml @@ -0,0 +1,29 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +components: + parameters: + other: + in: query + name: other + schema: + type: array + items: + type: string + expand: + in: query + name: $expand + schema: + type: array + items: + type: string +paths: + /pets: + get: + parameters: + - $ref: '#/components/parameters/other' + - $ref: '#/components/parameters/expand' + responses: + 206: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v31/parameters/OAR020/with-param.json b/src/test/resources/checks/v31/parameters/OAR020/with-param.json new file mode 100644 index 00000000..1097b436 --- /dev/null +++ b/src/test/resources/checks/v31/parameters/OAR020/with-param.json @@ -0,0 +1,27 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "Swagger Petstore", + "version": "1.0.0" + }, + "paths": { + "/examples/{id}": { + "get": { + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/examples/{id}/items/{id}": { + "get": { + "responses": { + "200": { + "description": "OK" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/parameters/OAR020/with-param.yaml b/src/test/resources/checks/v31/parameters/OAR020/with-param.yaml new file mode 100644 index 00000000..8b012753 --- /dev/null +++ b/src/test/resources/checks/v31/parameters/OAR020/with-param.yaml @@ -0,0 +1,15 @@ +openapi: 3.0.0 +info: + title: Swagger Petstore + version: 1.0.0 +paths: + /examples/{id}: + get: + responses: + '200': + description: OK + /examples/{id}/items/{id}: + get: + responses: + '200': + description: OK \ No newline at end of file diff --git a/src/test/resources/checks/v31/parameters/OAR020/with-ref.json b/src/test/resources/checks/v31/parameters/OAR020/with-ref.json new file mode 100644 index 00000000..52a22a10 --- /dev/null +++ b/src/test/resources/checks/v31/parameters/OAR020/with-ref.json @@ -0,0 +1,37 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "components": { + "parameters": { + "selectParameter": { + "in": "query", + "name": "$expand", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + }, + "paths": { + "/examples": { + "get": { + "parameters": [ + { + "$ref": "#/components/parameters/selectParameter" + } + ], + "responses": { + "206": { + "description": "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/parameters/OAR020/with-ref.yaml b/src/test/resources/checks/v31/parameters/OAR020/with-ref.yaml new file mode 100644 index 00000000..315ab8f9 --- /dev/null +++ b/src/test/resources/checks/v31/parameters/OAR020/with-ref.yaml @@ -0,0 +1,23 @@ +openapi: 3.0.0 +info: + version: 1.0.0 + title: Swagger Petstore + +components: + parameters: + selectParameter: + in: query + name: $expand + schema: + type: array + items: + type: string + +paths: + /examples: + get: + parameters: + - $ref: '#/components/parameters/selectParameter' + responses: + 206: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v31/parameters/OAR020/without-parameters.json b/src/test/resources/checks/v31/parameters/OAR020/without-parameters.json new file mode 100644 index 00000000..dd4f0781 --- /dev/null +++ b/src/test/resources/checks/v31/parameters/OAR020/without-parameters.json @@ -0,0 +1,18 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/pets" : { + "get" : { # Noncompliant {{OAR020: $expand must be defined as a parameter in this operation}} + "responses" : { + "206" : { + "description" : "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/parameters/OAR020/without-parameters.yaml b/src/test/resources/checks/v31/parameters/OAR020/without-parameters.yaml new file mode 100644 index 00000000..17256a1a --- /dev/null +++ b/src/test/resources/checks/v31/parameters/OAR020/without-parameters.yaml @@ -0,0 +1,10 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: + get: # Noncompliant {{OAR020: $expand must be defined as a parameter in this operation}} + responses: + 206: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v31/parameters/OAR021/excluded.json b/src/test/resources/checks/v31/parameters/OAR021/excluded.json new file mode 100644 index 00000000..7b77042f --- /dev/null +++ b/src/test/resources/checks/v31/parameters/OAR021/excluded.json @@ -0,0 +1,37 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/status" : { + "get" : { + "parameters" : [ { + "in" : "query", + "name" : "other", + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + }, { + "in" : "query", + "name" : "select", + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + } ], + "responses" : { + "206" : { + "description" : "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/parameters/OAR021/excluded.yaml b/src/test/resources/checks/v31/parameters/OAR021/excluded.yaml new file mode 100644 index 00000000..5bb25ac8 --- /dev/null +++ b/src/test/resources/checks/v31/parameters/OAR021/excluded.yaml @@ -0,0 +1,23 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /status: + get: + parameters: + - in: query + name: other + schema: + type: array + items: + type: string + - in: query + name: select + schema: + type: array + items: + type: string + responses: + 206: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v31/parameters/OAR021/plain-without.json b/src/test/resources/checks/v31/parameters/OAR021/plain-without.json new file mode 100644 index 00000000..78c3e87b --- /dev/null +++ b/src/test/resources/checks/v31/parameters/OAR021/plain-without.json @@ -0,0 +1,37 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/examples" : { + "get" : { # Noncompliant {{OAR021: $exclude must be defined as a parameter in this operation}} + "parameters" : [ { + "in" : "query", + "name" : "other", + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + }, { + "in" : "query", + "name" : "select", + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + } ], + "responses" : { + "206" : { + "description" : "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/parameters/OAR021/plain-without.yaml b/src/test/resources/checks/v31/parameters/OAR021/plain-without.yaml new file mode 100644 index 00000000..72854964 --- /dev/null +++ b/src/test/resources/checks/v31/parameters/OAR021/plain-without.yaml @@ -0,0 +1,23 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /examples: + get: # Noncompliant {{OAR021: $exclude must be defined as a parameter in this operation}} + parameters: + - in: query + name: other + schema: + type: array + items: + type: string + - in: query + name: select + schema: + type: array + items: + type: string + responses: + 206: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v31/parameters/OAR021/plain.json b/src/test/resources/checks/v31/parameters/OAR021/plain.json new file mode 100644 index 00000000..f07e2f8a --- /dev/null +++ b/src/test/resources/checks/v31/parameters/OAR021/plain.json @@ -0,0 +1,37 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/examples" : { + "get" : { + "parameters" : [ { + "in" : "query", + "name" : "$exclude", + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + }, { + "in" : "query", + "name" : "$exclude", + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + } ], + "responses" : { + "206" : { + "description" : "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/parameters/OAR021/plain.yaml b/src/test/resources/checks/v31/parameters/OAR021/plain.yaml new file mode 100644 index 00000000..f5d21041 --- /dev/null +++ b/src/test/resources/checks/v31/parameters/OAR021/plain.yaml @@ -0,0 +1,23 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /examples: + get: + parameters: + - in: query + name: $exclude + schema: + type: array + items: + type: string + - in: query + name: $exclude + schema: + type: array + items: + type: string + responses: + 206: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v31/parameters/OAR021/with-$ref-without.json b/src/test/resources/checks/v31/parameters/OAR021/with-$ref-without.json new file mode 100644 index 00000000..a9531c2f --- /dev/null +++ b/src/test/resources/checks/v31/parameters/OAR021/with-$ref-without.json @@ -0,0 +1,47 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "components": { + "parameters" : { + "other" : { + "in" : "query", + "name" : "other", + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + }, + "exclude" : { + "in" : "query", + "name" : "exclude", + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + } + } + }, + "paths" : { + "/pets" : { + "get" : { + "parameters" : [ { # Noncompliant {{OAR021: $exclude must be defined as a parameter in this operation}} + "$ref" : "#/components/parameters/other" + }, { + "$ref" : "#/components/parameters/exclude" + } ], + "responses" : { + "206" : { + "description" : "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/parameters/OAR021/with-$ref-without.yaml b/src/test/resources/checks/v31/parameters/OAR021/with-$ref-without.yaml new file mode 100644 index 00000000..c31ca64e --- /dev/null +++ b/src/test/resources/checks/v31/parameters/OAR021/with-$ref-without.yaml @@ -0,0 +1,29 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +components: + parameters: + other: + in: query + name: other + schema: + type: array + items: + type: string + exclude: + in: query + name: exclude + schema: + type: array + items: + type: string +paths: + /pets: + get: + parameters: # Noncompliant {{OAR021: $exclude must be defined as a parameter in this operation}} + - $ref: '#/components/parameters/other' + - $ref: '#/components/parameters/exclude' + responses: + 206: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v31/parameters/OAR021/with-$ref.json b/src/test/resources/checks/v31/parameters/OAR021/with-$ref.json new file mode 100644 index 00000000..60b07834 --- /dev/null +++ b/src/test/resources/checks/v31/parameters/OAR021/with-$ref.json @@ -0,0 +1,47 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "components": { + "parameters" : { + "other" : { + "in" : "query", + "name" : "other", + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + }, + "exclude" : { + "in" : "query", + "name" : "$exclude", + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + } + } + }, + "paths" : { + "/pets" : { + "get" : { + "parameters" : [ { + "$ref" : "#/components/parameters/other" + }, { + "$ref" : "#/components/parameters/exclude" + } ], + "responses" : { + "206" : { + "description" : "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/parameters/OAR021/with-$ref.yaml b/src/test/resources/checks/v31/parameters/OAR021/with-$ref.yaml new file mode 100644 index 00000000..967c1d7d --- /dev/null +++ b/src/test/resources/checks/v31/parameters/OAR021/with-$ref.yaml @@ -0,0 +1,29 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +components: + parameters: + other: + in: query + name: other + schema: + type: array + items: + type: string + exclude: + in: query + name: $exclude + schema: + type: array + items: + type: string +paths: + /pets: + get: + parameters: + - $ref: '#/components/parameters/other' + - $ref: '#/components/parameters/exclude' + responses: + 206: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v31/parameters/OAR021/with-param.json b/src/test/resources/checks/v31/parameters/OAR021/with-param.json new file mode 100644 index 00000000..1097b436 --- /dev/null +++ b/src/test/resources/checks/v31/parameters/OAR021/with-param.json @@ -0,0 +1,27 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "Swagger Petstore", + "version": "1.0.0" + }, + "paths": { + "/examples/{id}": { + "get": { + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/examples/{id}/items/{id}": { + "get": { + "responses": { + "200": { + "description": "OK" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/parameters/OAR021/with-param.yaml b/src/test/resources/checks/v31/parameters/OAR021/with-param.yaml new file mode 100644 index 00000000..8b012753 --- /dev/null +++ b/src/test/resources/checks/v31/parameters/OAR021/with-param.yaml @@ -0,0 +1,15 @@ +openapi: 3.0.0 +info: + title: Swagger Petstore + version: 1.0.0 +paths: + /examples/{id}: + get: + responses: + '200': + description: OK + /examples/{id}/items/{id}: + get: + responses: + '200': + description: OK \ No newline at end of file diff --git a/src/test/resources/checks/v31/parameters/OAR021/with-ref.json b/src/test/resources/checks/v31/parameters/OAR021/with-ref.json new file mode 100644 index 00000000..f3a1eb3d --- /dev/null +++ b/src/test/resources/checks/v31/parameters/OAR021/with-ref.json @@ -0,0 +1,37 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "components": { + "parameters": { + "selectParameter": { + "in": "query", + "name": "$exclude", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + }, + "paths": { + "/examples": { + "get": { + "parameters": [ + { + "$ref": "#/components/parameters/selectParameter" + } + ], + "responses": { + "206": { + "description": "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/parameters/OAR021/with-ref.yaml b/src/test/resources/checks/v31/parameters/OAR021/with-ref.yaml new file mode 100644 index 00000000..382897e5 --- /dev/null +++ b/src/test/resources/checks/v31/parameters/OAR021/with-ref.yaml @@ -0,0 +1,23 @@ +openapi: 3.0.0 +info: + version: 1.0.0 + title: Swagger Petstore + +components: + parameters: + selectParameter: + in: query + name: $exclude + schema: + type: array + items: + type: string + +paths: + /examples: + get: + parameters: + - $ref: '#/components/parameters/selectParameter' + responses: + 206: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v31/parameters/OAR021/without-parameters.json b/src/test/resources/checks/v31/parameters/OAR021/without-parameters.json new file mode 100644 index 00000000..fb4f3709 --- /dev/null +++ b/src/test/resources/checks/v31/parameters/OAR021/without-parameters.json @@ -0,0 +1,18 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/pets" : { + "get" : { # Noncompliant {{OAR021: $exclude must be defined as a parameter in this operation}} + "responses" : { + "206" : { + "description" : "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/parameters/OAR021/without-parameters.yaml b/src/test/resources/checks/v31/parameters/OAR021/without-parameters.yaml new file mode 100644 index 00000000..f9ca221f --- /dev/null +++ b/src/test/resources/checks/v31/parameters/OAR021/without-parameters.yaml @@ -0,0 +1,10 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: + get: # Noncompliant {{OAR021: $exclude must be defined as a parameter in this operation}} + responses: + 206: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v31/parameters/OAR022/excluded.json b/src/test/resources/checks/v31/parameters/OAR022/excluded.json new file mode 100644 index 00000000..7b77042f --- /dev/null +++ b/src/test/resources/checks/v31/parameters/OAR022/excluded.json @@ -0,0 +1,37 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/status" : { + "get" : { + "parameters" : [ { + "in" : "query", + "name" : "other", + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + }, { + "in" : "query", + "name" : "select", + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + } ], + "responses" : { + "206" : { + "description" : "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/parameters/OAR022/excluded.yaml b/src/test/resources/checks/v31/parameters/OAR022/excluded.yaml new file mode 100644 index 00000000..5bb25ac8 --- /dev/null +++ b/src/test/resources/checks/v31/parameters/OAR022/excluded.yaml @@ -0,0 +1,23 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /status: + get: + parameters: + - in: query + name: other + schema: + type: array + items: + type: string + - in: query + name: select + schema: + type: array + items: + type: string + responses: + 206: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v31/parameters/OAR022/plain-without.json b/src/test/resources/checks/v31/parameters/OAR022/plain-without.json new file mode 100644 index 00000000..e263f6bb --- /dev/null +++ b/src/test/resources/checks/v31/parameters/OAR022/plain-without.json @@ -0,0 +1,37 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/examples" : { + "get" : { # Noncompliant {{OAR022: $orderby must be defined as a parameter in this operation}} + "parameters" : [ { + "in" : "query", + "name" : "other", + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + }, { + "in" : "query", + "name" : "select", + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + } ], + "responses" : { + "206" : { + "description" : "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/parameters/OAR022/plain-without.yaml b/src/test/resources/checks/v31/parameters/OAR022/plain-without.yaml new file mode 100644 index 00000000..a284f1f4 --- /dev/null +++ b/src/test/resources/checks/v31/parameters/OAR022/plain-without.yaml @@ -0,0 +1,23 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /examples: + get: # Noncompliant {{OAR022: $orderby must be defined as a parameter in this operation}} + parameters: + - in: query + name: other + schema: + type: array + items: + type: string + - in: query + name: select + schema: + type: array + items: + type: string + responses: + 206: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v31/parameters/OAR022/plain.json b/src/test/resources/checks/v31/parameters/OAR022/plain.json new file mode 100644 index 00000000..dcf5ec3b --- /dev/null +++ b/src/test/resources/checks/v31/parameters/OAR022/plain.json @@ -0,0 +1,37 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/examples" : { + "get" : { + "parameters" : [ { + "in" : "query", + "name" : "$orderby", + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + }, { + "in" : "query", + "name" : "$orderby", + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + } ], + "responses" : { + "206" : { + "description" : "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/parameters/OAR022/plain.yaml b/src/test/resources/checks/v31/parameters/OAR022/plain.yaml new file mode 100644 index 00000000..173955f8 --- /dev/null +++ b/src/test/resources/checks/v31/parameters/OAR022/plain.yaml @@ -0,0 +1,23 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /examples: + get: + parameters: + - in: query + name: $orderby + schema: + type: array + items: + type: string + - in: query + name: $orderby + schema: + type: array + items: + type: string + responses: + 206: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v31/parameters/OAR022/with-$ref-without.json b/src/test/resources/checks/v31/parameters/OAR022/with-$ref-without.json new file mode 100644 index 00000000..64cfcc5e --- /dev/null +++ b/src/test/resources/checks/v31/parameters/OAR022/with-$ref-without.json @@ -0,0 +1,47 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "components": { + "parameters" : { + "other" : { + "in" : "query", + "name" : "other", + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + }, + "orderby" : { + "in" : "query", + "name" : "orderby", + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + } + } + }, + "paths" : { + "/pets" : { + "get" : { + "parameters" : [ { # Noncompliant {{OAR022: $orderby must be defined as a parameter in this operation}} + "$ref" : "#/components/parameters/other" + }, { + "$ref" : "#/components/parameters/orderby" + } ], + "responses" : { + "206" : { + "description" : "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/parameters/OAR022/with-$ref-without.yaml b/src/test/resources/checks/v31/parameters/OAR022/with-$ref-without.yaml new file mode 100644 index 00000000..7c120401 --- /dev/null +++ b/src/test/resources/checks/v31/parameters/OAR022/with-$ref-without.yaml @@ -0,0 +1,29 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +components: + parameters: + other: + in: query + name: other + schema: + type: array + items: + type: string + orderby: + in: query + name: orderby + schema: + type: array + items: + type: string +paths: + /pets: + get: + parameters: # Noncompliant {{OAR022: $orderby must be defined as a parameter in this operation}} + - $ref: '#/components/parameters/other' + - $ref: '#/components/parameters/orderby' + responses: + 206: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v31/parameters/OAR022/with-$ref.json b/src/test/resources/checks/v31/parameters/OAR022/with-$ref.json new file mode 100644 index 00000000..de939029 --- /dev/null +++ b/src/test/resources/checks/v31/parameters/OAR022/with-$ref.json @@ -0,0 +1,47 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "components": { + "parameters" : { + "other" : { + "in" : "query", + "name" : "other", + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + }, + "orderby" : { + "in" : "query", + "name" : "$orderby", + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + } + } + }, + "paths" : { + "/pets" : { + "get" : { + "parameters" : [ { + "$ref" : "#/components/parameters/other" + }, { + "$ref" : "#/components/parameters/orderby" + } ], + "responses" : { + "206" : { + "description" : "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/parameters/OAR022/with-$ref.yaml b/src/test/resources/checks/v31/parameters/OAR022/with-$ref.yaml new file mode 100644 index 00000000..f4c69d5b --- /dev/null +++ b/src/test/resources/checks/v31/parameters/OAR022/with-$ref.yaml @@ -0,0 +1,29 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +components: + parameters: + other: + in: query + name: other + schema: + type: array + items: + type: string + orderby: + in: query + name: $orderby + schema: + type: array + items: + type: string +paths: + /pets: + get: + parameters: + - $ref: '#/components/parameters/other' + - $ref: '#/components/parameters/orderby' + responses: + 206: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v31/parameters/OAR022/without-parameters.json b/src/test/resources/checks/v31/parameters/OAR022/without-parameters.json new file mode 100644 index 00000000..be5c3701 --- /dev/null +++ b/src/test/resources/checks/v31/parameters/OAR022/without-parameters.json @@ -0,0 +1,18 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/pets" : { + "get" : { # Noncompliant {{OAR022: $orderby must be defined as a parameter in this operation}} + "responses" : { + "206" : { + "description" : "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/parameters/OAR022/without-parameters.yaml b/src/test/resources/checks/v31/parameters/OAR022/without-parameters.yaml new file mode 100644 index 00000000..3e65a579 --- /dev/null +++ b/src/test/resources/checks/v31/parameters/OAR022/without-parameters.yaml @@ -0,0 +1,10 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: + get: # Noncompliant {{OAR022: $orderby must be defined as a parameter in this operation}} + responses: + 206: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v31/parameters/OAR023/excluded.json b/src/test/resources/checks/v31/parameters/OAR023/excluded.json new file mode 100644 index 00000000..7b77042f --- /dev/null +++ b/src/test/resources/checks/v31/parameters/OAR023/excluded.json @@ -0,0 +1,37 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/status" : { + "get" : { + "parameters" : [ { + "in" : "query", + "name" : "other", + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + }, { + "in" : "query", + "name" : "select", + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + } ], + "responses" : { + "206" : { + "description" : "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/parameters/OAR023/excluded.yaml b/src/test/resources/checks/v31/parameters/OAR023/excluded.yaml new file mode 100644 index 00000000..5bb25ac8 --- /dev/null +++ b/src/test/resources/checks/v31/parameters/OAR023/excluded.yaml @@ -0,0 +1,23 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /status: + get: + parameters: + - in: query + name: other + schema: + type: array + items: + type: string + - in: query + name: select + schema: + type: array + items: + type: string + responses: + 206: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v31/parameters/OAR023/plain-without.json b/src/test/resources/checks/v31/parameters/OAR023/plain-without.json new file mode 100644 index 00000000..871eddb2 --- /dev/null +++ b/src/test/resources/checks/v31/parameters/OAR023/plain-without.json @@ -0,0 +1,37 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/examples" : { + "get" : { # Noncompliant {{OAR023: $total must be defined as a parameter in this operation}} + "parameters" : [ { + "in" : "query", + "name" : "other", + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + }, { + "in" : "query", + "name" : "select", + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + } ], + "responses" : { + "206" : { + "description" : "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/parameters/OAR023/plain-without.yaml b/src/test/resources/checks/v31/parameters/OAR023/plain-without.yaml new file mode 100644 index 00000000..6f8d8d99 --- /dev/null +++ b/src/test/resources/checks/v31/parameters/OAR023/plain-without.yaml @@ -0,0 +1,23 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /examples: + get: # Noncompliant {{OAR023: $total must be defined as a parameter in this operation}} + parameters: + - in: query + name: other + schema: + type: array + items: + type: string + - in: query + name: select + schema: + type: array + items: + type: string + responses: + 206: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v31/parameters/OAR023/plain.json b/src/test/resources/checks/v31/parameters/OAR023/plain.json new file mode 100644 index 00000000..93ef330b --- /dev/null +++ b/src/test/resources/checks/v31/parameters/OAR023/plain.json @@ -0,0 +1,37 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/examples" : { + "get" : { + "parameters" : [ { + "in" : "query", + "name" : "$total", + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + }, { + "in" : "query", + "name" : "$total", + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + } ], + "responses" : { + "206" : { + "description" : "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/parameters/OAR023/plain.yaml b/src/test/resources/checks/v31/parameters/OAR023/plain.yaml new file mode 100644 index 00000000..e3b89931 --- /dev/null +++ b/src/test/resources/checks/v31/parameters/OAR023/plain.yaml @@ -0,0 +1,23 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /examples: + get: + parameters: + - in: query + name: $total + schema: + type: array + items: + type: string + - in: query + name: $total + schema: + type: array + items: + type: string + responses: + 206: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v31/parameters/OAR023/with-$ref-without.json b/src/test/resources/checks/v31/parameters/OAR023/with-$ref-without.json new file mode 100644 index 00000000..16176996 --- /dev/null +++ b/src/test/resources/checks/v31/parameters/OAR023/with-$ref-without.json @@ -0,0 +1,44 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "components": { + "parameters" : { + "other" : { + "in" : "query", + "name" : "other", + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + }, + "total" : { + "in" : "query", + "name" : "total", + "schema": { + "type" : "boolean" + } + } + } + }, + "paths" : { + "/pets" : { + "get" : { + "parameters" : [ { # Noncompliant {{OAR023: $total must be defined as a parameter in this operation}} + "$ref" : "#/components/parameters/other" + }, { + "$ref" : "#/components/parameters/total" + } ], + "responses" : { + "206" : { + "description" : "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/parameters/OAR023/with-$ref-without.yaml b/src/test/resources/checks/v31/parameters/OAR023/with-$ref-without.yaml new file mode 100644 index 00000000..fd019cc6 --- /dev/null +++ b/src/test/resources/checks/v31/parameters/OAR023/with-$ref-without.yaml @@ -0,0 +1,27 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +components: + parameters: + other: + in: query + name: other + schema: + type: array + items: + type: string + total: + in: query + name: total + schema: + type: boolean +paths: + /pets: + get: + parameters: # Noncompliant {{OAR023: $total must be defined as a parameter in this operation}} + - $ref: '#/components/parameters/other' + - $ref: '#/components/parameters/total' + responses: + 206: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v31/parameters/OAR023/with-$ref.json b/src/test/resources/checks/v31/parameters/OAR023/with-$ref.json new file mode 100644 index 00000000..db373f26 --- /dev/null +++ b/src/test/resources/checks/v31/parameters/OAR023/with-$ref.json @@ -0,0 +1,44 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "components": { + "parameters" : { + "other" : { + "in" : "query", + "name" : "other", + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + }, + "total" : { + "in" : "query", + "name" : "$total", + "schema": { + "type" : "boolean" + } + } + } + }, + "paths" : { + "/pets" : { + "get" : { + "parameters" : [ { + "$ref" : "#/components/parameters/other" + }, { + "$ref" : "#/components/parameters/total" + } ], + "responses" : { + "206" : { + "description" : "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/parameters/OAR023/with-$ref.yaml b/src/test/resources/checks/v31/parameters/OAR023/with-$ref.yaml new file mode 100644 index 00000000..702bb880 --- /dev/null +++ b/src/test/resources/checks/v31/parameters/OAR023/with-$ref.yaml @@ -0,0 +1,27 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +components: + parameters: + other: + in: query + name: other + schema: + type: array + items: + type: string + total: + in: query + name: $total + schema: + type: boolean +paths: + /pets: + get: + parameters: + - $ref: '#/components/parameters/other' + - $ref: '#/components/parameters/total' + responses: + 206: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v31/parameters/OAR023/without-parameters.json b/src/test/resources/checks/v31/parameters/OAR023/without-parameters.json new file mode 100644 index 00000000..f2376bff --- /dev/null +++ b/src/test/resources/checks/v31/parameters/OAR023/without-parameters.json @@ -0,0 +1,18 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/pets" : { + "get" : { # Noncompliant {{OAR023: $total must be defined as a parameter in this operation}} + "responses" : { + "206" : { + "description" : "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/parameters/OAR023/without-parameters.yaml b/src/test/resources/checks/v31/parameters/OAR023/without-parameters.yaml new file mode 100644 index 00000000..76a349a0 --- /dev/null +++ b/src/test/resources/checks/v31/parameters/OAR023/without-parameters.yaml @@ -0,0 +1,10 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: + get: # Noncompliant {{OAR023: $total must be defined as a parameter in this operation}} + responses: + 206: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v31/parameters/OAR024/excluded.json b/src/test/resources/checks/v31/parameters/OAR024/excluded.json new file mode 100644 index 00000000..7b77042f --- /dev/null +++ b/src/test/resources/checks/v31/parameters/OAR024/excluded.json @@ -0,0 +1,37 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/status" : { + "get" : { + "parameters" : [ { + "in" : "query", + "name" : "other", + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + }, { + "in" : "query", + "name" : "select", + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + } ], + "responses" : { + "206" : { + "description" : "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/parameters/OAR024/excluded.yaml b/src/test/resources/checks/v31/parameters/OAR024/excluded.yaml new file mode 100644 index 00000000..5bb25ac8 --- /dev/null +++ b/src/test/resources/checks/v31/parameters/OAR024/excluded.yaml @@ -0,0 +1,23 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /status: + get: + parameters: + - in: query + name: other + schema: + type: array + items: + type: string + - in: query + name: select + schema: + type: array + items: + type: string + responses: + 206: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v31/parameters/OAR024/plain-without.json b/src/test/resources/checks/v31/parameters/OAR024/plain-without.json new file mode 100644 index 00000000..d3533f31 --- /dev/null +++ b/src/test/resources/checks/v31/parameters/OAR024/plain-without.json @@ -0,0 +1,37 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/examples" : { + "get" : { # Noncompliant {{OAR024: $start must be defined as a parameter in this operation}} + "parameters" : [ { + "in" : "query", + "name" : "other", + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + }, { + "in" : "query", + "name" : "select", + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + } ], + "responses" : { + "206" : { + "description" : "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/parameters/OAR024/plain-without.yaml b/src/test/resources/checks/v31/parameters/OAR024/plain-without.yaml new file mode 100644 index 00000000..4e44fb6e --- /dev/null +++ b/src/test/resources/checks/v31/parameters/OAR024/plain-without.yaml @@ -0,0 +1,23 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /examples: + get: # Noncompliant {{OAR024: $start must be defined as a parameter in this operation}} + parameters: + - in: query + name: other + schema: + type: array + items: + type: string + - in: query + name: select + schema: + type: array + items: + type: string + responses: + 206: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v31/parameters/OAR024/plain.json b/src/test/resources/checks/v31/parameters/OAR024/plain.json new file mode 100644 index 00000000..0e100ef0 --- /dev/null +++ b/src/test/resources/checks/v31/parameters/OAR024/plain.json @@ -0,0 +1,37 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/examples" : { + "get" : { + "parameters" : [ { + "in" : "query", + "name" : "$start", + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + }, { + "in" : "query", + "name" : "$start", + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + } ], + "responses" : { + "206" : { + "description" : "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/parameters/OAR024/plain.yaml b/src/test/resources/checks/v31/parameters/OAR024/plain.yaml new file mode 100644 index 00000000..59d15dba --- /dev/null +++ b/src/test/resources/checks/v31/parameters/OAR024/plain.yaml @@ -0,0 +1,23 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /examples: + get: + parameters: + - in: query + name: $start + schema: + type: array + items: + type: string + - in: query + name: $start + schema: + type: array + items: + type: string + responses: + 206: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v31/parameters/OAR024/with-$ref-without.json b/src/test/resources/checks/v31/parameters/OAR024/with-$ref-without.json new file mode 100644 index 00000000..da1de6a6 --- /dev/null +++ b/src/test/resources/checks/v31/parameters/OAR024/with-$ref-without.json @@ -0,0 +1,45 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "components": { + "parameters" : { + "other" : { + "in" : "query", + "name" : "other", + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + }, + "init" : { + "in" : "query", + "name" : "init", + "schema": { + "type" : "integer", + "format" : "int64" + } + } + } + }, + "paths" : { + "/pets" : { + "get" : { + "parameters" : [ { # Noncompliant {{OAR024: $start must be defined as a parameter in this operation}} + "$ref" : "#/components/parameters/other" + }, { + "$ref" : "#/components/parameters/init" + } ], + "responses" : { + "206" : { + "description" : "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/parameters/OAR024/with-$ref-without.yaml b/src/test/resources/checks/v31/parameters/OAR024/with-$ref-without.yaml new file mode 100644 index 00000000..09efcc5a --- /dev/null +++ b/src/test/resources/checks/v31/parameters/OAR024/with-$ref-without.yaml @@ -0,0 +1,28 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +components: + parameters: + other: + in: query + name: other + schema: + type: array + items: + type: string + init: + in: query + name: init + schema: + type: integer + format: int64 +paths: + /pets: + get: + parameters: # Noncompliant {{OAR024: $start must be defined as a parameter in this operation}} + - $ref: '#/components/parameters/other' + - $ref: '#/components/parameters/init' + responses: + 206: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v31/parameters/OAR024/with-$ref.json b/src/test/resources/checks/v31/parameters/OAR024/with-$ref.json new file mode 100644 index 00000000..4e4888fd --- /dev/null +++ b/src/test/resources/checks/v31/parameters/OAR024/with-$ref.json @@ -0,0 +1,45 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "components": { + "parameters" : { + "other" : { + "in" : "query", + "name" : "other", + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + }, + "init" : { + "in" : "query", + "name" : "$start", + "schema": { + "type" : "integer", + "format" : "int64" + } + } + } + }, + "paths" : { + "/pets" : { + "get" : { + "parameters" : [ { + "$ref" : "#/components/parameters/other" + }, { + "$ref" : "#/components/parameters/init" + } ], + "responses" : { + "206" : { + "description" : "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/parameters/OAR024/with-$ref.yaml b/src/test/resources/checks/v31/parameters/OAR024/with-$ref.yaml new file mode 100644 index 00000000..32148ae7 --- /dev/null +++ b/src/test/resources/checks/v31/parameters/OAR024/with-$ref.yaml @@ -0,0 +1,28 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +components: + parameters: + other: + in: query + name: other + schema: + type: array + items: + type: string + init: + in: query + name: $start + schema: + type: integer + format: int64 +paths: + /pets: + get: + parameters: + - $ref: '#/components/parameters/other' + - $ref: '#/components/parameters/init' + responses: + 206: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v31/parameters/OAR024/without-parameters.json b/src/test/resources/checks/v31/parameters/OAR024/without-parameters.json new file mode 100644 index 00000000..1d44370b --- /dev/null +++ b/src/test/resources/checks/v31/parameters/OAR024/without-parameters.json @@ -0,0 +1,18 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/pets" : { + "get" : { # Noncompliant {{OAR024: $start must be defined as a parameter in this operation}} + "responses" : { + "206" : { + "description" : "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/parameters/OAR024/without-parameters.yaml b/src/test/resources/checks/v31/parameters/OAR024/without-parameters.yaml new file mode 100644 index 00000000..eb66f92f --- /dev/null +++ b/src/test/resources/checks/v31/parameters/OAR024/without-parameters.yaml @@ -0,0 +1,10 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: + get: # Noncompliant {{OAR024: $start must be defined as a parameter in this operation}} + responses: + 206: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v31/parameters/OAR025/excluded.json b/src/test/resources/checks/v31/parameters/OAR025/excluded.json new file mode 100644 index 00000000..7b77042f --- /dev/null +++ b/src/test/resources/checks/v31/parameters/OAR025/excluded.json @@ -0,0 +1,37 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/status" : { + "get" : { + "parameters" : [ { + "in" : "query", + "name" : "other", + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + }, { + "in" : "query", + "name" : "select", + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + } ], + "responses" : { + "206" : { + "description" : "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/parameters/OAR025/excluded.yaml b/src/test/resources/checks/v31/parameters/OAR025/excluded.yaml new file mode 100644 index 00000000..5bb25ac8 --- /dev/null +++ b/src/test/resources/checks/v31/parameters/OAR025/excluded.yaml @@ -0,0 +1,23 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /status: + get: + parameters: + - in: query + name: other + schema: + type: array + items: + type: string + - in: query + name: select + schema: + type: array + items: + type: string + responses: + 206: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v31/parameters/OAR025/plain-without.json b/src/test/resources/checks/v31/parameters/OAR025/plain-without.json new file mode 100644 index 00000000..e255f777 --- /dev/null +++ b/src/test/resources/checks/v31/parameters/OAR025/plain-without.json @@ -0,0 +1,37 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/examples" : { + "get" : { # Noncompliant {{OAR025: $limit must be defined as a parameter in this operation}} + "parameters" : [ { + "in" : "query", + "name" : "other", + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + }, { + "in" : "query", + "name" : "select", + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + } ], + "responses" : { + "206" : { + "description" : "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/parameters/OAR025/plain-without.yaml b/src/test/resources/checks/v31/parameters/OAR025/plain-without.yaml new file mode 100644 index 00000000..aba5d2c0 --- /dev/null +++ b/src/test/resources/checks/v31/parameters/OAR025/plain-without.yaml @@ -0,0 +1,23 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /examples: + get: # Noncompliant {{OAR025: $limit must be defined as a parameter in this operation}} + parameters: + - in: query + name: other + schema: + type: array + items: + type: string + - in: query + name: select + schema: + type: array + items: + type: string + responses: + 206: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v31/parameters/OAR025/plain.json b/src/test/resources/checks/v31/parameters/OAR025/plain.json new file mode 100644 index 00000000..b853da7f --- /dev/null +++ b/src/test/resources/checks/v31/parameters/OAR025/plain.json @@ -0,0 +1,37 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/examples" : { + "get" : { + "parameters" : [ { + "in" : "query", + "name" : "$limit", + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + }, { + "in" : "query", + "name" : "$limit", + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + } ], + "responses" : { + "206" : { + "description" : "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/parameters/OAR025/plain.yaml b/src/test/resources/checks/v31/parameters/OAR025/plain.yaml new file mode 100644 index 00000000..7eebb8fa --- /dev/null +++ b/src/test/resources/checks/v31/parameters/OAR025/plain.yaml @@ -0,0 +1,23 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /examples: + get: + parameters: + - in: query + name: $limit + schema: + type: array + items: + type: string + - in: query + name: $limit + schema: + type: array + items: + type: string + responses: + 206: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v31/parameters/OAR025/with-$ref-without.json b/src/test/resources/checks/v31/parameters/OAR025/with-$ref-without.json new file mode 100644 index 00000000..864d968a --- /dev/null +++ b/src/test/resources/checks/v31/parameters/OAR025/with-$ref-without.json @@ -0,0 +1,45 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "components": { + "parameters" : { + "other" : { + "in" : "query", + "name" : "other", + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + }, + "limit" : { + "in" : "query", + "name" : "limit", + "schema": { + "type" : "integer", + "format" : "int64" + } + } + } + }, + "paths" : { + "/pets" : { + "get" : { + "parameters" : [ { # Noncompliant {{OAR025: $limit must be defined as a parameter in this operation}} + "$ref" : "#/components/parameters/other" + }, { + "$ref" : "#/components/parameters/limit" + } ], + "responses" : { + "206" : { + "description" : "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/parameters/OAR025/with-$ref-without.yaml b/src/test/resources/checks/v31/parameters/OAR025/with-$ref-without.yaml new file mode 100644 index 00000000..36ceb535 --- /dev/null +++ b/src/test/resources/checks/v31/parameters/OAR025/with-$ref-without.yaml @@ -0,0 +1,28 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +components: + parameters: + other: + in: query + name: other + schema: + type: array + items: + type: string + limit: + in: query + name: limit + schema: + type: integer + format: int64 +paths: + /pets: + get: + parameters: # Noncompliant {{OAR025: $limit must be defined as a parameter in this operation}} + - $ref: '#/components/parameters/other' + - $ref: '#/components/parameters/limit' + responses: + 206: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v31/parameters/OAR025/with-$ref.json b/src/test/resources/checks/v31/parameters/OAR025/with-$ref.json new file mode 100644 index 00000000..8ebf79a9 --- /dev/null +++ b/src/test/resources/checks/v31/parameters/OAR025/with-$ref.json @@ -0,0 +1,46 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "components": { + "parameters" : { + "other" : { + "in" : "query", + "name" : "other", + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + }, + "limit" : { + "in" : "query", + "name" : "$limit", + "schema": { + "type" : "integer", + "format" : "int64" + } + } + } + }, + + "paths" : { + "/pets" : { + "get" : { + "parameters" : [ { + "$ref" : "#/components/parameters/other" + }, { + "$ref" : "#/components/parameters/limit" + } ], + "responses" : { + "206" : { + "description" : "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/parameters/OAR025/with-$ref.yaml b/src/test/resources/checks/v31/parameters/OAR025/with-$ref.yaml new file mode 100644 index 00000000..ae38c08d --- /dev/null +++ b/src/test/resources/checks/v31/parameters/OAR025/with-$ref.yaml @@ -0,0 +1,28 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +components: + parameters: + other: + in: query + name: other + schema: + type: array + items: + type: string + limit: + in: query + name: $limit + schema: + type: integer + format: int64 +paths: + /pets: + get: + parameters: + - $ref: '#/components/parameters/other' + - $ref: '#/components/parameters/limit' + responses: + 206: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v31/parameters/OAR025/without-parameters.json b/src/test/resources/checks/v31/parameters/OAR025/without-parameters.json new file mode 100644 index 00000000..2c99e1ea --- /dev/null +++ b/src/test/resources/checks/v31/parameters/OAR025/without-parameters.json @@ -0,0 +1,18 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/pets" : { + "get" : { # Noncompliant {{OAR025: $limit must be defined as a parameter in this operation}} + "responses" : { + "206" : { + "description" : "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/parameters/OAR025/without-parameters.yaml b/src/test/resources/checks/v31/parameters/OAR025/without-parameters.yaml new file mode 100644 index 00000000..729668f0 --- /dev/null +++ b/src/test/resources/checks/v31/parameters/OAR025/without-parameters.yaml @@ -0,0 +1,10 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: + get: # Noncompliant {{OAR025: $limit must be defined as a parameter in this operation}} + responses: + 206: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v31/parameters/OAR026/plain-with-$total-with-defval-false.json b/src/test/resources/checks/v31/parameters/OAR026/plain-with-$total-with-defval-false.json new file mode 100644 index 00000000..1b477763 --- /dev/null +++ b/src/test/resources/checks/v31/parameters/OAR026/plain-with-$total-with-defval-false.json @@ -0,0 +1,35 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/pets" : { + "get" : { + "parameters" : [ { + "in" : "query", + "name" : "other", + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + }, { + "in" : "query", + "name" : "$total", + "schema": { + "type" : "boolean", + "default" : false + } + } ], + "responses" : { + "206" : { + "description" : "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/parameters/OAR026/plain-with-$total-with-defval-false.yaml b/src/test/resources/checks/v31/parameters/OAR026/plain-with-$total-with-defval-false.yaml new file mode 100644 index 00000000..c33165c9 --- /dev/null +++ b/src/test/resources/checks/v31/parameters/OAR026/plain-with-$total-with-defval-false.yaml @@ -0,0 +1,22 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: + get: + parameters: + - in: query + name: other + schema: + type: array + items: + type: string + - in: query + name: $total + schema: + type: boolean + default: false + responses: + 206: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v31/parameters/OAR026/plain-with-$total-with-defval-true.json b/src/test/resources/checks/v31/parameters/OAR026/plain-with-$total-with-defval-true.json new file mode 100644 index 00000000..0295039e --- /dev/null +++ b/src/test/resources/checks/v31/parameters/OAR026/plain-with-$total-with-defval-true.json @@ -0,0 +1,35 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/pets" : { + "get" : { + "parameters" : [ { + "in" : "query", + "name" : "other", + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + }, { + "in" : "query", + "name" : "$total", + "schema": { + "type" : "boolean", + "default" : true # Noncompliant {{OAR026: The $total parameter default value should be false}} + } + } ], + "responses" : { + "206" : { + "description" : "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/parameters/OAR026/plain-with-$total-with-defval-true.yaml b/src/test/resources/checks/v31/parameters/OAR026/plain-with-$total-with-defval-true.yaml new file mode 100644 index 00000000..3324a5a2 --- /dev/null +++ b/src/test/resources/checks/v31/parameters/OAR026/plain-with-$total-with-defval-true.yaml @@ -0,0 +1,22 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: + get: + parameters: + - in: query + name: other + schema: + type: array + items: + type: string + - in: query + name: $total + schema: + type: boolean + default: true # Noncompliant {{OAR026: The $total parameter default value should be false}} + responses: + 206: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v31/parameters/OAR026/plain-with-$total-without-defval.json b/src/test/resources/checks/v31/parameters/OAR026/plain-with-$total-without-defval.json new file mode 100644 index 00000000..d756597f --- /dev/null +++ b/src/test/resources/checks/v31/parameters/OAR026/plain-with-$total-without-defval.json @@ -0,0 +1,34 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/pets" : { + "get" : { + "parameters" : [ { + "in" : "query", + "name" : "other", + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + }, { # Noncompliant {{OAR026: The $total parameter default value should be false}} + "in" : "query", + "name" : "$total", + "schema": { + "type" : "boolean" + } + } ], + "responses" : { + "206" : { + "description" : "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/parameters/OAR026/plain-with-$total-without-defval.yaml b/src/test/resources/checks/v31/parameters/OAR026/plain-with-$total-without-defval.yaml new file mode 100644 index 00000000..c2580dc0 --- /dev/null +++ b/src/test/resources/checks/v31/parameters/OAR026/plain-with-$total-without-defval.yaml @@ -0,0 +1,21 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: + get: + parameters: + - in: query + name: other + schema: + type: array + items: + type: string + - in: query # Noncompliant {{OAR026: The $total parameter default value should be false}} + name: $total + schema: + type: boolean + responses: + 206: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v31/parameters/OAR026/plain-without-$total.json b/src/test/resources/checks/v31/parameters/OAR026/plain-without-$total.json new file mode 100644 index 00000000..03c10cc8 --- /dev/null +++ b/src/test/resources/checks/v31/parameters/OAR026/plain-without-$total.json @@ -0,0 +1,34 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/pets" : { + "get" : { + "parameters" : [ { + "in" : "query", + "name" : "other", + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + }, { + "in" : "query", + "name" : "total", + "schema": { + "type" : "boolean" + } + } ], + "responses" : { + "206" : { + "description" : "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/parameters/OAR026/plain-without-$total.yaml b/src/test/resources/checks/v31/parameters/OAR026/plain-without-$total.yaml new file mode 100644 index 00000000..bf36bc7d --- /dev/null +++ b/src/test/resources/checks/v31/parameters/OAR026/plain-without-$total.yaml @@ -0,0 +1,21 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: + get: + parameters: + - in: query + name: other + schema: + type: array + items: + type: string + - in: query + name: total + schema: + type: boolean + responses: + 206: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v31/parameters/OAR026/with-$ref-with-$total-with-defval-false.json b/src/test/resources/checks/v31/parameters/OAR026/with-$ref-with-$total-with-defval-false.json new file mode 100644 index 00000000..ac0d6d53 --- /dev/null +++ b/src/test/resources/checks/v31/parameters/OAR026/with-$ref-with-$total-with-defval-false.json @@ -0,0 +1,45 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "components": { + "parameters" : { + "other" : { + "in" : "query", + "name" : "other", + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + }, + "total" : { + "in" : "query", + "name" : "$total", + "schema": { + "type" : "boolean", + "default" : false + } + } + } + }, + "paths" : { + "/pets" : { + "get" : { + "parameters" : [ { + "$ref" : "#/components/parameters/other" + }, { + "$ref" : "#/components/parameters/total" + } ], + "responses" : { + "206" : { + "description" : "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/parameters/OAR026/with-$ref-with-$total-with-defval-false.yaml b/src/test/resources/checks/v31/parameters/OAR026/with-$ref-with-$total-with-defval-false.yaml new file mode 100644 index 00000000..1e0b553f --- /dev/null +++ b/src/test/resources/checks/v31/parameters/OAR026/with-$ref-with-$total-with-defval-false.yaml @@ -0,0 +1,28 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +components: + parameters: + other: + in: query + name: other + schema: + type: array + items: + type: string + total: + in: query + name: $total + schema: + type: boolean + default: false +paths: + /pets: + get: + parameters: + - $ref: '#/components/parameters/other' + - $ref: '#/components/parameters/total' + responses: + 206: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v31/parameters/OAR026/with-$ref-with-$total-with-defval-true.json b/src/test/resources/checks/v31/parameters/OAR026/with-$ref-with-$total-with-defval-true.json new file mode 100644 index 00000000..45028091 --- /dev/null +++ b/src/test/resources/checks/v31/parameters/OAR026/with-$ref-with-$total-with-defval-true.json @@ -0,0 +1,45 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "components": { + "parameters" : { + "other" : { + "in" : "query", + "name" : "other", + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + }, + "total" : { + "in" : "query", + "name" : "$total", + "schema": { + "type" : "boolean", + "default" : true # Noncompliant {{OAR026: The $total parameter default value should be false}} + } + } + }, + }, + "paths" : { + "/pets" : { + "get" : { + "parameters" : [ { + "$ref" : "#/components/parameters/other" + }, { + "$ref" : "#/components/parameters/total" + } ], + "responses" : { + "206" : { + "description" : "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/parameters/OAR026/with-$ref-with-$total-with-defval-true.yaml b/src/test/resources/checks/v31/parameters/OAR026/with-$ref-with-$total-with-defval-true.yaml new file mode 100644 index 00000000..4936969a --- /dev/null +++ b/src/test/resources/checks/v31/parameters/OAR026/with-$ref-with-$total-with-defval-true.yaml @@ -0,0 +1,28 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +components: + parameters: + other: + in: query + name: other + schema: + type: array + items: + type: string + total: + in: query + name: $total + schema: + type: boolean + default: true # Noncompliant {{OAR026: The $total parameter default value should be false}} +paths: + /pets: + get: + parameters: + - $ref: '#/components/parameters/other' + - $ref: '#/components/parameters/total' + responses: + 206: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v31/parameters/OAR026/with-$ref-with-$total-without-defval.json b/src/test/resources/checks/v31/parameters/OAR026/with-$ref-with-$total-without-defval.json new file mode 100644 index 00000000..9c5ef562 --- /dev/null +++ b/src/test/resources/checks/v31/parameters/OAR026/with-$ref-with-$total-without-defval.json @@ -0,0 +1,44 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "components": { + "parameters" : { + "other" : { + "in" : "query", + "name" : "other", + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + }, + "total" : { # Noncompliant {{OAR026: The $total parameter default value should be false}} + "in" : "query", + "name" : "$total", + "schema": { + "type" : "boolean" + } + } + }, + }, + "paths" : { + "/pets" : { + "get" : { + "parameters" : [ { + "$ref" : "#/components/parameters/other" + }, { + "$ref" : "#/components/parameters/total" + } ], + "responses" : { + "206" : { + "description" : "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/parameters/OAR026/with-$ref-with-$total-without-defval.yaml b/src/test/resources/checks/v31/parameters/OAR026/with-$ref-with-$total-without-defval.yaml new file mode 100644 index 00000000..68f5a74b --- /dev/null +++ b/src/test/resources/checks/v31/parameters/OAR026/with-$ref-with-$total-without-defval.yaml @@ -0,0 +1,27 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +components: + parameters: + other: + in: query + name: other + schema: + type: array + items: + type: string + total: # Noncompliant {{OAR026: The $total parameter default value should be false}} + in: query + name: $total + schema: + type: boolean +paths: + /pets: + get: + parameters: + - $ref: '#/components/parameters/other' + - $ref: '#/components/parameters/total' + responses: + 206: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v31/parameters/OAR026/with-$ref-without-$total.json b/src/test/resources/checks/v31/parameters/OAR026/with-$ref-without-$total.json new file mode 100644 index 00000000..e32862b7 --- /dev/null +++ b/src/test/resources/checks/v31/parameters/OAR026/with-$ref-without-$total.json @@ -0,0 +1,44 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "components": { + "parameters" : { + "other" : { + "in" : "query", + "name" : "other", + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + }, + "total" : { + "in" : "query", + "name" : "total", + "schema": { + "type" : "boolean" + } + } + }, + }, + "paths" : { + "/pets" : { + "get" : { + "parameters" : [ { + "$ref" : "#/components/parameters/other" + }, { + "$ref" : "#/components/parameters/total" + } ], + "responses" : { + "206" : { + "description" : "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/parameters/OAR026/with-$ref-without-$total.yaml b/src/test/resources/checks/v31/parameters/OAR026/with-$ref-without-$total.yaml new file mode 100644 index 00000000..0b0047cb --- /dev/null +++ b/src/test/resources/checks/v31/parameters/OAR026/with-$ref-without-$total.yaml @@ -0,0 +1,27 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +components: + parameters: + other: + in: query + name: other + schema: + type: array + items: + type: string + total: + in: query + name: total + schema: + type: boolean +paths: + /pets: + get: + parameters: + - $ref: '#/components/parameters/other' + - $ref: '#/components/parameters/total' + responses: + 206: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v31/parameters/OAR026/without-parameters.json b/src/test/resources/checks/v31/parameters/OAR026/without-parameters.json new file mode 100644 index 00000000..6eb95f76 --- /dev/null +++ b/src/test/resources/checks/v31/parameters/OAR026/without-parameters.json @@ -0,0 +1,18 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/pets" : { + "get" : { + "responses" : { + "206" : { + "description" : "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/parameters/OAR026/without-parameters.yaml b/src/test/resources/checks/v31/parameters/OAR026/without-parameters.yaml new file mode 100644 index 00000000..28190798 --- /dev/null +++ b/src/test/resources/checks/v31/parameters/OAR026/without-parameters.yaml @@ -0,0 +1,10 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: + get: + responses: + 206: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v31/parameters/OAR028/components-param.json b/src/test/resources/checks/v31/parameters/OAR028/components-param.json new file mode 100644 index 00000000..38b3f30a --- /dev/null +++ b/src/test/resources/checks/v31/parameters/OAR028/components-param.json @@ -0,0 +1,29 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "components" : { + "parameters" : { + "filterParam" : { + "in" : "query", + "name" : "other", + "schema" : { + "type" : "string" + } + } + } + }, + "paths" : { + "/examples" : { + "get" : { + "responses" : { + "200" : { + "description" : "Ok" + } + } + } + } + } +} diff --git a/src/test/resources/checks/v31/parameters/OAR028/components-param.yaml b/src/test/resources/checks/v31/parameters/OAR028/components-param.yaml new file mode 100644 index 00000000..18bc4ac4 --- /dev/null +++ b/src/test/resources/checks/v31/parameters/OAR028/components-param.yaml @@ -0,0 +1,17 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +components: + parameters: + filterParam: + in: query + name: other + schema: + type: string +paths: + /examples: + get: + responses: + 200: + description: Ok diff --git a/src/test/resources/checks/v31/parameters/OAR028/exclude-noncompliant.json b/src/test/resources/checks/v31/parameters/OAR028/exclude-noncompliant.json new file mode 100644 index 00000000..ec73f987 --- /dev/null +++ b/src/test/resources/checks/v31/parameters/OAR028/exclude-noncompliant.json @@ -0,0 +1,37 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/status" : { + "get" : { + "parameters" : [ { + "in" : "query", + "name" : "other", # Noncompliant {{OAR028: $filter must be defined as a parameter in this operation}} + "schema" : { + "type" : "array", + "items" : { + "type" : "string" + } + } + }, { + "in" : "query", + "name" : "select", # Noncompliant {{OAR028: $filter must be defined as a parameter in this operation}} + "schema" : { + "type" : "array", + "items" : { + "type" : "string" + } + } + } ], + "responses" : { + "206" : { + "description" : "Ok" + } + } + } + } + } +} diff --git a/src/test/resources/checks/v31/parameters/OAR028/exclude-noncompliant.yaml b/src/test/resources/checks/v31/parameters/OAR028/exclude-noncompliant.yaml new file mode 100644 index 00000000..bc7139de --- /dev/null +++ b/src/test/resources/checks/v31/parameters/OAR028/exclude-noncompliant.yaml @@ -0,0 +1,23 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /status: + get: + parameters: + - in: query + name: other # Noncompliant {{OAR028: $filter must be defined as a parameter in this operation}} + schema: + type: array + items: + type: string + - in: query + name: select # Noncompliant {{OAR028: $filter must be defined as a parameter in this operation}} + schema: + type: array + items: + type: string + responses: + 206: + description: Ok diff --git a/src/test/resources/checks/v31/parameters/OAR028/excluded.json b/src/test/resources/checks/v31/parameters/OAR028/excluded.json new file mode 100644 index 00000000..7b77042f --- /dev/null +++ b/src/test/resources/checks/v31/parameters/OAR028/excluded.json @@ -0,0 +1,37 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/status" : { + "get" : { + "parameters" : [ { + "in" : "query", + "name" : "other", + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + }, { + "in" : "query", + "name" : "select", + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + } ], + "responses" : { + "206" : { + "description" : "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/parameters/OAR028/excluded.yaml b/src/test/resources/checks/v31/parameters/OAR028/excluded.yaml new file mode 100644 index 00000000..5bb25ac8 --- /dev/null +++ b/src/test/resources/checks/v31/parameters/OAR028/excluded.yaml @@ -0,0 +1,23 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /status: + get: + parameters: + - in: query + name: other + schema: + type: array + items: + type: string + - in: query + name: select + schema: + type: array + items: + type: string + responses: + 206: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v31/parameters/OAR028/plain-without.json b/src/test/resources/checks/v31/parameters/OAR028/plain-without.json new file mode 100644 index 00000000..56ec4af2 --- /dev/null +++ b/src/test/resources/checks/v31/parameters/OAR028/plain-without.json @@ -0,0 +1,37 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/examples" : { + "get" : { + "parameters" : [ { + "in" : "query", + "name" : "other", # Noncompliant {{OAR028: $filter must be defined as a parameter in this operation}} + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + }, { + "in" : "query", + "name" : "select", # Noncompliant {{OAR028: $filter must be defined as a parameter in this operation}} + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + } ], + "responses" : { + "206" : { + "description" : "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/parameters/OAR028/plain-without.yaml b/src/test/resources/checks/v31/parameters/OAR028/plain-without.yaml new file mode 100644 index 00000000..e756f798 --- /dev/null +++ b/src/test/resources/checks/v31/parameters/OAR028/plain-without.yaml @@ -0,0 +1,23 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /examples: + get: + parameters: + - in: query + name: other # Noncompliant {{OAR028: $filter must be defined as a parameter in this operation}} + schema: + type: array + items: + type: string + - in: query + name: select # Noncompliant {{OAR028: $filter must be defined as a parameter in this operation}} + schema: + type: array + items: + type: string + responses: + 206: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v31/parameters/OAR028/plain.json b/src/test/resources/checks/v31/parameters/OAR028/plain.json new file mode 100644 index 00000000..aadfd6a9 --- /dev/null +++ b/src/test/resources/checks/v31/parameters/OAR028/plain.json @@ -0,0 +1,37 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/examples" : { + "get" : { + "parameters" : [ { + "in" : "query", + "name" : "$filter", + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + }, { + "in" : "query", + "name" : "$filter", + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + } ], + "responses" : { + "206" : { + "description" : "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/parameters/OAR028/plain.yaml b/src/test/resources/checks/v31/parameters/OAR028/plain.yaml new file mode 100644 index 00000000..69e65b70 --- /dev/null +++ b/src/test/resources/checks/v31/parameters/OAR028/plain.yaml @@ -0,0 +1,23 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /examples: + get: + parameters: + - in: query + name: $filter + schema: + type: array + items: + type: string + - in: query + name: $filter + schema: + type: array + items: + type: string + responses: + 206: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v31/parameters/OAR028/with-$ref-without.json b/src/test/resources/checks/v31/parameters/OAR028/with-$ref-without.json new file mode 100644 index 00000000..e045953f --- /dev/null +++ b/src/test/resources/checks/v31/parameters/OAR028/with-$ref-without.json @@ -0,0 +1,47 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "components": { + "parameters" : { + "other" : { + "in" : "query", + "name" : "other", + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + }, + "orderby" : { + "in" : "query", + "name" : "orderby", + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + } + } + }, + "paths" : { + "/pets" : { + "get" : { + "parameters" : [ { # Noncompliant {{OAR028: $filter must be defined as a parameter in this operation}} + "$ref" : "#/components/parameters/other" + }, { + "$ref" : "#/components/parameters/orderby" + } ], + "responses" : { + "206" : { + "description" : "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/parameters/OAR028/with-$ref-without.yaml b/src/test/resources/checks/v31/parameters/OAR028/with-$ref-without.yaml new file mode 100644 index 00000000..74206e3d --- /dev/null +++ b/src/test/resources/checks/v31/parameters/OAR028/with-$ref-without.yaml @@ -0,0 +1,29 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +components: + parameters: + other: + in: query + name: other + schema: + type: array + items: + type: string + orderby: + in: query + name: orderby + schema: + type: array + items: + type: string +paths: + /pets: + get: + parameters: # Noncompliant {{OAR028: $filter must be defined as a parameter in this operation}} + - $ref: '#/components/parameters/other' + - $ref: '#/components/parameters/orderby' + responses: + 206: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v31/parameters/OAR028/with-$ref.json b/src/test/resources/checks/v31/parameters/OAR028/with-$ref.json new file mode 100644 index 00000000..02cd1cb9 --- /dev/null +++ b/src/test/resources/checks/v31/parameters/OAR028/with-$ref.json @@ -0,0 +1,47 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "components": { + "parameters" : { + "other" : { + "in" : "query", + "name" : "other", + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + }, + "orderby" : { + "in" : "query", + "name" : "$filter", + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + } + } + }, + "paths" : { + "/pets" : { + "get" : { + "parameters" : [ { + "$ref" : "#/components/parameters/other" + }, { + "$ref" : "#/components/parameters/orderby" + } ], + "responses" : { + "206" : { + "description" : "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/parameters/OAR028/with-$ref.yaml b/src/test/resources/checks/v31/parameters/OAR028/with-$ref.yaml new file mode 100644 index 00000000..1cddb613 --- /dev/null +++ b/src/test/resources/checks/v31/parameters/OAR028/with-$ref.yaml @@ -0,0 +1,29 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +components: + parameters: + other: + in: query + name: other + schema: + type: array + items: + type: string + orderby: + in: query + name: $filter + schema: + type: array + items: + type: string +paths: + /pets: + get: + parameters: + - $ref: '#/components/parameters/other' + - $ref: '#/components/parameters/orderby' + responses: + 206: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v31/parameters/OAR028/without-parameters.json b/src/test/resources/checks/v31/parameters/OAR028/without-parameters.json new file mode 100644 index 00000000..cd9cbea6 --- /dev/null +++ b/src/test/resources/checks/v31/parameters/OAR028/without-parameters.json @@ -0,0 +1,18 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/pets" : { + "get" : { # Noncompliant {{OAR028: $filter must be defined as a parameter in this operation}} + "responses" : { + "206" : { + "description" : "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/parameters/OAR028/without-parameters.yaml b/src/test/resources/checks/v31/parameters/OAR028/without-parameters.yaml new file mode 100644 index 00000000..12c50ca8 --- /dev/null +++ b/src/test/resources/checks/v31/parameters/OAR028/without-parameters.yaml @@ -0,0 +1,10 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: + get: # Noncompliant {{OAR028: $filter must be defined as a parameter in this operation}} + responses: + 206: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v31/parameters/OAR060/required-false.json b/src/test/resources/checks/v31/parameters/OAR060/required-false.json new file mode 100644 index 00000000..e0608d51 --- /dev/null +++ b/src/test/resources/checks/v31/parameters/OAR060/required-false.json @@ -0,0 +1,39 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/status" : { + "get" : { + "parameters" : [ { + "in" : "query", + "name" : "other", + "required": false, + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + }, { + "in" : "query", + "name" : "$filter", + "required": false, + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + } ], + "responses" : { + "206" : { + "description" : "Ok" + } + } + } + } + } + } \ No newline at end of file diff --git a/src/test/resources/checks/v31/parameters/OAR060/required-false.yaml b/src/test/resources/checks/v31/parameters/OAR060/required-false.yaml new file mode 100644 index 00000000..5537b3e6 --- /dev/null +++ b/src/test/resources/checks/v31/parameters/OAR060/required-false.yaml @@ -0,0 +1,25 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /status: + get: + parameters: + - in: query + name: other + required: false + schema: + type: array + items: + type: string + - in: query + name: $filter + required: false + schema: + type: array + items: + type: string + responses: + 206: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v31/parameters/OAR060/required-true.json b/src/test/resources/checks/v31/parameters/OAR060/required-true.json new file mode 100644 index 00000000..c57cdd06 --- /dev/null +++ b/src/test/resources/checks/v31/parameters/OAR060/required-true.json @@ -0,0 +1,39 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/status" : { + "get" : { + "parameters" : [ { + "in" : "query", + "name" : "other", + "required": true, # Noncompliant {{OAR060: All parameters in query must be defined as optional}} + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + }, { + "in" : "query", + "name" : "$filter", + "required": true, # Noncompliant {{OAR060: All parameters in query must be defined as optional}} + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + } ], + "responses" : { + "206" : { + "description" : "Ok" + } + } + } + } + } + } \ No newline at end of file diff --git a/src/test/resources/checks/v31/parameters/OAR060/required-true.yaml b/src/test/resources/checks/v31/parameters/OAR060/required-true.yaml new file mode 100644 index 00000000..00a697fb --- /dev/null +++ b/src/test/resources/checks/v31/parameters/OAR060/required-true.yaml @@ -0,0 +1,25 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /status: + get: + parameters: + - in: query + name: other + required: true # Noncompliant {{OAR060: All parameters in query must be defined as optional}} + schema: + type: array + items: + type: string + - in: query + name: $filter + required: true # Noncompliant {{OAR060: All parameters in query must be defined as optional}} + schema: + type: array + items: + type: string + responses: + 206: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v31/parameters/OAR069/bad-request400.json b/src/test/resources/checks/v31/parameters/OAR069/bad-request400.json new file mode 100644 index 00000000..5f9e2b7c --- /dev/null +++ b/src/test/resources/checks/v31/parameters/OAR069/bad-request400.json @@ -0,0 +1,42 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths": { + "/items": { + "get": { + "summary": "Get a list of items", + "parameters": [ + { + "name": "param1", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "A list of items", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + }, + "400": { + "description": "Bad Request" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/parameters/OAR069/bad-request400.yaml b/src/test/resources/checks/v31/parameters/OAR069/bad-request400.yaml new file mode 100644 index 00000000..8e3ad04a --- /dev/null +++ b/src/test/resources/checks/v31/parameters/OAR069/bad-request400.yaml @@ -0,0 +1,25 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /items: + get: + summary: Get a list of items + parameters: + - name: param1 + in: query + required: false + schema: + type: string + responses: + 200: + description: A list of items + content: + application/json: + schema: + type: array + items: + type: string + 400: + description: Bad Request \ No newline at end of file diff --git a/src/test/resources/checks/v31/parameters/OAR069/no-bad-request400.json b/src/test/resources/checks/v31/parameters/OAR069/no-bad-request400.json new file mode 100644 index 00000000..54ace04f --- /dev/null +++ b/src/test/resources/checks/v31/parameters/OAR069/no-bad-request400.json @@ -0,0 +1,38 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths": { + "/items": { + "get": { + "parameters": [ + { # Noncompliant {{OAR069: Any param in PATH or QUERY should have a Bad Request (400) response.}} + "name": "param1", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "A list of items", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + } + } + } + } + } \ No newline at end of file diff --git a/src/test/resources/checks/v31/parameters/OAR069/no-bad-request400.yaml b/src/test/resources/checks/v31/parameters/OAR069/no-bad-request400.yaml new file mode 100644 index 00000000..44c1d8ad --- /dev/null +++ b/src/test/resources/checks/v31/parameters/OAR069/no-bad-request400.yaml @@ -0,0 +1,22 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /items: + get: + parameters: + - name: param1 # Noncompliant {{OAR069: Any param in PATH or QUERY should have a Bad Request (400) response.}} + in: query + required: false + schema: + type: string + responses: + 200: + description: A list of items + content: + application/json: + schema: + type: array + items: + type: string diff --git a/src/test/resources/checks/v31/regex/OAR112/external-docs-invalid.json b/src/test/resources/checks/v31/regex/OAR112/external-docs-invalid.json new file mode 100644 index 00000000..17586e7f --- /dev/null +++ b/src/test/resources/checks/v31/regex/OAR112/external-docs-invalid.json @@ -0,0 +1,12 @@ +{ + "openapi" : "3.0.3", + "info" : { + "title" : "Test API", + "version" : "1.0.0" + }, + "externalDocs" : { + "description" : "lowercase external documentation", # Noncompliant {{OAR112: The field must start with an uppercase letter.}} + "url" : "https://example.com" + }, + "paths" : {} +} diff --git a/src/test/resources/checks/v31/regex/OAR112/external-docs-invalid.yaml b/src/test/resources/checks/v31/regex/OAR112/external-docs-invalid.yaml new file mode 100644 index 00000000..587823ce --- /dev/null +++ b/src/test/resources/checks/v31/regex/OAR112/external-docs-invalid.yaml @@ -0,0 +1,8 @@ +openapi: 3.0.3 +info: + title: Test API + version: 1.0.0 +externalDocs: + description: lowercase external documentation # Noncompliant {{OAR112: The field must start with an uppercase letter.}} + url: https://example.com +paths: {} diff --git a/src/test/resources/checks/v31/regex/OAR112/external-docs-valid.json b/src/test/resources/checks/v31/regex/OAR112/external-docs-valid.json new file mode 100644 index 00000000..b557673e --- /dev/null +++ b/src/test/resources/checks/v31/regex/OAR112/external-docs-valid.json @@ -0,0 +1,12 @@ +{ + "openapi" : "3.0.3", + "info" : { + "title" : "Test API", + "version" : "1.0.0" + }, + "externalDocs" : { + "description" : "Valid external documentation", + "url" : "https://example.com" + }, + "paths" : {} +} diff --git a/src/test/resources/checks/v31/regex/OAR112/external-docs-valid.yaml b/src/test/resources/checks/v31/regex/OAR112/external-docs-valid.yaml new file mode 100644 index 00000000..a273f219 --- /dev/null +++ b/src/test/resources/checks/v31/regex/OAR112/external-docs-valid.yaml @@ -0,0 +1,8 @@ +openapi: 3.0.3 +info: + title: Test API + version: 1.0.0 +externalDocs: + description: Valid external documentation + url: https://example.com +paths: {} diff --git a/src/test/resources/checks/v31/regex/OAR112/info-invalid.json b/src/test/resources/checks/v31/regex/OAR112/info-invalid.json new file mode 100644 index 00000000..1febb6b1 --- /dev/null +++ b/src/test/resources/checks/v31/regex/OAR112/info-invalid.json @@ -0,0 +1,9 @@ +{ + "openapi" : "3.0.3", + "info" : { + "title" : "Test API", + "version" : "1.0.0", + "description" : "lowercase description" # Noncompliant {{OAR112: The field must start with an uppercase letter.}} + }, + "paths" : {} +} diff --git a/src/test/resources/checks/v31/regex/OAR112/info-invalid.yaml b/src/test/resources/checks/v31/regex/OAR112/info-invalid.yaml new file mode 100644 index 00000000..32fbcf71 --- /dev/null +++ b/src/test/resources/checks/v31/regex/OAR112/info-invalid.yaml @@ -0,0 +1,6 @@ +openapi: 3.0.3 +info: + title: Test API + version: 1.0.0 + description: lowercase description # Noncompliant {{OAR112: The field must start with an uppercase letter.}} +paths: {} diff --git a/src/test/resources/checks/v31/regex/OAR112/minimal.json b/src/test/resources/checks/v31/regex/OAR112/minimal.json new file mode 100644 index 00000000..2c084747 --- /dev/null +++ b/src/test/resources/checks/v31/regex/OAR112/minimal.json @@ -0,0 +1,8 @@ +{ + "openapi" : "3.0.3", + "info" : { + "title" : "Test API", + "version" : "1.0.0" + }, + "paths" : {} +} diff --git a/src/test/resources/checks/v31/regex/OAR112/minimal.yaml b/src/test/resources/checks/v31/regex/OAR112/minimal.yaml new file mode 100644 index 00000000..f379c272 --- /dev/null +++ b/src/test/resources/checks/v31/regex/OAR112/minimal.yaml @@ -0,0 +1,5 @@ +openapi: 3.0.3 +info: + title: Test API + version: 1.0.0 +paths: {} diff --git a/src/test/resources/checks/v31/regex/OAR112/missing-description.json b/src/test/resources/checks/v31/regex/OAR112/missing-description.json new file mode 100644 index 00000000..f2549007 --- /dev/null +++ b/src/test/resources/checks/v31/regex/OAR112/missing-description.json @@ -0,0 +1,8 @@ +{ + "openapi" : "3.0.3", + "info" : { # Noncompliant {{OAR112: Expected to find a value but didn't.}} + "title" : "Test API", + "version" : "1.0.0" + }, + "paths" : {} +} diff --git a/src/test/resources/checks/v31/regex/OAR112/missing-description.yaml b/src/test/resources/checks/v31/regex/OAR112/missing-description.yaml new file mode 100644 index 00000000..db4ae777 --- /dev/null +++ b/src/test/resources/checks/v31/regex/OAR112/missing-description.yaml @@ -0,0 +1,5 @@ +openapi: 3.0.3 +info: # Noncompliant {{OAR112: Expected to find a value but didn't.}} + title: Test API + version: 1.0.0 +paths: {} diff --git a/src/test/resources/checks/v31/regex/OAR112/operation-invalid.json b/src/test/resources/checks/v31/regex/OAR112/operation-invalid.json new file mode 100644 index 00000000..8bfbed2b --- /dev/null +++ b/src/test/resources/checks/v31/regex/OAR112/operation-invalid.json @@ -0,0 +1,19 @@ +{ + "openapi" : "3.0.3", + "info" : { + "title" : "Test API", + "version" : "1.0.0" + }, + "paths" : { + "/test" : { + "get" : { + "summary" : "lowercase operation summary", # Noncompliant {{OAR112: The field must start with an uppercase letter.}} + "responses" : { + "200" : { + "description" : "OK" + } + } + } + } + } +} diff --git a/src/test/resources/checks/v31/regex/OAR112/operation-invalid.yaml b/src/test/resources/checks/v31/regex/OAR112/operation-invalid.yaml new file mode 100644 index 00000000..0bc1243b --- /dev/null +++ b/src/test/resources/checks/v31/regex/OAR112/operation-invalid.yaml @@ -0,0 +1,11 @@ +openapi: 3.0.3 +info: + title: Test API + version: 1.0.0 +paths: + /test: + get: + summary: lowercase operation summary # Noncompliant {{OAR112: The field must start with an uppercase letter.}} + responses: + '200': + description: OK diff --git a/src/test/resources/checks/v31/regex/OAR112/operation-valid.json b/src/test/resources/checks/v31/regex/OAR112/operation-valid.json new file mode 100644 index 00000000..84ad7faa --- /dev/null +++ b/src/test/resources/checks/v31/regex/OAR112/operation-valid.json @@ -0,0 +1,19 @@ +{ + "openapi" : "3.0.3", + "info" : { + "title" : "Test API", + "version" : "1.0.0" + }, + "paths" : { + "/test" : { + "get" : { + "summary" : "Valid Operation Summary", + "responses" : { + "200" : { + "description" : "OK" + } + } + } + } + } +} diff --git a/src/test/resources/checks/v31/regex/OAR112/operation-valid.yaml b/src/test/resources/checks/v31/regex/OAR112/operation-valid.yaml new file mode 100644 index 00000000..9b62b40c --- /dev/null +++ b/src/test/resources/checks/v31/regex/OAR112/operation-valid.yaml @@ -0,0 +1,11 @@ +openapi: 3.0.3 +info: + title: Test API + version: 1.0.0 +paths: + /test: + get: + summary: Valid Operation Summary + responses: + '200': + description: OK diff --git a/src/test/resources/checks/v31/regex/OAR112/parameters-invalid.json b/src/test/resources/checks/v31/regex/OAR112/parameters-invalid.json new file mode 100644 index 00000000..46495733 --- /dev/null +++ b/src/test/resources/checks/v31/regex/OAR112/parameters-invalid.json @@ -0,0 +1,26 @@ +{ + "openapi" : "3.0.3", + "info" : { + "title" : "Test API", + "version" : "1.0.0" + }, + "paths" : { + "/test" : { + "get" : { + "parameters" : [ { + "name" : "page", + "in" : "query", + "description" : "lowercase parameter description", # Noncompliant {{OAR112: The field must start with an uppercase letter.}} + "schema" : { + "type" : "integer" + } + } ], + "responses" : { + "200" : { + "description" : "OK" + } + } + } + } + } +} diff --git a/src/test/resources/checks/v31/regex/OAR112/parameters-invalid.yaml b/src/test/resources/checks/v31/regex/OAR112/parameters-invalid.yaml new file mode 100644 index 00000000..86159506 --- /dev/null +++ b/src/test/resources/checks/v31/regex/OAR112/parameters-invalid.yaml @@ -0,0 +1,16 @@ +openapi: 3.0.3 +info: + title: Test API + version: 1.0.0 +paths: + /test: + get: + parameters: + - name: page + in: query + description: lowercase parameter description # Noncompliant {{OAR112: The field must start with an uppercase letter.}} + schema: + type: integer + responses: + '200': + description: OK diff --git a/src/test/resources/checks/v31/regex/OAR112/parameters-valid.json b/src/test/resources/checks/v31/regex/OAR112/parameters-valid.json new file mode 100644 index 00000000..27af1750 --- /dev/null +++ b/src/test/resources/checks/v31/regex/OAR112/parameters-valid.json @@ -0,0 +1,26 @@ +{ + "openapi" : "3.0.3", + "info" : { + "title" : "Test API", + "version" : "1.0.0" + }, + "paths" : { + "/test" : { + "get" : { + "parameters" : [ { + "name" : "page", + "in" : "query", + "description" : "Valid parameter description", + "schema" : { + "type" : "integer" + } + } ], + "responses" : { + "200" : { + "description" : "OK" + } + } + } + } + } +} diff --git a/src/test/resources/checks/v31/regex/OAR112/parameters-valid.yaml b/src/test/resources/checks/v31/regex/OAR112/parameters-valid.yaml new file mode 100644 index 00000000..9ec6ebd6 --- /dev/null +++ b/src/test/resources/checks/v31/regex/OAR112/parameters-valid.yaml @@ -0,0 +1,16 @@ +openapi: 3.0.3 +info: + title: Test API + version: 1.0.0 +paths: + /test: + get: + parameters: + - name: page + in: query + description: Valid parameter description + schema: + type: integer + responses: + '200': + description: OK diff --git a/src/test/resources/checks/v31/regex/OAR112/plain.json b/src/test/resources/checks/v31/regex/OAR112/plain.json new file mode 100644 index 00000000..aab1e213 --- /dev/null +++ b/src/test/resources/checks/v31/regex/OAR112/plain.json @@ -0,0 +1,37 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/examples" : { + "get" : { + "parameters" : [ { + "in" : "query", + "name" : "$select", + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + }, { + "in" : "query", + "name" : "$select", + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + } ], + "responses" : { + "206" : { + "description" : "Ok" + } + } + } + } + } + } \ No newline at end of file diff --git a/src/test/resources/checks/v31/regex/OAR112/plain.yaml b/src/test/resources/checks/v31/regex/OAR112/plain.yaml new file mode 100644 index 00000000..4621ff6f --- /dev/null +++ b/src/test/resources/checks/v31/regex/OAR112/plain.yaml @@ -0,0 +1,46 @@ +openapi: 3.0.3 +info: + title: Ejemplo de API + version: 1.0.0 + description: Una API de ejemplo para ilustrar la estructura de OpenAPI. +servers: + - url: https://api.ejemplo.com/v1 +paths: + /usuarios: + get: + summary: Obtiene una lista de usuarios + description: Retorna una lista completa de usuarios registrados. + operationId: getUsuarios + tags: + - Usuarios + parameters: + - name: "page" + in: "query" + description: "Número de página para la paginación" + required: false + schema: + type: "integer" + format: "int32" + responses: + '200': + description: ana lista de usuarios se retorna en caso de éxito. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Usuario' + '404': + description: No se encontraron usuarios. +components: + schemas: + Usuario: + type: object + properties: + id: + type: integer + format: int64 + description: El ID único del usuario. + nombre: + type: string + description: El nombre del usuario. \ No newline at end of file diff --git a/src/test/resources/checks/v31/regex/OAR112/servers-invalid.json b/src/test/resources/checks/v31/regex/OAR112/servers-invalid.json new file mode 100644 index 00000000..c5cda036 --- /dev/null +++ b/src/test/resources/checks/v31/regex/OAR112/servers-invalid.json @@ -0,0 +1,12 @@ +{ + "openapi" : "3.0.3", + "info" : { + "title" : "Test API", + "version" : "1.0.0" + }, + "servers" : [ { + "url" : "https://api.example.com", + "description" : "lowercase server description" # Noncompliant {{OAR112: The field must start with an uppercase letter.}} + } ], + "paths" : {} +} diff --git a/src/test/resources/checks/v31/regex/OAR112/servers-invalid.yaml b/src/test/resources/checks/v31/regex/OAR112/servers-invalid.yaml new file mode 100644 index 00000000..835f2b06 --- /dev/null +++ b/src/test/resources/checks/v31/regex/OAR112/servers-invalid.yaml @@ -0,0 +1,8 @@ +openapi: 3.0.3 +info: + title: Test API + version: 1.0.0 +servers: + - url: https://api.example.com + description: lowercase server description # Noncompliant {{OAR112: The field must start with an uppercase letter.}} +paths: {} diff --git a/src/test/resources/checks/v31/regex/OAR112/servers-valid.json b/src/test/resources/checks/v31/regex/OAR112/servers-valid.json new file mode 100644 index 00000000..735983f4 --- /dev/null +++ b/src/test/resources/checks/v31/regex/OAR112/servers-valid.json @@ -0,0 +1,12 @@ +{ + "openapi" : "3.0.3", + "info" : { + "title" : "Test API", + "version" : "1.0.0" + }, + "servers" : [ { + "url" : "https://api.example.com", + "description" : "Valid server description" + } ], + "paths" : {} +} diff --git a/src/test/resources/checks/v31/regex/OAR112/servers-valid.yaml b/src/test/resources/checks/v31/regex/OAR112/servers-valid.yaml new file mode 100644 index 00000000..511f93d7 --- /dev/null +++ b/src/test/resources/checks/v31/regex/OAR112/servers-valid.yaml @@ -0,0 +1,8 @@ +openapi: 3.0.3 +info: + title: Test API + version: 1.0.0 +servers: + - url: https://api.example.com + description: Valid server description +paths: {} diff --git a/src/test/resources/checks/v31/regex/OAR112/tags-invalid.json b/src/test/resources/checks/v31/regex/OAR112/tags-invalid.json new file mode 100644 index 00000000..5995f7ba --- /dev/null +++ b/src/test/resources/checks/v31/regex/OAR112/tags-invalid.json @@ -0,0 +1,11 @@ +{ + "openapi" : "3.0.3", + "info" : { + "title" : "Test API", + "version" : "1.0.0" + }, + "tags" : [ { + "name" : "invalidTag" # Noncompliant {{OAR112: The field must start with an uppercase letter.}} + } ], + "paths" : {} +} diff --git a/src/test/resources/checks/v31/regex/OAR112/tags-invalid.yaml b/src/test/resources/checks/v31/regex/OAR112/tags-invalid.yaml new file mode 100644 index 00000000..48c06b71 --- /dev/null +++ b/src/test/resources/checks/v31/regex/OAR112/tags-invalid.yaml @@ -0,0 +1,7 @@ +openapi: 3.0.3 +info: + title: Test API + version: 1.0.0 +tags: + - name: invalidTag # Noncompliant {{OAR112: The field must start with an uppercase letter.}} +paths: {} diff --git a/src/test/resources/checks/v31/regex/OAR112/tags-valid.json b/src/test/resources/checks/v31/regex/OAR112/tags-valid.json new file mode 100644 index 00000000..f28ad145 --- /dev/null +++ b/src/test/resources/checks/v31/regex/OAR112/tags-valid.json @@ -0,0 +1,11 @@ +{ + "openapi" : "3.0.3", + "info" : { + "title" : "Test API", + "version" : "1.0.0" + }, + "tags" : [ { + "name" : "ValidTag" + } ], + "paths" : {} +} diff --git a/src/test/resources/checks/v31/regex/OAR112/tags-valid.yaml b/src/test/resources/checks/v31/regex/OAR112/tags-valid.yaml new file mode 100644 index 00000000..045b483f --- /dev/null +++ b/src/test/resources/checks/v31/regex/OAR112/tags-valid.yaml @@ -0,0 +1,7 @@ +openapi: 3.0.3 +info: + title: Test API + version: 1.0.0 +tags: + - name: ValidTag +paths: {} diff --git a/src/test/resources/checks/v31/resources/OAR008/plain.json b/src/test/resources/checks/v31/resources/OAR008/plain.json new file mode 100644 index 00000000..9b40ba23 --- /dev/null +++ b/src/test/resources/checks/v31/resources/OAR008/plain.json @@ -0,0 +1,60 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/pets" : { + "patch" : { + "responses" : { + "200" : { + "description" : "Ok" + } + } + }, + "get" : { + "responses" : { + "200" : { + "description" : "Ok" + } + } + }, + "post" : { + "responses" : { + "200" : { + "description" : "Ok" + } + } + }, + "put" : { + "responses" : { + "200" : { + "description" : "Ok" + } + } + }, + "delete" : { + "responses" : { + "200" : { + "description" : "Ok" + } + } + }, + "head" : { # Noncompliant {{OAR008: Http verb (head) not encouraged}} + "responses" : { + "200" : { + "description" : "Ok" + } + } + }, + "options" : { # Noncompliant {{OAR008: Http verb (options) not encouraged}} + "responses" : { + "200" : { + "description" : "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/resources/OAR008/plain.yaml b/src/test/resources/checks/v31/resources/OAR008/plain.yaml new file mode 100644 index 00000000..fa0fc5fc --- /dev/null +++ b/src/test/resources/checks/v31/resources/OAR008/plain.yaml @@ -0,0 +1,35 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: + patch: + responses: + 200: + description: Ok + get: + responses: + 200: + description: Ok + post: + responses: + 200: + description: Ok + put: + responses: + 200: + description: Ok + delete: + responses: + 200: + description: Ok + head: # Noncompliant {{OAR008: Http verb (head) not encouraged}} + responses: + 200: + description: Ok + options: # Noncompliant {{OAR008: Http verb (options) not encouraged}} + responses: + 200: + description: Ok + diff --git a/src/test/resources/checks/v31/resources/OAR013/plain.json b/src/test/resources/checks/v31/resources/OAR013/plain.json new file mode 100644 index 00000000..78e9374c --- /dev/null +++ b/src/test/resources/checks/v31/resources/OAR013/plain.json @@ -0,0 +1,25 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/pets" : { + "get" : { + "responses" : { # Noncompliant {{OAR013: Default response is required}} + "200" : { + "description" : "Ok" + } + } + }, + "post" : { + "responses" : { + "default" : { + "description" : "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/resources/OAR013/plain.yaml b/src/test/resources/checks/v31/resources/OAR013/plain.yaml new file mode 100644 index 00000000..a58371d8 --- /dev/null +++ b/src/test/resources/checks/v31/resources/OAR013/plain.yaml @@ -0,0 +1,14 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: + get: + responses: # Noncompliant {{OAR013: Default response is required}} + 200: + description: Ok + post: + responses: + default: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v31/resources/OAR014/plain.json b/src/test/resources/checks/v31/resources/OAR014/plain.json new file mode 100644 index 00000000..ec717959 --- /dev/null +++ b/src/test/resources/checks/v31/resources/OAR014/plain.json @@ -0,0 +1,54 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/one": { + "get": { + "responses": { + "default": { + "description": "Ok" + } + } + } + }, + "/one/two": { + "get": { + "responses": { + "default": { + "description": "Ok" + } + } + } + }, + "/one/two/three": { + "get": { + "responses": { + "default": { + "description": "Ok" + } + } + } + }, + "/one/two/three/four": { # Noncompliant {{OAR014: Resources depth level should be smaller}} + "get": { + "responses": { + "default": { + "description": "Ok" + } + } + } + }, + "/one/two/three/four/five": { # Noncompliant {{OAR014: Resources depth level should be smaller}} + "get": { + "responses": { + "default": { + "description": "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/resources/OAR014/plain.yaml b/src/test/resources/checks/v31/resources/OAR014/plain.yaml new file mode 100644 index 00000000..08c7baa0 --- /dev/null +++ b/src/test/resources/checks/v31/resources/OAR014/plain.yaml @@ -0,0 +1,30 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /one: + get: + responses: + default: + description: Ok + /one/two: + get: + responses: + default: + description: Ok + /one/two/three: + get: + responses: + default: + description: Ok + /one/two/three/four: # Noncompliant {{OAR014: Resources depth level should be smaller}} + get: + responses: + default: + description: Ok + /one/two/three/four/five: # Noncompliant {{OAR014: Resources depth level should be smaller}} + get: + responses: + default: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v31/resources/OAR015/plain.json b/src/test/resources/checks/v31/resources/OAR015/plain.json new file mode 100644 index 00000000..258325fe --- /dev/null +++ b/src/test/resources/checks/v31/resources/OAR015/plain.json @@ -0,0 +1,72 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/one": { + "get": { + "responses": { + "default": { + "description": "Ok" + } + } + } + }, + "/one/two": { + "get": { + "responses": { + "default": { + "description": "Ok" + } + } + } + }, + "/one/two/three": { + "get": { + "responses": { + "default": { + "description": "Ok" + } + } + } + }, + "/one/two/three/four": { + "get": { + "responses": { + "default": { + "description": "Ok" + } + } + } + }, + "/one/two/three/four/five": { + "get": { + "responses": { + "default": { + "description": "Ok" + } + } + } + }, + "/one/two/three/four/five/six": { # Noncompliant {{OAR015: Resources depth level should be smaller}} + "get": { + "responses": { + "default": { + "description": "Ok" + } + } + } + }, + "/one/two/three/four/five/six/seven": { # Noncompliant {{OAR015: Resources depth level should be smaller}} + "get": { + "responses": { + "default": { + "description": "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/resources/OAR015/plain.yaml b/src/test/resources/checks/v31/resources/OAR015/plain.yaml new file mode 100644 index 00000000..94edfe5d --- /dev/null +++ b/src/test/resources/checks/v31/resources/OAR015/plain.yaml @@ -0,0 +1,40 @@ +openapi: 3.0.0 +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /one: + get: + responses: + default: + description: Ok + /one/two: + get: + responses: + default: + description: Ok + /one/two/three: + get: + responses: + default: + description: Ok + /one/two/three/four: + get: + responses: + default: + description: Ok + /one/two/three/four/five: + get: + responses: + default: + description: Ok + /one/two/three/four/five/six: # Noncompliant {{OAR015: Resources depth level should be smaller}} + get: + responses: + default: + description: Ok + /one/two/three/four/five/six/seven: # Noncompliant {{OAR015: Resources depth level should be smaller}} + get: + responses: + default: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v31/resources/OAR017/plain.json b/src/test/resources/checks/v31/resources/OAR017/plain.json new file mode 100644 index 00000000..1106c56c --- /dev/null +++ b/src/test/resources/checks/v31/resources/OAR017/plain.json @@ -0,0 +1,63 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/one" : { + "get" : { + "responses" : { + "200" : { + "description" : "Ok" + } + } + } + }, + "/{one}" : { # Noncompliant {{OAR017: Resource path should alternate static and parametrized parts}} + "get" : { + "responses" : { + "200" : { + "description" : "Ok" + } + } + } + }, + "/one/two" : { # Noncompliant {{OAR017: Resource path should alternate static and parametrized parts}} + "get" : { + "responses" : { + "200" : { + "description" : "Ok" + } + } + } + }, + "/one/{two}" : { + "get" : { + "responses" : { + "200" : { + "description" : "Ok" + } + } + } + }, + "/one/{two}/three" : { + "get" : { + "responses" : { + "200" : { + "description" : "Ok" + } + } + } + }, + "/one/{two}/{three}" : { # Noncompliant {{OAR017: Resource path should alternate static and parametrized parts}} + "get" : { + "responses" : { + "200" : { + "description" : "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/resources/OAR017/plain.yaml b/src/test/resources/checks/v31/resources/OAR017/plain.yaml new file mode 100644 index 00000000..29c02541 --- /dev/null +++ b/src/test/resources/checks/v31/resources/OAR017/plain.yaml @@ -0,0 +1,52 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /one: + get: + responses: + 200: + description: Ok + + /{one}: # Noncompliant {{OAR017: Resource path should alternate static and parametrized parts}} + get: + responses: + 200: + description: Ok + + /one/two: # Noncompliant {{OAR017: Resource path should alternate static and parametrized parts}} + get: + responses: + 200: + description: Ok + + /one/{two}: + get: + responses: + 200: + description: Ok + + /one/{two}/three: + get: + responses: + 200: + description: Ok + + /one/me: + get: + responses: + 200: + description: Ok + + /one/me/three: + get: + responses: + 200: + description: Ok + + /one/{two}/{three}: # Noncompliant {{OAR017: Resource path should alternate static and parametrized parts}} + get: + responses: + 200: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v31/resources/OAR018/plain.json b/src/test/resources/checks/v31/resources/OAR018/plain.json new file mode 100644 index 00000000..691f21b9 --- /dev/null +++ b/src/test/resources/checks/v31/resources/OAR018/plain.json @@ -0,0 +1,194 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/resources": { + "get": { + "responses": { + "200": { + "description": "Ok" + } + } + }, + "post": { + "responses": { + "200": { + "description": "Ok" + } + } + }, + "put": { # Noncompliant {{OAR018: Operation not recommended for resource path: PUT /resources}} + "responses": { + "200": { + "description": "Ok" + } + } + }, + "patch": { # Noncompliant {{OAR018: Operation not recommended for resource path: PATCH /resources}} + "responses": { + "200": { + "description": "Ok" + } + } + }, + "delete": { # Noncompliant {{OAR018: Operation not recommended for resource path: DELETE /resources}} + "responses": { + "200": { + "description": "Ok" + } + } + } + }, + "/resources/{r_id}": { + "get": { + "responses": { + "200": { + "description": "Ok" + } + } + }, + "post": { # Noncompliant {{OAR018: Operation not recommended for resource path: POST /resources/{r_id}}} + "responses": { + "200": { + "description": "Ok" + } + } + }, + "put": { + "responses": { + "200": { + "description": "Ok" + } + } + }, + "patch": { + "responses": { + "200": { + "description": "Ok" + } + } + }, + "delete": { + "responses": { + "200": { + "description": "Ok" + } + } + } + }, + "/resources/get": { + "get": { # Noncompliant {{OAR018: Operation not recommended for resource path: GET /resources/get}} + "responses": { + "200": { + "description": "Ok" + } + } + }, + "post": { + "responses": { + "200": { + "description": "Ok" + } + } + }, + "put": { # Noncompliant {{OAR018: Operation not recommended for resource path: PUT /resources/get}} + "responses": { + "200": { + "description": "Ok" + } + } + }, + "patch": { # Noncompliant {{OAR018: Operation not recommended for resource path: PATCH /resources/get}} + "responses": { + "200": { + "description": "Ok" + } + } + }, + "delete": { # Noncompliant {{OAR018: Operation not recommended for resource path: DELETE /resources/get}} + "responses": { + "200": { + "description": "Ok" + } + } + } + }, + "/resources/delete": { + "get": { # Noncompliant {{OAR018: Operation not recommended for resource path: GET /resources/delete}} + "responses": { + "200": { + "description": "Ok" + } + } + }, + "post": { + "responses": { + "200": { + "description": "Ok" + } + } + }, + "put": { # Noncompliant {{OAR018: Operation not recommended for resource path: PUT /resources/delete}} + "responses": { + "200": { + "description": "Ok" + } + } + }, + "patch": { # Noncompliant {{OAR018: Operation not recommended for resource path: PATCH /resources/delete}} + "responses": { + "200": { + "description": "Ok" + } + } + }, + "delete": { # Noncompliant {{OAR018: Operation not recommended for resource path: DELETE /resources/delete}} + "responses": { + "200": { + "description": "Ok" + } + } + } + }, + "/resources/{r_id}/other": { + "get": { + "responses": { + "200": { + "description": "Ok" + } + } + }, + "post": { + "responses": { + "200": { + "description": "Ok" + } + } + }, + "put": { # Noncompliant {{OAR018: Operation not recommended for resource path: PUT /resources/{r_id}/other}} + "responses": { + "200": { + "description": "Ok" + } + } + }, + "patch": { # Noncompliant {{OAR018: Operation not recommended for resource path: PATCH /resources/{r_id}/other}} + "responses": { + "200": { + "description": "Ok" + } + } + }, + "delete": { # Noncompliant {{OAR018: Operation not recommended for resource path: DELETE /resources/{r_id}/other}} + "responses": { + "200": { + "description": "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/resources/OAR018/plain.yaml b/src/test/resources/checks/v31/resources/OAR018/plain.yaml new file mode 100644 index 00000000..bed03643 --- /dev/null +++ b/src/test/resources/checks/v31/resources/OAR018/plain.yaml @@ -0,0 +1,114 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /resources: + get: + responses: + 200: + description: Ok + post: + responses: + 200: + description: Ok + put: # Noncompliant {{OAR018: Operation not recommended for resource path: PUT /resources}} + responses: + 200: + description: Ok + patch: # Noncompliant {{OAR018: Operation not recommended for resource path: PATCH /resources}} + responses: + 200: + description: Ok + delete: # Noncompliant {{OAR018: Operation not recommended for resource path: DELETE /resources}} + responses: + 200: + description: Ok + + /resources/{r_id}: + get: + responses: + 200: + description: Ok + post: # Noncompliant {{OAR018: Operation not recommended for resource path: POST /resources/{r_id}}} + responses: + 200: + description: Ok + put: + responses: + 200: + description: Ok + patch: + responses: + 200: + description: Ok + delete: + responses: + 200: + description: Ok + + /resources/get: + get: # Noncompliant {{OAR018: Operation not recommended for resource path: GET /resources/get}} + responses: + 200: + description: Ok + post: + responses: + 200: + description: Ok + put: # Noncompliant {{OAR018: Operation not recommended for resource path: PUT /resources/get}} + responses: + 200: + description: Ok + patch: # Noncompliant {{OAR018: Operation not recommended for resource path: PATCH /resources/get}} + responses: + 200: + description: Ok + delete: # Noncompliant {{OAR018: Operation not recommended for resource path: DELETE /resources/get}} + responses: + 200: + description: Ok + + /resources/delete: + get: # Noncompliant {{OAR018: Operation not recommended for resource path: GET /resources/delete}} + responses: + 200: + description: Ok + post: + responses: + 200: + description: Ok + put: # Noncompliant {{OAR018: Operation not recommended for resource path: PUT /resources/delete}} + responses: + 200: + description: Ok + patch: # Noncompliant {{OAR018: Operation not recommended for resource path: PATCH /resources/delete}} + responses: + 200: + description: Ok + delete: # Noncompliant {{OAR018: Operation not recommended for resource path: DELETE /resources/delete}} + responses: + 200: + description: Ok + + /resources/{r_id}/other: + get: + responses: + 200: + description: Ok + post: + responses: + 200: + description: Ok + put: # Noncompliant {{OAR018: Operation not recommended for resource path: PUT /resources/{r_id}/other}} + responses: + 200: + description: Ok + patch: # Noncompliant {{OAR018: Operation not recommended for resource path: PATCH /resources/{r_id}/other}} + responses: + 200: + description: Ok + delete: # Noncompliant {{OAR018: Operation not recommended for resource path: DELETE /resources/{r_id}/other}} + responses: + 200: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v31/resources/OAR027/no-post.json b/src/test/resources/checks/v31/resources/OAR027/no-post.json new file mode 100644 index 00000000..06e93395 --- /dev/null +++ b/src/test/resources/checks/v31/resources/OAR027/no-post.json @@ -0,0 +1,18 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/pets" : { + "get" : { + "responses" : { + "201" : { + "description" : "Found" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/resources/OAR027/no-post.yaml b/src/test/resources/checks/v31/resources/OAR027/no-post.yaml new file mode 100644 index 00000000..9e1d488a --- /dev/null +++ b/src/test/resources/checks/v31/resources/OAR027/no-post.yaml @@ -0,0 +1,10 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: + get: + responses: + 201: + description: Found \ No newline at end of file diff --git a/src/test/resources/checks/v31/resources/OAR027/post-201-with-location.json b/src/test/resources/checks/v31/resources/OAR027/post-201-with-location.json new file mode 100644 index 00000000..1911e07c --- /dev/null +++ b/src/test/resources/checks/v31/resources/OAR027/post-201-with-location.json @@ -0,0 +1,25 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/pets/" : { + "post" : { + "responses" : { + "201" : { + "description" : "Created", + "headers" : { + "Location" : { + "schema": { + "type" : "string" + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/resources/OAR027/post-201-with-location.yaml b/src/test/resources/checks/v31/resources/OAR027/post-201-with-location.yaml new file mode 100644 index 00000000..9b065b0a --- /dev/null +++ b/src/test/resources/checks/v31/resources/OAR027/post-201-with-location.yaml @@ -0,0 +1,14 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets/: + post: + responses: + 201: + description: Created + headers: + Location: + schema: + type: string \ No newline at end of file diff --git a/src/test/resources/checks/v31/resources/OAR027/post-201-with-other-headers.json b/src/test/resources/checks/v31/resources/OAR027/post-201-with-other-headers.json new file mode 100644 index 00000000..6e423478 --- /dev/null +++ b/src/test/resources/checks/v31/resources/OAR027/post-201-with-other-headers.json @@ -0,0 +1,25 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/pets/" : { + "post" : { + "responses" : { + "201" : { + "description" : "Created", + "headers" : { # Noncompliant {{OAR027: Location header is required in responses with code 201 from POST operations}} + "X-Location" : { + "schema": { + "type" : "string" + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/resources/OAR027/post-201-with-other-headers.yaml b/src/test/resources/checks/v31/resources/OAR027/post-201-with-other-headers.yaml new file mode 100644 index 00000000..a080d8ed --- /dev/null +++ b/src/test/resources/checks/v31/resources/OAR027/post-201-with-other-headers.yaml @@ -0,0 +1,14 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets/: + post: + responses: + 201: + description: Created + headers: # Noncompliant {{OAR027: Location header is required in responses with code 201 from POST operations}} + X-Location: + schema: + type: string \ No newline at end of file diff --git a/src/test/resources/checks/v31/resources/OAR027/post-201-without-location.json b/src/test/resources/checks/v31/resources/OAR027/post-201-without-location.json new file mode 100644 index 00000000..3c46c6a4 --- /dev/null +++ b/src/test/resources/checks/v31/resources/OAR027/post-201-without-location.json @@ -0,0 +1,18 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/pets" : { + "post" : { + "responses" : { + "201" : { # Noncompliant {{OAR027: Location header is required in responses with code 201 from POST operations}} + "description" : "Created" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/resources/OAR027/post-201-without-location.yaml b/src/test/resources/checks/v31/resources/OAR027/post-201-without-location.yaml new file mode 100644 index 00000000..eb45ccf1 --- /dev/null +++ b/src/test/resources/checks/v31/resources/OAR027/post-201-without-location.yaml @@ -0,0 +1,10 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: + post: + responses: + 201: # Noncompliant {{OAR027: Location header is required in responses with code 201 from POST operations}} + description: Created \ No newline at end of file diff --git a/src/test/resources/checks/v31/resources/OAR027/post-no-201.json b/src/test/resources/checks/v31/resources/OAR027/post-no-201.json new file mode 100644 index 00000000..680dc49d --- /dev/null +++ b/src/test/resources/checks/v31/resources/OAR027/post-no-201.json @@ -0,0 +1,18 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/pets" : { + "post" : { + "responses" : { + "200" : { + "description" : "OK" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/resources/OAR027/post-no-201.yaml b/src/test/resources/checks/v31/resources/OAR027/post-no-201.yaml new file mode 100644 index 00000000..bef9c590 --- /dev/null +++ b/src/test/resources/checks/v31/resources/OAR027/post-no-201.yaml @@ -0,0 +1,10 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: + post: + responses: + 200: + description: OK \ No newline at end of file diff --git a/src/test/resources/checks/v31/resources/OAR029/valid-all-of-md.json b/src/test/resources/checks/v31/resources/OAR029/valid-all-of-md.json new file mode 100644 index 00000000..d39ce425 --- /dev/null +++ b/src/test/resources/checks/v31/resources/OAR029/valid-all-of-md.json @@ -0,0 +1,134 @@ +{ + "openapi": "3.0.1", + "info": { + "title": "Swagger Petstore", + "version": "1.0.0" + }, + "servers": [ + { + "url": "/" + } + ], + "paths": { + "/endpoint": { + "get": { + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/response" + } + } + } + }, + "204": { + "description": "No content", + "content": { + } + }, + "400": { + "description": "Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/response" + } + } + } + }, + "default": { + "description": "Unknown", + "content": { + } + } + } + } + } + }, + "components": { + "schemas": { + "response": { + "allOf": [ + { + "$ref": "#/components/schemas/standard_response" + } + ], + "properties" : { + "data" : { + "type" : "object", + "properties" : { + "tipos" : { + "type" : "array", + "items" : { + "type" : "string" + } + } + } + } + } + }, + "standard_response": { + "allOf": [ + { + "$ref": "#/components/schemas/standard_response_result" + }, + { + "$ref": "#/components/schemas/standard_response_metadata" + } + ] + }, + "standard_response_result": { + "type": "object", + "properties": { + "result": { + "required": [ + "http_code", + "status", + "trace_id" + ], + "type": "object", + "properties": { + "status": { + "type": "boolean" + }, + "http_code": { + "type": "integer" + }, + "errors": { + "type": "array", + "items": { + "required": [ + "code", + "message" + ], + "type": "object", + "properties": { + "code": { + "type": "integer" + }, + "message": { + "type": "string" + } + } + } + }, + "trace_id": { + "type": "string" + } + } + } + } + }, + "standard_response_metadata": { + "type": "object", + "properties": { + "metadata": { + "type": "string" + } + } + } + } + } + } \ No newline at end of file diff --git a/src/test/resources/checks/v31/resources/OAR029/valid-all-of-md.yaml b/src/test/resources/checks/v31/resources/OAR029/valid-all-of-md.yaml new file mode 100644 index 00000000..5413414a --- /dev/null +++ b/src/test/resources/checks/v31/resources/OAR029/valid-all-of-md.yaml @@ -0,0 +1,78 @@ +openapi: 3.0.1 +info: + title: Swagger Petstore + version: 1.0.0 +servers: +- url: / +paths: + /endpoint: + get: + responses: + 200: + description: Ok + content: + 'application/json': + schema: + $ref: '#/components/schemas/response' + 204: + description: No content + content: {} + 400: + description: Error + content: + 'application/json': + schema: + $ref: '#/components/schemas/response' + default: + description: Unknown + content: {} +components: + schemas: + response: + allOf: + - $ref: '#/components/schemas/standard_response' + properties: + data: + type: object + properties: + tipos: + type: array + items: + type: string + standard_response: + allOf: + - $ref: '#/components/schemas/standard_response_result' + - $ref: '#/components/schemas/standard_response_metadata' + standard_response_result: + type: object + properties: + result: + required: + - http_code + - status + - trace_id + type: object + properties: + status: + type: boolean + http_code: + type: integer + errors: + type: array + items: + required: + - code + - message + type: object + properties: + code: + type: integer + message: + type: string + trace_id: + type: string + standard_response_metadata: + type: object + properties: + metadata: + type: string diff --git a/src/test/resources/checks/v31/resources/OAR029/valid-all-of.json b/src/test/resources/checks/v31/resources/OAR029/valid-all-of.json new file mode 100644 index 00000000..cae30865 --- /dev/null +++ b/src/test/resources/checks/v31/resources/OAR029/valid-all-of.json @@ -0,0 +1,116 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/endpoint" : { + "get" : { + "responses" : { + "200" : { + "description" : "Ok", + "content": { + "application/json": { + "schema" : { + "$ref" : "#/components/schemas/response" + } + } + } + }, + "204" : { + "description" : "No content" + }, + "400" : { + "description" : "Error", + "content": { + "application/json": { + "schema" : { + "$ref" : "#/components/schemas/response" + } + } + } + }, + "default" : { + "description" : "Unknown" + } + } + } + } + }, + "components": { + "schemas" : { + "response" : { + "type" : "object", + "allOf" : [ { + "$ref" : "#/components/schemas/standard_response" + } ], + "properties" : { + "data" : { + "type" : "object", + "properties" : { + "tipos" : { + "type" : "array", + "items" : { + "type" : "string" + } + } + } + } + } + }, + "standard_response" : { + "allOf" : [ { + "$ref" : "#/components/schemas/standard_response_result" + }, { + "$ref" : "#/components/schemas/standard_response_metadata" + } ], + "required" : [ "status" ] + }, + "standard_response_result" : { + "type" : "object", + "properties" : { + "status" : { + "type" : "object", + "properties" : { + "http_status" : { + "type" : "string" + }, + "code" : { + "type" : "integer" + }, + "errors" : { + "type" : "array", + "items" : { + "type" : "object", + "properties": { + "name": { + "type": "string" + }, + "value": { + "type": "string" + } + } + } + }, + "description" : { + "type" : "string" + }, + "internal_code" : { + "type" : "string" + } + }, + "required" : [ "http_status", "code", "description", "errors" ] + } + } + }, + "standard_response_metadata" : { + "properties" : { + "metadata" : { + "type" : "string" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/resources/OAR029/valid-all-of.yaml b/src/test/resources/checks/v31/resources/OAR029/valid-all-of.yaml new file mode 100644 index 00000000..a7203f72 --- /dev/null +++ b/src/test/resources/checks/v31/resources/OAR029/valid-all-of.yaml @@ -0,0 +1,76 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /endpoint: + get: + responses: + 200: + description: Ok + content: + application/json: + schema: + $ref: '#/components/schemas/response' + 204: + description: No content + 400: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/response' + default: + description: Unknown +components: + schemas: + response: + type: object + allOf: + - $ref: '#/components/schemas/standard_response' + properties: + data: + type: object + properties: + tipos: + type: array + items: + type: string + standard_response: + allOf: + - $ref: '#/components/schemas/standard_response_result' + - $ref: '#/components/schemas/standard_response_metadata' + required: + - status + standard_response_result: + type: object + properties: + status: + type: object + properties: + http_status: + type: string + code: + type: integer + errors: + type: array + items: + type: object + properties: + name: + type: string + value: + type: string + description: + type: string + internal_code: + type: string + required: + - http_status + - code + - description + - errors + standard_response_metadata: + properties: + metadata: + type: string \ No newline at end of file diff --git a/src/test/resources/checks/v31/resources/OAR029/valid-md.json b/src/test/resources/checks/v31/resources/OAR029/valid-md.json new file mode 100644 index 00000000..dab6fe31 --- /dev/null +++ b/src/test/resources/checks/v31/resources/OAR029/valid-md.json @@ -0,0 +1,116 @@ +{ + "openapi": "3.0.1", + "info": { + "title": "Swagger Petstore", + "version": "1.0.0" + }, + "servers": [ + { + "url": "/" + } + ], + "paths": { + "/endpoint": { + "get": { + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/response" + } + } + } + }, + "204": { + "description": "No content", + "content": { + } + }, + "400": { + "description": "Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/response" + } + } + } + }, + "default": { + "description": "Unknown", + "content": { + } + } + } + } + } + }, + "components": { + "schemas": { + "response": { + "allOf": [ + { + "$ref": "#/components/schemas/standard_response" + } + ], + "properties" : { + "data" : { + "type" : "object", + "properties" : { + "tipos" : { + "type" : "array", + "items" : { + "type" : "string" + } + } + } + } + } + }, + "standard_response": { + "type": "object", + "properties": { + "result": { + "required": [ + "http_code", + "status", + "trace_id" + ], + "type": "object", + "properties": { + "status": { + "type": "boolean" + }, + "http_code": { + "type": "integer" + }, + "errors": { + "type": "array", + "items": { + "required": [ + "code", + "message" + ], + "type": "object", + "properties": { + "code": { + "type": "integer" + }, + "message": { + "type": "string" + } + } + } + }, + "trace_id": { + "type": "string" + } + } + } + } + } + } + } + } \ No newline at end of file diff --git a/src/test/resources/checks/v31/resources/OAR029/valid-md.yaml b/src/test/resources/checks/v31/resources/OAR029/valid-md.yaml new file mode 100644 index 00000000..7df432ae --- /dev/null +++ b/src/test/resources/checks/v31/resources/OAR029/valid-md.yaml @@ -0,0 +1,69 @@ +openapi: 3.0.1 +info: + title: Swagger Petstore + version: 1.0.0 +servers: +- url: / +paths: + /endpoint: + get: + responses: + 200: + description: Ok + content: + 'application/json': + schema: + $ref: '#/components/schemas/response' + 204: + description: No content + content: {} + 400: + description: Error + content: + 'application/json': + schema: + $ref: '#/components/schemas/response' + default: + description: Unknown + content: {} +components: + schemas: + response: + allOf: + - $ref: '#/components/schemas/standard_response' + properties: + data: + type: object + properties: + tipos: + type: array + items: + type: string + standard_response: + type: object + properties: + result: + required: + - http_code + - status + - trace_id + type: object + properties: + status: + type: boolean + http_code: + type: integer + errors: + type: array + items: + required: + - code + - message + type: object + properties: + code: + type: integer + message: + type: string + trace_id: + type: string diff --git a/src/test/resources/checks/v31/resources/OAR029/valid-r.json b/src/test/resources/checks/v31/resources/OAR029/valid-r.json new file mode 100644 index 00000000..95ea5878 --- /dev/null +++ b/src/test/resources/checks/v31/resources/OAR029/valid-r.json @@ -0,0 +1,96 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/endpoint": { + "get": { + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/successResponseData" + } + } + } + }, + "204": { + "description": "No content" + }, + "400": { + "$ref": "#/components/responses/errorResponse" + }, + "default": { + "description": "Unknown" + } + } + } + } + }, + "components": { + "schemas": { + "successResponseData": { + "type": "object", + "properties": { + "payload": { + "type": "object", + "properties": { + "tipos": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + }, + "errorResponseData": { + "type": "object", + "properties": { + "error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "message": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "type": "string" + } + }, + "httpStatus": { + "type": "integer" + } + }, + "required": [ + "code", + "message", + "httpStatus" + ] + } + } + } + }, + "responses": { + "errorResponse": { + "description": "Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errorResponseData" + } + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/resources/OAR029/valid-r.yaml b/src/test/resources/checks/v31/resources/OAR029/valid-r.yaml new file mode 100644 index 00000000..f3c42c5c --- /dev/null +++ b/src/test/resources/checks/v31/resources/OAR029/valid-r.yaml @@ -0,0 +1,59 @@ +openapi: 3.0.0 +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /endpoint: + get: + responses: + 200: + description: Ok + content: + application/json: + schema: + $ref: '#/components/schemas/successResponseData' + 204: + description: No content + 400: + $ref: '#/components/responses/errorResponse' + default: + description: Unknown +components: + schemas: + successResponseData: + type: object + properties: + payload: + type: object + properties: + tipos: + type: array + items: + type: string + errorResponseData: + type: object + properties: + error: + type: object + properties: + code: + type: string + message: + type: string + details: + type: array + items: + type: string + httpStatus: + type: integer + required: + - code + - message + - httpStatus + responses: + errorResponse: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/errorResponseData' diff --git a/src/test/resources/checks/v31/resources/OAR029/valid.json b/src/test/resources/checks/v31/resources/OAR029/valid.json new file mode 100644 index 00000000..dc03b61e --- /dev/null +++ b/src/test/resources/checks/v31/resources/OAR029/valid.json @@ -0,0 +1,105 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/endpoint" : { + "get" : { + "responses" : { + "200" : { + "description" : "Ok", + "content": { + "application/json": { + "schema" : { + "$ref" : "#/components/schemas/response" + } + } + } + }, + "204" : { + "description" : "No content" + }, + "400" : { + "description" : "Error", + "content": { + "application/json": { + "schema" : { + "$ref" : "#/components/schemas/response" + } + } + } + }, + "default" : { + "description" : "Unknown" + } + } + } + } + }, + "components": { + "schemas" : { + "response" : { + "type" : "object", + "allOf" : [ { + "$ref" : "#/components/schemas/standard_response" + } ], + "properties" : { + "data" : { + "type" : "object", + "properties" : { + "tipos" : { + "type" : "array", + "items" : { + "type" : "string" + } + } + } + } + }, + "required": [ + "status", + "data" + ] + }, + "standard_response" : { + "type" : "object", + "properties" : { + "status" : { + "type" : "object", + "properties" : { + "http_status" : { + "type" : "string" + }, + "code" : { + "type" : "integer" + }, + "errors" : { + "type" : "array", + "items" : { + "type" : "object", + "properties": { + "name": { + "type": "string" + }, + "value": { + "type": "string" + } + } + } + }, + "description" : { + "type" : "string" + }, + "internal_code" : { + "type" : "string" + } + }, + "required" : [ "http_status", "code", "description", "errors" ] + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/resources/OAR029/valid.yaml b/src/test/resources/checks/v31/resources/OAR029/valid.yaml new file mode 100644 index 00000000..8aa93539 --- /dev/null +++ b/src/test/resources/checks/v31/resources/OAR029/valid.yaml @@ -0,0 +1,69 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /endpoint: + get: + responses: + 200: + description: Ok + content: + application/json: + schema: + $ref: '#/components/schemas/response' + 204: + description: No content + 400: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/response' + default: + description: Unknown +components: + schemas: + response: + type: object + allOf: + - $ref: '#/components/schemas/standard_response' + properties: + data: + type: object + properties: + tipos: + type: array + items: + type: string + required: + - data + - status + standard_response: + type: object + properties: + status: + type: object + properties: + http_status: + type: string + code: + type: integer + errors: + type: array + items: + type: object + properties: + name: + type: string + value: + type: string + description: + type: string + internal_code: + type: string + required: + - http_status + - code + - description + - errors diff --git a/src/test/resources/checks/v31/resources/OAR029/with-error-with-properties-wrong-type-r.json b/src/test/resources/checks/v31/resources/OAR029/with-error-with-properties-wrong-type-r.json new file mode 100644 index 00000000..6a2f1e5e --- /dev/null +++ b/src/test/resources/checks/v31/resources/OAR029/with-error-with-properties-wrong-type-r.json @@ -0,0 +1,88 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/endpoint": { + "get": { + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/successResponse" + } + } + } + }, + "204": { + "description": "No content" + }, + "400": { + "description": "Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errorResponse" + } + } + } + }, + "default": { + "description": "Unknown" + } + } + } + } + }, + "components": { + "schemas": { + "successResponse": { + "type": "object", + "properties": { + "payload": { + "type": "object", + "properties": { + "tipos": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + }, + "errorResponse": { + "type": "object", + "properties": { + "error": { + "type": "object", + "properties": { + "code": { + "type": "integer" # Noncompliant {{OAR029: 'code' must be of type string}} + }, + "message": { + "type": "integer" # Noncompliant {{OAR029: 'message' must be of type string}} + }, + "details": { + "type": "integer" # Noncompliant {{OAR029: 'details' must be of type array}} + }, + "httpStatus": { + "type": "string" # Noncompliant {{OAR029: 'httpStatus' must be of type integer}} + } + }, + "required": [ + "code", + "message", + "httpStatus" + ] + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/resources/OAR029/with-error-with-properties-wrong-type-r.yaml b/src/test/resources/checks/v31/resources/OAR029/with-error-with-properties-wrong-type-r.yaml new file mode 100644 index 00000000..32eabe95 --- /dev/null +++ b/src/test/resources/checks/v31/resources/OAR029/with-error-with-properties-wrong-type-r.yaml @@ -0,0 +1,55 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /endpoint: + get: + responses: + 200: + description: Ok + content: + application/json: + schema: + $ref: '#/components/schemas/successResponse' + 204: + description: No content + 400: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/errorResponse' + default: + description: Unknown + +components: + schemas: + successResponse: + type: object + properties: + payload: + type: object + properties: + tipos: + type: array + items: + type: string + errorResponse: + type: object + properties: + error: + type: object + properties: + code: + type: integer # Noncompliant {{OAR029: 'code' must be of type string}} + message: + type: integer # Noncompliant {{OAR029: 'message' must be of type string}} + details: + type: integer # Noncompliant {{OAR029: 'details' must be of type array}} + httpStatus: + type: string # Noncompliant {{OAR029: 'httpStatus' must be of type integer}} + required: + - code + - message + - httpStatus diff --git a/src/test/resources/checks/v31/resources/OAR029/with-error-without-properties-r.json b/src/test/resources/checks/v31/resources/OAR029/with-error-without-properties-r.json new file mode 100644 index 00000000..d8ea6754 --- /dev/null +++ b/src/test/resources/checks/v31/resources/OAR029/with-error-without-properties-r.json @@ -0,0 +1,75 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/endpoint": { + "get": { + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/successResponse" + } + } + } + }, + "204": { + "description": "No content" + }, + "400": { + "description": "Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errorResponse" + } + } + } + }, + "default": { + "description": "Unknown" + } + } + } + } + }, + "components": { + "schemas": { + "successResponse": { + "type": "object", + "properties": { + "payload": { + "type": "object", + "properties": { + "tipos": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + }, + "errorResponse": { + "type": "object", + "properties": { + "error": { # Noncompliant {{OAR029: 'code' property is missing}} {{OAR029: 'details' property is missing}} {{OAR029: 'httpStatus' property is missing}} {{OAR029: 'message' property is missing}} + "type": "object", + "properties": {}, + "required": [ + "code", + "message", + "httpStatus" + ] + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/resources/OAR029/with-error-without-properties-r.yaml b/src/test/resources/checks/v31/resources/OAR029/with-error-without-properties-r.yaml new file mode 100644 index 00000000..16e83e55 --- /dev/null +++ b/src/test/resources/checks/v31/resources/OAR029/with-error-without-properties-r.yaml @@ -0,0 +1,47 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /endpoint: + get: + responses: + 200: + description: Ok + content: + application/json: + schema: + $ref: '#/components/schemas/successResponse' + 204: + description: No content + 400: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/errorResponse' + default: + description: Unknown + +components: + schemas: + successResponse: + type: object + properties: + payload: + type: object + properties: + tipos: + type: array + items: + type: string + errorResponse: + type: object + properties: + error: # Noncompliant {{OAR029: 'code' property is missing}} {{OAR029: 'details' property is missing}} {{OAR029: 'httpStatus' property is missing}} {{OAR029: 'message' property is missing}} + type: object + properties: {} + required: + - code + - message + - httpStatus \ No newline at end of file diff --git a/src/test/resources/checks/v31/resources/OAR029/with-error-wrong-type-r.json b/src/test/resources/checks/v31/resources/OAR029/with-error-wrong-type-r.json new file mode 100644 index 00000000..2ed7ec61 --- /dev/null +++ b/src/test/resources/checks/v31/resources/OAR029/with-error-wrong-type-r.json @@ -0,0 +1,91 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/endpoint": { + "get": { + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/successResponse" + } + } + } + }, + "204": { + "description": "No content" + }, + "400": { + "description": "Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errorResponse" + } + } + } + }, + "default": { + "description": "Unknown" + } + } + } + } + }, + "components": { + "schemas": { + "successResponse": { + "type": "object", + "properties": { + "payload": { + "type": "object", + "properties": { + "tipos": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + }, + "errorResponse": { + "type": "object", + "properties": { + "error": { + "type": "integer", # Noncompliant {{OAR029: 'error' must be of type object}} + "properties": { + "code": { + "type": "string" + }, + "message": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "type": "string" + } + }, + "httpStatus": { + "type": "integer" + } + }, + "required": [ + "code", + "message", + "httpStatus" + ] + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/resources/OAR029/with-error-wrong-type-r.yaml b/src/test/resources/checks/v31/resources/OAR029/with-error-wrong-type-r.yaml new file mode 100644 index 00000000..ac0cbfcf --- /dev/null +++ b/src/test/resources/checks/v31/resources/OAR029/with-error-wrong-type-r.yaml @@ -0,0 +1,57 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /endpoint: + get: + responses: + 200: + description: Ok + content: + application/json: + schema: + $ref: '#/components/schemas/successResponse' + 204: + description: No content + 400: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/errorResponse' + default: + description: Unknown + +components: + schemas: + successResponse: + type: object + properties: + payload: + type: object + properties: + tipos: + type: array + items: + type: string + errorResponse: + type: object + properties: + error: + type: integer # Noncompliant {{OAR029: 'error' must be of type object}} + properties: + code: + type: string + message: + type: string + details: + type: array + items: + type: string + httpStatus: + type: integer + required: + - code + - message + - httpStatus \ No newline at end of file diff --git a/src/test/resources/checks/v31/resources/OAR029/with-result-with-properties-wrong-type-md.json b/src/test/resources/checks/v31/resources/OAR029/with-result-with-properties-wrong-type-md.json new file mode 100644 index 00000000..fbdfa315 --- /dev/null +++ b/src/test/resources/checks/v31/resources/OAR029/with-result-with-properties-wrong-type-md.json @@ -0,0 +1,96 @@ +{ + "openapi": "3.0.1", + "info": { + "title": "Swagger Petstore", + "version": "1.0.0" + }, + "servers": [ + { + "url": "/" + } + ], + "paths": { + "/endpoint": { + "get": { + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/response" + } + } + } + }, + "204": { + "description": "No content", + "content": { + } + }, + "400": { + "description": "Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/response" + } + } + } + }, + "default": { + "description": "Unknown", + "content": { + } + } + } + } + } + }, + "components": { + "schemas": { + "response": { + "allOf": [ + { + "$ref": "#/components/schemas/standard_response" + } + ] + }, + "standard_response": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "id": { + "type": "string" + } + } + }, + "result": { + "required": [ + "http_code", + "status", + "trace_id" + ], + "type": "object", + "properties": { + "status": { + "type": "string" # Noncompliant {{OAR029: 'status' must be of type boolean}} + }, + "http_code": { + "type": "string" # Noncompliant {{OAR029: 'http_code' must be of type integer}} + }, + "errors": { + "type": "string" # Noncompliant {{OAR029: 'errors' must be of type array}} + }, + "trace_id": { + "type": "integer" # Noncompliant {{OAR029: 'trace_id' must be of type string}} + } + } + } + } + } + } + } + } \ No newline at end of file diff --git a/src/test/resources/checks/v31/resources/OAR029/with-result-with-properties-wrong-type-md.yaml b/src/test/resources/checks/v31/resources/OAR029/with-result-with-properties-wrong-type-md.yaml new file mode 100644 index 00000000..21b31cd5 --- /dev/null +++ b/src/test/resources/checks/v31/resources/OAR029/with-result-with-properties-wrong-type-md.yaml @@ -0,0 +1,56 @@ +openapi: 3.0.1 +info: + title: Swagger Petstore + version: 1.0.0 +servers: +- url: / +paths: + /endpoint: + get: + responses: + 200: + description: Ok + content: + 'application/json': + schema: + $ref: '#/components/schemas/response' + 204: + description: No content + content: {} + 400: + description: Error + content: + 'application/json': + schema: + $ref: '#/components/schemas/response' + default: + description: Unknown + content: {} +components: + schemas: + response: + allOf: + - $ref: '#/components/schemas/standard_response' + standard_response: + type: object + properties: + data: + type: object + properties: + id: + type: string + result: + required: + - http_code + - status + - trace_id + type: object + properties: + status: + type: string # Noncompliant {{OAR029: 'status' must be of type boolean}} + http_code: + type: string # Noncompliant {{OAR029: 'http_code' must be of type integer}} + errors: + type: string # Noncompliant {{OAR029: 'errors' must be of type array}} + trace_id: + type: integer # Noncompliant {{OAR029: 'trace_id' must be of type string}} diff --git a/src/test/resources/checks/v31/resources/OAR029/with-result-without-properties-md.json b/src/test/resources/checks/v31/resources/OAR029/with-result-without-properties-md.json new file mode 100644 index 00000000..5b02c8a8 --- /dev/null +++ b/src/test/resources/checks/v31/resources/OAR029/with-result-without-properties-md.json @@ -0,0 +1,80 @@ +{ + "openapi": "3.0.1", + "info": { + "title": "Swagger Petstore", + "version": "1.0.0" + }, + "servers": [ + { + "url": "/" + } + ], + "paths": { + "/endpoint": { + "get": { + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/response" + } + } + } + }, + "204": { + "description": "No content", + "content": { + } + }, + "400": { + "description": "Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/response" + } + } + } + }, + "default": { + "description": "Unknown", + "content": { + } + } + } + } + } + }, + "components": { + "schemas": { + "response": { + "allOf": [ + { + "$ref": "#/components/schemas/standard_response" + } + ] + }, + "standard_response": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "id": { + "type": "string" + } + } + }, + "result": { # Noncompliant {{OAR029: 'errors' property is missing}} {{OAR029: 'http_code' property is missing}} {{OAR029: 'status' property is missing}} {{OAR029: 'trace_id' property is missing}} + "type": "object", + "properties": { + }, + "required": ["http_code", "status", "trace_id"] + } + } + } + } + } + } \ No newline at end of file diff --git a/src/test/resources/checks/v31/resources/OAR029/with-result-without-properties-md.yaml b/src/test/resources/checks/v31/resources/OAR029/with-result-without-properties-md.yaml new file mode 100644 index 00000000..6434b79c --- /dev/null +++ b/src/test/resources/checks/v31/resources/OAR029/with-result-without-properties-md.yaml @@ -0,0 +1,48 @@ +openapi: 3.0.1 +info: + title: Swagger Petstore + version: 1.0.0 +servers: +- url: / +paths: + /endpoint: + get: + responses: + 200: + description: Ok + content: + 'application/json': + schema: + $ref: '#/components/schemas/response' + 204: + description: No content + content: {} + 400: + description: Error + content: + 'application/json': + schema: + $ref: '#/components/schemas/response' + default: + description: Unknown + content: {} +components: + schemas: + response: + allOf: + - $ref: '#/components/schemas/standard_response' + standard_response: + type: object + properties: + data: + type: object + properties: + id: + type: string + result: # Noncompliant {{OAR029: 'errors' property is missing}} {{OAR029: 'http_code' property is missing}} {{OAR029: 'status' property is missing}} {{OAR029: 'trace_id' property is missing}} + type: object + properties: {} + required: + - http_code + - status + - trace_id diff --git a/src/test/resources/checks/v31/resources/OAR029/with-result-wrong-type-md.json b/src/test/resources/checks/v31/resources/OAR029/with-result-wrong-type-md.json new file mode 100644 index 00000000..c24b20fd --- /dev/null +++ b/src/test/resources/checks/v31/resources/OAR029/with-result-wrong-type-md.json @@ -0,0 +1,101 @@ +{ + "openapi": "3.0.1", + "info": { + "title": "Swagger Petstore", + "version": "1.0.0" + }, + "servers": [ + { + "url": "/" + } + ], + "paths": { + "/endpoint": { + "get": { + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/response" + } + } + } + }, + "204": { + "description": "No content", + "content": { + } + }, + "400": { + "description": "Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/response" + } + } + } + }, + "default": { + "description": "Unknown", + "content": { + } + } + } + } + } + }, + "components": { + "schemas": { + "response": { + "allOf": [ + { + "$ref": "#/components/schemas/standard_response" + } + ] + }, + "standard_response": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "id": { + "type": "string" + } + } + }, + "result": { + "required": [ + "http_code", + "status", + "trace_id" + ], + "type": "integer", # Noncompliant {{OAR029: 'result' must be of type object}} + "properties": { + "status": { + "type": "boolean" + }, + "http_code": { + "type": "integer" + }, + "errors": { + "type": "array", + "items": { + "type": "object", + "properties": { + } + } + }, + "trace_id": { + "type": "string" + } + } + } + } + } + } + } + } \ No newline at end of file diff --git a/src/test/resources/checks/v31/resources/OAR029/with-result-wrong-type-md.yaml b/src/test/resources/checks/v31/resources/OAR029/with-result-wrong-type-md.yaml new file mode 100644 index 00000000..37e75c1b --- /dev/null +++ b/src/test/resources/checks/v31/resources/OAR029/with-result-wrong-type-md.yaml @@ -0,0 +1,59 @@ +openapi: 3.0.1 +info: + title: Swagger Petstore + version: 1.0.0 +servers: +- url: / +paths: + /endpoint: + get: + responses: + 200: + description: Ok + content: + 'application/json': + schema: + $ref: '#/components/schemas/response' + 204: + description: No content + content: {} + 400: + description: Error + content: + 'application/json': + schema: + $ref: '#/components/schemas/response' + default: + description: Unknown + content: {} +components: + schemas: + response: + allOf: + - $ref: '#/components/schemas/standard_response' + standard_response: + type: object + properties: + data: + type: object + properties: + id: + type: string + result: + required: + - http_code + - status + - trace_id + type: integer # Noncompliant {{OAR029: 'result' must be of type object}} + properties: + status: + type: boolean + http_code: + type: integer + errors: + type: array + items: + type: object + properties: {} + trace_id: + type: string diff --git a/src/test/resources/checks/v31/resources/OAR029/with-status-with-properties-wrong-type.json b/src/test/resources/checks/v31/resources/OAR029/with-status-with-properties-wrong-type.json new file mode 100644 index 00000000..af6d6d23 --- /dev/null +++ b/src/test/resources/checks/v31/resources/OAR029/with-status-with-properties-wrong-type.json @@ -0,0 +1,90 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/endpoint" : { + "get" : { + "responses" : { + "200" : { + "description" : "Ok", + "content": { + "application/json": { + "schema" : { + "$ref" : "#/components/schemas/response" + } + } + } + }, + "204" : { + "description" : "No content" + }, + "400" : { + "description" : "Error", + "content": { + "application/json": { + "schema" : { + "$ref" : "#/components/schemas/response" + } + } + } + }, + "default" : { + "description" : "Unknown" + } + } + } + } + }, + "components": { + "schemas" : { + "response" : { + "type" : "object", + "allOf" : [ { + "$ref" : "#/components/schemas/standard_response" + } ], + "properties" : { + "data" : { + "type" : "object", + "properties" : { + "tipos" : { + "type" : "array", + "items" : { + "type" : "string" + } + } + } + } + } + }, + "standard_response" : { + "type" : "object", + "properties" : { + "status" : { + "type" : "object", + "properties" : { + "http_status" : { + "type" : "boolean" # Noncompliant {{OAR029: 'http_status' must be of type string}} + }, + "code" : { + "type" : "string" # Noncompliant {{OAR029: 'code' must be of type integer}} + }, + "errors" : { + "type" : "string" # Noncompliant {{OAR029: 'errors' must be of type array}} + }, + "description" : { + "type" : "integer" # Noncompliant {{OAR029: 'description' must be of type string}} + }, + "internal_code" : { + "type" : "integer" # Noncompliant {{OAR029: 'internal_code' must be of type string}} + } + }, + "required" : [ "http_status", "code", "description", "errors" ] + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/resources/OAR029/with-status-with-properties-wrong-type.yaml b/src/test/resources/checks/v31/resources/OAR029/with-status-with-properties-wrong-type.yaml new file mode 100644 index 00000000..68e59b91 --- /dev/null +++ b/src/test/resources/checks/v31/resources/OAR029/with-status-with-properties-wrong-type.yaml @@ -0,0 +1,59 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /endpoint: + get: + responses: + 200: + description: Ok + content: + application/json: + schema: + $ref: '#/components/schemas/response' + 204: + description: No content + 400: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/response' + default: + description: Unknown +components: + schemas: + response: + type: object + allOf: + - $ref: '#/components/schemas/standard_response' + properties: + data: + type: object + properties: + tipos: + type: array + items: + type: string + standard_response: + type: object + properties: + status: + type: object + properties: + http_status: + type: boolean # Noncompliant {{OAR029: 'http_status' must be of type string}} + code: + type: string # Noncompliant {{OAR029: 'code' must be of type integer}} + errors: + type: string # Noncompliant {{OAR029: 'errors' must be of type array}} + description: + type: integer # Noncompliant {{OAR029: 'description' must be of type string}} + internal_code: + type: integer # Noncompliant {{OAR029: 'internal_code' must be of type string}} + required: + - http_status + - code + - description + - errors diff --git a/src/test/resources/checks/v31/resources/OAR029/with-status-without-properties.json b/src/test/resources/checks/v31/resources/OAR029/with-status-without-properties.json new file mode 100644 index 00000000..80e9dbf2 --- /dev/null +++ b/src/test/resources/checks/v31/resources/OAR029/with-status-without-properties.json @@ -0,0 +1,74 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/endpoint" : { + "get" : { + "responses" : { + "200" : { + "description" : "Ok", + "content": { + "application/json": { + "schema" : { + "$ref" : "#/components/schemas/response" + } + } + } + }, + "204" : { + "description" : "No content" + }, + "400" : { + "description" : "Error", + "content": { + "application/json": { + "schema" : { + "$ref" : "#/components/schemas/response" + } + } + } + }, + "default" : { + "description" : "Unknown" + } + } + } + } + }, + "components": { + "schemas" : { + "response" : { + "type" : "object", + "allOf" : [ { + "$ref" : "#/components/schemas/standard_response" + } ], + "properties" : { + "data" : { + "type" : "object", + "properties" : { + "tipos" : { + "type" : "array", + "items" : { + "type" : "string" + } + } + } + } + } + }, + "standard_response" : { + "type" : "object", + "properties" : { + "status" : { # Noncompliant {{OAR029: 'code' property is missing}} {{OAR029: 'description' property is missing}} {{OAR029: 'errors' property is missing}} {{OAR029: 'http_status' property is missing}} {{OAR029: 'internal_code' property is missing}} + "type" : "object", + "properties" : { }, + "required" : [ "http_status", "code", "description", "errors" ] + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/resources/OAR029/with-status-without-properties.yaml b/src/test/resources/checks/v31/resources/OAR029/with-status-without-properties.yaml new file mode 100644 index 00000000..2437684e --- /dev/null +++ b/src/test/resources/checks/v31/resources/OAR029/with-status-without-properties.yaml @@ -0,0 +1,49 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /endpoint: + get: + responses: + 200: + description: Ok + content: + application/json: + schema: + $ref: '#/components/schemas/response' + 204: + description: No content + 400: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/response' + default: + description: Unknown +components: + schemas: + response: + type: object + allOf: + - $ref: '#/components/schemas/standard_response' + properties: + data: + type: object + properties: + tipos: + type: array + items: + type: string + standard_response: + type: object + properties: + status: # Noncompliant {{OAR029: 'code' property is missing}} {{OAR029: 'description' property is missing}} {{OAR029: 'errors' property is missing}} {{OAR029: 'http_status' property is missing}} {{OAR029: 'internal_code' property is missing}} + type: object + properties: {} + required: + - http_status + - code + - description + - errors diff --git a/src/test/resources/checks/v31/resources/OAR029/with-status-wrong-type.json b/src/test/resources/checks/v31/resources/OAR029/with-status-wrong-type.json new file mode 100644 index 00000000..014223c9 --- /dev/null +++ b/src/test/resources/checks/v31/resources/OAR029/with-status-wrong-type.json @@ -0,0 +1,101 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/endpoint" : { + "get" : { + "responses" : { + "200" : { + "description" : "Ok", + "content": { + "application/json": { + "schema" : { + "$ref" : "#/components/schemas/response" + } + } + } + }, + "204" : { + "description" : "No content" + }, + "400" : { + "description" : "Error", + "content": { + "application/json": { + "schema" : { + "$ref" : "#/components/schemas/response" + } + } + } + }, + "default" : { + "description" : "Unknown" + } + } + } + } + }, + "components": { + "schemas" : { + "response" : { + "type" : "object", + "allOf" : [ { + "$ref" : "#/components/schemas/standard_response" + } ], + "properties" : { + "data" : { + "type" : "object", + "properties" : { + "tipos" : { + "type" : "array", + "items" : { + "type" : "string" + } + } + } + } + } + }, + "standard_response" : { + "type" : "object", + "properties" : { + "status" : { + "type" : "integer", # Noncompliant {{OAR029: 'status' must be of type object}} + "properties" : { + "http_status" : { + "type" : "string" + }, + "code" : { + "type" : "integer" + }, + "errors" : { + "type" : "array", + "items" : { + "type" : "object", + "properties": { + "name": { + "type": "string" + }, + "value": { + "type": "string" + } + } + } + }, + "description" : { + "type" : "string" + }, + "internal_code" : { + "type" : "string" + } + }, + "required" : [ "http_status", "code", "description", "errors" ] + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/resources/OAR029/with-status-wrong-type.yaml b/src/test/resources/checks/v31/resources/OAR029/with-status-wrong-type.yaml new file mode 100644 index 00000000..13bce453 --- /dev/null +++ b/src/test/resources/checks/v31/resources/OAR029/with-status-wrong-type.yaml @@ -0,0 +1,66 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /endpoint: + get: + responses: + 200: + description: Ok + content: + application/json: + schema: + $ref: '#/components/schemas/response' + 204: + description: No content + 400: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/response' + default: + description: Unknown +components: + schemas: + response: + type: object + allOf: + - $ref: '#/components/schemas/standard_response' + properties: + data: + type: object + properties: + tipos: + type: array + items: + type: string + standard_response: + type: object + properties: + status: + type: integer # Noncompliant {{OAR029: 'status' must be of type object}} + properties: + http_status: + type: string + code: + type: integer + errors: + type: array + items: + type: object + properties: + name: + type: string + value: + type: string + description: + type: string + internal_code: + type: string + required: + - http_status + - code + - description + - errors \ No newline at end of file diff --git a/src/test/resources/checks/v31/resources/OAR029/without-data-md.json b/src/test/resources/checks/v31/resources/OAR029/without-data-md.json new file mode 100644 index 00000000..8262dd65 --- /dev/null +++ b/src/test/resources/checks/v31/resources/OAR029/without-data-md.json @@ -0,0 +1,103 @@ +{ + "openapi": "3.0.1", + "info": { + "title": "Swagger Petstore", + "version": "1.0.0" + }, + "servers": [ + { + "url": "/" + } + ], + "paths": { + "/endpoint": { + "get": { + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/response" + } + } + } + }, + "204": { + "description": "No content", + "content": { + } + }, + "400": { + "description": "Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/response" + } + } + } + }, + "default": { + "description": "Unknown", + "content": { + } + } + } + } + } + }, + "components": { + "schemas": { + "response": { # Noncompliant {{OAR029: 'data' property is missing}} + "allOf": [ + { + "$ref": "#/components/schemas/standard_response" + } + ] + }, + "standard_response": { + "type": "object", + "properties": { + "result": { + "required": [ + "http_code", + "status", + "trace_id" + ], + "type": "object", + "properties": { + "status": { + "type": "boolean" + }, + "http_code": { + "type": "integer" + }, + "errors": { + "type": "array", + "items": { + "required": [ + "code", + "message" + ], + "type": "object", + "properties": { + "code": { + "type": "integer" + }, + "message": { + "type": "string" + } + } + } + }, + "trace_id": { + "type": "string" + } + } + } + } + } + } + } + } \ No newline at end of file diff --git a/src/test/resources/checks/v31/resources/OAR029/without-data-md.yaml b/src/test/resources/checks/v31/resources/OAR029/without-data-md.yaml new file mode 100644 index 00000000..950439cb --- /dev/null +++ b/src/test/resources/checks/v31/resources/OAR029/without-data-md.yaml @@ -0,0 +1,61 @@ +openapi: 3.0.1 +info: + title: Swagger Petstore + version: 1.0.0 +servers: +- url: / +paths: + /endpoint: + get: + responses: + 200: + description: Ok + content: + 'application/json': + schema: + $ref: '#/components/schemas/response' + 204: + description: No content + content: {} + 400: + description: Error + content: + 'application/json': + schema: + $ref: '#/components/schemas/response' + default: + description: Unknown + content: {} +components: + schemas: + response: # Noncompliant {{OAR029: 'data' property is missing}} + allOf: + - $ref: '#/components/schemas/standard_response' + standard_response: + type: object + properties: + result: + required: + - http_code + - status + - trace_id + type: object + properties: + status: + type: boolean + http_code: + type: integer + errors: + type: array + items: + required: + - code + - message + type: object + properties: + code: + type: integer + message: + type: string + trace_id: + type: string diff --git a/src/test/resources/checks/v31/resources/OAR029/without-data.json b/src/test/resources/checks/v31/resources/OAR029/without-data.json new file mode 100644 index 00000000..4c36767a --- /dev/null +++ b/src/test/resources/checks/v31/resources/OAR029/without-data.json @@ -0,0 +1,101 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/endpoint" : { + "get" : { + "responses" : { + "200" : { + "description" : "Ok", + "content": { + "application/json": { + "schema" : { + "$ref" : "#/components/schemas/response" + } + } + } + }, + "204" : { + "description" : "No content" + }, + "400" : { + "description" : "Error", + "content": { + "application/json": { + "schema" : { + "$ref" : "#/components/schemas/response" + } + } + } + }, + "default" : { + "description" : "Unknown" + } + } + } + } + }, + "components": { + "schemas" : { + "response" : { # Noncompliant {{OAR029: 'data' property is missing}} + "type" : "object", + "allOf" : [ { + "$ref" : "#/components/schemas/standard_response" + } ], + "properties" : { + "value" : { + "type" : "object", + "properties" : { + "tipos" : { + "type" : "array", + "items" : { + "type" : "string" + } + } + } + } + } + }, + "standard_response" : { + "type" : "object", + "properties" : { + "status" : { + "type" : "object", + "properties" : { + "http_status" : { + "type" : "string" + }, + "code" : { + "type" : "integer" + }, + "errors" : { + "type" : "array", + "items" : { + "type" : "object", + "properties": { + "name": { + "type": "string" + }, + "value": { + "type": "string" + } + } + } + }, + "description" : { + "type" : "string" + }, + "internal_code" : { + "type" : "string" + } + }, + "required" : [ "http_status", "code", "description", "errors" ] + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/resources/OAR029/without-data.yaml b/src/test/resources/checks/v31/resources/OAR029/without-data.yaml new file mode 100644 index 00000000..02cb167f --- /dev/null +++ b/src/test/resources/checks/v31/resources/OAR029/without-data.yaml @@ -0,0 +1,66 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /endpoint: + get: + responses: + 200: + description: Ok + content: + application/json: + schema: + $ref: '#/components/schemas/response' + 204: + description: No content + 400: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/response' + default: + description: Unknown +components: + schemas: + response: # Noncompliant {{OAR029: 'data' property is missing}} + type: object + allOf: + - $ref: '#/components/schemas/standard_response' + properties: + value: + type: object + properties: + tipos: + type: array + items: + type: string + standard_response: + type: object + properties: + status: + type: object + properties: + http_status: + type: string + code: + type: integer + errors: + type: array + items: + type: object + properties: + name: + type: string + value: + type: string + description: + type: string + internal_code: + type: string + required: + - http_status + - code + - description + - errors diff --git a/src/test/resources/checks/v31/resources/OAR029/without-error-r.json b/src/test/resources/checks/v31/resources/OAR029/without-error-r.json new file mode 100644 index 00000000..4a2978a7 --- /dev/null +++ b/src/test/resources/checks/v31/resources/OAR029/without-error-r.json @@ -0,0 +1,91 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/endpoint" : { + "get" : { + "responses" : { + "200" : { + "description" : "Ok", + "content": { + "application/json": { + "schema" : { + "$ref" : "#/components/schemas/successResponse" + } + } + } + }, + "204" : { + "description" : "No content" + }, + "400" : { + "description" : "Error", + "content": { + "application/json": { + "schema" : { + "$ref" : "#/components/schemas/errorResponse" + } + } + } + }, + "default" : { + "description" : "Unknown" + } + } + } + } + }, + "components": { + "schemas": { + "successResponse": { + "type": "object", + "properties": { + "payload": { + "type": "object", + "properties": { + "tipos": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + }, + "errorResponse": { # Noncompliant {{OAR029: 'error' property is missing}} + "type": "object", + "properties": { + "result": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "message": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "type": "string" + } + }, + "httpStatus": { + "type": "integer" + } + }, + "required": [ + "code", + "message", + "httpStatus" + ] + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/resources/OAR029/without-error-r.yaml b/src/test/resources/checks/v31/resources/OAR029/without-error-r.yaml new file mode 100644 index 00000000..fdaf26ad --- /dev/null +++ b/src/test/resources/checks/v31/resources/OAR029/without-error-r.yaml @@ -0,0 +1,57 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /endpoint: + get: + responses: + 200: + description: Ok + content: + application/json: + schema: + $ref: '#/components/schemas/successResponse' + 204: + description: No content + 400: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/errorResponse' + default: + description: Unknown + +components: + schemas: + successResponse: + type: object + properties: + payload: + type: object + properties: + tipos: + type: array + items: + type: string + errorResponse: # Noncompliant {{OAR029: 'error' property is missing}} + type: object + properties: + result: + type: object + properties: + code: + type: string + message: + type: string + details: + type: array + items: + type: string + httpStatus: + type: integer + required: + - code + - message + - httpStatus diff --git a/src/test/resources/checks/v31/resources/OAR029/without-payload-r.json b/src/test/resources/checks/v31/resources/OAR029/without-payload-r.json new file mode 100644 index 00000000..f2ee25c9 --- /dev/null +++ b/src/test/resources/checks/v31/resources/OAR029/without-payload-r.json @@ -0,0 +1,91 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/endpoint" : { + "get" : { + "responses" : { + "200" : { + "description" : "Ok", + "content": { + "application/json": { + "schema" : { + "$ref" : "#/components/schemas/successResponse" + } + } + } + }, + "204" : { + "description" : "No content" + }, + "400" : { + "description" : "Error", + "content": { + "application/json": { + "schema" : { + "$ref" : "#/components/schemas/errorResponse" + } + } + } + }, + "default" : { + "description" : "Unknown" + } + } + } + } + }, + "components": { + "schemas": { + "successResponse": { # Noncompliant {{OAR029: 'payload' property is missing}} + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "tipos": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + }, + "errorResponse": { + "type": "object", + "properties": { + "error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "message": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "type": "string" + } + }, + "httpStatus": { + "type": "integer" + } + }, + "required": [ + "code", + "message", + "httpStatus" + ] + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/resources/OAR029/without-payload-r.yaml b/src/test/resources/checks/v31/resources/OAR029/without-payload-r.yaml new file mode 100644 index 00000000..0993f891 --- /dev/null +++ b/src/test/resources/checks/v31/resources/OAR029/without-payload-r.yaml @@ -0,0 +1,57 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /endpoint: + get: + responses: + 200: + description: Ok + content: + application/json: + schema: + $ref: '#/components/schemas/successResponse' + 204: + description: No content + 400: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/errorResponse' + default: + description: Unknown + +components: + schemas: + successResponse: # Noncompliant {{OAR029: 'payload' property is missing}} + type: object + properties: + data: + type: object + properties: + tipos: + type: array + items: + type: string + errorResponse: + type: object + properties: + error: + type: object + properties: + code: + type: string + message: + type: string + details: + type: array + items: + type: string + httpStatus: + type: integer + required: + - code + - message + - httpStatus diff --git a/src/test/resources/checks/v31/resources/OAR029/without-required-fields-md.json b/src/test/resources/checks/v31/resources/OAR029/without-required-fields-md.json new file mode 100644 index 00000000..63d7a3bb --- /dev/null +++ b/src/test/resources/checks/v31/resources/OAR029/without-required-fields-md.json @@ -0,0 +1,107 @@ +{ + "openapi": "3.0.1", + "info": { + "title": "Swagger Petstore", + "version": "1.0.0" + }, + "servers": [ + { + "url": "/" + } + ], + "paths": { + "/endpoint": { + "get": { + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/response" + } + } + } + }, + "204": { + "description": "No content", + "content": { + } + }, + "400": { + "description": "Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/response" + } + } + } + }, + "default": { + "description": "Unknown", + "content": { + } + } + } + } + } + }, + "components": { + "schemas": { + "response": { + "allOf": [ + { + "$ref": "#/components/schemas/standard_response" + } + ] + }, + "standard_response": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "id": { + "type": "string" + } + } + }, + "result": { + "required": ["status"], # Noncompliant {{OAR029: The following fields must be required: http_code, status, trace_id}} + "type": "object", + "properties": { + "status": { + "type": "boolean" + }, + "http_code": { + "type": "integer" + }, + "errors": { + "type": "array", + "items": { + "required": [ + "code", + "message" + ], + "type": "object", + "properties": { + "code": { + "type": "integer" + }, + "message": { + "type": "string" + } + } + } + }, + "trace_id": { + "type": "string" + } + } + } + } + } + } + } + } \ No newline at end of file diff --git a/src/test/resources/checks/v31/resources/OAR029/without-required-fields-md.yaml b/src/test/resources/checks/v31/resources/OAR029/without-required-fields-md.yaml new file mode 100644 index 00000000..efecd06f --- /dev/null +++ b/src/test/resources/checks/v31/resources/OAR029/without-required-fields-md.yaml @@ -0,0 +1,64 @@ +openapi: 3.0.1 +info: + title: Swagger Petstore + version: 1.0.0 +servers: +- url: / +paths: + /endpoint: + get: + responses: + 200: + description: Ok + content: + 'application/json': + schema: + $ref: '#/components/schemas/response' + 204: + description: No content + content: {} + 400: + description: Error + content: + 'application/json': + schema: + $ref: '#/components/schemas/response' + default: + description: Unknown + content: {} +components: + schemas: + response: + allOf: + - $ref: '#/components/schemas/standard_response' + standard_response: + type: object + properties: + data: + type: object + properties: + id: + type: string + result: + required: # Noncompliant {{OAR029: The following fields must be required: http_code, status, trace_id}} + - status + type: object + properties: + status: + type: boolean + http_code: + type: integer + errors: + type: array + items: + required: + - code + - message + type: object + properties: + code: + type: integer + message: + type: string + trace_id: + type: string diff --git a/src/test/resources/checks/v31/resources/OAR029/without-required-fields-r.json b/src/test/resources/checks/v31/resources/OAR029/without-required-fields-r.json new file mode 100644 index 00000000..ea97f57f --- /dev/null +++ b/src/test/resources/checks/v31/resources/OAR029/without-required-fields-r.json @@ -0,0 +1,89 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/endpoint": { + "get": { + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/successResponse" + } + } + } + }, + "204": { + "description": "No content" + }, + "400": { + "description": "Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errorResponse" + } + } + } + }, + "default": { + "description": "Unknown" + } + } + } + } + }, + "components": { + "schemas": { + "successResponse": { + "type": "object", + "properties": { + "payload": { + "type": "object", + "properties": { + "tipos": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + }, + "errorResponse": { + "type": "object", + "properties": { + "error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "message": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "type": "string" + } + }, + "httpStatus": { + "type": "integer" + } + }, + "required": [ # Noncompliant {{OAR029: The following fields must be required: code, httpStatus, message}} + "httpStatus" + ] + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/resources/OAR029/without-required-fields-r.yaml b/src/test/resources/checks/v31/resources/OAR029/without-required-fields-r.yaml new file mode 100644 index 00000000..8ee987d5 --- /dev/null +++ b/src/test/resources/checks/v31/resources/OAR029/without-required-fields-r.yaml @@ -0,0 +1,55 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /endpoint: + get: + responses: + 200: + description: Ok + content: + application/json: + schema: + $ref: '#/components/schemas/successResponse' + 204: + description: No content + 400: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/errorResponse' + default: + description: Unknown + +components: + schemas: + successResponse: + type: object + properties: + payload: + type: object + properties: + tipos: + type: array + items: + type: string + errorResponse: + type: object + properties: + error: + type: object + properties: + code: + type: string + message: + type: string + details: + type: array + items: + type: string + httpStatus: + type: integer + required: # Noncompliant {{OAR029: The following fields must be required: code, httpStatus, message}} + - httpStatus diff --git a/src/test/resources/checks/v31/resources/OAR029/without-required-fields.json b/src/test/resources/checks/v31/resources/OAR029/without-required-fields.json new file mode 100644 index 00000000..350d748a --- /dev/null +++ b/src/test/resources/checks/v31/resources/OAR029/without-required-fields.json @@ -0,0 +1,101 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/endpoint" : { + "get" : { + "responses" : { + "200" : { + "description" : "Ok", + "content": { + "application/json": { + "schema" : { + "$ref" : "#/components/schemas/response" + } + } + } + }, + "204" : { + "description" : "No content" + }, + "400" : { + "description" : "Error", + "content": { + "application/json": { + "schema" : { + "$ref" : "#/components/schemas/response" + } + } + } + }, + "default" : { + "description" : "Unknown" + } + } + } + } + }, + "components": { + "schemas" : { + "response" : { + "type" : "object", + "allOf" : [ { + "$ref" : "#/components/schemas/standard_response" + } ], + "properties" : { + "data" : { + "type" : "object", + "properties" : { + "tipos" : { + "type" : "array", + "items" : { + "type" : "string" + } + } + } + } + } + }, + "standard_response" : { + "type" : "object", + "properties" : { + "status" : { + "type" : "object", + "properties" : { + "http_status" : { + "type" : "string" + }, + "code" : { + "type" : "integer" + }, + "errors" : { + "type" : "array", + "items" : { + "type" : "object", + "properties": { + "name": { + "type": "string" + }, + "value": { + "type": "string" + } + } + } + }, + "description" : { + "type" : "string" + }, + "internal_code" : { + "type" : "string" + } + }, + "required" : [ "http_status" ] # Noncompliant {{OAR029: The following fields must be required: code, description, errors, http_status}} + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/resources/OAR029/without-required-fields.yaml b/src/test/resources/checks/v31/resources/OAR029/without-required-fields.yaml new file mode 100644 index 00000000..234683f0 --- /dev/null +++ b/src/test/resources/checks/v31/resources/OAR029/without-required-fields.yaml @@ -0,0 +1,63 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /endpoint: + get: + responses: + 200: + description: Ok + content: + application/json: + schema: + $ref: '#/components/schemas/response' + 204: + description: No content + 400: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/response' + default: + description: Unknown +components: + schemas: + response: + type: object + allOf: + - $ref: '#/components/schemas/standard_response' + properties: + data: + type: object + properties: + tipos: + type: array + items: + type: string + standard_response: + type: object + properties: + status: + type: object + properties: + http_status: + type: string + code: + type: integer + errors: + type: array + items: + type: object + properties: + name: + type: string + value: + type: string + description: + type: string + internal_code: + type: string + required: # Noncompliant {{OAR029: The following fields must be required: code, description, errors, http_status}} + - http_status diff --git a/src/test/resources/checks/v31/resources/OAR029/without-result-md.json b/src/test/resources/checks/v31/resources/OAR029/without-result-md.json new file mode 100644 index 00000000..136cf12d --- /dev/null +++ b/src/test/resources/checks/v31/resources/OAR029/without-result-md.json @@ -0,0 +1,101 @@ +{ + "openapi": "3.0.1", + "info": { + "title": "Swagger Petstore", + "version": "1.0.0" + }, + "servers": [ + { + "url": "/" + } + ], + "paths": { + "/endpoint": { + "get": { + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/response" + } + } + } + }, + "204": { + "description": "No content", + "content": { + } + }, + "400": { + "description": "Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/response" + } + } + } + }, + "default": { + "description": "Unknown", + "content": { + } + } + } + } + } + }, + "components": { + "schemas": { + "response": { # Noncompliant {{OAR029: 'result' property is missing}} + "allOf": [ + { + "$ref": "#/components/schemas/standard_response" + } + ] + }, + "standard_response": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "id": { + "type": "string" + } + } + }, + "response": { + "required": [ + "http_code", + "status", + "trace_id" + ], + "type": "object", + "properties": { + "status": { + "type": "boolean" + }, + "http_code": { + "type": "integer" + }, + "errors": { + "type": "array", + "items": { + "type": "object", + "properties": { + } + } + }, + "trace_id": { + "type": "string" + } + } + } + } + } + } + } + } \ No newline at end of file diff --git a/src/test/resources/checks/v31/resources/OAR029/without-result-md.yaml b/src/test/resources/checks/v31/resources/OAR029/without-result-md.yaml new file mode 100644 index 00000000..81cebda9 --- /dev/null +++ b/src/test/resources/checks/v31/resources/OAR029/without-result-md.yaml @@ -0,0 +1,59 @@ +openapi: 3.0.1 +info: + title: Swagger Petstore + version: 1.0.0 +servers: +- url: / +paths: + /endpoint: + get: + responses: + 200: + description: Ok + content: + 'application/json': + schema: + $ref: '#/components/schemas/response' + 204: + description: No content + content: {} + 400: + description: Error + content: + 'application/json': + schema: + $ref: '#/components/schemas/response' + default: + description: Unknown + content: {} +components: + schemas: + response: # Noncompliant {{OAR029: 'result' property is missing}} + allOf: + - $ref: '#/components/schemas/standard_response' + standard_response: + type: object + properties: + data: + type: object + properties: + id: + type: string + response: + required: + - http_code + - status + - trace_id + type: object + properties: + status: + type: boolean + http_code: + type: integer + errors: + type: array + items: + type: object + properties: {} + trace_id: + type: string diff --git a/src/test/resources/checks/v31/resources/OAR029/without-status.json b/src/test/resources/checks/v31/resources/OAR029/without-status.json new file mode 100644 index 00000000..6e0d5fcb --- /dev/null +++ b/src/test/resources/checks/v31/resources/OAR029/without-status.json @@ -0,0 +1,101 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/endpoint" : { + "get" : { + "responses" : { + "200" : { + "description" : "Ok", + "content": { + "application/json": { + "schema" : { + "$ref" : "#/components/schemas/response" + } + } + } + }, + "204" : { + "description" : "No content" + }, + "400" : { + "description" : "Error", + "content": { + "application/json": { + "schema" : { + "$ref" : "#/components/schemas/response" + } + } + } + }, + "default" : { + "description" : "Unknown" + } + } + } + } + }, + "components": { + "schemas" : { + "response" : { # Noncompliant {{OAR029: 'status' property is missing}} + "type" : "object", + "allOf" : [ { + "$ref" : "#/components/schemas/standard_response" + } ], + "properties" : { + "data" : { + "type" : "object", + "properties" : { + "tipos" : { + "type" : "array", + "items" : { + "type" : "string" + } + } + } + } + } + }, + "standard_response" : { + "type" : "object", + "properties" : { + "response" : { + "type" : "object", + "properties" : { + "http_status" : { + "type" : "string" + }, + "code" : { + "type" : "integer" + }, + "errors" : { + "type" : "array", + "items" : { + "type" : "object", + "properties": { + "name": { + "type": "string" + }, + "value": { + "type": "string" + } + } + } + }, + "description" : { + "type" : "string" + }, + "internal_code" : { + "type" : "string" + } + }, + "required" : [ "http_status", "code", "description", "errors" ] + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/resources/OAR029/without-status.yaml b/src/test/resources/checks/v31/resources/OAR029/without-status.yaml new file mode 100644 index 00000000..de0781dd --- /dev/null +++ b/src/test/resources/checks/v31/resources/OAR029/without-status.yaml @@ -0,0 +1,66 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /endpoint: + get: + responses: + 200: + description: Ok + content: + application/json: + schema: + $ref: '#/components/schemas/response' + 204: + description: No content + 400: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/response' + default: + description: Unknown +components: + schemas: + response: # Noncompliant {{OAR029: 'status' property is missing}} + type: object + allOf: + - $ref: '#/components/schemas/standard_response' + properties: + data: + type: object + properties: + tipos: + type: array + items: + type: string + standard_response: + type: object + properties: + response: + type: object + properties: + http_status: + type: string + code: + type: integer + errors: + type: array + items: + type: object + properties: + name: + type: string + value: + type: string + description: + type: string + internal_code: + type: string + required: + - http_status + - code + - description + - errors diff --git a/src/test/resources/checks/v31/resources/OAR030/valid.json b/src/test/resources/checks/v31/resources/OAR030/valid.json new file mode 100644 index 00000000..69748c50 --- /dev/null +++ b/src/test/resources/checks/v31/resources/OAR030/valid.json @@ -0,0 +1,27 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/status" : { + "get" : { + "responses" : { + "200" : { + "description" : "Ok" + } + } + } + }, + "/other" : { + "get" : { + "responses" : { + "200" : { + "description" : "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/resources/OAR030/valid.yaml b/src/test/resources/checks/v31/resources/OAR030/valid.yaml new file mode 100644 index 00000000..1f15c90e --- /dev/null +++ b/src/test/resources/checks/v31/resources/OAR030/valid.yaml @@ -0,0 +1,15 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /status: + get: + responses: + 200: + description: Ok + /other: + get: + responses: + 200: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v31/resources/OAR030/with-status-without-get.json b/src/test/resources/checks/v31/resources/OAR030/with-status-without-get.json new file mode 100644 index 00000000..c3694e1b --- /dev/null +++ b/src/test/resources/checks/v31/resources/OAR030/with-status-without-get.json @@ -0,0 +1,27 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/status" : { # Noncompliant {{OAR030: Method get must be declared}} + "post" : { + "responses" : { + "200" : { + "description" : "Ok" + } + } + } + }, + "/other" : { + "get" : { + "responses" : { + "200" : { + "description" : "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/resources/OAR030/with-status-without-get.yaml b/src/test/resources/checks/v31/resources/OAR030/with-status-without-get.yaml new file mode 100644 index 00000000..e7b5a51f --- /dev/null +++ b/src/test/resources/checks/v31/resources/OAR030/with-status-without-get.yaml @@ -0,0 +1,15 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /status: # Noncompliant {{OAR030: Method get must be declared}} + post: + responses: + 200: + description: Ok + /other: + get: + responses: + 200: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v31/resources/OAR030/without-status.json b/src/test/resources/checks/v31/resources/OAR030/without-status.json new file mode 100644 index 00000000..5ae26a3c --- /dev/null +++ b/src/test/resources/checks/v31/resources/OAR030/without-status.json @@ -0,0 +1,18 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { # Noncompliant {{OAR030: The path '/status' must be declared}} + "/other" : { + "get" : { + "responses" : { + "200" : { + "description" : "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/resources/OAR030/without-status.yaml b/src/test/resources/checks/v31/resources/OAR030/without-status.yaml new file mode 100644 index 00000000..2a015345 --- /dev/null +++ b/src/test/resources/checks/v31/resources/OAR030/without-status.yaml @@ -0,0 +1,10 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: # Noncompliant {{OAR030: The path '/status' must be declared}} + /other: + get: + responses: + 200: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v31/resources/OAR031/valid.json b/src/test/resources/checks/v31/resources/OAR031/valid.json new file mode 100644 index 00000000..2beb36a3 --- /dev/null +++ b/src/test/resources/checks/v31/resources/OAR031/valid.json @@ -0,0 +1,170 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/pets": { + "post": { + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/pet" + }, + "example": { + "name": "Puppy", + "type": "dog" + } + } + } + }, + "responses": { + "201": { + "description": "Pet list", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/pet" + }, + "example": { + "name": "Puppy", + "type": "dog" + } + } + } + }, + "default": { + "$ref": "#/components/responses/server_error_response" + } + } + }, + "get": { + "responses": { + "206": { + "description": "Pet created", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/pets" + }, + "example": { + "size": 2, + "pets": [ + { + "name": "Fluffy", + "type": "cat" + }, + { + "name": "Sparky", + "type": "dog" + } + ] + } + } + } + }, + "default": { + "$ref": "#/components/responses/server_error_response" + } + } + } + }, + "/pets/{id}": { + "get": { + "parameters": [ + { + "$ref": "#/components/parameters/id" + } + ], + "responses": { + "200": { + "description": "One pet", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/pet" + }, + "example": { + "name": "Fluffy", + "type": "cat" + } + } + } + }, + "default": { + "$ref": "#/components/responses/server_error_response" + } + } + } + } + }, + "components": { + "parameters": { + "id": { + "in": "path", + "name": "id", + "schema": { + "type": "integer", + "format": "int64", + "maxLength": 22 + }, + "description": "Identificador del tipo de centro a obtener, actualizar o eliminar.", + "required": true, + "example": 513168138 + } + }, + "schemas": { + "pet": { + "type": "object", + "properties": { + "name": { + "type": "string", + "example": "Snow" + }, + "type": { + "type": "string", + "example": "dog" + } + } + }, + "pets": { + "type": "object", + "properties": { + "size": { + "type": "integer", + "example": 1 + }, + "pets": { + "type": "array", + "items": { + "$ref": "#/components/schemas/pet" + } + } + } + } + }, + "responses": { + "server_error_response": { + "description": "Default error response", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "example": "Server error" + } + } + }, + "example": { + "error": "Server error" + } + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/resources/OAR031/valid.yaml b/src/test/resources/checks/v31/resources/OAR031/valid.yaml new file mode 100644 index 00000000..d0100253 --- /dev/null +++ b/src/test/resources/checks/v31/resources/OAR031/valid.yaml @@ -0,0 +1,113 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: + post: + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/pet" + example: + name: Puppy + type: dog + responses: + 201: + description: Pet list + content: + application/json: + schema: + $ref: '#/components/schemas/pet' + example: + name: Puppy + type: dog + 204: + description: No content + default: + $ref: "#/components/responses/server_error_response" + get: + responses: + 204: + description: No content + 206: + description: Pet created + content: + application/json: + schema: + $ref: '#/components/schemas/pets' + example: + size: 2 + pets: + - name: Fluffy + type: cat + - name: Sparky + type: dog + default: + $ref: "#/components/responses/server_error_response" + /pets/{id}: + get: + parameters: + - $ref: "#/components/parameters/id" + responses: + 200: + description: One pet + content: + application/json: + schema: + $ref: "#/components/schemas/pet" + example: + name: Fluffy + type: cat + 204: + description: No content + default: + $ref: "#/components/responses/server_error_response" + +components: + parameters: + id: + in: path + name: id + schema: + type: integer + format: int64 + maxLength: 22 + example: 513168138 + description: Identificador del tipo de centro a obtener, actualizar o eliminar. + required: true + + schemas: + pet: + type: object + properties: + name: + type: string + example: "Snow" + type: + type: string + example: "dog" + pets: + type: object + properties: + size: + type: integer + example: 1 + pets: + type: array + items: + $ref: '#/components/schemas/pet' + responses: + server_error_response: + description: Default error response + content: + application/json: + schema: + type: object + properties: + error: + type: string + example: "Server error" + example: + error: "Server error" \ No newline at end of file diff --git a/src/test/resources/checks/v31/resources/OAR031/without-examples.json b/src/test/resources/checks/v31/resources/OAR031/without-examples.json new file mode 100644 index 00000000..40728d00 --- /dev/null +++ b/src/test/resources/checks/v31/resources/OAR031/without-examples.json @@ -0,0 +1,120 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/pets": { + "get": { + "responses": { + "206": { # Noncompliant {{OAR031: Responses must have one or more examples defined}} + "description": "Pet list", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/pets" + } + } + } + }, + "default": { + "$ref": "#/components/responses/server_error_response" + } + } + } + }, + "/pets/{id}": { + "parameters": [ + { # Noncompliant {{OAR031: Parameters must have one or more examples defined}} + "in": "query", + "name": "$start", + "schema": { + "type": "integer" + } + } + ], + "get": { + "parameters": [ + { + "$ref": "#/components/parameters/id" + } + ], + "responses": { + "200": { # Noncompliant {{OAR031: Responses must have one or more examples defined}} + "description": "One pet", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/pet" + } + } + } + }, + "default": { + "$ref": "#/components/responses/server_error_response" + } + } + } + } + }, + "components": { + "parameters": { + "id": { # Noncompliant {{OAR031: Parameters must have one or more examples defined}} + "in": "path", + "name": "id", + "schema": { + "type": "integer", + "format": "int64", + "maxLength": 22 + }, + "description": "Identificador del tipo de centro a obtener, actualizar o eliminar.", + "required": true + } + }, + "schemas": { + "pet": { + "type": "object", + "properties": { + "name": { # Noncompliant {{OAR031: Properties must have an example defined}} + "type": "string" + }, + "type": { # Noncompliant {{OAR031: Properties must have an example defined}} + "type": "string" + } + } + }, + "pets": { + "type": "object", + "properties": { + "size": { # Noncompliant {{OAR031: Properties must have an example defined}} + "type": "integer" + }, + "pets": { + "type": "array", + "items": { + "$ref": "#/components/schemas/pet" + } + } + } + } + }, + "responses": { + "server_error_response": { # Noncompliant {{OAR031: Responses must have one or more examples defined}} + "description": "Default error response", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "error": { # Noncompliant {{OAR031: Properties must have an example defined}} + "type": "string" + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/resources/OAR031/without-examples.yaml b/src/test/resources/checks/v31/resources/OAR031/without-examples.yaml new file mode 100644 index 00000000..ec8cd2a0 --- /dev/null +++ b/src/test/resources/checks/v31/resources/OAR031/without-examples.yaml @@ -0,0 +1,73 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: + get: + responses: + 206: # Noncompliant {{OAR031: Responses must have one or more examples defined}} + description: Pet list + content: + application/json: + schema: + $ref: '#/components/schemas/pets' + default: + $ref: "#/components/responses/server_error_response" + /pets/{id}: + parameters: + - in: query # Noncompliant {{OAR031: Parameters must have one or more examples defined}} + name: $start + schema: + type: integer + get: + parameters: + - $ref: "#/components/parameters/id" + responses: + 200: # Noncompliant {{OAR031: Responses must have one or more examples defined}} + description: One pet + content: + application/json: + schema: + $ref: "#/components/schemas/pet" + default: + $ref: "#/components/responses/server_error_response" + +components: + parameters: + id: + in: path # Noncompliant {{OAR031: Parameters must have one or more examples defined}} + name: id + schema: + type: integer + format: int64 + maxLength: 22 + description: Identificador del tipo de centro a obtener, actualizar o eliminar. + required: true + schemas: + pet: + type: object + properties: + name: # Noncompliant {{OAR031: Properties must have an example defined}} + type: string + type: # Noncompliant {{OAR031: Properties must have an example defined}} + type: string + pets: + type: object + properties: + size: # Noncompliant {{OAR031: Properties must have an example defined}} + type: integer + pets: + type: array + items: + $ref: '#/components/schemas/pet' + responses: + server_error_response: # Noncompliant {{OAR031: Responses must have one or more examples defined}} + description: Default error response + content: + application/json: + schema: + type: object + properties: + error: # Noncompliant {{OAR031: Properties must have an example defined}} + type: string \ No newline at end of file diff --git a/src/test/resources/checks/v31/resources/OAR032/forbidden-names.json b/src/test/resources/checks/v31/resources/OAR032/forbidden-names.json new file mode 100644 index 00000000..9c26b26f --- /dev/null +++ b/src/test/resources/checks/v31/resources/OAR032/forbidden-names.json @@ -0,0 +1,36 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/elements" : { # Noncompliant {{OAR032: Ambiguous path parts not encouraged: elements}} + "get" : { + "responses" : { + "200" : { + "description" : "Ok" + } + } + } + }, + "/a/nested/items" : { # Noncompliant {{OAR032: Ambiguous path parts not encouraged: items}} + "get" : { + "responses" : { + "200" : { + "description" : "Ok" + } + } + } + }, + "/another/{param}/with/valores" : { # Noncompliant {{OAR032: Ambiguous path parts not encouraged: valores}} + "get" : { + "responses" : { + "200" : { + "description" : "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/resources/OAR032/forbidden-names.yaml b/src/test/resources/checks/v31/resources/OAR032/forbidden-names.yaml new file mode 100644 index 00000000..2e3b2806 --- /dev/null +++ b/src/test/resources/checks/v31/resources/OAR032/forbidden-names.yaml @@ -0,0 +1,20 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /elements: # Noncompliant {{OAR032: Ambiguous path parts not encouraged: elements}} + get: + responses: + 200: + description: Ok + /a/nested/items: # Noncompliant {{OAR032: Ambiguous path parts not encouraged: items}} + get: + responses: + 200: + description: Ok + /another/{param}/with/valores: # Noncompliant {{OAR032: Ambiguous path parts not encouraged: valores}} + get: + responses: + 200: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v31/resources/OAR032/valid.json b/src/test/resources/checks/v31/resources/OAR032/valid.json new file mode 100644 index 00000000..bce9cd4c --- /dev/null +++ b/src/test/resources/checks/v31/resources/OAR032/valid.json @@ -0,0 +1,27 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/pets" : { + "get" : { + "responses" : { + "200" : { + "description" : "Ok" + } + } + } + }, + "/pets/{elements}" : { + "get" : { + "responses" : { + "200" : { + "description" : "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/resources/OAR032/valid.yaml b/src/test/resources/checks/v31/resources/OAR032/valid.yaml new file mode 100644 index 00000000..f26951f4 --- /dev/null +++ b/src/test/resources/checks/v31/resources/OAR032/valid.yaml @@ -0,0 +1,15 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: + get: + responses: + 200: + description: Ok + /pets/{elements}: + get: + responses: + 200: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v31/resources/OAR034/valid-all-of.json b/src/test/resources/checks/v31/resources/OAR034/valid-all-of.json new file mode 100644 index 00000000..0a433770 --- /dev/null +++ b/src/test/resources/checks/v31/resources/OAR034/valid-all-of.json @@ -0,0 +1,126 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/endpoint": { + "get": { + "responses": { + "206": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/response" + } + } + } + }, + "204": { + "description": "No content" + }, + "400": { + "description": "Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/response" + } + } + } + }, + "default": { + "description": "Unknown" + } + } + } + } + }, + "components": { + "schemas": { + "response": { + "type": "object", + "allOf": [ { + "$ref": "#/components/schemas/paged_response" + } ], + "properties": { + "data": { + "type": "object", + "properties": { + "values": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + }, + "paged_response": { + "type": "object", + "properties": { + "paging": { + "type": "object", + "properties": { + "start": { + "type": "integer" + }, + "limit": { + "type": "integer" + }, + "total": { + "type": "integer" + }, + "numPages": { + "type": "integer" + }, + "links": { + "type": "object", + "properties": { + "self": { + "allOf": [ { + "$ref": "#/components/schemas/link" + } ] + }, + "first": { + "allOf": [ { + "$ref": "#/components/schemas/link" + } ] + }, + "previous": { + "allOf": [ { + "$ref": "#/components/schemas/link" + } ] + }, + "next": { + "allOf": [ { + "$ref": "#/components/schemas/link" + } ] + }, + "last": { + "allOf": [ { + "$ref": "#/components/schemas/link" + } ] + } + }, + "required": [ "self", "previous", "next" ] + } + }, + "required": [ "start", "limit", "links" ] + } + } + }, + "link": { + "type": "object", + "properties": { + "href": { + "type": "string" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/resources/OAR034/valid-all-of.yaml b/src/test/resources/checks/v31/resources/OAR034/valid-all-of.yaml new file mode 100644 index 00000000..15669c82 --- /dev/null +++ b/src/test/resources/checks/v31/resources/OAR034/valid-all-of.yaml @@ -0,0 +1,84 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /endpoint: + get: + responses: + 206: + description: Ok + content: + application/json: + schema: + $ref: '#/components/schemas/response' + 204: + description: No content + 400: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/response' + default: + description: Unknown + +components: + schemas: + response: + type: object + allOf: + - $ref: '#/components/schemas/paged_response' + properties: + data: + type: object + properties: + values: + type: array + items: + type: string + paged_response: + type: object + properties: + paging: + type: object + properties: + start: + type: integer + limit: + type: integer + total: + type: integer + numPages: + type: integer + links: + type: object + properties: + self: + allOf: + - $ref: '#/components/schemas/link' + first: + allOf: + - $ref: '#/components/schemas/link' + previous: + allOf: + - $ref: '#/components/schemas/link' + next: + allOf: + - $ref: '#/components/schemas/link' + last: + allOf: + - $ref: '#/components/schemas/link' + required: + - self + - previous + - next + required: + - start + - limit + - links + link: + type: object + properties: + href: + type: string \ No newline at end of file diff --git a/src/test/resources/checks/v31/resources/OAR034/valid.json b/src/test/resources/checks/v31/resources/OAR034/valid.json new file mode 100644 index 00000000..242adbb8 --- /dev/null +++ b/src/test/resources/checks/v31/resources/OAR034/valid.json @@ -0,0 +1,116 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/endpoint": { + "get": { + "responses": { + "206": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/response" + } + } + } + }, + "204": { + "description": "No content" + }, + "400": { + "description": "Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/response" + } + } + } + }, + "default": { + "description": "Unknown" + } + } + } + } + }, + "components": { + "schemas": { + "response": { + "type": "object", + "allOf": [ { + "$ref": "#/components/schemas/paged_response" + } ], + "properties": { + "data": { + "type": "object", + "properties": { + "values": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + }, + "paged_response": { + "type": "object", + "properties": { + "paging": { + "type": "object", + "properties": { + "start": { + "type": "integer" + }, + "limit": { + "type": "integer" + }, + "total": { + "type": "integer" + }, + "numPages": { + "type": "integer" + }, + "links": { + "type": "object", + "properties": { + "self": { + "$ref": "#/components/schemas/link" + }, + "first": { + "$ref": "#/components/schemas/link" + }, + "previous": { + "$ref": "#/components/schemas/link" + }, + "next": { + "$ref": "#/components/schemas/link" + }, + "last": { + "$ref": "#/components/schemas/link" + } + }, + "required": [ "self", "previous", "next" ] + } + }, + "required": [ "start", "limit", "links" ] + } + } + }, + "link": { + "type": "object", + "properties": { + "href": { + "type": "string" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/resources/OAR034/valid.yaml b/src/test/resources/checks/v31/resources/OAR034/valid.yaml new file mode 100644 index 00000000..62da717a --- /dev/null +++ b/src/test/resources/checks/v31/resources/OAR034/valid.yaml @@ -0,0 +1,79 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /endpoint: + get: + responses: + 206: + description: Ok + content: + application/json: + schema: + $ref: '#/components/schemas/response' + 204: + description: No content + 400: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/response' + default: + description: Unknown + +components: + schemas: + response: + type: object + allOf: + - $ref: '#/components/schemas/paged_response' + properties: + data: + type: object + properties: + values: + type: array + items: + type: string + paged_response: + type: object + properties: + paging: + type: object + properties: + start: + type: integer + limit: + type: integer + total: + type: integer + numPages: + type: integer + links: + type: object + properties: + self: + $ref: '#/components/schemas/link' + first: + $ref: '#/components/schemas/link' + previous: + $ref: '#/components/schemas/link' + next: + $ref: '#/components/schemas/link' + last: + $ref: '#/components/schemas/link' + required: + - self + - previous + - next + required: + - start + - limit + - links + link: + type: object + properties: + href: + type: string \ No newline at end of file diff --git a/src/test/resources/checks/v31/resources/OAR034/with-links-without-properties.json b/src/test/resources/checks/v31/resources/OAR034/with-links-without-properties.json new file mode 100644 index 00000000..7f789dbc --- /dev/null +++ b/src/test/resources/checks/v31/resources/OAR034/with-links-without-properties.json @@ -0,0 +1,96 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/endpoint": { + "get": { + "responses": { + "206": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/response" + } + } + } + }, + "204": { + "description": "No content" + }, + "400": { + "description": "Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/response" + } + } + } + }, + "default": { + "description": "Unknown" + } + } + } + } + }, + "components": { + "schemas": { + "response": { + "type": "object", + "allOf": [ { + "$ref": "#/components/schemas/paged_response" + } ], + "properties": { + "data": { + "type": "object", + "properties": { + "values": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + }, + "paged_response": { + "type": "object", + "properties": { + "paging": { + "type": "object", + "properties": { + "start": { + "type": "integer" + }, + "limit": { + "type": "integer" + }, + "total": { + "type": "integer" + }, + "numPages": { + "type": "integer" + }, + "links": { # Noncompliant {{OAR034: 'first' property is missing}} {{OAR034: 'last' property is missing}} {{OAR034: 'next' property is missing}} {{OAR034: 'previous' property is missing}} {{OAR034: 'self' property is missing}} + "type": "object", + "properties": { + "name": { + "type": "string" + } + }, + "required": [ "self", "previous", "next" ] + } + }, + "required": [ "start", "limit", "links" ] + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/resources/OAR034/with-links-without-properties.yaml b/src/test/resources/checks/v31/resources/OAR034/with-links-without-properties.yaml new file mode 100644 index 00000000..3685c1f3 --- /dev/null +++ b/src/test/resources/checks/v31/resources/OAR034/with-links-without-properties.yaml @@ -0,0 +1,66 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /endpoint: + get: + responses: + 206: + description: Ok + content: + application/json: + schema: + $ref: '#/components/schemas/response' + 204: + description: No content + 400: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/response' + default: + description: Unknown + +components: + schemas: + response: + type: object + allOf: + - $ref: '#/components/schemas/paged_response' + properties: + data: + type: object + properties: + values: + type: array + items: + type: string + paged_response: + type: object + properties: + paging: + type: object + properties: + start: + type: integer + limit: + type: integer + total: + type: integer + numPages: + type: integer + links: # Noncompliant {{OAR034: 'first' property is missing}} {{OAR034: 'last' property is missing}} {{OAR034: 'next' property is missing}} {{OAR034: 'previous' property is missing}} {{OAR034: 'self' property is missing}} + type: object + properties: + name: + type: string + required: + - self + - previous + - next + required: + - start + - limit + - links \ No newline at end of file diff --git a/src/test/resources/checks/v31/resources/OAR034/with-paging-with-properties-wrong-types.json b/src/test/resources/checks/v31/resources/OAR034/with-paging-with-properties-wrong-types.json new file mode 100644 index 00000000..119921b1 --- /dev/null +++ b/src/test/resources/checks/v31/resources/OAR034/with-paging-with-properties-wrong-types.json @@ -0,0 +1,91 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/endpoint": { + "get": { + "responses": { + "206": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/response" + } + } + } + }, + "204": { + "description": "No content" + }, + "400": { + "description": "Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/response" + } + } + } + }, + "default": { + "description": "Unknown" + } + } + } + } + }, + "components": { + "schemas": { + "response": { + "type": "object", + "allOf": [ { + "$ref": "#/components/schemas/paged_response" + } ], + "properties": { + "data": { + "type": "object", + "properties": { + "values": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + }, + "paged_response": { + "type": "object", + "properties": { + "paging": { + "type": "object", + "properties": { + "start": { + "type": "string" # Noncompliant {{OAR034: 'start' must be of type integer}} + }, + "limit": { + "type": "string" # Noncompliant {{OAR034: 'limit' must be of type integer}} + }, + "total": { + "type": "string" # Noncompliant {{OAR034: 'total' must be of type integer}} + }, + "numPages": { + "type": "string" # Noncompliant {{OAR034: 'numPages' must be of type integer}} + }, + "links": { + "type": "string", # Noncompliant {{OAR034: 'links' must be of type object}} + "required": [ "self", "previous", "next" ] + } + }, + "required": [ "start", "limit", "links" ] + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/resources/OAR034/with-paging-with-properties-wrong-types.yaml b/src/test/resources/checks/v31/resources/OAR034/with-paging-with-properties-wrong-types.yaml new file mode 100644 index 00000000..4d725aca --- /dev/null +++ b/src/test/resources/checks/v31/resources/OAR034/with-paging-with-properties-wrong-types.yaml @@ -0,0 +1,63 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /endpoint: + get: + responses: + 206: + description: Ok + content: + application/json: + schema: + $ref: '#/components/schemas/response' + 204: + description: No content + 400: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/response' + default: + description: Unknown + +components: + schemas: + response: + type: object + allOf: + - $ref: '#/components/schemas/paged_response' + properties: + data: + type: object + properties: + values: + type: array + items: + type: string + paged_response: + type: object + properties: + paging: + type: object + properties: + start: + type: string # Noncompliant {{OAR034: 'start' must be of type integer}} + limit: + type: string # Noncompliant {{OAR034: 'limit' must be of type integer}} + total: + type: string # Noncompliant {{OAR034: 'total' must be of type integer}} + numPages: + type: string # Noncompliant {{OAR034: 'numPages' must be of type integer}} + links: + type: string # Noncompliant {{OAR034: 'links' must be of type object}} + required: + - self + - previous + - next + required: + - start + - limit + - links \ No newline at end of file diff --git a/src/test/resources/checks/v31/resources/OAR034/with-paging-without-properties.json b/src/test/resources/checks/v31/resources/OAR034/with-paging-without-properties.json new file mode 100644 index 00000000..ed4ab056 --- /dev/null +++ b/src/test/resources/checks/v31/resources/OAR034/with-paging-without-properties.json @@ -0,0 +1,78 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/endpoint": { + "get": { + "responses": { + "206": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/response" + } + } + } + }, + "204": { + "description": "No content" + }, + "400": { + "description": "Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/response" + } + } + } + }, + "default": { + "description": "Unknown" + } + } + } + } + }, + "components": { + "schemas": { + "response": { + "type": "object", + "allOf": [ { + "$ref": "#/components/schemas/paged_response" + } ], + "properties": { + "data": { + "type": "object", + "properties": { + "values": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + }, + "paged_response": { + "type": "object", + "properties": { + "paging": { # Noncompliant {{OAR034: 'limit' property is missing}} {{OAR034: 'links' property is missing}} {{OAR034: 'numPages' property is missing}} {{OAR034: 'start' property is missing}} {{OAR034: 'total' property is missing}} + "type": "object", + "properties": { + "name": { + "type": "string" + } + }, + "required": [ "start", "limit", "links" ] + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/resources/OAR034/with-paging-without-properties.yaml b/src/test/resources/checks/v31/resources/OAR034/with-paging-without-properties.yaml new file mode 100644 index 00000000..153ece2f --- /dev/null +++ b/src/test/resources/checks/v31/resources/OAR034/with-paging-without-properties.yaml @@ -0,0 +1,51 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /endpoint: + get: + responses: + 206: + description: Ok + content: + application/json: + schema: + $ref: '#/components/schemas/response' + 204: + description: No content + 400: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/response' + default: + description: Unknown + +components: + schemas: + response: + type: object + allOf: + - $ref: '#/components/schemas/paged_response' + properties: + data: + type: object + properties: + values: + type: array + items: + type: string + paged_response: + type: object + properties: + paging: # Noncompliant {{OAR034: 'limit' property is missing}} {{OAR034: 'links' property is missing}} {{OAR034: 'numPages' property is missing}} {{OAR034: 'start' property is missing}} {{OAR034: 'total' property is missing}} + type: object + properties: + name: + type: string + required: + - start + - limit + - links \ No newline at end of file diff --git a/src/test/resources/checks/v31/resources/OAR034/with-paging-wrong-type.json b/src/test/resources/checks/v31/resources/OAR034/with-paging-wrong-type.json new file mode 100644 index 00000000..d9966a0b --- /dev/null +++ b/src/test/resources/checks/v31/resources/OAR034/with-paging-wrong-type.json @@ -0,0 +1,73 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/endpoint": { + "get": { + "responses": { + "206": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/response" + } + } + } + }, + "204": { + "description": "No content" + }, + "400": { + "description": "Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/response" + } + } + } + }, + "default": { + "description": "Unknown" + } + } + } + } + }, + "components": { + "schemas": { + "response": { + "type": "object", + "allOf": [ { + "$ref": "#/components/schemas/paged_response" + } ], + "properties": { + "data": { + "type": "object", + "properties": { + "values": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + }, + "paged_response": { + "type": "object", + "properties": { + "paging": { + "type": "string", # Noncompliant {{OAR034: 'paging' must be of type object}} + "required": [ "start", "limit", "links" ] + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/resources/OAR034/with-paging-wrong-type.yaml b/src/test/resources/checks/v31/resources/OAR034/with-paging-wrong-type.yaml new file mode 100644 index 00000000..33d666d9 --- /dev/null +++ b/src/test/resources/checks/v31/resources/OAR034/with-paging-wrong-type.yaml @@ -0,0 +1,48 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /endpoint: + get: + responses: + 206: + description: Ok + content: + application/json: + schema: + $ref: '#/components/schemas/response' + 204: + description: No content + 400: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/response' + default: + description: Unknown + +components: + schemas: + response: + type: object + allOf: + - $ref: '#/components/schemas/paged_response' + properties: + data: + type: object + properties: + values: + type: array + items: + type: string + paged_response: + type: object + properties: + paging: + type: string # Noncompliant {{OAR034: 'paging' must be of type object}} + required: + - start + - limit + - links \ No newline at end of file diff --git a/src/test/resources/checks/v31/resources/OAR034/without-links-required-fields.json b/src/test/resources/checks/v31/resources/OAR034/without-links-required-fields.json new file mode 100644 index 00000000..5ecd5e4b --- /dev/null +++ b/src/test/resources/checks/v31/resources/OAR034/without-links-required-fields.json @@ -0,0 +1,116 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/endpoint": { + "get": { + "responses": { + "206": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/response" + } + } + } + }, + "204": { + "description": "No content" + }, + "400": { + "description": "Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/response" + } + } + } + }, + "default": { + "description": "Unknown" + } + } + } + } + }, + "components": { + "schemas": { + "response": { + "type": "object", + "allOf": [ { + "$ref": "#/components/schemas/paged_response" + } ], + "properties": { + "data": { + "type": "object", + "properties": { + "values": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + }, + "paged_response": { + "type": "object", + "properties": { + "paging": { + "type": "object", + "properties": { + "start": { + "type": "integer" + }, + "limit": { + "type": "integer" + }, + "total": { + "type": "integer" + }, + "numPages": { + "type": "integer" + }, + "links": { + "type": "object", + "properties": { + "self": { + "$ref": "#/components/schemas/link" + }, + "first": { + "$ref": "#/components/schemas/link" + }, + "previous": { + "$ref": "#/components/schemas/link" + }, + "next": { + "$ref": "#/components/schemas/link" + }, + "last": { + "$ref": "#/components/schemas/link" + } + }, + "required": [ "self" ] # Noncompliant {{OAR034: The following fields must be required: next, previous, self}} + } + }, + "required": [ "start", "limit", "links" ] + } + } + }, + "link": { + "type": "object", + "properties": { + "href": { + "type": "string" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/resources/OAR034/without-links-required-fields.yaml b/src/test/resources/checks/v31/resources/OAR034/without-links-required-fields.yaml new file mode 100644 index 00000000..3ca7987e --- /dev/null +++ b/src/test/resources/checks/v31/resources/OAR034/without-links-required-fields.yaml @@ -0,0 +1,77 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /endpoint: + get: + responses: + 206: + description: Ok + content: + application/json: + schema: + $ref: '#/components/schemas/response' + 204: + description: No content + 400: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/response' + default: + description: Unknown + +components: + schemas: + response: + type: object + allOf: + - $ref: '#/components/schemas/paged_response' + properties: + data: + type: object + properties: + values: + type: array + items: + type: string + paged_response: + type: object + properties: + paging: + type: object + properties: + start: + type: integer + limit: + type: integer + total: + type: integer + numPages: + type: integer + links: + type: object + properties: + self: + $ref: '#/components/schemas/link' + first: + $ref: '#/components/schemas/link' + previous: + $ref: '#/components/schemas/link' + next: + $ref: '#/components/schemas/link' + last: + $ref: '#/components/schemas/link' + required: # Noncompliant {{OAR034: The following fields must be required: next, previous, self}} + - self + required: + - start + - limit + - links + link: + type: object + properties: + href: + type: string \ No newline at end of file diff --git a/src/test/resources/checks/v31/resources/OAR034/without-pagination-required-fields.json b/src/test/resources/checks/v31/resources/OAR034/without-pagination-required-fields.json new file mode 100644 index 00000000..fd7e6e38 --- /dev/null +++ b/src/test/resources/checks/v31/resources/OAR034/without-pagination-required-fields.json @@ -0,0 +1,116 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/endpoint": { + "get": { + "responses": { + "206": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/response" + } + } + } + }, + "204": { + "description": "No content" + }, + "400": { + "description": "Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/response" + } + } + } + }, + "default": { + "description": "Unknown" + } + } + } + } + }, + "components": { + "schemas": { + "response": { + "type": "object", + "allOf": [ { + "$ref": "#/components/schemas/paged_response" + } ], + "properties": { + "data": { + "type": "object", + "properties": { + "values": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + }, + "paged_response": { + "type": "object", + "properties": { + "paging": { + "type": "object", + "properties": { + "start": { + "type": "integer" + }, + "limit": { + "type": "integer" + }, + "total": { + "type": "integer" + }, + "numPages": { + "type": "integer" + }, + "links": { + "type": "object", + "properties": { + "self": { + "$ref": "#/components/schemas/link" + }, + "first": { + "$ref": "#/components/schemas/link" + }, + "previous": { + "$ref": "#/components/schemas/link" + }, + "next": { + "$ref": "#/components/schemas/link" + }, + "last": { + "$ref": "#/components/schemas/link" + } + }, + "required": [ "self", "previous", "next" ] + } + }, + "required": [ "start" ] # Noncompliant {{OAR034: The following fields must be required: limit, links, start}} + } + } + }, + "link": { + "type": "object", + "properties": { + "href": { + "type": "string" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/resources/OAR034/without-pagination-required-fields.yaml b/src/test/resources/checks/v31/resources/OAR034/without-pagination-required-fields.yaml new file mode 100644 index 00000000..cc4c316a --- /dev/null +++ b/src/test/resources/checks/v31/resources/OAR034/without-pagination-required-fields.yaml @@ -0,0 +1,77 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /endpoint: + get: + responses: + 206: + description: Ok + content: + application/json: + schema: + $ref: '#/components/schemas/response' + 204: + description: No content + 400: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/response' + default: + description: Unknown + +components: + schemas: + response: + type: object + allOf: + - $ref: '#/components/schemas/paged_response' + properties: + data: + type: object + properties: + values: + type: array + items: + type: string + paged_response: + type: object + properties: + paging: + type: object + properties: + start: + type: integer + limit: + type: integer + total: + type: integer + numPages: + type: integer + links: + type: object + properties: + self: + $ref: '#/components/schemas/link' + first: + $ref: '#/components/schemas/link' + previous: + $ref: '#/components/schemas/link' + next: + $ref: '#/components/schemas/link' + last: + $ref: '#/components/schemas/link' + required: + - self + - previous + - next + required: # Noncompliant {{OAR034: The following fields must be required: limit, links, start}} + - start + link: + type: object + properties: + href: + type: string \ No newline at end of file diff --git a/src/test/resources/checks/v31/resources/OAR034/without-paging.json b/src/test/resources/checks/v31/resources/OAR034/without-paging.json new file mode 100644 index 00000000..4fb4a8e9 --- /dev/null +++ b/src/test/resources/checks/v31/resources/OAR034/without-paging.json @@ -0,0 +1,61 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/endpoint": { + "get": { + "responses": { + "206": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/response" + } + } + } + }, + "204": { + "description": "No content" + }, + "400": { + "description": "Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/response" + } + } + } + }, + "default": { + "description": "Unknown" + } + } + } + } + }, + "components": { + "schemas": { + "response": { # Noncompliant {{OAR034: 'paging' property is missing}} + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "values": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/resources/OAR034/without-paging.yaml b/src/test/resources/checks/v31/resources/OAR034/without-paging.yaml new file mode 100644 index 00000000..0bb219ab --- /dev/null +++ b/src/test/resources/checks/v31/resources/OAR034/without-paging.yaml @@ -0,0 +1,37 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /endpoint: + get: + responses: + 206: + description: Ok + content: + application/json: + schema: + $ref: '#/components/schemas/response' + 204: + description: No content + 400: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/response' + default: + description: Unknown + +components: + schemas: + response: # Noncompliant {{OAR034: 'paging' property is missing}} + type: object + properties: + data: + type: object + properties: + values: + type: array + items: + type: string \ No newline at end of file diff --git a/src/test/resources/checks/v31/resources/OAR038/valid-multiple-properties.json b/src/test/resources/checks/v31/resources/OAR038/valid-multiple-properties.json new file mode 100644 index 00000000..6c5aa7f8 --- /dev/null +++ b/src/test/resources/checks/v31/resources/OAR038/valid-multiple-properties.json @@ -0,0 +1,48 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/endpoint" : { + "post" : { + "responses" : { + "201" : { + "description" : "Ok", + "content": { + "application/json":{ + "schema" : { + "$ref" : "#/components/schemas/response" + } + } + } + }, + "204" : { + "description" : "No content" + } + } + } + } + }, + "components": { + "schemas": { + "response" : { + "type" : "object", + "properties" : { + "data" : { + "type" : "object", + "properties" : { + "id" : { + "type" : "string" + }, + "name" : { + "type" : "string" + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/resources/OAR038/valid-multiple-properties.yaml b/src/test/resources/checks/v31/resources/OAR038/valid-multiple-properties.yaml new file mode 100644 index 00000000..64c4f794 --- /dev/null +++ b/src/test/resources/checks/v31/resources/OAR038/valid-multiple-properties.yaml @@ -0,0 +1,29 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /endpoint: + post: + responses: + 201: + description: Ok + content: + application/json: + schema: + $ref: '#/components/schemas/response' + 204: + description: No content + +components: + schemas: + response: + type: object + properties: + data: + type: object + properties: + id: + type: string + name: + type: string diff --git a/src/test/resources/checks/v31/resources/OAR038/valid-one-property.json b/src/test/resources/checks/v31/resources/OAR038/valid-one-property.json new file mode 100644 index 00000000..76dae630 --- /dev/null +++ b/src/test/resources/checks/v31/resources/OAR038/valid-one-property.json @@ -0,0 +1,45 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/endpoint" : { + "post" : { + "responses" : { + "201" : { + "description" : "Ok", + "content": { + "application/json":{ + "schema" : { + "$ref" : "#/components/schemas/response" + } + } + } + }, + "204" : { + "description" : "No content" + } + } + } + } + }, + "components": { + "schemas": { + "response" : { + "type" : "object", + "properties" : { + "data" : { + "type" : "object", + "properties" : { + "id" : { + "type" : "string" + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/resources/OAR038/valid-one-property.yaml b/src/test/resources/checks/v31/resources/OAR038/valid-one-property.yaml new file mode 100644 index 00000000..6a93ee9d --- /dev/null +++ b/src/test/resources/checks/v31/resources/OAR038/valid-one-property.yaml @@ -0,0 +1,27 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /endpoint: + post: + responses: + 201: + description: Ok + content: + application/json: + schema: + $ref: '#/components/schemas/response' + 204: + description: No content + +components: + schemas: + response: + type: object + properties: + data: + type: object + properties: + id: + type: string diff --git a/src/test/resources/checks/v31/resources/OAR038/with-properties-empty.json b/src/test/resources/checks/v31/resources/OAR038/with-properties-empty.json new file mode 100644 index 00000000..8f2032d6 --- /dev/null +++ b/src/test/resources/checks/v31/resources/OAR038/with-properties-empty.json @@ -0,0 +1,41 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/endpoint" : { + "post" : { + "responses" : { + "201" : { + "description" : "Ok", + "content": { + "application/json":{ + "schema" : { + "$ref" : "#/components/schemas/response" + } + } + } + }, + "204" : { + "description" : "No content" + } + } + } + } + }, + "components": { + "schemas": { + "response" : { + "type" : "object", + "properties" : { + "data" : { # Noncompliant {{OAR038: At least you have to define the identifier property}} + "type" : "object", + "properties" : { } + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/resources/OAR038/with-properties-empty.yaml b/src/test/resources/checks/v31/resources/OAR038/with-properties-empty.yaml new file mode 100644 index 00000000..4680fd0a --- /dev/null +++ b/src/test/resources/checks/v31/resources/OAR038/with-properties-empty.yaml @@ -0,0 +1,25 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /endpoint: + post: + responses: + 201: + description: Ok + content: + application/json: + schema: + $ref: '#/components/schemas/response' + 204: + description: No content + +components: + schemas: + response: + type: object + properties: + data: # Noncompliant {{OAR038: At least you have to define the identifier property}} + type: object + properties: {} diff --git a/src/test/resources/checks/v31/resources/OAR038/without-data.json b/src/test/resources/checks/v31/resources/OAR038/without-data.json new file mode 100644 index 00000000..a6d5f9a6 --- /dev/null +++ b/src/test/resources/checks/v31/resources/OAR038/without-data.json @@ -0,0 +1,35 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/endpoint" : { + "post" : { + "responses" : { + "201" : { + "description" : "Ok", + "content": { + "application/json":{ + "schema" : { + "$ref" : "#/components/schemas/response" + } + } + } + }, + "204" : { + "description" : "No content" + } + } + } + } + }, + "components": { + "schemas" : { + "response" : { # Noncompliant {{OAR038: 'data' property is missing}} + "type" : "object" + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/resources/OAR038/without-data.yaml b/src/test/resources/checks/v31/resources/OAR038/without-data.yaml new file mode 100644 index 00000000..b64463dd --- /dev/null +++ b/src/test/resources/checks/v31/resources/OAR038/without-data.yaml @@ -0,0 +1,21 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /endpoint: + post: + responses: + 201: + description: Ok + content: + application/json: + schema: + $ref: '#/components/schemas/response' + 204: + description: No content + +components: + schemas: + response: # Noncompliant {{OAR038: 'data' property is missing}} + type: object \ No newline at end of file diff --git a/src/test/resources/checks/v31/resources/OAR038/without-properties.json b/src/test/resources/checks/v31/resources/OAR038/without-properties.json new file mode 100644 index 00000000..3573e876 --- /dev/null +++ b/src/test/resources/checks/v31/resources/OAR038/without-properties.json @@ -0,0 +1,53 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/endpoint": { + "post": { + "responses": { + "201": { + "$ref": "#/components/responses/createResponse" + }, + "204": { + "description": "No content" + } + } + } + } + }, + "components": { + "schemas": { + "response": { + "type": "object", + "allOf": [ + { + "$ref": "#/components/schemas/post_response" + } + ] + }, + "post_response": { + "type": "object", + "properties": { + "data": { # Noncompliant {{OAR038: At least you have to define the identifier property}} + "type": "object" + } + } + } + }, + "responses": { + "createResponse": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/response" + } + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/resources/OAR038/without-properties.yaml b/src/test/resources/checks/v31/resources/OAR038/without-properties.yaml new file mode 100644 index 00000000..b57f97f7 --- /dev/null +++ b/src/test/resources/checks/v31/resources/OAR038/without-properties.yaml @@ -0,0 +1,33 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /endpoint: + post: + responses: + 201: + $ref: '#/components/responses/createResponse' + 204: + description: No content + +components: + schemas: + response: + type: object + allOf: + - $ref: '#/components/schemas/post_response' + + post_response: + type: object + properties: + data: # Noncompliant {{OAR038: At least you have to define the identifier property}} + type: object + + responses: + createResponse: + description: Ok + content: + application/json: + schema: + $ref: '#/components/schemas/response' \ No newline at end of file diff --git a/src/test/resources/checks/v31/resources/OAR038/without-schema.json b/src/test/resources/checks/v31/resources/OAR038/without-schema.json new file mode 100644 index 00000000..8cdacdba --- /dev/null +++ b/src/test/resources/checks/v31/resources/OAR038/without-schema.json @@ -0,0 +1,21 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/endpoint" : { + "post" : { + "responses" : { + "201" : { # Noncompliant {{OAR038: Response schema is required}} + "description" : "Ok" + }, + "204" : { + "description" : "No content" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/resources/OAR038/without-schema.yaml b/src/test/resources/checks/v31/resources/OAR038/without-schema.yaml new file mode 100644 index 00000000..5ec0e410 --- /dev/null +++ b/src/test/resources/checks/v31/resources/OAR038/without-schema.yaml @@ -0,0 +1,12 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /endpoint: + post: + responses: + 201: # Noncompliant {{OAR038: Response schema is required}} + description: Ok + 204: + description: No content \ No newline at end of file diff --git a/src/test/resources/checks/v31/resources/OAR039/missing-codes.json b/src/test/resources/checks/v31/resources/OAR039/missing-codes.json new file mode 100644 index 00000000..1495f285 --- /dev/null +++ b/src/test/resources/checks/v31/resources/OAR039/missing-codes.json @@ -0,0 +1,109 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths": { + "/pets": { + "get": { + "responses": { # Noncompliant {{OAR039: Response code 200 or 206 must be defined}} {{OAR039: Response code 400 must be defined}} {{OAR039: Response code 500 must be defined}} {{OAR039: Response code 503 must be defined}} + "default": { + "description": "Unexpected error" + } + } + }, + "post": { + "responses": { # Noncompliant {{OAR039: Response code 200 or 201 or 202 must be defined}} {{OAR039: Response code 400 must be defined}} {{OAR039: Response code 415 must be defined}} {{OAR039: Response code 500 must be defined}} {{OAR039: Response code 503 must be defined}} + "default": { + "description": "Unexpected error" + } + } + } + }, + "/pets/get": { + "post": { + "responses": { # Noncompliant {{OAR039: Response code 200 must be defined}} {{OAR039: Response code 400 must be defined}} {{OAR039: Response code 404 must be defined}} {{OAR039: Response code 415 must be defined}} {{OAR039: Response code 500 must be defined}} {{OAR039: Response code 503 must be defined}} + "default": { + "description": "Unexpected error" + } + } + } + }, + "/pets/delete": { + "post": { + "responses": { # Noncompliant {{OAR039: Response code 200 must be defined}} {{OAR039: Response code 400 must be defined}} {{OAR039: Response code 404 must be defined}} {{OAR039: Response code 415 must be defined}} {{OAR039: Response code 500 must be defined}} {{OAR039: Response code 503 must be defined}} + "default": { + "description": "Unexpected error" + } + } + } + }, + "/pets/{id}": { + "get": { + "responses": { # Noncompliant {{OAR039: Response code 200 must be defined}} {{OAR039: Response code 400 must be defined}} {{OAR039: Response code 404 must be defined}} {{OAR039: Response code 500 must be defined}} {{OAR039: Response code 503 must be defined}} + "default": { + "description": "Unexpected error" + } + } + }, + "put": { + "responses": { # Noncompliant {{OAR039: Response code 200 must be defined}} {{OAR039: Response code 400 must be defined}} {{OAR039: Response code 404 must be defined}} {{OAR039: Response code 415 must be defined}} {{OAR039: Response code 500 must be defined}} {{OAR039: Response code 503 must be defined}} + "default": { + "description": "Unexpected error" + } + } + }, + "patch": { + "responses": { # Noncompliant {{OAR039: Response code 200 must be defined}} {{OAR039: Response code 400 must be defined}} {{OAR039: Response code 404 must be defined}} {{OAR039: Response code 415 must be defined}} {{OAR039: Response code 500 must be defined}} {{OAR039: Response code 503 must be defined}} + "default": { + "description": "Unexpected error" + } + } + }, + "delete": { + "responses": { # Noncompliant {{OAR039: Response code 200 must be defined}} {{OAR039: Response code 400 must be defined}} {{OAR039: Response code 404 must be defined}} {{OAR039: Response code 500 must be defined}} {{OAR039: Response code 503 must be defined}} + "default": { + "description": "Unexpected error" + } + } + } + }, + "/pets/{id}/owner": { + "post": { + "responses": { # Noncompliant {{OAR039: Response code 200 or 201 or 202 must be defined}} {{OAR039: Response code 400 must be defined}} {{OAR039: Response code 404 must be defined}} {{OAR039: Response code 415 must be defined}} {{OAR039: Response code 500 must be defined}} {{OAR039: Response code 503 must be defined}} + "default": { + "description": "Unexpected error" + } + } + } + }, + "/pets/{id}/owner/get": { + "post": { + "responses": { # Noncompliant {{OAR039: Response code 200 must be defined}} {{OAR039: Response code 400 must be defined}} {{OAR039: Response code 404 must be defined}} {{OAR039: Response code 415 must be defined}} {{OAR039: Response code 500 must be defined}} {{OAR039: Response code 503 must be defined}} + "default": { + "description": "Unexpected error" + } + } + } + }, + "/pets/{id}/owner/delete": { + "post": { + "responses": { # Noncompliant {{OAR039: Response code 200 must be defined}} {{OAR039: Response code 400 must be defined}} {{OAR039: Response code 404 must be defined}} {{OAR039: Response code 415 must be defined}} {{OAR039: Response code 500 must be defined}} {{OAR039: Response code 503 must be defined}} + "default": { + "description": "Unexpected error" + } + } + } + }, + "/status": { + "get": { + "responses": { + "default": { + "description": "Unexpected error" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/resources/OAR039/missing-codes.yaml b/src/test/resources/checks/v31/resources/OAR039/missing-codes.yaml new file mode 100644 index 00000000..b2be1e3d --- /dev/null +++ b/src/test/resources/checks/v31/resources/OAR039/missing-codes.yaml @@ -0,0 +1,68 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: + get: + responses: # Noncompliant {{OAR039: Response code 200 or 206 must be defined}} {{OAR039: Response code 400 must be defined}} {{OAR039: Response code 500 must be defined}} {{OAR039: Response code 503 must be defined}} + default: + description: Unexpected error + post: + responses: # Noncompliant {{OAR039: Response code 200 or 201 or 202 must be defined}} {{OAR039: Response code 400 must be defined}} {{OAR039: Response code 415 must be defined}} {{OAR039: Response code 500 must be defined}} {{OAR039: Response code 503 must be defined}} + default: + description: Unexpected error + + /pets/get: + post: + responses: # Noncompliant {{OAR039: Response code 200 must be defined}} {{OAR039: Response code 400 must be defined}} {{OAR039: Response code 404 must be defined}} {{OAR039: Response code 415 must be defined}} {{OAR039: Response code 500 must be defined}} {{OAR039: Response code 503 must be defined}} + default: + description: Unexpected error + + /pets/delete: + post: + responses: # Noncompliant {{OAR039: Response code 200 must be defined}} {{OAR039: Response code 400 must be defined}} {{OAR039: Response code 404 must be defined}} {{OAR039: Response code 415 must be defined}} {{OAR039: Response code 500 must be defined}} {{OAR039: Response code 503 must be defined}} + default: + description: Unexpected error + + /pets/{id}: + get: + responses: # Noncompliant {{OAR039: Response code 200 must be defined}} {{OAR039: Response code 400 must be defined}} {{OAR039: Response code 404 must be defined}} {{OAR039: Response code 500 must be defined}} {{OAR039: Response code 503 must be defined}} + default: + description: Unexpected error + put: + responses: # Noncompliant {{OAR039: Response code 200 must be defined}} {{OAR039: Response code 400 must be defined}} {{OAR039: Response code 404 must be defined}} {{OAR039: Response code 415 must be defined}} {{OAR039: Response code 500 must be defined}} {{OAR039: Response code 503 must be defined}} + default: + description: Unexpected error + patch: + responses: # Noncompliant {{OAR039: Response code 200 must be defined}} {{OAR039: Response code 400 must be defined}} {{OAR039: Response code 404 must be defined}} {{OAR039: Response code 415 must be defined}} {{OAR039: Response code 500 must be defined}} {{OAR039: Response code 503 must be defined}} + default: + description: Unexpected error + delete: + responses: # Noncompliant {{OAR039: Response code 200 must be defined}} {{OAR039: Response code 400 must be defined}} {{OAR039: Response code 404 must be defined}} {{OAR039: Response code 500 must be defined}} {{OAR039: Response code 503 must be defined}} + default: + description: Unexpected error + + /pets/{id}/owner: + post: + responses: # Noncompliant {{OAR039: Response code 200 or 201 or 202 must be defined}} {{OAR039: Response code 400 must be defined}} {{OAR039: Response code 404 must be defined}} {{OAR039: Response code 415 must be defined}} {{OAR039: Response code 500 must be defined}} {{OAR039: Response code 503 must be defined}} + default: + description: Unexpected error + + /pets/{id}/owner/get: + post: + responses: # Noncompliant {{OAR039: Response code 200 must be defined}} {{OAR039: Response code 400 must be defined}} {{OAR039: Response code 404 must be defined}} {{OAR039: Response code 415 must be defined}} {{OAR039: Response code 500 must be defined}} {{OAR039: Response code 503 must be defined}} + default: + description: Unexpected error + + /pets/{id}/owner/delete: + post: + responses: # Noncompliant {{OAR039: Response code 200 must be defined}} {{OAR039: Response code 400 must be defined}} {{OAR039: Response code 404 must be defined}} {{OAR039: Response code 415 must be defined}} {{OAR039: Response code 500 must be defined}} {{OAR039: Response code 503 must be defined}} + default: + description: Unexpected error + + /status: + get: + responses: + default: + description: Unexpected error \ No newline at end of file diff --git a/src/test/resources/checks/v31/resources/OAR039/valid.json b/src/test/resources/checks/v31/resources/OAR039/valid.json new file mode 100644 index 00000000..59eaf067 --- /dev/null +++ b/src/test/resources/checks/v31/resources/OAR039/valid.json @@ -0,0 +1,283 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths": { + "/pets": { + "get": { + "responses": { + "206": { + "description": "Partial collection" + }, + "400": { + "description": "Bad request" + }, + "500": { + "description": "Internal server error" + }, + "503": { + "description": "Service unavailable" + } + } + }, + "post": { + "responses": { + "201": { + "description": "Created" + }, + "400": { + "description": "Bad request" + }, + "413": { + "description": "Payload too large" + }, + "415": { + "description": "Unsupported media type" + }, + "500": { + "description": "Internal server error" + }, + "503": { + "description": "Service unavailable" + } + } + } + }, + "/pets/get": { + "post": { + "responses": { + "200": { + "description": "Ok" + }, + "400": { + "description": "Bad request" + }, + "404": { + "description": "Not found" + }, + "413": { + "description": "Payload too large" + }, + "415": { + "description": "Unsupported media type" + }, + "500": { + "description": "Internal server error" + }, + "503": { + "description": "Service unavailable" + } + } + } + }, + "/pets/delete": { + "post": { + "responses": { + "200": { + "description": "Ok" + }, + "400": { + "description": "Bad request" + }, + "404": { + "description": "Not found" + }, + "413": { + "description": "Payload too large" + }, + "415": { + "description": "Unsupported media type" + }, + "500": { + "description": "Internal server error" + }, + "503": { + "description": "Service unavailable" + } + } + } + }, + "/pets/{id}": { + "get": { + "responses": { + "200": { + "description": "Ok" + }, + "400": { + "description": "Bad request" + }, + "404": { + "description": "Not found" + }, + "500": { + "description": "Internal server error" + }, + "503": { + "description": "Service unavailable" + } + } + }, + "put": { + "responses": { + "200": { + "description": "Ok" + }, + "400": { + "description": "Bad request" + }, + "404": { + "description": "Not found" + }, + "413": { + "description": "Payload too large" + }, + "415": { + "description": "Unsupported media type" + }, + "500": { + "description": "Internal server error" + }, + "503": { + "description": "Service unavailable" + } + } + }, + "patch": { + "responses": { + "200": { + "description": "Ok" + }, + "400": { + "description": "Bad request" + }, + "404": { + "description": "Not found" + }, + "413": { + "description": "Payload too large" + }, + "415": { + "description": "Unsupported media type" + }, + "500": { + "description": "Internal server error" + }, + "503": { + "description": "Service unavailable" + } + } + }, + "delete": { + "responses": { + "200": { + "description": "Ok" + }, + "400": { + "description": "Bad request" + }, + "404": { + "description": "Not found" + }, + "500": { + "description": "Internal server error" + }, + "503": { + "description": "Service unavailable" + } + } + } + }, + "/pets/{id}/owner": { + "post": { + "responses": { + "201": { + "description": "Created" + }, + "400": { + "description": "Bad request" + }, + "404": { + "description": "Not found" + }, + "413": { + "description": "Payload too large" + }, + "415": { + "description": "Unsupported media type" + }, + "500": { + "description": "Internal server error" + }, + "503": { + "description": "Service unavailable" + } + } + } + }, + "/pets/{id}/owner/get": { + "post": { + "responses": { + "200": { + "description": "Ok" + }, + "400": { + "description": "Bad request" + }, + "404": { + "description": "Not found" + }, + "413": { + "description": "Payload too large" + }, + "415": { + "description": "Unsupported media type" + }, + "500": { + "description": "Internal server error" + }, + "503": { + "description": "Service unavailable" + } + } + } + }, + "/pets/{id}/owner/delete": { + "post": { + "responses": { + "200": { + "description": "Ok" + }, + "400": { + "description": "Bad request" + }, + "404": { + "description": "Not found" + }, + "413": { + "description": "Payload too large" + }, + "415": { + "description": "Unsupported media type" + }, + "500": { + "description": "Internal server error" + }, + "503": { + "description": "Service unavailable" + } + } + } + }, + "/status": { + "get": { + "responses": { + "default": { + "description": "Unexpected error" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/resources/OAR039/valid.yaml b/src/test/resources/checks/v31/resources/OAR039/valid.yaml new file mode 100644 index 00000000..1f23f21a --- /dev/null +++ b/src/test/resources/checks/v31/resources/OAR039/valid.yaml @@ -0,0 +1,184 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: + get: + responses: + 206: + description: Partial collection + 400: + description: Bad request + 500: + description: Internal server error + 503: + description: Service unavailable + post: + responses: + 201: + description: Created + 400: + description: Bad request + 413: + description: Payload too large + 415: + description: Unsupported media type + 500: + description: Internal server error + 503: + description: Service unavailable + + /pets/get: + post: + responses: + 200: + description: Ok + 400: + description: Bad request + 404: + description: Not found + 413: + description: Payload too large + 415: + description: Unsupported media type + 500: + description: Internal server error + 503: + description: Service unavailable + + /pets/delete: + post: + responses: + 200: + description: Ok + 400: + description: Bad request + 404: + description: Not found + 413: + description: Payload too large + 415: + description: Unsupported media type + 500: + description: Internal server error + 503: + description: Service unavailable + + /pets/{id}: + get: + responses: + 200: + description: Ok + 400: + description: Bad request + 404: + description: Not found + 500: + description: Internal server error + 503: + description: Service unavailable + put: + responses: + 200: + description: Ok + 400: + description: Bad request + 404: + description: Not found + 413: + description: Payload too large + 415: + description: Unsupported media type + 500: + description: Internal server error + 503: + description: Service unavailable + patch: + responses: + 200: + description: Ok + 400: + description: Bad request + 404: + description: Not found + 413: + description: Payload too large + 415: + description: Unsupported media type + 500: + description: Internal server error + 503: + description: Service unavailable + delete: + responses: + 200: + description: Ok + 400: + description: Bad request + 404: + description: Not found + 500: + description: Internal server error + 503: + description: Service unavailable + + /pets/{id}/owner: + post: + responses: + 201: + description: Created + 400: + description: Bad request + 404: + description: Not found + 413: + description: Payload too large + 415: + description: Unsupported media type + 500: + description: Internal server error + 503: + description: Service unavailable + + /pets/{id}/owner/get: + post: + responses: + 200: + description: Ok + 400: + description: Bad request + 404: + description: Not found + 413: + description: Payload too large + 415: + description: Unsupported media type + 500: + description: Internal server error + 503: + description: Service unavailable + + /pets/{id}/owner/delete: + post: + responses: + 200: + description: Ok + 400: + description: Bad request + 404: + description: Not found + 413: + description: Payload too large + 415: + description: Unsupported media type + 500: + description: Internal server error + 503: + description: Service unavailable + + /status: + get: + responses: + default: + description: Unexpected error \ No newline at end of file diff --git a/src/test/resources/checks/v31/schemas/OAR080/empty-global-security.json b/src/test/resources/checks/v31/schemas/OAR080/empty-global-security.json new file mode 100644 index 00000000..81763b5c --- /dev/null +++ b/src/test/resources/checks/v31/schemas/OAR080/empty-global-security.json @@ -0,0 +1,20 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Sample API" + }, + "security": [], + "paths": { + "/users": { + "get": { # Noncompliant {{OAR080: The security scheme must be among those allowed by the organization and must be complete.}} + "summary": "Get all users", + "responses": { + "200": { + "description": "OK" + } + } + } + } + } +} diff --git a/src/test/resources/checks/v31/schemas/OAR080/empty-global-security.yaml b/src/test/resources/checks/v31/schemas/OAR080/empty-global-security.yaml new file mode 100644 index 00000000..05fb3ba3 --- /dev/null +++ b/src/test/resources/checks/v31/schemas/OAR080/empty-global-security.yaml @@ -0,0 +1,12 @@ +openapi: 3.0.0 +info: + version: 1.0.0 + title: Sample API +security: [] +paths: + /users: + get: # Noncompliant {{OAR080: The security scheme must be among those allowed by the organization and must be complete.}} + summary: Get all users + responses: + '200': + description: OK diff --git a/src/test/resources/checks/v31/schemas/OAR080/empty-security.json b/src/test/resources/checks/v31/schemas/OAR080/empty-security.json new file mode 100644 index 00000000..b7f31ef0 --- /dev/null +++ b/src/test/resources/checks/v31/schemas/OAR080/empty-security.json @@ -0,0 +1,31 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Sample API" + }, + "paths": { + "/users": { + "get": { # Noncompliant {{OAR080: The security scheme must be among those allowed by the organization and must be complete.}} + "summary": "Get all users", + "security": [], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/products": { + "post": { # Noncompliant {{OAR080: The security scheme must be among those allowed by the organization and must be complete.}} + "summary": "Create a new product", + "security": [], + "responses": { + "200": { + "description": "OK" + } + } + } + } + } +} diff --git a/src/test/resources/checks/v31/schemas/OAR080/empty-security.yaml b/src/test/resources/checks/v31/schemas/OAR080/empty-security.yaml new file mode 100644 index 00000000..8821cacf --- /dev/null +++ b/src/test/resources/checks/v31/schemas/OAR080/empty-security.yaml @@ -0,0 +1,19 @@ +openapi: 3.0.0 +info: + version: 1.0.0 + title: Sample API +paths: + /users: + get: # Noncompliant {{OAR080: The security scheme must be among those allowed by the organization and must be complete.}} + summary: Get all users + security: [] + responses: + '200': + description: OK + /products: + post: # Noncompliant {{OAR080: The security scheme must be among those allowed by the organization and must be complete.}} + summary: Create a new product + security: [] + responses: + '200': + description: OK diff --git a/src/test/resources/checks/v31/schemas/OAR080/global-security.json b/src/test/resources/checks/v31/schemas/OAR080/global-security.json new file mode 100644 index 00000000..645a4a88 --- /dev/null +++ b/src/test/resources/checks/v31/schemas/OAR080/global-security.json @@ -0,0 +1,53 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Sample API" + }, + "security": [ + { "apiKey": [] }, + { "oauth2": [] } + ], + "components": { + "securitySchemes": { + "oauth2": { + "type": "oauth2", + "flows": { + "implicit": { + "authorizationUrl": "https://example.com/oauth/authorize", + "scopes": { + "read": "Read access" + } + } + } + }, + "apiKey": { + "type": "apiKey", + "name": "X-API-Key", + "in": "header" + } + } + }, + "paths": { + "/users": { + "get": { + "summary": "Get all users", + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/products": { + "post": { + "summary": "Create a new product", + "responses": { + "200": { + "description": "OK" + } + } + } + } + } +} diff --git a/src/test/resources/checks/v31/schemas/OAR080/global-security.yaml b/src/test/resources/checks/v31/schemas/OAR080/global-security.yaml new file mode 100644 index 00000000..3205ed2a --- /dev/null +++ b/src/test/resources/checks/v31/schemas/OAR080/global-security.yaml @@ -0,0 +1,51 @@ +openapi: 3.0.0 +info: + version: 1.0.0 + title: Sample API +security: + - apiKey: [] + - oauth2: [] +components: + securitySchemes: + oauth2: + type: oauth2 + flows: + implicit: + authorizationUrl: https://example.com/oauth/authorize + scopes: + read: Read access + apiKey: + type: apiKey + name: X-API-Key + in: header +paths: + /users: + get: + summary: Get all users + responses: + '200': + description: OK + /products: + post: + summary: Create a new product + responses: + '200': + description: OK + /orders: + put: + summary: Update an order + responses: + '200': + description: OK + /invoices: + delete: + summary: Delete an invoice + responses: + '200': + description: OK + /items: + patch: + summary: Patch an item + responses: + '200': + description: OK diff --git a/src/test/resources/checks/v31/schemas/OAR080/with-security.json b/src/test/resources/checks/v31/schemas/OAR080/with-security.json new file mode 100644 index 00000000..1157cab0 --- /dev/null +++ b/src/test/resources/checks/v31/schemas/OAR080/with-security.json @@ -0,0 +1,71 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Sample API" + }, + "paths": { + "/users": { + "get": { + "summary": "Get all users", + "security": [ + { + "apiKey": [], + "oauth2": [] + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/products": { + "post": { + "summary": "Create a new product", + "security": [ + { + "oauth2": [], + "apiKey": [] + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/orders": { + "put": { # Noncompliant {{OAR080: The security scheme must be among those allowed by the organization and must be complete.}} + "summary": "Update an order", + "security": [ + { + "unknownScheme": [] + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/invoices": { + "delete": { # Noncompliant {{OAR080: The security scheme must be among those allowed by the organization and must be complete.}} + "summary": "Delete an invoice", + "security": [ + { + "unknownScheme": [] + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/schemas/OAR080/with-security.yaml b/src/test/resources/checks/v31/schemas/OAR080/with-security.yaml new file mode 100644 index 00000000..de18bc04 --- /dev/null +++ b/src/test/resources/checks/v31/schemas/OAR080/with-security.yaml @@ -0,0 +1,39 @@ +openapi: 3.0.0 +info: + version: 1.0.0 + title: Sample API +paths: + /users: + get: + summary: Get all users + security: + - apiKey: [] + - oauth2: [] + responses: + '200': + description: OK + /products: + post: + summary: Create a new product + security: + - apiKey: [] + - oauth2: [] + responses: + '200': + description: OK + /orders: + put: # Noncompliant {{OAR080: The security scheme must be among those allowed by the organization and must be complete.}} + summary: Update an order + security: + - unknownScheme: [] + responses: + '200': + description: OK + /invoices: + delete: # Noncompliant {{OAR080: The security scheme must be among those allowed by the organization and must be complete.}} + summary: Delete an invoice + security: + - unknownScheme: [] + responses: + '200': + description: OK \ No newline at end of file diff --git a/src/test/resources/checks/v31/schemas/OAR080/without-security.json b/src/test/resources/checks/v31/schemas/OAR080/without-security.json new file mode 100644 index 00000000..82430d79 --- /dev/null +++ b/src/test/resources/checks/v31/schemas/OAR080/without-security.json @@ -0,0 +1,69 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Sample API" + }, + "paths": { + "/users": { + "get": { # Noncompliant {{OAR080: The security scheme must be among those allowed by the organization and must be complete.}} + "summary": "Get all users", + "security": [ + { + "apiKey": [] + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/products": { + "post": { # Noncompliant {{OAR080: The security scheme must be among those allowed by the organization and must be complete.}} + "summary": "Create a new product", + "security": [ + { + "oauth2": [] + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/orders": { + "put": { # Noncompliant {{OAR080: The security scheme must be among those allowed by the organization and must be complete.}} + "summary": "Update an order", + "security": [ + { + "unknownScheme": [] + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/invoices": { + "delete": { # Noncompliant {{OAR080: The security scheme must be among those allowed by the organization and must be complete.}} + "summary": "Delete an invoice", + "security": [ + { + "unknownScheme": [] + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/schemas/OAR080/without-security.yaml b/src/test/resources/checks/v31/schemas/OAR080/without-security.yaml new file mode 100644 index 00000000..675f89b2 --- /dev/null +++ b/src/test/resources/checks/v31/schemas/OAR080/without-security.yaml @@ -0,0 +1,37 @@ +openapi: 3.0.0 +info: + version: 1.0.0 + title: Sample API +paths: + /users: + get: # Noncompliant {{OAR080: The security scheme must be among those allowed by the organization and must be complete.}} + summary: Get all users + security: + - apiKey: [] + responses: + '200': + description: OK + /products: + post: # Noncompliant {{OAR080: The security scheme must be among those allowed by the organization and must be complete.}} + summary: Create a new product + security: + - oauth2: [] + responses: + '200': + description: OK + /orders: + put: # Noncompliant {{OAR080: The security scheme must be among those allowed by the organization and must be complete.}} + summary: Update an order + security: + - unknownScheme: [] + responses: + '200': + description: OK + /invoices: + delete: # Noncompliant {{OAR080: The security scheme must be among those allowed by the organization and must be complete.}} + summary: Delete an invoice + security: + - unknownScheme: [] + responses: + '200': + description: OK \ No newline at end of file diff --git a/src/test/resources/checks/v31/schemas/OAR080/wrong-scheme.json b/src/test/resources/checks/v31/schemas/OAR080/wrong-scheme.json new file mode 100644 index 00000000..b042b2b4 --- /dev/null +++ b/src/test/resources/checks/v31/schemas/OAR080/wrong-scheme.json @@ -0,0 +1,54 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Sample API" + }, + "paths": { + "/users": { + "get": { # Noncompliant {{OAR080: The security scheme must be among those allowed by the organization and must be complete.}} + "summary": "Get all users", + "security": [ + { + "unknownScheme": [] + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/products": { + "post": { # Noncompliant {{OAR080: The security scheme must be among those allowed by the organization and must be complete.}} + "summary": "Create a new product", + "security": [ + { + "apiKey": [] + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/orders": { + "patch": { # Noncompliant {{OAR080: The security scheme must be among those allowed by the organization and must be complete.}} + "summary": "Patch an order", + "security": [ + { + "unknownScheme": [] + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + } + } +} diff --git a/src/test/resources/checks/v31/schemas/OAR080/wrong-scheme.yaml b/src/test/resources/checks/v31/schemas/OAR080/wrong-scheme.yaml new file mode 100644 index 00000000..86220d9f --- /dev/null +++ b/src/test/resources/checks/v31/schemas/OAR080/wrong-scheme.yaml @@ -0,0 +1,35 @@ +openapi: 3.0.0 +info: + version: 1.0.0 + title: Sample API +paths: + /users: + get: # Noncompliant {{OAR080: The security scheme must be among those allowed by the organization and must be complete.}} + summary: Get all users + security: + - unknownScheme: [] + responses: + '200': + description: OK + /products: + post: # Noncompliant {{OAR080: The security scheme must be among those allowed by the organization and must be complete.}} + summary: Create a new product + security: + - apiKey: [] + responses: + '200': + description: OK + /orders: + patch: # Noncompliant {{OAR080: The security scheme must be among those allowed by the organization and must be complete.}} + summary: Patch an order + security: + - unknownScheme: [] + responses: + '200': + description: OK + /items: + head: + summary: Head – non-security verb, ignored + responses: + '200': + description: OK diff --git a/src/test/resources/checks/v31/schemas/OAR108/invalid.json b/src/test/resources/checks/v31/schemas/OAR108/invalid.json new file mode 100644 index 00000000..3ce871c6 --- /dev/null +++ b/src/test/resources/checks/v31/schemas/OAR108/invalid.json @@ -0,0 +1,38 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "Ejemplo de API", + "version": "1.0.0" + }, + "paths": { + "/item": { + "get": { + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "nombre": { + "type": "string" + } + }, + "required": ["id", "nombre"] + }, + "example": { # Noncompliant {{OAR108: Schema does not match the provided example}} + "id": "hola", + "nombre": "Ejemplo" + } + } + } + } + } + } + } + } + } diff --git a/src/test/resources/checks/v31/schemas/OAR108/invalid.yaml b/src/test/resources/checks/v31/schemas/OAR108/invalid.yaml new file mode 100644 index 00000000..67c4fb32 --- /dev/null +++ b/src/test/resources/checks/v31/schemas/OAR108/invalid.yaml @@ -0,0 +1,25 @@ + openapi: 3.0.0 + info: + title: Ejemplo de API + version: 1.0.0 + paths: + /item: + get: + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + id: + type: integer + nombre: + type: string + required: + - id + - nombre + example: # Noncompliant {{OAR108: Schema does not match the provided example}} + id: hola123 + nombre: Ejemplo diff --git a/src/test/resources/checks/v31/schemas/OAR108/valid.json b/src/test/resources/checks/v31/schemas/OAR108/valid.json new file mode 100644 index 00000000..6a922454 --- /dev/null +++ b/src/test/resources/checks/v31/schemas/OAR108/valid.json @@ -0,0 +1,38 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "Ejemplo de API", + "version": "1.0.0" + }, + "paths": { + "/item": { + "get": { + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "id": { + "type": "number" + }, + "nombre": { + "type": "string" + } + }, + "required": ["id", "nombre"] + }, + "example": { + "id": 12.3, + "nombre": "Ejemplo" + } + } + } + } + } + } + } + } + } diff --git a/src/test/resources/checks/v31/schemas/OAR108/valid.yaml b/src/test/resources/checks/v31/schemas/OAR108/valid.yaml new file mode 100644 index 00000000..6c14d980 --- /dev/null +++ b/src/test/resources/checks/v31/schemas/OAR108/valid.yaml @@ -0,0 +1,47 @@ +openapi: 3.0.0 +info: + title: Ejemplo de API Ampliada + version: 1.0.0 +paths: + /item: + get: + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + id: + type: number + nombre: + type: string + activo: + type: boolean + configuracion: + type: object + properties: + tema: + type: string + notificaciones: + type: boolean + tags: + type: array + items: + type: string + proyectoNull: + type: string + nullable: true + required: + - id + - nombre + example: + id: 123.0 + nombre: Ejemplo + activo: false + configuracion: + tema: Oscuro + notificaciones: true + tags: ["api", "openapi"] + proyectoNull: null \ No newline at end of file diff --git a/src/test/resources/checks/v31/security/OAR001/with-servers.json b/src/test/resources/checks/v31/security/OAR001/with-servers.json new file mode 100644 index 00000000..14fb615b --- /dev/null +++ b/src/test/resources/checks/v31/security/OAR001/with-servers.json @@ -0,0 +1,15 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "servers" : [ + { + "url": "http://petstore.swagger.io/v1" # Noncompliant {{OAR001: Protocol https in server url is mandatory}} + } + ], + "paths" : { + "/pets" : { } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/security/OAR001/with-servers.yaml b/src/test/resources/checks/v31/security/OAR001/with-servers.yaml new file mode 100644 index 00000000..0827de6e --- /dev/null +++ b/src/test/resources/checks/v31/security/OAR001/with-servers.yaml @@ -0,0 +1,8 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +servers: + - url: http://petstore.swagger.io/v1 # Noncompliant {{OAR001: Protocol https in server url is mandatory}} +paths: + /pets: {} diff --git a/src/test/resources/checks/v31/security/OAR001/without-servers.json b/src/test/resources/checks/v31/security/OAR001/without-servers.json new file mode 100644 index 00000000..0bb90cf7 --- /dev/null +++ b/src/test/resources/checks/v31/security/OAR001/without-servers.json @@ -0,0 +1,10 @@ +{ # Noncompliant {{OAR001: Define 'servers' is mandatory}} + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/pets" : { } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/security/OAR001/without-servers.yaml b/src/test/resources/checks/v31/security/OAR001/without-servers.yaml new file mode 100644 index 00000000..a4233292 --- /dev/null +++ b/src/test/resources/checks/v31/security/OAR001/without-servers.yaml @@ -0,0 +1,7 @@ +# Noncompliant {{OAR001: Define 'servers' is mandatory}} +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: {} diff --git a/src/test/resources/checks/v31/security/OAR033/valid.json b/src/test/resources/checks/v31/security/OAR033/valid.json new file mode 100644 index 00000000..8315cce5 --- /dev/null +++ b/src/test/resources/checks/v31/security/OAR033/valid.json @@ -0,0 +1,52 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/pets": { + "get": { + "parameters": [ + { + "in": "header", + "name": "x-api-key", + "schema": { + "type": "string" + }, + "required": true + }, + { + "in": "header", + "name": "traceId", + "schema": { + "type": "string" + }, + "required": true + }, + { + "in": "header", + "name": "dateTime", + "schema": { + "type": "string" + }, + "required": true + }, + { + "in": "query", + "name": "Authorization", + "schema": { + "type": "string" + }, + "required": true + } + ], + "responses": { + "200": { + "description": "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/security/OAR033/valid.yaml b/src/test/resources/checks/v31/security/OAR033/valid.yaml new file mode 100644 index 00000000..87f75ec1 --- /dev/null +++ b/src/test/resources/checks/v31/security/OAR033/valid.yaml @@ -0,0 +1,31 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /petts: + parameters: + - in: header + name: x-api-key + schema: + type: string + required: true + - in: header + name: traceId + schema: + type: string + required: true + - in: header + name: dateTime + schema: + type: string + required: true + - in: query + name: Authorization + schema: + type: string + required: true + get: + responses: + 200: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v31/security/OAR033/with-forbidden-params.json b/src/test/resources/checks/v31/security/OAR033/with-forbidden-params.json new file mode 100644 index 00000000..ea0db738 --- /dev/null +++ b/src/test/resources/checks/v31/security/OAR033/with-forbidden-params.json @@ -0,0 +1,54 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "components": { + "parameters": { + "x-api-key": { + "in": "header", + "name": "x-api-key", + "schema": { + "type": "string" + }, + "required": true + }, + "accept": { + "in": "header", + "name": "Accept", # Noncompliant {{OAR033: Header not allowed}} + "schema": { + "type": "string" + }, + "required": true + } + } + }, + "paths": { + "/pets": { + "get": { + "parameters": [ + { + "$ref": "#/components/parameters/x-api-key" + }, + { + "$ref": "#/components/parameters/accept" + }, + { + "in": "header", + "name": "Authorization", # Noncompliant {{OAR033: Header not allowed}} + "schema": { + "type": "string" + }, + "required": true + } + ], + "responses": { + "200": { + "description": "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/security/OAR033/with-forbidden-params.yaml b/src/test/resources/checks/v31/security/OAR033/with-forbidden-params.yaml new file mode 100644 index 00000000..187dab95 --- /dev/null +++ b/src/test/resources/checks/v31/security/OAR033/with-forbidden-params.yaml @@ -0,0 +1,32 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +components: + parameters: + x-api-key: + in: header + name: x-api-key + schema: + type: string + required: true + accept: + in: header + name: Accept # Noncompliant {{OAR033: Header not allowed}} + schema: + type: string + required: true +paths: + /pets: + get: + parameters: + - $ref: '#/components/parameters/x-api-key' + - $ref: '#/components/parameters/accept' + - in: header + name: Authorization # Noncompliant {{OAR033: Header not allowed}} + schema: + type: string + required: true + responses: + 200: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v31/security/OAR033/without-required-params.json b/src/test/resources/checks/v31/security/OAR033/without-required-params.json new file mode 100644 index 00000000..27231df1 --- /dev/null +++ b/src/test/resources/checks/v31/security/OAR033/without-required-params.json @@ -0,0 +1,53 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "components": { + "parameters": { + "x-api-key": { + "in": "header", + "name": "x-api-key", + "schema": { + "type": "string" + }, + "required": true + }, + "traceId": { + "in": "header", + "name": "traceId", + "schema": { + "type": "string" + }, + "required": true + } + } + }, + "paths": { + "/pets": { + "parameters": [ + { + "$ref": "#/components/parameters/traceId" + } + ], + "get": { # Noncompliant {{OAR033: Headers [x-api-key] are required}} + "parameters": [ + { + "in": "header", + "name": "dateTime", + "schema": { + "type": "string" + }, + "required": true + } + ], + "responses": { + "200": { + "description": "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/security/OAR033/without-required-params.yaml b/src/test/resources/checks/v31/security/OAR033/without-required-params.yaml new file mode 100644 index 00000000..ff8b0fc6 --- /dev/null +++ b/src/test/resources/checks/v31/security/OAR033/without-required-params.yaml @@ -0,0 +1,32 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +components: + parameters: + x-api-key: + in: header + name: x-api-key + schema: + type: string + required: true + traceId: + in: header + name: traceId + schema: + type: string + required: true +paths: + /pets: + parameters: + - $ref: '#/components/parameters/traceId' + get: # Noncompliant {{OAR033: Headers [x-api-key] are required}} + parameters: + - in: header + name: dateTime + schema: + type: string + required: true + responses: + 200: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v31/security/OAR035/valid.json b/src/test/resources/checks/v31/security/OAR035/valid.json new file mode 100644 index 00000000..c45fbe9a --- /dev/null +++ b/src/test/resources/checks/v31/security/OAR035/valid.json @@ -0,0 +1,117 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "components": { + "securitySchemes": { + "BasicAuth": { + "type": "http", + "scheme": "basic" + }, + "BearerAuth": { + "type": "http", + "scheme": "bearer" + }, + "ApiKeyAuth": { + "type": "apiKey", + "in": "header", + "name": "X-API-Key" + }, + "OpenID": { + "type": "openIdConnect", + "openIdConnectUrl": "https://example.com/.well-known/openid-configuration" + }, + "OAuth2": { + "type": "oauth2", + "flows": { + "authorizationCode": { + "authorizationUrl": "https://example.com/oauth/authorize", + "tokenUrl": "https://example.com/oauth/token", + "scopes": { + "read": "Grants read access", + "write": "Grants write access", + "admin": "Grants access to admin operations" + } + } + } + } + } + }, + "paths": { + "/with-auth-and-header": { + "get": { + "parameters": [ + { + "in": "header", + "name": "x-api-key", + "schema": { + "type": "string" + } + } + ], + "security": [ + { + "ApiKeyAuth": [ + + ] + }, + { + "OAuth2": [ + "read", + "write" + ] + } + ], + "responses": { + "200": { + "description": "Ok" + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + }, + "429": { + "description": "Forbidden" + } + } + } + }, + "/with-header": { + "parameters": [ + { + "in": "header", + "name": "x-api-key", + "schema": { + "type": "string" + } + } + ], + "get": { + "responses": { + "200": { + "description": "Ok" + }, + "401": { + "description": "Unauthorized" + }, + "429": { + "description": "Unauthorized" + } + } + } + }, + "/without": { + "get": { + "responses": { + "200": { + "description": "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/security/OAR035/valid.yaml b/src/test/resources/checks/v31/security/OAR035/valid.yaml new file mode 100644 index 00000000..4ada663f --- /dev/null +++ b/src/test/resources/checks/v31/security/OAR035/valid.yaml @@ -0,0 +1,70 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +components: + securitySchemes: + BasicAuth: + type: http + scheme: basic + BearerAuth: + type: http + scheme: bearer + ApiKeyAuth: + type: apiKey + in: header + name: X-API-Key + OpenID: + type: openIdConnect + openIdConnectUrl: https://example.com/.well-known/openid-configuration + OAuth2: + type: oauth2 + flows: + authorizationCode: + authorizationUrl: https://example.com/oauth/authorize + tokenUrl: https://example.com/oauth/token + scopes: + read: Grants read access + write: Grants write access + admin: Grants access to admin operations +paths: + /with-auth-and-header: + get: + parameters: + - in: header + name: x-api-key + schema: + type: string + security: + - ApiKeyAuth: [] + - OAuth2: + - read + - write + responses: + 200: + description: Ok + 401: + description: Unauthorized + 403: + description: Forbidden + 429: + description: Forbidden + /with-header: + parameters: + - in: header + name: x-api-key + schema: + type: string + get: + responses: + 200: + description: Ok + 401: + description: Unauthorized + 429: + description: Unauthorized + /without: + get: + responses: + 200: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v31/security/OAR035/without-authorization-responses.json b/src/test/resources/checks/v31/security/OAR035/without-authorization-responses.json new file mode 100644 index 00000000..cf9d9e5c --- /dev/null +++ b/src/test/resources/checks/v31/security/OAR035/without-authorization-responses.json @@ -0,0 +1,100 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "components": { + "securitySchemes": { + "BasicAuth": { + "type": "http", + "scheme": "basic" + }, + "BearerAuth": { + "type": "http", + "scheme": "bearer" + }, + "ApiKeyAuth": { + "type": "apiKey", + "in": "header", + "name": "X-API-Key" + }, + "OpenID": { + "type": "openIdConnect", + "openIdConnectUrl": "https://example.com/.well-known/openid-configuration" + }, + "OAuth2": { + "type": "oauth2", + "flows": { + "authorizationCode": { + "authorizationUrl": "https://example.com/oauth/authorize", + "tokenUrl": "https://example.com/oauth/token", + "scopes": { + "read": "Grants read access", + "write": "Grants write access", + "admin": "Grants access to admin operations" + } + } + } + } + } + }, + "paths": { + "/with-auth-and-header": { + "get": { + "parameters": [ + { + "in": "header", + "name": "x-api-key", + "schema": { + "type": "string" + } + } + ], + "security": [ + { + "ApiKeyAuth": [] + }, + { + "OAuth2": [ + "read", + "write" + ] + } + ], + "responses": { # Noncompliant {{OAR035: Response code 401 must be defined for operations with security schemes defined}} + "200": { + "description": "Ok" + } + } + } + }, + "/with-header": { + "parameters": [ + { + "in": "header", + "name": "x-api-key", + "schema": { + "type": "string" + } + } + ], + "get": { + "responses": { + "200": { + "description": "Ok" + } + } + } + }, + "/without": { + "get": { + "responses": { + "200": { + "description": "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/security/OAR035/without-authorization-responses.yaml b/src/test/resources/checks/v31/security/OAR035/without-authorization-responses.yaml new file mode 100644 index 00000000..b03ad2df --- /dev/null +++ b/src/test/resources/checks/v31/security/OAR035/without-authorization-responses.yaml @@ -0,0 +1,62 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +components: + securitySchemes: + BasicAuth: + type: http + scheme: basic + BearerAuth: + type: http + scheme: bearer + ApiKeyAuth: + type: apiKey + in: header + name: X-API-Key + OpenID: + type: openIdConnect + openIdConnectUrl: https://example.com/.well-known/openid-configuration + OAuth2: + type: oauth2 + flows: + authorizationCode: + authorizationUrl: https://example.com/oauth/authorize + tokenUrl: https://example.com/oauth/token + scopes: + read: Grants read access + write: Grants write access + admin: Grants access to admin operations +security: + - ApiKeyAuth: [] + - OAuth2: + - read + - write +paths: + /with-auth-and-header: + get: + parameters: + - in: header + name: x-api-key + schema: + type: string + responses: # Noncompliant {{OAR035: Response code 401 must be defined for operations with security schemes defined}} + 200: + description: Ok + + /with-header: + parameters: + - in: header + name: x-api-key + schema: + type: string + get: + responses: # Noncompliant {{OAR035: Response code 401 must be defined for operations with security schemes defined}} + 200: + description: Ok + + /without: + get: + responses: # Noncompliant {{OAR035: Response code 401 must be defined for operations with security schemes defined}} + 200: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v31/security/OAR036/valid.json b/src/test/resources/checks/v31/security/OAR036/valid.json new file mode 100644 index 00000000..bead835f --- /dev/null +++ b/src/test/resources/checks/v31/security/OAR036/valid.json @@ -0,0 +1,26 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/pets": { + "get": { + "parameters": [ { + "in": "header", + "name": "X-Authorization", + "schema": { + "type": "string" + }, + "required": true + } ], + "responses": { + "200": { + "description": "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/security/OAR036/valid.yaml b/src/test/resources/checks/v31/security/OAR036/valid.yaml new file mode 100644 index 00000000..23afab6a --- /dev/null +++ b/src/test/resources/checks/v31/security/OAR036/valid.yaml @@ -0,0 +1,16 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: + get: + parameters: + - in: header + name: X-Authorization + schema: + type: string + required: true + responses: + 200: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v31/security/OAR036/with-cookie.json b/src/test/resources/checks/v31/security/OAR036/with-cookie.json new file mode 100644 index 00000000..9d79650a --- /dev/null +++ b/src/test/resources/checks/v31/security/OAR036/with-cookie.json @@ -0,0 +1,42 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/pets": { + "parameters": [ { + "in": "header", + "name": "Cookie", # Noncompliant {{OAR036: Cookie use is forbidden as a session mechanism}} + "schema": { + "type": "string" + }, + "required": true + } ], + "get": { + "parameters": [ { + "in": "header", + "name": "Cookie", # Noncompliant {{OAR036: Cookie use is forbidden as a session mechanism}} + "schema": { + "type": "string" + }, + "required": true + } ], + "responses": { + "200": { + "description": "Ok", + "headers": { + "Set-Cookie": { # Noncompliant {{OAR036: Cookie use is forbidden as a session mechanism}} + "schema": { + "type": "string" + }, + "description": "session" + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/security/OAR036/with-cookie.yaml b/src/test/resources/checks/v31/security/OAR036/with-cookie.yaml new file mode 100644 index 00000000..e6b279f4 --- /dev/null +++ b/src/test/resources/checks/v31/security/OAR036/with-cookie.yaml @@ -0,0 +1,27 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: + parameters: + - in: header + name: Cookie # Noncompliant {{OAR036: Cookie use is forbidden as a session mechanism}} + schema: + type: string + required: true + get: + parameters: + - in: header + name: Cookie # Noncompliant {{OAR036: Cookie use is forbidden as a session mechanism}} + schema: + type: string + required: true + responses: + 200: + description: Ok + headers: + Set-Cookie: # Noncompliant {{OAR036: Cookie use is forbidden as a session mechanism}} + schema: + type: string + description: session \ No newline at end of file diff --git a/src/test/resources/checks/v31/security/OAR045/defined-response.json b/src/test/resources/checks/v31/security/OAR045/defined-response.json new file mode 100644 index 00000000..f86d6ac4 --- /dev/null +++ b/src/test/resources/checks/v31/security/OAR045/defined-response.json @@ -0,0 +1,78 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/pets": { + "get": { + "responses": { + "200": { + "description": "some response" // Noncompliant {{OAR045: Define the model of your response}} + }, + "202": { + "description": "some response", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + }, + "401": { // Noncompliant {{OAR045: Define the model of your response}} + "description": "error response", + "$ref": "#/components/responses/MyErroneousResponse" + } + } + }, + "post": { + "responses": {} // Noncompliant {{OAR045: Define the responses of your operations}} + }, + "put": { + "responses": { + "default": { + "description": "default response", + "content": { + "application/json": { + "schema": { + "type": "object" + } + } + } + }, + "200": { // Noncompliant {{OAR045: Define the model of your response}} + "description": "success response" + } + } + } + }, + "/other": { + "delete": { + "responses": { + "204": { + "description": "No content" + } + } + } + } + }, + "components": { + "responses": { + "MyErroneousResponse": { + "description": "an example response missing a model" + }, + "MyOtherResponse": { + "description": "some response", + "content": { + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } +} diff --git a/src/test/resources/checks/v31/security/OAR045/defined-response.yaml b/src/test/resources/checks/v31/security/OAR045/defined-response.yaml new file mode 100644 index 00000000..4370ac6c --- /dev/null +++ b/src/test/resources/checks/v31/security/OAR045/defined-response.yaml @@ -0,0 +1,48 @@ +openapi: 3.0.0 +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: + get: + responses: + # Noncompliant@+1 {{OAR045: Define the model of your response}} + '200': + description: some response + '202': + description: some response + content: + application/json: + schema: + type: string + '401': # Noncompliant {{OAR045: Define the model of your response}} + description: error response + $ref: '#/components/responses/MyErroneousResponse' + post: + # Noncompliant@+1 {{OAR045: Define the responses of your operations}} + responses: {} + put: + responses: + default: + description: default response + content: + application/json: + schema: + type: object + '200': # Noncompliant {{OAR045: Define the model of your response}} + description: success response + /other: + delete: + responses: + '204': + description: No content +components: + responses: + MyErroneousResponse: + description: an example response missing a model + MyOtherResponse: + description: some response + content: + application/json: + schema: + type: object diff --git a/src/test/resources/checks/v31/security/OAR053/valid.json b/src/test/resources/checks/v31/security/OAR053/valid.json new file mode 100644 index 00000000..774ea388 --- /dev/null +++ b/src/test/resources/checks/v31/security/OAR053/valid.json @@ -0,0 +1,42 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "components": { + "responses": { + "PetsResponse": { + "description": "OK", + "headers": { + "x-trace-id": { + "schema": { + "type": "string" + } + } + } + } + } + }, + "paths": { + "/pets": { + "get": { + "responses": { + "200": { + "$ref": "#/components/responses/PetsResponse" + }, + "400": { + "description": "Bad Request", + "headers": { + "x-trace-id": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/security/OAR053/valid.yaml b/src/test/resources/checks/v31/security/OAR053/valid.yaml new file mode 100644 index 00000000..bfda5f93 --- /dev/null +++ b/src/test/resources/checks/v31/security/OAR053/valid.yaml @@ -0,0 +1,26 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore + +components: + responses: + PetsResponse: + description: OK + headers: + x-trace-id: + schema: + type: string + +paths: + /pets: + get: + responses: + '200': + $ref: '#/components/responses/PetsResponse' + '400': + description: Bad Request + headers: + x-trace-id: + schema: + type: string \ No newline at end of file diff --git a/src/test/resources/checks/v31/security/OAR054/valid.json b/src/test/resources/checks/v31/security/OAR054/valid.json new file mode 100644 index 00000000..2f45e288 --- /dev/null +++ b/src/test/resources/checks/v31/security/OAR054/valid.json @@ -0,0 +1,19 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "servers": [ + { + "url": "https://api-dev.apiaddicts.org/api-vehicular/v1/" + }, + { + "url": "https://api-test.apiaddicts.org/api-vehicular/v1/" + }, + { + "url": "https://api.apiaddicts.org/api-vehicular/v1/" + } + ], + "paths": { } +} diff --git a/src/test/resources/checks/v31/security/OAR054/valid.yaml b/src/test/resources/checks/v31/security/OAR054/valid.yaml new file mode 100644 index 00000000..a87e4212 --- /dev/null +++ b/src/test/resources/checks/v31/security/OAR054/valid.yaml @@ -0,0 +1,9 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +servers: + - url: https://api-dev.apiaddicts.org/api-vehicular/v1/ + - url: https://api-test.apiaddicts.org/api-vehicular/v1/ + - url: https://api.apiaddicts.org/api-vehicular/v1/ +paths: {} diff --git a/src/test/resources/checks/v31/security/OAR072/no-stack-trace.json b/src/test/resources/checks/v31/security/OAR072/no-stack-trace.json new file mode 100644 index 00000000..929b4279 --- /dev/null +++ b/src/test/resources/checks/v31/security/OAR072/no-stack-trace.json @@ -0,0 +1,47 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "Compliant API", + "version": "1.0.0" + }, + "paths": { + "/example": { + "get": { + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "maxLength": 100 + } + } + } + } + } + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "maxLength": 100 + } + } + } + } + } + } + } + } + } + } + } \ No newline at end of file diff --git a/src/test/resources/checks/v31/security/OAR072/no-stack-trace.yaml b/src/test/resources/checks/v31/security/OAR072/no-stack-trace.yaml new file mode 100644 index 00000000..9c5c83f1 --- /dev/null +++ b/src/test/resources/checks/v31/security/OAR072/no-stack-trace.yaml @@ -0,0 +1,36 @@ +openapi: 3.0.0 +info: + title: Sample API + version: 1.0.0 +paths: + /sample: + get: + responses: + '200': + description: Successful operation + content: + application/json: + schema: + type: object + properties: + id: + type: integer + format: int64 + name: + type: string + status: + type: string + '400': + description: Bad request + content: + application/json: + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: string \ No newline at end of file diff --git a/src/test/resources/checks/v31/security/OAR072/with-stack-trace.json b/src/test/resources/checks/v31/security/OAR072/with-stack-trace.json new file mode 100644 index 00000000..35468a59 --- /dev/null +++ b/src/test/resources/checks/v31/security/OAR072/with-stack-trace.json @@ -0,0 +1,62 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "Sample API", + "version": "1.0.0" + }, + "paths": { + "/sample": { + "get": { + "responses": { + "200": { + "description": "Successful operation", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "name": { + "type": "string" + }, + "status": { + "type": "string" + } + } + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + }, + "details": { + "type": "string" + }, + "stackTrace": { # Noncompliant {{OAR072: Non OK responses shouldnt have stackTraces}} + "type": "string" + } + } + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/security/OAR072/with-stack-trace.yaml b/src/test/resources/checks/v31/security/OAR072/with-stack-trace.yaml new file mode 100644 index 00000000..8d1fcadf --- /dev/null +++ b/src/test/resources/checks/v31/security/OAR072/with-stack-trace.yaml @@ -0,0 +1,40 @@ +openapi: 3.0.0 +info: + title: Sample API + version: 1.0.0 +paths: + /sample: + get: + responses: + '201': + description: Successful operation + content: + application/json: + schema: + type: object + properties: + id: + type: integer + format: int64 + name: + type: string + status: + type: string + stackTrace: + type: string + '400': + description: Bad request + content: + application/json: + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: string + stackTrace: # Noncompliant {{OAR072: Non OK responses shouldnt have stackTraces}} + type: string \ No newline at end of file diff --git a/src/test/resources/checks/v31/security/OAR074/no-restrictions.json b/src/test/resources/checks/v31/security/OAR074/no-restrictions.json new file mode 100644 index 00000000..4d6b726c --- /dev/null +++ b/src/test/resources/checks/v31/security/OAR074/no-restrictions.json @@ -0,0 +1,35 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "My API" + }, + "paths": { + "/items": { + "get": { + "summary": "Get a list of items", + "parameters": [ + { + "name": "param1", + "in": "query", + "schema": { + "type": "integer" # Noncompliant {{OAR074: Numeric parameters should have minimum, maximum, or format restriction}} + } + }, + { + "name": "param2", + "in": "query", + "schema": { + "type": "number" # Noncompliant {{OAR074: Numeric parameters should have minimum, maximum, or format restriction}} + } + } + ], + "responses": { + "200": { + "description": "A list of items" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/security/OAR074/no-restrictions.yaml b/src/test/resources/checks/v31/security/OAR074/no-restrictions.yaml new file mode 100644 index 00000000..91fea43c --- /dev/null +++ b/src/test/resources/checks/v31/security/OAR074/no-restrictions.yaml @@ -0,0 +1,20 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: My API +paths: + /items: + get: + summary: Get a list of items + parameters: + - name: param1 + in: query + schema: + type: integer # Noncompliant {{OAR074: Numeric parameters should have minimum, maximum, or format restriction}} + - name: param2 + in: query + schema: + type: number # Noncompliant {{OAR074: Numeric parameters should have minimum, maximum, or format restriction}} + responses: + 200: + description: A list of items \ No newline at end of file diff --git a/src/test/resources/checks/v31/security/OAR074/with-restrictions.json b/src/test/resources/checks/v31/security/OAR074/with-restrictions.json new file mode 100644 index 00000000..02a94a5f --- /dev/null +++ b/src/test/resources/checks/v31/security/OAR074/with-restrictions.json @@ -0,0 +1,40 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "My API" + }, + "paths": { + "/items": { + "get": { + "summary": "Get a list of items", + "parameters": [ + { + "name": "param1", + "in": "query", + "schema": { + "type": "integer", + "minimum": 1, + "maximum": 100, + "format": "double" + } + }, + { + "name": "param2", + "in": "query", + "schema": { + "type": "number", + "minimum": 1, + "maximum": 100 + } + } + ], + "responses": { + "200": { + "description": "A list of items" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/security/OAR074/with-restrictions.yaml b/src/test/resources/checks/v31/security/OAR074/with-restrictions.yaml new file mode 100644 index 00000000..65e43fea --- /dev/null +++ b/src/test/resources/checks/v31/security/OAR074/with-restrictions.yaml @@ -0,0 +1,26 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: My API +paths: + /items: + get: + summary: Get a list of items + parameters: + - name: param1 + in: query + schema: + type: integer + minimum: 1 + maximum: 100 + format: double + - name: param2 + in: query + schema: + type: number + minimum: 1 + maximum: 100 + format: double + responses: + 200: + description: A list of items \ No newline at end of file diff --git a/src/test/resources/checks/v31/security/OAR075/no-restrictions.json b/src/test/resources/checks/v31/security/OAR075/no-restrictions.json new file mode 100644 index 00000000..1c260f41 --- /dev/null +++ b/src/test/resources/checks/v31/security/OAR075/no-restrictions.json @@ -0,0 +1,28 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "API sin restricciones", + "version": "1.0.0" + }, + "paths": { + "/users/{id}": { + "get": { + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" # Noncompliant {{OAR075: String parameters should have minLength, maxLength, pattern (regular expression), or enum restriction that are defined in the properties}} + } + } + ], + "responses": { + "200": { + "description": "Un usuario" + } + } + } + } + } + } \ No newline at end of file diff --git a/src/test/resources/checks/v31/security/OAR075/no-restrictions.yaml b/src/test/resources/checks/v31/security/OAR075/no-restrictions.yaml new file mode 100644 index 00000000..067bbe64 --- /dev/null +++ b/src/test/resources/checks/v31/security/OAR075/no-restrictions.yaml @@ -0,0 +1,16 @@ +openapi: 3.0.0 +info: + title: API sin restricciones + version: 1.0.0 +paths: + /users/{id}: + get: + parameters: + - name: id + in: path + required: true + schema: + type: string # Noncompliant {{OAR075: String parameters should have minLength, maxLength, pattern (regular expression), or enum restriction that are defined in the properties}} + responses: + '200': + description: Un usuario \ No newline at end of file diff --git a/src/test/resources/checks/v31/security/OAR075/with-restrictions.json b/src/test/resources/checks/v31/security/OAR075/with-restrictions.json new file mode 100644 index 00000000..b27eda32 --- /dev/null +++ b/src/test/resources/checks/v31/security/OAR075/with-restrictions.json @@ -0,0 +1,32 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "API con restricciones", + "version": "1.0.0" + }, + "paths": { + "/users/{id}": { + "get": { + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "minLength": 5, + "maxLength": 120, + "format": "date", + "enum": ["admin", "user", "guest"] + } + } + ], + "responses": { + "200": { + "description": "Un usuario" + } + } + } + } + } + } \ No newline at end of file diff --git a/src/test/resources/checks/v31/security/OAR075/with-restrictions.yaml b/src/test/resources/checks/v31/security/OAR075/with-restrictions.yaml new file mode 100644 index 00000000..69aadfff --- /dev/null +++ b/src/test/resources/checks/v31/security/OAR075/with-restrictions.yaml @@ -0,0 +1,20 @@ +openapi: 3.0.0 +info: + title: API con restricciones + version: 1.0.0 +paths: + /users/{id}: + get: + parameters: + - name: id + in: path + required: true + schema: + type: string + minLength: 5 + maxLength: 120 + format: date + enum: ['admin', 'user', 'guest'] + responses: + '200': + description: Un usuario \ No newline at end of file diff --git a/src/test/resources/checks/v31/security/OAR076/nested.json b/src/test/resources/checks/v31/security/OAR076/nested.json new file mode 100644 index 00000000..b02da78c --- /dev/null +++ b/src/test/resources/checks/v31/security/OAR076/nested.json @@ -0,0 +1,40 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/invoices": { + "get": { + "responses": { + "200": { + "description": "A invoice.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "price": { + "type": "number", + "format": "double" + }, + "nested": { + "type": "object", + "properties": { + "value": { + "type": "number", # Noncompliant {{OAR076: Numeric types requires a valid format}} + "format": "int64" + } + } + } + } + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/security/OAR076/nested.yaml b/src/test/resources/checks/v31/security/OAR076/nested.yaml new file mode 100644 index 00000000..f0607065 --- /dev/null +++ b/src/test/resources/checks/v31/security/OAR076/nested.yaml @@ -0,0 +1,25 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /invoices: + get: + responses: + 200: + description: A invoice. + content: + application/json: + schema: + type: object + properties: + price: + type: number + format: double + nested: + type: object + properties: + value: + type: number # Noncompliant {{OAR076: Numeric types requires a valid format}} + format: int64 + diff --git a/src/test/resources/checks/v31/security/OAR076/plain.json b/src/test/resources/checks/v31/security/OAR076/plain.json new file mode 100644 index 00000000..b41cd0e8 --- /dev/null +++ b/src/test/resources/checks/v31/security/OAR076/plain.json @@ -0,0 +1,42 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/invoices": { + "get": { + "responses": { + "200": { + "description": "A invoice.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "id": { + "type": "integer" # Noncompliant {{OAR076: Numeric types requires a valid format}} + }, + "product_id": { + "type": "integer", # Noncompliant {{OAR076: Numeric types requires a valid format}} + "format": "int128" + }, + "line": { + "type": "number", # Noncompliant {{OAR076: Numeric types requires a valid format}} + "format": "int32" + }, + "price": { + "type": "number", + "format": "double" + } + } + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/security/OAR076/plain.yaml b/src/test/resources/checks/v31/security/OAR076/plain.yaml new file mode 100644 index 00000000..8128fb01 --- /dev/null +++ b/src/test/resources/checks/v31/security/OAR076/plain.yaml @@ -0,0 +1,27 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /invoices: + get: + responses: + 200: + description: A invoice. + content: + application/json: + schema: + type: object + properties: + id: + type: integer # Noncompliant {{OAR076: Numeric types requires a valid format}} + product_id: + type: integer # Noncompliant {{OAR076: Numeric types requires a valid format}} + format: int128 + line: + type: number # Noncompliant {{OAR076: Numeric types requires a valid format}} + format: int32 + price: + type: number + format: double + diff --git a/src/test/resources/checks/v31/security/OAR076/with-$ref.json b/src/test/resources/checks/v31/security/OAR076/with-$ref.json new file mode 100644 index 00000000..f2c2d7c8 --- /dev/null +++ b/src/test/resources/checks/v31/security/OAR076/with-$ref.json @@ -0,0 +1,47 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/invoices": { + "get": { + "responses": { + "200": { + "description": "A invoice.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "price": { + "type": "number", + "format": "double" + }, + "nested": { + "$ref": "#/components/schemas/nested" + } + } + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "nested": { + "type": "object", + "properties": { + "value": { + "type": "number", # Noncompliant {{OAR076: Numeric types requires a valid format}} + "format": "int64" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/security/OAR076/with-$ref.yaml b/src/test/resources/checks/v31/security/OAR076/with-$ref.yaml new file mode 100644 index 00000000..3f3e2db7 --- /dev/null +++ b/src/test/resources/checks/v31/security/OAR076/with-$ref.yaml @@ -0,0 +1,29 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /invoices: + get: + responses: + 200: + description: A invoice. + content: + application/json: + schema: + type: object + properties: + price: + type: number + format: double + nested: + $ref: '#/components/schemas/nested' + +components: + schemas: + nested: + type: object + properties: + value: + type: number # Noncompliant {{OAR076: Numeric types requires a valid format}} + format: int64 diff --git a/src/test/resources/checks/v31/security/OAR078/no-security.json b/src/test/resources/checks/v31/security/OAR078/no-security.json new file mode 100644 index 00000000..74770f90 --- /dev/null +++ b/src/test/resources/checks/v31/security/OAR078/no-security.json @@ -0,0 +1,54 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Sample API" + }, + "components": { + "securitySchemes": { + "apiKey": { + "type": "apiKey", + "name": "X-API-Key", + "in": "header" + } + } + }, + "paths": { + "/users": { + "get": { # Noncompliant {{OAR078: All API methods must have security}} + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/products": { + "post": { # Noncompliant {{OAR078: All API methods must have security}} + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/orders": { + "put": { # Noncompliant {{OAR078: All API methods must have security}} + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/invoices": { + "delete": { # Noncompliant {{OAR078: All API methods must have security}} + "responses": { + "200": { + "description": "OK" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/security/OAR078/no-security.yaml b/src/test/resources/checks/v31/security/OAR078/no-security.yaml new file mode 100644 index 00000000..005c2fbc --- /dev/null +++ b/src/test/resources/checks/v31/security/OAR078/no-security.yaml @@ -0,0 +1,33 @@ +openapi: 3.0.0 +info: + version: 1.0.0 + title: Sample API +components: + securitySchemes: + apiKey: + type: apiKey + name: X-API-Key + in: header +paths: + /users: + get: # Noncompliant {{OAR078: All API methods must have security}} + responses: + '200': + description: OK + /products: + post: # Noncompliant {{OAR078: All API methods must have security}} + responses: + '200': + description: OK + + /orders: + put: # Noncompliant {{OAR078: All API methods must have security}} + responses: + '200': + description: OK + + /invoices: + delete: # Noncompliant {{OAR078: All API methods must have security}} + responses: + '200': + description: OK diff --git a/src/test/resources/checks/v31/security/OAR078/with-security.json b/src/test/resources/checks/v31/security/OAR078/with-security.json new file mode 100644 index 00000000..dd025133 --- /dev/null +++ b/src/test/resources/checks/v31/security/OAR078/with-security.json @@ -0,0 +1,74 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Sample API" + }, + "paths": { + "/users": { + "get": { + "security": [ + { + "apiKey": [] + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/products": { + "post": { + "security": [ + { + "apiKey": [] + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/orders": { + "put": { + "security": [ + { + "apiKey": [] + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/invoices": { + "delete": { + "security": [ + { + "apiKey": [] + } + ], + "responses": { + "200": { + "description": "OK esto a json" + } + } + } + } + }, + "components": { + "securitySchemes": { + "apiKey": { + "type": "apiKey", + "name": "X-API-Key", + "in": "header" + } + } + } + } \ No newline at end of file diff --git a/src/test/resources/checks/v31/security/OAR078/with-security.yaml b/src/test/resources/checks/v31/security/OAR078/with-security.yaml new file mode 100644 index 00000000..c591c997 --- /dev/null +++ b/src/test/resources/checks/v31/security/OAR078/with-security.yaml @@ -0,0 +1,49 @@ +openapi: 3.0.0 +info: + title: Sample API + version: 1.0.0 +servers: + - url: https://api.example.com/v1 + +# Definición de seguridad global +security: + - apiKeyHeader: [] + +paths: + /items: + get: # Verb 'get' sin definición de seguridad local + summary: Get all items + responses: + '200': + description: Successful response + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Item' + post: # Verb 'post' sin definición de seguridad local + summary: Create an item + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Item' + responses: + '201': + description: Item created + +components: + schemas: + Item: + type: object + properties: + id: + type: string + name: + type: string + securitySchemes: + apiKeyHeader: + type: apiKey + in: header + name: X-API-Key \ No newline at end of file diff --git a/src/test/resources/checks/v31/security/OAR079/bad-request404.json b/src/test/resources/checks/v31/security/OAR079/bad-request404.json new file mode 100644 index 00000000..751268d5 --- /dev/null +++ b/src/test/resources/checks/v31/security/OAR079/bad-request404.json @@ -0,0 +1,42 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths": { + "/items": { + "get": { + "summary": "Get a list of items", + "parameters": [ + { + "name": "param1", + "in": "path", + "required": false, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "A list of items", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + }, + "404": { + "description": "Bad Request" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/security/OAR079/bad-request404.yaml b/src/test/resources/checks/v31/security/OAR079/bad-request404.yaml new file mode 100644 index 00000000..53082801 --- /dev/null +++ b/src/test/resources/checks/v31/security/OAR079/bad-request404.yaml @@ -0,0 +1,25 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /items: + get: + summary: Get a list of items + parameters: + - name: param1 + in: path + required: false + schema: + type: string + responses: + 200: + description: A list of items + content: + application/json: + schema: + type: array + items: + type: string + 404: + description: Bad Request \ No newline at end of file diff --git a/src/test/resources/checks/v31/security/OAR079/no-bad-request404.json b/src/test/resources/checks/v31/security/OAR079/no-bad-request404.json new file mode 100644 index 00000000..be422fe0 --- /dev/null +++ b/src/test/resources/checks/v31/security/OAR079/no-bad-request404.json @@ -0,0 +1,38 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths": { + "/example1": { + "get": { + "parameters": [ + { + "name": "param1", + "in": "path", + "required": false, + "schema": { + "type": "string" + } + } + ], + "responses": { # Noncompliant {{OAR079: Paths parameters, should have not found (404) response}} + "200": { + "description": "A list of items", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + } + } + } + } + } \ No newline at end of file diff --git a/src/test/resources/checks/v31/security/OAR079/no-bad-request404.yaml b/src/test/resources/checks/v31/security/OAR079/no-bad-request404.yaml new file mode 100644 index 00000000..0cbefaf9 --- /dev/null +++ b/src/test/resources/checks/v31/security/OAR079/no-bad-request404.yaml @@ -0,0 +1,22 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /status: + get: + parameters: + - name: param1 + in: path + required: false + schema: + type: string + responses: + 200: + description: A list of items + content: + application/json: + schema: + type: array + items: + type: string diff --git a/src/test/resources/checks/v31/security/OAR079/no-parameters.json b/src/test/resources/checks/v31/security/OAR079/no-parameters.json new file mode 100644 index 00000000..9d39ba8a --- /dev/null +++ b/src/test/resources/checks/v31/security/OAR079/no-parameters.json @@ -0,0 +1,19 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/items": { + "get": { + "summary": "Get a list of items", + "responses": { + "200": { + "description": "A list of items" + } + } + } + } + } +} diff --git a/src/test/resources/checks/v31/security/OAR079/no-parameters.yaml b/src/test/resources/checks/v31/security/OAR079/no-parameters.yaml new file mode 100644 index 00000000..f220c16c --- /dev/null +++ b/src/test/resources/checks/v31/security/OAR079/no-parameters.yaml @@ -0,0 +1,11 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /items: + get: + summary: Get a list of items + responses: + 200: + description: A list of items diff --git a/src/test/resources/checks/v31/security/OAR079/query-param-only.json b/src/test/resources/checks/v31/security/OAR079/query-param-only.json new file mode 100644 index 00000000..ad428c6b --- /dev/null +++ b/src/test/resources/checks/v31/security/OAR079/query-param-only.json @@ -0,0 +1,26 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/items": { + "get": { + "summary": "Get a list of items", + "parameters": [ + { + "name": "param1", + "in": "query", + "schema": { "type": "string" } + } + ], + "responses": { + "200": { + "description": "A list of items" + } + } + } + } + } +} diff --git a/src/test/resources/checks/v31/security/OAR079/query-param-only.yaml b/src/test/resources/checks/v31/security/OAR079/query-param-only.yaml new file mode 100644 index 00000000..d85cf1b8 --- /dev/null +++ b/src/test/resources/checks/v31/security/OAR079/query-param-only.yaml @@ -0,0 +1,16 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /items: + get: + summary: Get a list of items + parameters: + - name: param1 + in: query + schema: + type: string + responses: + 200: + description: A list of items diff --git a/src/test/resources/checks/v31/security/OAR081/.gitkeep b/src/test/resources/checks/v31/security/OAR081/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/src/test/resources/checks/v31/security/OAR081/not-valid-password.json b/src/test/resources/checks/v31/security/OAR081/not-valid-password.json new file mode 100644 index 00000000..eb626afe --- /dev/null +++ b/src/test/resources/checks/v31/security/OAR081/not-valid-password.json @@ -0,0 +1,52 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/users": { + "post": { + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "username": { + "type": "string" + }, + "password": { + "type": "string", + "format": "password" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "A user was successfully created.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "username": { + "type": "string" + }, + "password": { # Noncompliant {{OAR081: Fields of type password should be string with format password}} + "type": "string", + "format": "number" + } + } + } + } + } + } + } + } + } + } + } \ No newline at end of file diff --git a/src/test/resources/checks/v31/security/OAR081/not-valid-password.yaml b/src/test/resources/checks/v31/security/OAR081/not-valid-password.yaml new file mode 100644 index 00000000..4d7804fb --- /dev/null +++ b/src/test/resources/checks/v31/security/OAR081/not-valid-password.yaml @@ -0,0 +1,31 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /users: + post: + requestBody: + content: + application/json: + schema: + type: object + properties: + username: + type: string + password: # Noncompliant {{OAR081: Fields of type password should be string with format password}} + type: string + format: number + responses: + 200: + description: A user was successfully created. + content: + application/json: + schema: + type: object + properties: + username: + type: string + password: # Noncompliant {{OAR081: Fields of type password should be string with format password}} + type: string + format: number \ No newline at end of file diff --git a/src/test/resources/checks/v31/security/OAR081/valid-password.json b/src/test/resources/checks/v31/security/OAR081/valid-password.json new file mode 100644 index 00000000..1bc3a18d --- /dev/null +++ b/src/test/resources/checks/v31/security/OAR081/valid-password.json @@ -0,0 +1,52 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/users": { + "post": { + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "username": { + "type": "string" + }, + "password": { + "type": "string", + "format": "password" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "A user was successfully created.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "username": { + "type": "string" + }, + "password": { + "type": "string", + "format": "password" + } + } + } + } + } + } + } + } + } + } + } \ No newline at end of file diff --git a/src/test/resources/checks/v31/security/OAR081/valid-password.yaml b/src/test/resources/checks/v31/security/OAR081/valid-password.yaml new file mode 100644 index 00000000..2545f739 --- /dev/null +++ b/src/test/resources/checks/v31/security/OAR081/valid-password.yaml @@ -0,0 +1,31 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /users: + post: + requestBody: + content: + application/json: + schema: + type: object + properties: + username: + type: string + password: + type: string + format: password + responses: + 200: + description: A user was successfully created. + content: + application/json: + schema: + type: object + properties: + username: + type: string + password: + type: string + format: password \ No newline at end of file diff --git a/src/test/resources/checks/v31/security/OAR081/valid-with-components.json b/src/test/resources/checks/v31/security/OAR081/valid-with-components.json new file mode 100644 index 00000000..0ce1cdd6 --- /dev/null +++ b/src/test/resources/checks/v31/security/OAR081/valid-with-components.json @@ -0,0 +1,50 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/users": { + "post": { + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/User" + } + } + } + }, + "responses": { + "200": { + "description": "A user was successfully created.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/User" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "User": { + "type": "object", + "properties": { + "username": { + "type": "string" + }, + "password": { # Noncompliant {{OAR081: Fields of type password should be string with format password}} + "type": "string", + "format": "number" + } + } + } + } + } + } \ No newline at end of file diff --git a/src/test/resources/checks/v31/security/OAR081/valid-with-components.yaml b/src/test/resources/checks/v31/security/OAR081/valid-with-components.yaml new file mode 100644 index 00000000..61c4d53c --- /dev/null +++ b/src/test/resources/checks/v31/security/OAR081/valid-with-components.yaml @@ -0,0 +1,29 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /users: + post: + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/User' + responses: + 200: + description: A user was successfully created. + content: + application/json: + schema: + $ref: '#/components/schemas/User' +components: + schemas: + User: + type: object + properties: + username: + type: string + password: # Noncompliant {{OAR081: Fields of type password should be string with format password}} + type: string + format: number \ No newline at end of file diff --git a/src/test/resources/checks/v31/security/OAR082/.gitkeep b/src/test/resources/checks/v31/security/OAR082/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/src/test/resources/checks/v31/security/OAR082/valid-format.json b/src/test/resources/checks/v31/security/OAR082/valid-format.json new file mode 100644 index 00000000..7423cb98 --- /dev/null +++ b/src/test/resources/checks/v31/security/OAR082/valid-format.json @@ -0,0 +1,45 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/invoices": { + "get": { + "responses": { + "200": { + "description": "A invoice.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "product": { + "type": "string", # Noncompliant {{OAR082: The string properties of the specified parameters must define a byte or binary format.}} + "format": "int128" + }, + "line": { + "type": "string" # Noncompliant {{OAR082: The string properties of the specified parameters must define a byte or binary format.}} + }, + "price": { + "type": "string", + "format": "byte" + } + } + } + } + } + } + } + } + } + } + } + + + + + + + \ No newline at end of file diff --git a/src/test/resources/checks/v31/security/OAR082/valid-format.yaml b/src/test/resources/checks/v31/security/OAR082/valid-format.yaml new file mode 100644 index 00000000..626624e9 --- /dev/null +++ b/src/test/resources/checks/v31/security/OAR082/valid-format.yaml @@ -0,0 +1,23 @@ +openapi: "3.0.0" +info: + version: "1.0.0" + title: "Swagger Petstore" +paths: + /invoices: + get: + responses: + '200': + description: A invoice. + content: + application/json: + schema: + type: object + properties: + product: + type: string # Noncompliant {{OAR082: The string properties of the specified parameters must define a byte or binary format.}} + format: int128 + line: + type: string # Noncompliant {{OAR082: The string properties of the specified parameters must define a byte or binary format.}} + price: + type: string + format: byte \ No newline at end of file diff --git a/src/test/resources/checks/v31/security/OAR083/forbidden-query-params.json b/src/test/resources/checks/v31/security/OAR083/forbidden-query-params.json new file mode 100644 index 00000000..b0519a8d --- /dev/null +++ b/src/test/resources/checks/v31/security/OAR083/forbidden-query-params.json @@ -0,0 +1,45 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "My API" + }, + "paths": { + "/examples": { + "get": { + "summary": "Get a list of items", + "parameters": [ # Noncompliant {{OAR083: The parameter email should not pass through this querystring}} + { + "name": "email", + "in": "query", + "schema": { + "type": "string" + } + }, + { + "name": "patata", + "in": "query", + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "description": "A list of items", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + } + } + } + } + } \ No newline at end of file diff --git a/src/test/resources/checks/v31/security/OAR083/forbidden-query-params.yaml b/src/test/resources/checks/v31/security/OAR083/forbidden-query-params.yaml new file mode 100644 index 00000000..1a6d9121 --- /dev/null +++ b/src/test/resources/checks/v31/security/OAR083/forbidden-query-params.yaml @@ -0,0 +1,26 @@ + openapi: "3.0.0" + info: + version: 1.0.0 + title: My API + paths: + /examples: + post: + summary: Get a list of items + parameters: # Noncompliant {{OAR083: The parameter email should not pass through this querystring}} + - name: email + in: query + schema: + type: string + - name: param2 + in: query + schema: + type: integer + responses: + 200: + description: A list of items + content: + application/json: + schema: + type: array + items: + type: string \ No newline at end of file diff --git a/src/test/resources/checks/v31/security/OAR083/no-parameters.json b/src/test/resources/checks/v31/security/OAR083/no-parameters.json new file mode 100644 index 00000000..c4aee44f --- /dev/null +++ b/src/test/resources/checks/v31/security/OAR083/no-parameters.json @@ -0,0 +1,19 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "My API" + }, + "paths": { + "/examples": { + "get": { + "summary": "Get a list of items", + "responses": { + "200": { + "description": "A list of items" + } + } + } + } + } +} diff --git a/src/test/resources/checks/v31/security/OAR083/no-parameters.yaml b/src/test/resources/checks/v31/security/OAR083/no-parameters.yaml new file mode 100644 index 00000000..cc4eaac0 --- /dev/null +++ b/src/test/resources/checks/v31/security/OAR083/no-parameters.yaml @@ -0,0 +1,11 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: My API +paths: + /examples: + get: + summary: Get a list of items + responses: + 200: + description: A list of items diff --git a/src/test/resources/checks/v31/security/OAR083/null-name-param.json b/src/test/resources/checks/v31/security/OAR083/null-name-param.json new file mode 100644 index 00000000..467fc8c9 --- /dev/null +++ b/src/test/resources/checks/v31/security/OAR083/null-name-param.json @@ -0,0 +1,30 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "My API" + }, + "paths": { + "/examples/{id}": { + "get": { + "summary": "Get an item", + "parameters": [ + { + "name": null, + "in": "query", + "schema": { "type": "string" } + }, + { + "name": "id", + "in": "path", + "required": true, + "schema": { "type": "string" } + } + ], + "responses": { + "200": { "description": "An item" } + } + } + } + } +} diff --git a/src/test/resources/checks/v31/security/OAR083/null-name-param.yaml b/src/test/resources/checks/v31/security/OAR083/null-name-param.yaml new file mode 100644 index 00000000..67ccaf06 --- /dev/null +++ b/src/test/resources/checks/v31/security/OAR083/null-name-param.yaml @@ -0,0 +1,21 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: My API +paths: + /examples/{id}: + get: + summary: Get an item + parameters: + - name: ~ + in: query + schema: + type: string + - name: id + in: path + required: true + schema: + type: string + responses: + 200: + description: An item diff --git a/src/test/resources/checks/v31/security/OAR083/options-operation.json b/src/test/resources/checks/v31/security/OAR083/options-operation.json new file mode 100644 index 00000000..f2471041 --- /dev/null +++ b/src/test/resources/checks/v31/security/OAR083/options-operation.json @@ -0,0 +1,24 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "My API" + }, + "paths": { + "/examples": { + "options": { + "summary": "Options for the resource", + "parameters": [ + { + "name": "email", + "in": "query", + "schema": { "type": "string" } + } + ], + "responses": { + "200": { "description": "OK" } + } + } + } + } +} diff --git a/src/test/resources/checks/v31/security/OAR083/options-operation.yaml b/src/test/resources/checks/v31/security/OAR083/options-operation.yaml new file mode 100644 index 00000000..02b2fada --- /dev/null +++ b/src/test/resources/checks/v31/security/OAR083/options-operation.yaml @@ -0,0 +1,16 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: My API +paths: + /examples: + options: + summary: Options for the resource + parameters: + - name: email + in: query + schema: + type: string + responses: + 200: + description: OK diff --git a/src/test/resources/checks/v31/security/OAR083/valid-query-params.json b/src/test/resources/checks/v31/security/OAR083/valid-query-params.json new file mode 100644 index 00000000..9251c180 --- /dev/null +++ b/src/test/resources/checks/v31/security/OAR083/valid-query-params.json @@ -0,0 +1,45 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "My API" + }, + "paths": { + "/items": { + "get": { + "summary": "Get a list of items", + "parameters": [ + { + "name": "param1", + "in": "query", + "schema": { + "type": "string" + } + }, + { + "name": "param2", + "in": "query", + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "description": "A list of items", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + } + } + } + } + } \ No newline at end of file diff --git a/src/test/resources/checks/v31/security/OAR083/valid-query-params.yaml b/src/test/resources/checks/v31/security/OAR083/valid-query-params.yaml new file mode 100644 index 00000000..4347bb96 --- /dev/null +++ b/src/test/resources/checks/v31/security/OAR083/valid-query-params.yaml @@ -0,0 +1,26 @@ + openapi: "3.0.0" + info: + version: 1.0.0 + title: My API + paths: + /items: + get: + summary: Get a list of items + parameters: + - name: param1 + in: query + schema: + type: string + - name: param2 + in: query + schema: + type: integer + responses: + 200: + description: A list of items + content: + application/json: + schema: + type: array + items: + type: string \ No newline at end of file diff --git a/src/test/resources/checks/v31/security/OAR084/forbidden-query-formats.json b/src/test/resources/checks/v31/security/OAR084/forbidden-query-formats.json new file mode 100644 index 00000000..9b2e7f7b --- /dev/null +++ b/src/test/resources/checks/v31/security/OAR084/forbidden-query-formats.json @@ -0,0 +1,46 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "My API" + }, + "paths": { + "/examples": { + "get": { + "summary": "Get a list of items", + "parameters": [ + { + "name": "exampleParam1", + "in": "query", + "schema": { + "type": "string", + "format": "password" # Noncompliant {{OAR084: The format password should not pass through this querystring}} + } + }, + { + "name": "param3", + "in": "query", + "schema": { + "type": "boolean" + } + } + ], + "responses": { + "200": { + "description": "A list of items", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/security/OAR084/forbidden-query-formats.yaml b/src/test/resources/checks/v31/security/OAR084/forbidden-query-formats.yaml new file mode 100644 index 00000000..892eaa69 --- /dev/null +++ b/src/test/resources/checks/v31/security/OAR084/forbidden-query-formats.yaml @@ -0,0 +1,27 @@ +openapi: 3.0.0 +info: + version: 1.0.0 + title: My API +paths: + /examples: + get: + summary: Get a list of items + parameters: + - name: exampleParam1 + in: query + schema: + type: string + format: password # Noncompliant {{OAR084: The format password should not pass through this querystring}} + - name: param3 + in: query + schema: + type: boolean + responses: + 200: + description: A list of items + content: + application/json: + schema: + type: array + items: + type: string \ No newline at end of file diff --git a/src/test/resources/checks/v31/security/OAR084/no-parameters.json b/src/test/resources/checks/v31/security/OAR084/no-parameters.json new file mode 100644 index 00000000..dcdc8dd6 --- /dev/null +++ b/src/test/resources/checks/v31/security/OAR084/no-parameters.json @@ -0,0 +1,17 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "My API" + }, + "paths": { + "/examples": { + "get": { + "summary": "Get a list of items", + "responses": { + "200": { "description": "A list of items" } + } + } + } + } +} diff --git a/src/test/resources/checks/v31/security/OAR084/no-parameters.yaml b/src/test/resources/checks/v31/security/OAR084/no-parameters.yaml new file mode 100644 index 00000000..cc4eaac0 --- /dev/null +++ b/src/test/resources/checks/v31/security/OAR084/no-parameters.yaml @@ -0,0 +1,11 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: My API +paths: + /examples: + get: + summary: Get a list of items + responses: + 200: + description: A list of items diff --git a/src/test/resources/checks/v31/security/OAR084/non-query-param.json b/src/test/resources/checks/v31/security/OAR084/non-query-param.json new file mode 100644 index 00000000..2b52b6d3 --- /dev/null +++ b/src/test/resources/checks/v31/security/OAR084/non-query-param.json @@ -0,0 +1,28 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "My API" + }, + "paths": { + "/examples/{id}": { + "get": { + "summary": "Get an item", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "password" + } + } + ], + "responses": { + "200": { "description": "An item" } + } + } + } + } +} diff --git a/src/test/resources/checks/v31/security/OAR084/non-query-param.yaml b/src/test/resources/checks/v31/security/OAR084/non-query-param.yaml new file mode 100644 index 00000000..b9ec5900 --- /dev/null +++ b/src/test/resources/checks/v31/security/OAR084/non-query-param.yaml @@ -0,0 +1,18 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: My API +paths: + /examples/{id}: + get: + summary: Get an item + parameters: + - name: id + in: path + required: true + schema: + type: string + format: password + responses: + 200: + description: An item diff --git a/src/test/resources/checks/v31/security/OAR084/null-format-param.json b/src/test/resources/checks/v31/security/OAR084/null-format-param.json new file mode 100644 index 00000000..8f760ba8 --- /dev/null +++ b/src/test/resources/checks/v31/security/OAR084/null-format-param.json @@ -0,0 +1,27 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "My API" + }, + "paths": { + "/examples": { + "get": { + "summary": "Get a list of items", + "parameters": [ + { + "name": "exampleParam1", + "in": "query", + "schema": { + "type": "string", + "format": null + } + } + ], + "responses": { + "200": { "description": "A list of items" } + } + } + } + } +} diff --git a/src/test/resources/checks/v31/security/OAR084/null-format-param.yaml b/src/test/resources/checks/v31/security/OAR084/null-format-param.yaml new file mode 100644 index 00000000..dbdd4a21 --- /dev/null +++ b/src/test/resources/checks/v31/security/OAR084/null-format-param.yaml @@ -0,0 +1,17 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: My API +paths: + /examples: + get: + summary: Get a list of items + parameters: + - name: exampleParam1 + in: query + schema: + type: string + format: ~ + responses: + 200: + description: A list of items diff --git a/src/test/resources/checks/v31/security/OAR084/valid-query-formats.json b/src/test/resources/checks/v31/security/OAR084/valid-query-formats.json new file mode 100644 index 00000000..9251c180 --- /dev/null +++ b/src/test/resources/checks/v31/security/OAR084/valid-query-formats.json @@ -0,0 +1,45 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "My API" + }, + "paths": { + "/items": { + "get": { + "summary": "Get a list of items", + "parameters": [ + { + "name": "param1", + "in": "query", + "schema": { + "type": "string" + } + }, + { + "name": "param2", + "in": "query", + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "description": "A list of items", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + } + } + } + } + } \ No newline at end of file diff --git a/src/test/resources/checks/v31/security/OAR084/valid-query-formats.yaml b/src/test/resources/checks/v31/security/OAR084/valid-query-formats.yaml new file mode 100644 index 00000000..5a53854c --- /dev/null +++ b/src/test/resources/checks/v31/security/OAR084/valid-query-formats.yaml @@ -0,0 +1,27 @@ +openapi: 3.0.0 +info: + version: 1.0.0 + title: My API +paths: + /examples: + get: + summary: Get a list of items + parameters: + - name: exampleParam1 + in: query + schema: + type: string + format: date + - name: param3 + in: query + schema: + type: boolean + responses: + 200: + description: A list of items + content: + application/json: + schema: + type: array + items: + type: string \ No newline at end of file diff --git a/src/test/resources/checks/v31/security/OAR085/invalid-openapi-version.json b/src/test/resources/checks/v31/security/OAR085/invalid-openapi-version.json new file mode 100644 index 00000000..88a6bbca --- /dev/null +++ b/src/test/resources/checks/v31/security/OAR085/invalid-openapi-version.json @@ -0,0 +1,9 @@ +{ + "openapi": "3.0.3", + "info": { + "title": "Sample API", + "description": "This is a sample API.", + "version": "1.0.0" + }, + "paths": {} +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/security/OAR085/invalid-openapi-version.yaml b/src/test/resources/checks/v31/security/OAR085/invalid-openapi-version.yaml new file mode 100644 index 00000000..9cfcd02d --- /dev/null +++ b/src/test/resources/checks/v31/security/OAR085/invalid-openapi-version.yaml @@ -0,0 +1,6 @@ +openapi: 3.0.3 +info: + title: Sample API + description: This is a sample API. + version: 1.0.0 +paths: {} \ No newline at end of file diff --git a/src/test/resources/checks/v31/security/OAR085/valid-openapi-version.json b/src/test/resources/checks/v31/security/OAR085/valid-openapi-version.json new file mode 100644 index 00000000..0997875d --- /dev/null +++ b/src/test/resources/checks/v31/security/OAR085/valid-openapi-version.json @@ -0,0 +1,9 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "Sample API", + "description": "This is a sample API.", + "version": "1.0.0" + }, + "paths": {} + } \ No newline at end of file diff --git a/src/test/resources/checks/v31/security/OAR085/valid-openapi-version.yaml b/src/test/resources/checks/v31/security/OAR085/valid-openapi-version.yaml index a6105909..ee95c7c0 100644 --- a/src/test/resources/checks/v31/security/OAR085/valid-openapi-version.yaml +++ b/src/test/resources/checks/v31/security/OAR085/valid-openapi-version.yaml @@ -1,4 +1,4 @@ -openapi: 3.1.0 +openapi: 3.0.0 info: title: Sample API description: This is a sample API. diff --git a/src/test/resources/checks/v31/security/OAR096/valid.json b/src/test/resources/checks/v31/security/OAR096/valid.json new file mode 100644 index 00000000..c45fbe9a --- /dev/null +++ b/src/test/resources/checks/v31/security/OAR096/valid.json @@ -0,0 +1,117 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "components": { + "securitySchemes": { + "BasicAuth": { + "type": "http", + "scheme": "basic" + }, + "BearerAuth": { + "type": "http", + "scheme": "bearer" + }, + "ApiKeyAuth": { + "type": "apiKey", + "in": "header", + "name": "X-API-Key" + }, + "OpenID": { + "type": "openIdConnect", + "openIdConnectUrl": "https://example.com/.well-known/openid-configuration" + }, + "OAuth2": { + "type": "oauth2", + "flows": { + "authorizationCode": { + "authorizationUrl": "https://example.com/oauth/authorize", + "tokenUrl": "https://example.com/oauth/token", + "scopes": { + "read": "Grants read access", + "write": "Grants write access", + "admin": "Grants access to admin operations" + } + } + } + } + } + }, + "paths": { + "/with-auth-and-header": { + "get": { + "parameters": [ + { + "in": "header", + "name": "x-api-key", + "schema": { + "type": "string" + } + } + ], + "security": [ + { + "ApiKeyAuth": [ + + ] + }, + { + "OAuth2": [ + "read", + "write" + ] + } + ], + "responses": { + "200": { + "description": "Ok" + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + }, + "429": { + "description": "Forbidden" + } + } + } + }, + "/with-header": { + "parameters": [ + { + "in": "header", + "name": "x-api-key", + "schema": { + "type": "string" + } + } + ], + "get": { + "responses": { + "200": { + "description": "Ok" + }, + "401": { + "description": "Unauthorized" + }, + "429": { + "description": "Unauthorized" + } + } + } + }, + "/without": { + "get": { + "responses": { + "200": { + "description": "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/security/OAR096/valid.yaml b/src/test/resources/checks/v31/security/OAR096/valid.yaml new file mode 100644 index 00000000..4ada663f --- /dev/null +++ b/src/test/resources/checks/v31/security/OAR096/valid.yaml @@ -0,0 +1,70 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +components: + securitySchemes: + BasicAuth: + type: http + scheme: basic + BearerAuth: + type: http + scheme: bearer + ApiKeyAuth: + type: apiKey + in: header + name: X-API-Key + OpenID: + type: openIdConnect + openIdConnectUrl: https://example.com/.well-known/openid-configuration + OAuth2: + type: oauth2 + flows: + authorizationCode: + authorizationUrl: https://example.com/oauth/authorize + tokenUrl: https://example.com/oauth/token + scopes: + read: Grants read access + write: Grants write access + admin: Grants access to admin operations +paths: + /with-auth-and-header: + get: + parameters: + - in: header + name: x-api-key + schema: + type: string + security: + - ApiKeyAuth: [] + - OAuth2: + - read + - write + responses: + 200: + description: Ok + 401: + description: Unauthorized + 403: + description: Forbidden + 429: + description: Forbidden + /with-header: + parameters: + - in: header + name: x-api-key + schema: + type: string + get: + responses: + 200: + description: Ok + 401: + description: Unauthorized + 429: + description: Unauthorized + /without: + get: + responses: + 200: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v31/security/OAR096/without-authorization-responses.json b/src/test/resources/checks/v31/security/OAR096/without-authorization-responses.json new file mode 100644 index 00000000..4fa2d839 --- /dev/null +++ b/src/test/resources/checks/v31/security/OAR096/without-authorization-responses.json @@ -0,0 +1,100 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "components": { + "securitySchemes": { + "BasicAuth": { + "type": "http", + "scheme": "basic" + }, + "BearerAuth": { + "type": "http", + "scheme": "bearer" + }, + "ApiKeyAuth": { + "type": "apiKey", + "in": "header", + "name": "X-API-Key" + }, + "OpenID": { + "type": "openIdConnect", + "openIdConnectUrl": "https://example.com/.well-known/openid-configuration" + }, + "OAuth2": { + "type": "oauth2", + "flows": { + "authorizationCode": { + "authorizationUrl": "https://example.com/oauth/authorize", + "tokenUrl": "https://example.com/oauth/token", + "scopes": { + "read": "Grants read access", + "write": "Grants write access", + "admin": "Grants access to admin operations" + } + } + } + } + } + }, + "paths": { + "/with-auth-and-header": { + "get": { + "parameters": [ + { + "in": "header", + "name": "x-api-key", + "schema": { + "type": "string" + } + } + ], + "security": [ + { + "ApiKeyAuth": [] + }, + { + "OAuth2": [ + "read", + "write" + ] + } + ], + "responses": { # Noncompliant {{OAR096: Response code 403 must be defined for operations with security schemes defined}} + "200": { + "description": "Ok" + } + } + } + }, + "/with-header": { + "parameters": [ + { + "in": "header", + "name": "x-api-key", + "schema": { + "type": "string" + } + } + ], + "get": { + "responses": { + "200": { + "description": "Ok" + } + } + } + }, + "/without": { + "get": { + "responses": { + "200": { + "description": "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/security/OAR096/without-authorization-responses.yaml b/src/test/resources/checks/v31/security/OAR096/without-authorization-responses.yaml new file mode 100644 index 00000000..45b6d2e7 --- /dev/null +++ b/src/test/resources/checks/v31/security/OAR096/without-authorization-responses.yaml @@ -0,0 +1,62 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +components: + securitySchemes: + BasicAuth: + type: http + scheme: basic + BearerAuth: + type: http + scheme: bearer + ApiKeyAuth: + type: apiKey + in: header + name: X-API-Key + OpenID: + type: openIdConnect + openIdConnectUrl: https://example.com/.well-known/openid-configuration + OAuth2: + type: oauth2 + flows: + authorizationCode: + authorizationUrl: https://example.com/oauth/authorize + tokenUrl: https://example.com/oauth/token + scopes: + read: Grants read access + write: Grants write access + admin: Grants access to admin operations +security: + - ApiKeyAuth: [] + - OAuth2: + - read + - write +paths: + /with-auth-and-header: + get: + parameters: + - in: header + name: x-api-key + schema: + type: string + responses: # Noncompliant {{OAR096: Response code 403 must be defined for operations with security schemes defined}} + 200: + description: Ok + + /with-header: + parameters: + - in: header + name: x-api-key + schema: + type: string + get: + responses: # Noncompliant {{OAR096: Response code 403 must be defined for operations with security schemes defined}} + 200: + description: Ok + + /without: + get: + responses: # Noncompliant {{OAR096: Response code 403 must be defined for operations with security schemes defined}} + 200: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v31/security/OAR114/valid.json b/src/test/resources/checks/v31/security/OAR114/valid.json new file mode 100644 index 00000000..79d9c816 --- /dev/null +++ b/src/test/resources/checks/v31/security/OAR114/valid.json @@ -0,0 +1,32 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "Valid Response Headers Test", + "version": "1.0" + }, + "paths": { + "/example": { + "get": { + "responses": { + "200": { + "description": "OK", + "headers": { + "x-api-key": { + "description": "Mandatory header", + "schema": { + "type": "string" + } + }, + "traceId": { + "description": "Optional but allowed", + "schema": { + "type": "string" + } + } + } + } + } + } + } + } +} diff --git a/src/test/resources/checks/v31/security/OAR114/valid.yaml b/src/test/resources/checks/v31/security/OAR114/valid.yaml new file mode 100644 index 00000000..8c936a19 --- /dev/null +++ b/src/test/resources/checks/v31/security/OAR114/valid.yaml @@ -0,0 +1,19 @@ +openapi: 3.0.0 +info: + title: Valid Response Headers Test + version: "1.0" +paths: + /example: + get: + responses: + "200": + description: OK + headers: + x-api-key: + description: Mandatory header + schema: + type: string + traceId: + description: Optional but allowed + schema: + type: string diff --git a/src/test/resources/checks/v31/security/OAR114/with-forbidden-params.json b/src/test/resources/checks/v31/security/OAR114/with-forbidden-params.json new file mode 100644 index 00000000..975318bc --- /dev/null +++ b/src/test/resources/checks/v31/security/OAR114/with-forbidden-params.json @@ -0,0 +1,26 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "Forbidden Header Test", + "version": "1.0" + }, + "paths": { + "/example": { + "get": { + "responses": { + "200": { # Noncompliant {{OAR114: Headers [x-api-key] are required}} + "description": "OK", + "headers": { + "Authorization": { # Noncompliant {{OAR114: Header not allowed}} + "description": "Forbidden header", + "schema": { + "type": "string" + } + } + } + } + } + } + } + } +} diff --git a/src/test/resources/checks/v31/security/OAR114/with-forbidden-params.yaml b/src/test/resources/checks/v31/security/OAR114/with-forbidden-params.yaml new file mode 100644 index 00000000..4f2c2bc7 --- /dev/null +++ b/src/test/resources/checks/v31/security/OAR114/with-forbidden-params.yaml @@ -0,0 +1,15 @@ +openapi: 3.0.0 +info: + title: Forbidden Header Test + version: "1.0" +paths: + /example: + get: + responses: + "200": # Noncompliant {{OAR114: Headers [x-api-key] are required}} + description: OK + headers: + Authorization: # Noncompliant {{OAR114: Header not allowed}} + description: Forbidden header + schema: + type: string diff --git a/src/test/resources/checks/v31/security/OAR114/without-required-params.json b/src/test/resources/checks/v31/security/OAR114/without-required-params.json new file mode 100644 index 00000000..876746f3 --- /dev/null +++ b/src/test/resources/checks/v31/security/OAR114/without-required-params.json @@ -0,0 +1,26 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "Missing Mandatory Header Test", + "version": "1.0" + }, + "paths": { + "/example": { + "get": { + "responses": { + "200": { # Noncompliant {{OAR114: Headers [x-api-key] are required}} + "description": "OK", + "headers": { + "traceId": { + "description": "Allowed header", + "schema": { + "type": "string" + } + } + } + } + } + } + } + } +} diff --git a/src/test/resources/checks/v31/security/OAR114/without-required-params.yaml b/src/test/resources/checks/v31/security/OAR114/without-required-params.yaml new file mode 100644 index 00000000..5603c561 --- /dev/null +++ b/src/test/resources/checks/v31/security/OAR114/without-required-params.yaml @@ -0,0 +1,15 @@ +openapi: 3.0.0 +info: + title: Missing Mandatory Header Test + version: "1.0" +paths: + /example: + get: + responses: + "200": # Noncompliant {{OAR114: Headers [x-api-key] are required}} + description: OK + headers: + traceId: + description: Allowed header + schema: + type: string diff --git a/src/test/resources/checks/v32/core/OAR044/media-type.json b/src/test/resources/checks/v32/core/OAR044/media-type.json new file mode 100644 index 00000000..992ea7bd --- /dev/null +++ b/src/test/resources/checks/v32/core/OAR044/media-type.json @@ -0,0 +1,45 @@ +{ + "openapi" : "3.0.1", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/pets" : { + "get" : { + "requestBody" : { + "content" : { + "application" : { }, # Noncompliant {{OAR044: Declared media type range should conform to RFC7231}} + "text/*" : { } + } + }, + "responses" : { + "200" : { + "description" : "some operation", + "content" : { + "application" : { } # Noncompliant {{OAR044: Declared media type range should conform to RFC7231}} + } + } + }, + "parameters" : [ { + "name" : "someParam", + "in" : "query", + "content" : { + "application" : { }, # Noncompliant {{OAR044: Declared mime type should conform to RFC6838}} + "text/plain" : { } + } + }, { + "name" : "otherParam", + "in" : "path" + } ] + }, + "post" : { + "responses" : { + "200" : { + "description" : "some operation" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/core/OAR044/media-type.yaml b/src/test/resources/checks/v32/core/OAR044/media-type.yaml new file mode 100644 index 00000000..80aba718 --- /dev/null +++ b/src/test/resources/checks/v32/core/OAR044/media-type.yaml @@ -0,0 +1,29 @@ +openapi: "3.0.1" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: + get: + requestBody: + content: + 'application': {} # Noncompliant {{OAR044: Declared media type range should conform to RFC7231}} +# ^^^^^^^^^^^^^ + 'text/*': {} + responses: + '200': + description: some operation + content: + 'application': {} # Noncompliant {{OAR044: Declared media type range should conform to RFC7231}} + parameters: + - name: someParam + in: query + content: + 'application': {} # Noncompliant {{OAR044: Declared mime type should conform to RFC6838}} + 'text/plain': {} # invalid (only 1 content allowed by spec), but should not be caught by this rule + - name: otherParam + in: path + post: + responses: + '200': + description: some operation diff --git a/src/test/resources/checks/v32/core/OAR045/defined-response.json b/src/test/resources/checks/v32/core/OAR045/defined-response.json new file mode 100644 index 00000000..f86d6ac4 --- /dev/null +++ b/src/test/resources/checks/v32/core/OAR045/defined-response.json @@ -0,0 +1,78 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/pets": { + "get": { + "responses": { + "200": { + "description": "some response" // Noncompliant {{OAR045: Define the model of your response}} + }, + "202": { + "description": "some response", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + }, + "401": { // Noncompliant {{OAR045: Define the model of your response}} + "description": "error response", + "$ref": "#/components/responses/MyErroneousResponse" + } + } + }, + "post": { + "responses": {} // Noncompliant {{OAR045: Define the responses of your operations}} + }, + "put": { + "responses": { + "default": { + "description": "default response", + "content": { + "application/json": { + "schema": { + "type": "object" + } + } + } + }, + "200": { // Noncompliant {{OAR045: Define the model of your response}} + "description": "success response" + } + } + } + }, + "/other": { + "delete": { + "responses": { + "204": { + "description": "No content" + } + } + } + } + }, + "components": { + "responses": { + "MyErroneousResponse": { + "description": "an example response missing a model" + }, + "MyOtherResponse": { + "description": "some response", + "content": { + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } +} diff --git a/src/test/resources/checks/v32/core/OAR045/defined-response.yaml b/src/test/resources/checks/v32/core/OAR045/defined-response.yaml new file mode 100644 index 00000000..4370ac6c --- /dev/null +++ b/src/test/resources/checks/v32/core/OAR045/defined-response.yaml @@ -0,0 +1,48 @@ +openapi: 3.0.0 +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: + get: + responses: + # Noncompliant@+1 {{OAR045: Define the model of your response}} + '200': + description: some response + '202': + description: some response + content: + application/json: + schema: + type: string + '401': # Noncompliant {{OAR045: Define the model of your response}} + description: error response + $ref: '#/components/responses/MyErroneousResponse' + post: + # Noncompliant@+1 {{OAR045: Define the responses of your operations}} + responses: {} + put: + responses: + default: + description: default response + content: + application/json: + schema: + type: object + '200': # Noncompliant {{OAR045: Define the model of your response}} + description: success response + /other: + delete: + responses: + '204': + description: No content +components: + responses: + MyErroneousResponse: + description: an example response missing a model + MyOtherResponse: + description: some response + content: + application/json: + schema: + type: object diff --git a/src/test/resources/checks/v32/core/OAR046/declared-tag.json b/src/test/resources/checks/v32/core/OAR046/declared-tag.json new file mode 100644 index 00000000..82549a89 --- /dev/null +++ b/src/test/resources/checks/v32/core/OAR046/declared-tag.json @@ -0,0 +1,26 @@ +{ + "openapi" : "3.0.1", + "tags" : [ { + "name" : "used-tag", + "description" : "a tag referenced in the operations" + } ], + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/pets" : { + "get" : { + "tags" : [ "used-tag" ], + "responses" : { } + }, + "post" : { # Noncompliant {{OAR046: Associate a tag to this operation}} + "responses" : { + "default" : { + "description" : "the default response" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/core/OAR046/declared-tag.yaml b/src/test/resources/checks/v32/core/OAR046/declared-tag.yaml new file mode 100644 index 00000000..2bf092e6 --- /dev/null +++ b/src/test/resources/checks/v32/core/OAR046/declared-tag.yaml @@ -0,0 +1,17 @@ +openapi: "3.0.1" +tags: +- name: used-tag + description: a tag referenced in the operations +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: + get: + tags: + - used-tag + responses: {} + post: # Noncompliant {{OAR046: Associate a tag to this operation}} + responses: + default: + description: the default response \ No newline at end of file diff --git a/src/test/resources/checks/v32/core/OAR047/documented-tag.json b/src/test/resources/checks/v32/core/OAR047/documented-tag.json new file mode 100644 index 00000000..12326a3a --- /dev/null +++ b/src/test/resources/checks/v32/core/OAR047/documented-tag.json @@ -0,0 +1,24 @@ +{ + "openapi" : "3.0.1", + "tags" : [ { + "name" : "used-tag", + "description" : "a tag referenced in the operations" + }, { + "name" : "undescribed-tag" # Noncompliant {{OAR047: Add a short description to this tag}} + }, { + "name" : "used-tag", # Noncompliant [[secondary=-3]] {{OAR047: Remove this duplicate tag}} + "description" : "another description" + } ], + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/pets" : { + "get" : { + "tags" : [ "used-tag", "undescribed-tag", "unlisted-tag" ], # Noncompliant {{OAR047: This tag should be declared in the tags section of the contract}} + "responses" : { } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/core/OAR047/documented-tag.yaml b/src/test/resources/checks/v32/core/OAR047/documented-tag.yaml new file mode 100644 index 00000000..197ffd50 --- /dev/null +++ b/src/test/resources/checks/v32/core/OAR047/documented-tag.yaml @@ -0,0 +1,18 @@ +openapi: "3.0.1" +tags: +- name: used-tag + description: a tag referenced in the operations +- name: undescribed-tag # Noncompliant {{OAR047: Add a short description to this tag}} +- name: used-tag # Noncompliant [[secondary=-3]] {{OAR047: Remove this duplicate tag}} + description: another description +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: + get: + tags: + - used-tag + - undescribed-tag + - unlisted-tag # Noncompliant {{OAR047: This tag should be declared in the tags section of the contract}} + responses: {} diff --git a/src/test/resources/checks/v32/core/OAR049/no-content-in-204.json b/src/test/resources/checks/v32/core/OAR049/no-content-in-204.json new file mode 100644 index 00000000..c27c9ad6 --- /dev/null +++ b/src/test/resources/checks/v32/core/OAR049/no-content-in-204.json @@ -0,0 +1,25 @@ +{ + "openapi" : "3.0.1", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/other-pets/{petId}" : { + "delete" : { + "responses" : { + "204" : { # Noncompliant {{OAR049: 204 No Content MUST NOT return anything}} + "description" : "delete pet", + "content" : { + "application/json" : { + "schema" : { + "type" : "object" + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/core/OAR049/no-content-in-204.yaml b/src/test/resources/checks/v32/core/OAR049/no-content-in-204.yaml new file mode 100644 index 00000000..8567c679 --- /dev/null +++ b/src/test/resources/checks/v32/core/OAR049/no-content-in-204.yaml @@ -0,0 +1,14 @@ +openapi: "3.0.1" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /other-pets/{petId}: + delete: + responses: + '204': # Noncompliant {{OAR049: 204 No Content MUST NOT return anything}} + description: delete pet + content: + 'application/json': + schema: + type: object diff --git a/src/test/resources/checks/v32/core/OAR050/provide-summary.json b/src/test/resources/checks/v32/core/OAR050/provide-summary.json new file mode 100644 index 00000000..a5b45a2a --- /dev/null +++ b/src/test/resources/checks/v32/core/OAR050/provide-summary.json @@ -0,0 +1,26 @@ +{ + "openapi" : "3.0.1", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/pets" : { + "post" : { # Noncompliant {{OAR050: Provide a summary for each operation}} + "responses" : { + "default" : { + "description" : "the default response" + } + } + }, + "get" : { + "summary" : "list all pets", + "responses" : { + "default" : { + "description" : "the default response" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/core/OAR050/provide-summary.yaml b/src/test/resources/checks/v32/core/OAR050/provide-summary.yaml new file mode 100644 index 00000000..8d19ba90 --- /dev/null +++ b/src/test/resources/checks/v32/core/OAR050/provide-summary.yaml @@ -0,0 +1,15 @@ +openapi: "3.0.1" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: + post: # Noncompliant {{OAR050: Provide a summary for each operation}} + responses: + default: + description: the default response + get: + summary: list all pets + responses: + default: + description: the default response \ No newline at end of file diff --git a/src/test/resources/checks/v32/core/OAR051/different-description.json b/src/test/resources/checks/v32/core/OAR051/different-description.json new file mode 100644 index 00000000..784c6b8b --- /dev/null +++ b/src/test/resources/checks/v32/core/OAR051/different-description.json @@ -0,0 +1,30 @@ +{ + "openapi" : "3.0.1", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/pets" : { + "post" : { + "summary" : "create a pet", + "description" : "Create a new pet. The pet type is assigned a new unique ID, and can then be referenced in other operations.", + "responses" : { + "default" : { + "description" : "the default response" + } + } + }, + "get" : { + "summary" : "list all pets", + # Noncompliant@+1 {{OAR051: Description must differ from summary}} + "description" : "List all pets", + "responses" : { + "default" : { + "description" : "the default response" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/core/OAR051/different-description.yaml b/src/test/resources/checks/v32/core/OAR051/different-description.yaml new file mode 100644 index 00000000..600efaff --- /dev/null +++ b/src/test/resources/checks/v32/core/OAR051/different-description.yaml @@ -0,0 +1,21 @@ +openapi: "3.0.1" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: + post: + summary: create a pet + description: Create a new pet. The pet type is assigned a new unique ID, and can then be referenced in other + operations. + responses: + default: + description: the default response + get: + summary: list all pets + # Noncompliant@+1 {{OAR051: Description must differ from summary}} + description: List all pets +# ^^^^^^^^^^^ + responses: + default: + description: the default response \ No newline at end of file diff --git a/src/test/resources/checks/v32/examples/OAR094/externalref.yaml b/src/test/resources/checks/v32/examples/OAR094/externalref.yaml new file mode 100644 index 00000000..d750e57a --- /dev/null +++ b/src/test/resources/checks/v32/examples/OAR094/externalref.yaml @@ -0,0 +1,62 @@ +openapi: 3.0.1 +info: + title: Sample-API_efc2b9f76813_V + contact: + name: Nombre del Contacto. + email: contact@mail.com + version: 1.0.12 +servers: + - url: https://api.example.es/api-sample/v1 +paths: + /datos-usuarios: + get: + summary: Listado de usuarios + parameters: + - name: desde + in: query + schema: + type: string + format: date + required: false + - name: hasta + in: query + schema: + type: string + format: date + required: false + responses: + '200': + description: OK. + headers: + X-Correlation-Id: + description: Cabecera 'X-Correlation-Id' + schema: + type: string + content: + application/json: + schema: + $ref: >- # Noncompliant {{OAR094: It is recommended to use examples instead of example as some tools like microcks use this section of the definition}} + https://raw.githubusercontent.com/apiaddicts/sonaropenapi-rules/refs/heads/master/src/test/resources/externalRef/OAR094.yaml#/components/schemas/Pet + '400': + description: Bad Request. + headers: + X-Correlation-Id: + description: Cabecera 'X-Correlation-Id' + schema: + type: string + content: + application/json: + schema: + $ref: >- # Noncompliant {{OAR094: It is recommended to use examples instead of example as some tools like microcks use this section of the definition}} + https://raw.githubusercontent.com/apiaddicts/sonaropenapi-rules/refs/heads/master/src/test/resources/externalRef/OAR094.yaml#/components/schemas/ErrorMessage + example: # Noncompliant {{OAR094: It is recommended to use examples instead of example as some tools like microcks use this section of the definition}} + error: + status: '400' + message: Bad Request + path: /datos-usuario + type: https://docs.example.es/x/A1D8Aw + operationId: '10004' + errors: + - code: '101' + message: Invalid format + location: desde \ No newline at end of file diff --git a/src/test/resources/checks/v32/examples/OAR094/invalid-example.json b/src/test/resources/checks/v32/examples/OAR094/invalid-example.json new file mode 100644 index 00000000..70dc0305 --- /dev/null +++ b/src/test/resources/checks/v32/examples/OAR094/invalid-example.json @@ -0,0 +1,54 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "API con Example", + "version": "1.0.0" + }, + "paths": { + "/pets": { + "get": { + "summary": "Devuelve una lista de mascotas", + "responses": { + "200": { + "description": "Lista exitosa de mascotas", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Pet" + } + }, + "example": [ # Noncompliant {{OAR094: It is recommended to use examples instead of example as some tools like microcks use this section of the definition}} + { + "name": "Whiskers", + "animalType": "Cat" + }, + { + "name": "Daisy", + "animalType": "Dog" + } + ] + } + } + } + } + } + } + }, + "components": { + "schemas": { + "Pet": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "animalType": { + "type": "string" + } + } + } + } + } + } \ No newline at end of file diff --git a/src/test/resources/checks/v32/examples/OAR094/invalid-example.yaml b/src/test/resources/checks/v32/examples/OAR094/invalid-example.yaml new file mode 100644 index 00000000..31628bcd --- /dev/null +++ b/src/test/resources/checks/v32/examples/OAR094/invalid-example.yaml @@ -0,0 +1,31 @@ +openapi: 3.0.0 +info: + title: API con Example + version: 1.0.0 +paths: + /pets: + get: + summary: Devuelve una lista de mascotas + responses: + '200': + description: Lista exitosa de mascotas + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Pet' + example: # Noncompliant {{OAR094: It is recommended to use examples instead of example as some tools like microcks use this section of the definition}} + - name: Whiskers + animalType: Cat + - name: Daisy + animalType: Dog +components: + schemas: + Pet: + type: object + properties: + name: + type: string + animalType: + type: string \ No newline at end of file diff --git a/src/test/resources/checks/v32/examples/OAR094/valid-example.json b/src/test/resources/checks/v32/examples/OAR094/valid-example.json new file mode 100644 index 00000000..c1cc5b38 --- /dev/null +++ b/src/test/resources/checks/v32/examples/OAR094/valid-example.json @@ -0,0 +1,62 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "API con Examples", + "version": "1.0.0" + }, + "paths": { + "/pets": { + "get": { + "summary": "Devuelve una lista de mascotas", + "responses": { + "200": { + "description": "Lista exitosa de mascotas", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Pet" + } + }, + "examples": { + "catExample": { + "value": [ + { + "name": "Whiskers", + "animalType": "Cat" + } + ] + }, + "dogExample": { + "value": [ + { + "name": "Daisy", + "animalType": "Dog" + } + ] + } + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "Pet": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "animalType": { + "type": "string" + } + } + } + } + } + } \ No newline at end of file diff --git a/src/test/resources/checks/v32/examples/OAR094/valid-example.yaml b/src/test/resources/checks/v32/examples/OAR094/valid-example.yaml new file mode 100644 index 00000000..ab2b5d5a --- /dev/null +++ b/src/test/resources/checks/v32/examples/OAR094/valid-example.yaml @@ -0,0 +1,35 @@ +openapi: 3.0.0 +info: + title: API con Examples + version: 1.0.0 +paths: + /pets: + get: + summary: Devuelve una lista de mascotas + responses: + '200': + description: Lista exitosa de mascotas + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Pet' + examples: + catExample: + value: + - name: Whiskers + animalType: Cat + dogExample: + value: + - name: Daisy + animalType: Dog +components: + schemas: + Pet: + type: object + properties: + name: + type: string + animalType: + type: string \ No newline at end of file diff --git a/src/test/resources/checks/v32/format/OAR006/without-anything.json b/src/test/resources/checks/v32/format/OAR006/without-anything.json new file mode 100644 index 00000000..e7eb8518 --- /dev/null +++ b/src/test/resources/checks/v32/format/OAR006/without-anything.json @@ -0,0 +1,18 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/pets": { + "post": { # Noncompliant {{OAR006: Section requestBody is mandatory}} + "responses": { + "200": { + "description": "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/format/OAR006/without-anything.yaml b/src/test/resources/checks/v32/format/OAR006/without-anything.yaml new file mode 100644 index 00000000..88d684f0 --- /dev/null +++ b/src/test/resources/checks/v32/format/OAR006/without-anything.yaml @@ -0,0 +1,10 @@ +openapi: 3.0.0 +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: + post: # Noncompliant {{OAR006: Section requestBody is mandatory}} + responses: + 200: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v32/format/OAR007/without-anything.json b/src/test/resources/checks/v32/format/OAR007/without-anything.json new file mode 100644 index 00000000..805f9d37 --- /dev/null +++ b/src/test/resources/checks/v32/format/OAR007/without-anything.json @@ -0,0 +1,18 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/pets": { + "get": { + "responses": { + "200": { # Noncompliant {{OAR007: Section content is mandatory}} + "description": "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/format/OAR007/without-anything.yaml b/src/test/resources/checks/v32/format/OAR007/without-anything.yaml new file mode 100644 index 00000000..ad6533a3 --- /dev/null +++ b/src/test/resources/checks/v32/format/OAR007/without-anything.yaml @@ -0,0 +1,10 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: + get: + responses: + 200: # Noncompliant {{OAR007: Section content is mandatory}} + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v32/format/OAR009/operation-not-allows-request-body.json b/src/test/resources/checks/v32/format/OAR009/operation-not-allows-request-body.json new file mode 100644 index 00000000..87c3e35c --- /dev/null +++ b/src/test/resources/checks/v32/format/OAR009/operation-not-allows-request-body.json @@ -0,0 +1,23 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/pets": { + "get": { # Noncompliant {{OAR009: requestBody not allowed with operation 'GET'}} + "requestBody": { + "content": { + "application/json": {} + } + }, + "responses": { + "200": { + "description": "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/format/OAR009/operation-not-allows-request-body.yaml b/src/test/resources/checks/v32/format/OAR009/operation-not-allows-request-body.yaml new file mode 100644 index 00000000..7a0f59fa --- /dev/null +++ b/src/test/resources/checks/v32/format/OAR009/operation-not-allows-request-body.yaml @@ -0,0 +1,14 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore + +paths: + /pets: + get: # Noncompliant {{OAR009: requestBody not allowed with operation 'GET'}} + requestBody: + content: + application/json: {} + responses: + 200: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v32/format/OAR009/with-default-and-$ref.json b/src/test/resources/checks/v32/format/OAR009/with-default-and-$ref.json new file mode 100644 index 00000000..55f22b21 --- /dev/null +++ b/src/test/resources/checks/v32/format/OAR009/with-default-and-$ref.json @@ -0,0 +1,43 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "components": { + "requestBodies": { + "PetsPostRequest": { + "content": { + "application/json": {}, + "application/xml": {} + } + } + } + }, + "paths": { + "/pets": { + "post": { + "requestBody": { + "$ref": "#/components/requestBodies/PetsPostRequest" + }, + "responses": { + "200": { + "description": "Ok" + } + } + }, + "put": { + "requestBody": { + "content": { + "application/json": {} + } + }, + "responses": { + "200": { + "description": "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/format/OAR009/with-default-and-$ref.yaml b/src/test/resources/checks/v32/format/OAR009/with-default-and-$ref.yaml new file mode 100644 index 00000000..19eb54b9 --- /dev/null +++ b/src/test/resources/checks/v32/format/OAR009/with-default-and-$ref.yaml @@ -0,0 +1,25 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +components: + requestBodies: + PetsPostRequest: + content: + application/json: {} + application/xml: {} +paths: + /pets: + post: + requestBody: + $ref: '#/components/requestBodies/PetsPostRequest' + responses: + 200: + description: Ok + put: + requestBody: + content: + application/json: {} + responses: + 200: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v32/format/OAR009/with-default-and-specific.json b/src/test/resources/checks/v32/format/OAR009/with-default-and-specific.json new file mode 100644 index 00000000..5c1ec6af --- /dev/null +++ b/src/test/resources/checks/v32/format/OAR009/with-default-and-specific.json @@ -0,0 +1,38 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/pets": { + "post": { + "requestBody": { + "content": { # Noncompliant {{OAR009: Should indicate the default request media type}} + "application/xml": {} + } + }, + "responses": { + "200": { + "description": "Ok" + } + } + } + }, + "/owners": { + "post": { + "requestBody": { + "content": { + "application/xml": {}, + "application/json": {} + } + }, + "responses": { + "200": { + "description": "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/format/OAR009/with-default-and-specific.yaml b/src/test/resources/checks/v32/format/OAR009/with-default-and-specific.yaml new file mode 100644 index 00000000..7cb1533a --- /dev/null +++ b/src/test/resources/checks/v32/format/OAR009/with-default-and-specific.yaml @@ -0,0 +1,22 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: + post: + requestBody: + content: # Noncompliant {{OAR009: Should indicate the default request media type}} + application/xml: {} + responses: + 200: + description: Ok + /owners: + post: + requestBody: + content: + application/xml: {} + application/json: {} + responses: + 200: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v32/format/OAR009/with-specific.json b/src/test/resources/checks/v32/format/OAR009/with-specific.json new file mode 100644 index 00000000..e2f86e06 --- /dev/null +++ b/src/test/resources/checks/v32/format/OAR009/with-specific.json @@ -0,0 +1,37 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/pets": { + "post": { + "requestBody": { + "content": { + "application/json": {} + } + }, + "responses": { + "200": { + "description": "Ok" + } + } + } + }, + "/owners": { + "post": { + "requestBody": { + "content": { # Noncompliant {{OAR009: Should indicate the default request media type}} + "application/xml": {} + } + }, + "responses": { + "200": { + "description": "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/format/OAR009/with-specific.yaml b/src/test/resources/checks/v32/format/OAR009/with-specific.yaml new file mode 100644 index 00000000..8275c170 --- /dev/null +++ b/src/test/resources/checks/v32/format/OAR009/with-specific.yaml @@ -0,0 +1,22 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore + +paths: + /pets: + post: + requestBody: + content: + application/json: {} + responses: + 200: + description: Ok + /owners: + post: + requestBody: + content: # Noncompliant {{OAR009: Should indicate the default request media type}} + application/xml: {} + responses: + 200: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v32/format/OAR009/with-wrong-default-and-specific.json b/src/test/resources/checks/v32/format/OAR009/with-wrong-default-and-specific.json new file mode 100644 index 00000000..717e2ce1 --- /dev/null +++ b/src/test/resources/checks/v32/format/OAR009/with-wrong-default-and-specific.json @@ -0,0 +1,37 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/pets": { + "post": { + "requestBody": { + "content": { # Noncompliant {{OAR009: Should indicate the default request media type}} + "application/xml": {} + } + }, + "responses": { + "200": { + "description": "Ok" + } + } + } + }, + "/owners": { + "post": { + "requestBody": { + "content": { # Noncompliant {{OAR009: Should indicate the default request media type}} + "application/text": {} + } + }, + "responses": { + "200": { + "description": "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/format/OAR009/with-wrong-default-and-specific.yaml b/src/test/resources/checks/v32/format/OAR009/with-wrong-default-and-specific.yaml new file mode 100644 index 00000000..5f5a2c42 --- /dev/null +++ b/src/test/resources/checks/v32/format/OAR009/with-wrong-default-and-specific.yaml @@ -0,0 +1,21 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: + post: + requestBody: + content: # Noncompliant {{OAR009: Should indicate the default request media type}} + application/xml: {} + responses: + 200: + description: Ok + /owners: + post: + requestBody: + content: # Noncompliant {{OAR009: Should indicate the default request media type}} + application/text: {} + responses: + 200: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v32/format/OAR009/with-wrong-default.json b/src/test/resources/checks/v32/format/OAR009/with-wrong-default.json new file mode 100644 index 00000000..8858d3f7 --- /dev/null +++ b/src/test/resources/checks/v32/format/OAR009/with-wrong-default.json @@ -0,0 +1,23 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/pets": { + "post": { + "requestBody": { + "content": { # Noncompliant {{OAR009: Should indicate the default request media type}} + "application/text": {} + } + }, + "responses": { + "200": { + "description": "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/format/OAR009/with-wrong-default.yaml b/src/test/resources/checks/v32/format/OAR009/with-wrong-default.yaml new file mode 100644 index 00000000..d318d68c --- /dev/null +++ b/src/test/resources/checks/v32/format/OAR009/with-wrong-default.yaml @@ -0,0 +1,13 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: + post: + requestBody: + content: # Noncompliant {{OAR009: Should indicate the default request media type}} + application/text: {} + responses: + 200: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v32/format/OAR009/without-anything.json b/src/test/resources/checks/v32/format/OAR009/without-anything.json new file mode 100644 index 00000000..75ad9f22 --- /dev/null +++ b/src/test/resources/checks/v32/format/OAR009/without-anything.json @@ -0,0 +1,18 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/pets": { + "post": { # Noncompliant {{OAR009: Should indicate the default request media type}} + "responses": { + "200": { + "description": "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/format/OAR009/without-anything.yaml b/src/test/resources/checks/v32/format/OAR009/without-anything.yaml new file mode 100644 index 00000000..a7e26847 --- /dev/null +++ b/src/test/resources/checks/v32/format/OAR009/without-anything.yaml @@ -0,0 +1,10 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: + post: # Noncompliant {{OAR009: Should indicate the default request media type}} + responses: + 200: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v32/format/OAR010/with-default-and-$ref.json b/src/test/resources/checks/v32/format/OAR010/with-default-and-$ref.json new file mode 100644 index 00000000..93c56075 --- /dev/null +++ b/src/test/resources/checks/v32/format/OAR010/with-default-and-$ref.json @@ -0,0 +1,29 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "components": { + "responses": { + "PetsResponse": { + "description": "OK", + "content": { + "application/json": {}, + "application/xml": {} + } + } + } + }, + "paths": { + "/pets": { + "get": { + "responses": { + "200": { + "$ref": "#/components/responses/PetsResponse" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/format/OAR010/with-default-and-$ref.yaml b/src/test/resources/checks/v32/format/OAR010/with-default-and-$ref.yaml new file mode 100644 index 00000000..37260cd9 --- /dev/null +++ b/src/test/resources/checks/v32/format/OAR010/with-default-and-$ref.yaml @@ -0,0 +1,17 @@ +openapi: 3.0.0 +info: + version: 1.0.0 + title: Swagger Petstore +components: + responses: + PetsResponse: + description: OK + content: + application/json: {} + application/xml: {} +paths: + /pets: + get: + responses: + '200': + $ref: '#/components/responses/PetsResponse' diff --git a/src/test/resources/checks/v32/format/OAR010/with-default-and-specific.json b/src/test/resources/checks/v32/format/OAR010/with-default-and-specific.json new file mode 100644 index 00000000..714dc3e9 --- /dev/null +++ b/src/test/resources/checks/v32/format/OAR010/with-default-and-specific.json @@ -0,0 +1,34 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/pets": { + "get": { + "responses": { + "200": { + "description": "Ok", + "content": { # Noncompliant {{OAR010: Should indicate the default response media type}} + "application/xml": {} + } + } + } + } + }, + "/owners": { + "get": { + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": {}, + "application/xml": {} + } + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/format/OAR010/with-default-and-specific.yaml b/src/test/resources/checks/v32/format/OAR010/with-default-and-specific.yaml new file mode 100644 index 00000000..1059a75d --- /dev/null +++ b/src/test/resources/checks/v32/format/OAR010/with-default-and-specific.yaml @@ -0,0 +1,20 @@ +openapi: 3.0.0 +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: + get: + responses: + '200': + description: Ok + content: # Noncompliant {{OAR010: Should indicate the default response media type}} + application/xml: {} + /owners: + get: + responses: + '200': + description: Ok + content: + application/json: {} + application/xml: {} \ No newline at end of file diff --git a/src/test/resources/checks/v32/format/OAR010/with-specific.json b/src/test/resources/checks/v32/format/OAR010/with-specific.json new file mode 100644 index 00000000..59a2ee24 --- /dev/null +++ b/src/test/resources/checks/v32/format/OAR010/with-specific.json @@ -0,0 +1,33 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/pets": { + "get": { + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": {} + } + } + } + } + }, + "/owners": { + "get": { + "responses": { + "200": { + "description": "Ok", + "content": { # Noncompliant {{OAR010: Should indicate the default response media type}} + "application/xml": {} + } + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/format/OAR010/with-specific.yaml b/src/test/resources/checks/v32/format/OAR010/with-specific.yaml new file mode 100644 index 00000000..0026c70d --- /dev/null +++ b/src/test/resources/checks/v32/format/OAR010/with-specific.yaml @@ -0,0 +1,20 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore + +paths: + /pets: + get: + responses: + 200: + description: Ok + content: + application/json: {} + /owners: + get: + responses: + 200: + description: Ok + content: # Noncompliant {{OAR010: Should indicate the default response media type}} + application/xml: {} \ No newline at end of file diff --git a/src/test/resources/checks/v32/format/OAR010/with-wrong-default-and-specific.json b/src/test/resources/checks/v32/format/OAR010/with-wrong-default-and-specific.json new file mode 100644 index 00000000..fb05f275 --- /dev/null +++ b/src/test/resources/checks/v32/format/OAR010/with-wrong-default-and-specific.json @@ -0,0 +1,33 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/pets": { + "get": { + "responses": { + "200": { + "description": "Ok", + "content": { # Noncompliant {{OAR010: Should indicate the default response media type}} + "application/xml": {} + } + } + } + } + }, + "/owners": { + "get": { + "responses": { + "200": { + "description": "Ok", + "content": { # Noncompliant {{OAR010: Should indicate the default response media type}} + "application/text": {} + } + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/format/OAR010/with-wrong-default-and-specific.yaml b/src/test/resources/checks/v32/format/OAR010/with-wrong-default-and-specific.yaml new file mode 100644 index 00000000..561511e4 --- /dev/null +++ b/src/test/resources/checks/v32/format/OAR010/with-wrong-default-and-specific.yaml @@ -0,0 +1,19 @@ +openapi: 3.0.0 +info: + version: 1.0.0 + title: Swagger Petstore +paths: + "/pets": + get: + responses: + '200': + description: Ok + content: # Noncompliant {{OAR010: Should indicate the default response media type}} + application/xml: {} + "/owners": + get: + responses: + '200': + description: Ok + content: # Noncompliant {{OAR010: Should indicate the default response media type}} + application/text: {} \ No newline at end of file diff --git a/src/test/resources/checks/v32/format/OAR010/with-wrong-default.json b/src/test/resources/checks/v32/format/OAR010/with-wrong-default.json new file mode 100644 index 00000000..345e4ba0 --- /dev/null +++ b/src/test/resources/checks/v32/format/OAR010/with-wrong-default.json @@ -0,0 +1,21 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/pets": { + "get": { + "responses": { + "200": { + "description": "Ok", + "content": { # Noncompliant {{OAR010: Should indicate the default response media type}} + "application/text": {} + } + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/format/OAR010/with-wrong-default.yaml b/src/test/resources/checks/v32/format/OAR010/with-wrong-default.yaml new file mode 100644 index 00000000..d0513d3e --- /dev/null +++ b/src/test/resources/checks/v32/format/OAR010/with-wrong-default.yaml @@ -0,0 +1,12 @@ +openapi: 3.0.0 +info: + version: 1.0.0 + title: Swagger Petstore +paths: + "/pets": + get: + responses: + '200': + description: Ok + content: # Noncompliant {{OAR010: Should indicate the default response media type}} + application/text: {} \ No newline at end of file diff --git a/src/test/resources/checks/v32/format/OAR010/without-anything.json b/src/test/resources/checks/v32/format/OAR010/without-anything.json new file mode 100644 index 00000000..fe401526 --- /dev/null +++ b/src/test/resources/checks/v32/format/OAR010/without-anything.json @@ -0,0 +1,18 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/pets": { + "get": { + "responses": { + "200": { # Noncompliant {{OAR010: Should indicate the default response media type}} + "description": "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/format/OAR010/without-anything.yaml b/src/test/resources/checks/v32/format/OAR010/without-anything.yaml new file mode 100644 index 00000000..2a4bf55e --- /dev/null +++ b/src/test/resources/checks/v32/format/OAR010/without-anything.yaml @@ -0,0 +1,10 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: + get: + responses: + 200: # Noncompliant {{OAR010: Should indicate the default response media type}} + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v32/format/OAR011/base-path-ok.json b/src/test/resources/checks/v32/format/OAR011/base-path-ok.json new file mode 100644 index 00000000..56dd4fa1 --- /dev/null +++ b/src/test/resources/checks/v32/format/OAR011/base-path-ok.json @@ -0,0 +1,13 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "servers" : [ + { + "url": "https://petstore.swagger.io/api-store/v1" + } + ], + "paths": {} +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/format/OAR011/base-path-ok.yaml b/src/test/resources/checks/v32/format/OAR011/base-path-ok.yaml new file mode 100644 index 00000000..6e24d7c7 --- /dev/null +++ b/src/test/resources/checks/v32/format/OAR011/base-path-ok.yaml @@ -0,0 +1,7 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +servers: + - url: https://petstore.swagger.io/api-store/v1 +paths: {} \ No newline at end of file diff --git a/src/test/resources/checks/v32/format/OAR011/base-path-wrong.json b/src/test/resources/checks/v32/format/OAR011/base-path-wrong.json new file mode 100644 index 00000000..535e82b4 --- /dev/null +++ b/src/test/resources/checks/v32/format/OAR011/base-path-wrong.json @@ -0,0 +1,13 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "servers" : [ + { + "url": "https://petstore.swagger.io/APIStore/v1" # Noncompliant {{OAR011: The base path and resource names with more than two words must be compliant with the standard naming convention: kebab-case}} + } + ], + "paths": {} +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/format/OAR011/base-path-wrong.yaml b/src/test/resources/checks/v32/format/OAR011/base-path-wrong.yaml new file mode 100644 index 00000000..6833d3fc --- /dev/null +++ b/src/test/resources/checks/v32/format/OAR011/base-path-wrong.yaml @@ -0,0 +1,7 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +servers: + - url: https://petstore.swagger.io/APIStore/v1 # Noncompliant {{OAR011: The base path and resource names with more than two words must be compliant with the standard naming convention: kebab-case}} +paths: {} \ No newline at end of file diff --git a/src/test/resources/checks/v32/format/OAR011/plain.json b/src/test/resources/checks/v32/format/OAR011/plain.json new file mode 100644 index 00000000..cf5279d9 --- /dev/null +++ b/src/test/resources/checks/v32/format/OAR011/plain.json @@ -0,0 +1,90 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/pets": { + "get": { + "responses": { + "200": { + "description": "Ok" + } + } + } + }, + "/Pets": { # Noncompliant {{OAR011: The base path and resource names with more than two words must be compliant with the standard naming convention: kebab-case}} + "get": { + "responses": { + "200": { + "description": "Ok" + } + } + } + }, + "/PETS": { # Noncompliant {{OAR011: The base path and resource names with more than two words must be compliant with the standard naming convention: kebab-case}} + "get": { + "responses": { + "200": { + "description": "Ok" + } + } + } + }, + "/pets/{id}": { + "get": { + "responses": { + "200": { + "description": "Ok" + } + } + } + }, + "/Pets/{id}": { # Noncompliant {{OAR011: The base path and resource names with more than two words must be compliant with the standard naming convention: kebab-case}} + "get": { + "responses": { + "200": { + "description": "Ok" + } + } + } + }, + "/PETS/{id}": { # Noncompliant {{OAR011: The base path and resource names with more than two words must be compliant with the standard naming convention: kebab-case}} + "get": { + "responses": { + "200": { + "description": "Ok" + } + } + } + }, + "/pets/{id}/external-info": { + "get": { + "responses": { + "200": { + "description": "Ok" + } + } + } + }, + "/Pets/{id}/EXternal_INFO": { # Noncompliant {{OAR011: The base path and resource names with more than two words must be compliant with the standard naming convention: kebab-case}} + "get": { + "responses": { + "200": { + "description": "Ok" + } + } + } + }, + "/PETS/{id}/externalInfo": { # Noncompliant {{OAR011: The base path and resource names with more than two words must be compliant with the standard naming convention: kebab-case}} + "get": { + "responses": { + "200": { + "description": "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/format/OAR011/plain.yaml b/src/test/resources/checks/v32/format/OAR011/plain.yaml new file mode 100644 index 00000000..7b13396a --- /dev/null +++ b/src/test/resources/checks/v32/format/OAR011/plain.yaml @@ -0,0 +1,50 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: + get: + responses: + 200: + description: Ok + /Pets: # Noncompliant {{OAR011: The base path and resource names with more than two words must be compliant with the standard naming convention: kebab-case}} + get: + responses: + 200: + description: Ok + /PETS: # Noncompliant {{OAR011: The base path and resource names with more than two words must be compliant with the standard naming convention: kebab-case}} + get: + responses: + 200: + description: Ok + /pets/{id}: + get: + responses: + 200: + description: Ok + /Pets/{id}: # Noncompliant {{OAR011: The base path and resource names with more than two words must be compliant with the standard naming convention: kebab-case}} + get: + responses: + 200: + description: Ok + /PETS/{id}: # Noncompliant {{OAR011: The base path and resource names with more than two words must be compliant with the standard naming convention: kebab-case}} + get: + responses: + 200: + description: Ok + /pets/{id}/external-info: + get: + responses: + 200: + description: Ok + /Pets/{id}/EXternal_INFO: # Noncompliant {{OAR011: The base path and resource names with more than two words must be compliant with the standard naming convention: kebab-case}} + get: + responses: + 200: + description: Ok + /PETS/{id}/externalInfo: # Noncompliant {{OAR011: The base path and resource names with more than two words must be compliant with the standard naming convention: kebab-case}} + get: + responses: + 200: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v32/format/OAR012/camel-case-plain.json b/src/test/resources/checks/v32/format/OAR012/camel-case-plain.json new file mode 100644 index 00000000..bb26e131 --- /dev/null +++ b/src/test/resources/checks/v32/format/OAR012/camel-case-plain.json @@ -0,0 +1,136 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/pets": { + "parameters": [ + { + "in": "path", + "name": "pet_id", # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: camelCase}} + "schema": { + "type": "integer" + } + }, + { + "in": "path", + "name": "petId", + "schema": { + "type": "integer" + } + }, + { + "in": "path", + "name": "PET-ID", # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: camelCase}} + "schema": { + "type": "integer" + } + }, + { + "in": "query", + "name": "expand_info", # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: camelCase}} + "schema": { + "type": "integer" + } + }, + { + "in": "query", + "name": "expandInfo", + "schema": { + "type": "integer" + } + }, + { + "in": "query", + "name": "EXPAND-INFO", # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: camelCase}} + "schema": { + "type": "integer" + } + }, + { + "in": "query", + "name": "expandInfo3", # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: camelCase}} + "schema": { + "type": "integer" + } + }, + { + "in": "header", + "name": "X-Request-ID", + "schema": { + "type": "string" + }, + "required": true + } + ], + "get": { + "parameters": [ + { + "in": "path", + "name": "pet_id", # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: camelCase}} + "schema": { + "type": "integer" + } + }, + { + "in": "path", + "name": "petId", + "schema": { + "type": "integer" + } + }, + { + "in": "path", + "name": "PET-ID", # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: camelCase}} + "schema": { + "type": "integer" + } + }, + { + "in": "query", + "name": "expand_info", # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: camelCase}} + "schema": { + "type": "integer" + } + }, + { + "in": "query", + "name": "expandInfo", + "schema": { + "type": "integer" + } + }, + { + "in": "query", + "name": "EXPAND-INFO", # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: camelCase}} + "schema": { + "type": "integer" + } + }, + { + "in": "query", + "name": "expandInfo3", # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: camelCase}} + "schema": { + "type": "integer" + } + }, + { + "in": "header", + "name": "X-Request-ID", + "schema": { + "type": "string" + }, + "required": true + } + ], + "responses": { + "200": { + "description": "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/format/OAR012/camel-case-plain.yaml b/src/test/resources/checks/v32/format/OAR012/camel-case-plain.yaml new file mode 100644 index 00000000..ccbabec1 --- /dev/null +++ b/src/test/resources/checks/v32/format/OAR012/camel-case-plain.yaml @@ -0,0 +1,78 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: + parameters: + - in: path + name: pet_id # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: camelCase}} + schema: + type: integer + - in: path + name: petId + schema: + type: integer + - in: path + name: PET-ID # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: camelCase}} + schema: + type: integer + - in: query + name: expand_info # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: camelCase}} + schema: + type: integer + - in: query + name: expandInfo + schema: + type: integer + - in: query + name: EXPAND-INFO # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: camelCase}} + schema: + type: integer + - in: query + name: expandInfo3 # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: camelCase}} + schema: + type: integer + - in: header + name: X-Request-ID + schema: + type: string + required: true + get: + parameters: + - in: path + name: pet_id # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: camelCase}} + schema: + type: integer + - in: path + name: petId + schema: + type: integer + - in: path + name: PET-ID # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: camelCase}} + schema: + type: integer + - in: query + name: expand_info # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: camelCase}} + schema: + type: integer + - in: query + name: expandInfo + schema: + type: integer + - in: query + name: EXPAND-INFO # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: camelCase}} + schema: + type: integer + - in: query + name: expandInfo3 # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: camelCase}} + schema: + type: integer + - in: header + name: X-Request-ID + schema: + type: string + required: true + responses: + 200: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v32/format/OAR012/camel-case-with-$ref.json b/src/test/resources/checks/v32/format/OAR012/camel-case-with-$ref.json new file mode 100644 index 00000000..8a695818 --- /dev/null +++ b/src/test/resources/checks/v32/format/OAR012/camel-case-with-$ref.json @@ -0,0 +1,209 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "components": { + "parameters": { + "petType": { + "in": "path", + "name": "pet-Type", # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: camelCase}} + "schema": { + "type": "integer" + } + }, + "pathParamOk": { + "in": "path", + "name": "petId", + "schema": { + "type": "integer" + } + }, + "pathParamWrong1": { + "in": "path", + "name": "pet_id", # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: camelCase}} + "schema": { + "type": "integer" + } + }, + "pathParamWrong2": { + "in": "path", + "name": "PET-ID", # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: camelCase}} + "schema": { + "type": "integer" + } + }, + "queryParamOk": { + "in": "query", + "name": "expandInfo", + "schema": { + "type": "integer" + } + }, + "queryParamWrong1": { + "in": "query", + "name": "expand_info", # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: camelCase}} + "schema": { + "type": "integer" + } + }, + "queryParamWrong2": { + "in": "query", + "name": "expand-info", # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: camelCase}} + "schema": { + "type": "integer" + } + }, + "headerParam": { + "in": "header", + "name": "X-Request-ID", + "schema": { + "type": "string" + }, + "required": true + } + }, + "schemas": { + "Pet": { + "type": "object", + "properties": { + "pet-type": { # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: camelCase}} + "type": "string" + }, + "petAge": { + "type": "number" + }, + "pet_name": { # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: camelCase}} + "type": "string" + } + } + } + }, + "requestBodies": { + "PetsPostRequest": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "pet_name": { # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: camelCase}} + "type": "string" + } + } + } + } + } + } + }, + "responses": { + "PetsResponse": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "pet_name": { # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: camelCase}} + "type": "string" + } + } + } + } + } + } + } + }, + "paths": { + "/pets": { + "parameters": [ + { + "$ref": "#/components/parameters/petType" + }, + { + "in": "path", + "name": "petName", + "schema": { + "type": "string" + } + } + ], + "post": { + "parameters": [ + { + "$ref": "#/components/parameters/pathParamOk" + }, + { + "$ref": "#/components/parameters/pathParamWrong1" + }, + { + "$ref": "#/components/parameters/pathParamWrong2" + }, + { + "$ref": "#/components/parameters/queryParamOk" + }, + { + "$ref": "#/components/parameters/queryParamWrong1" + }, + { + "$ref": "#/components/parameters/queryParamWrong2" + }, + { + "$ref": "#/components/parameters/headerParam" + } + ], + "requestBody": { + "$ref": "#/components/requestBodies/PetsPostRequest" + }, + "responses": { + "200": { + "$ref": "#/components/responses/PetsResponse" + } + } + }, + "put": { + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "pet_name": { # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: camelCase}} + "type": "string" + } + } + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/Pet" + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "pet_name": { # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: camelCase}} + "type": "string" + } + } + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/Pet" + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/format/OAR012/camel-case-with-$ref.yaml b/src/test/resources/checks/v32/format/OAR012/camel-case-with-$ref.yaml new file mode 100644 index 00000000..7cca23f2 --- /dev/null +++ b/src/test/resources/checks/v32/format/OAR012/camel-case-with-$ref.yaml @@ -0,0 +1,130 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +components: + parameters: + petType: + in: path + name: pet-Type # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: camelCase}} + schema: + type: integer + pathParamOk: + in: path + name: petId + schema: + type: integer + pathParamWrong1: + in: path + name: pet_id # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: camelCase}} + schema: + type: integer + pathParamWrong2: + in: path + name: PET-ID # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: camelCase}} + schema: + type: integer + queryParamOk: + in: query + name: expandInfo + schema: + type: integer + queryParamWrong1: + in: query + name: expand_info # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: camelCase}} + schema: + type: integer + queryParamWrong2: + in: query + name: expand-info # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: camelCase}} + schema: + type: integer + headerParam: + in: header + name: X-Request-ID + schema: + type: string + required: true + schemas: + Pet: + type: object + properties: + pet-type: # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: camelCase}} + type: string + petAge: + type: number + pet_name: # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: camelCase}} + type: string + requestBodies: + PetsPostRequest: + content: + application/json: + schema: + type: object + properties: + pet_name: # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: camelCase}} + type: string + petAge: + type: number + responses: + PetsResponse: + description: OK + content: + application/json: + schema: + type: object + properties: + pet_name: # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: camelCase}} + type: string + +paths: + /pets: + parameters: + - $ref: "#/components/parameters/petType" + - in: path + name: petName + schema: + type: string + post: + parameters: + - $ref: '#/components/parameters/pathParamOk' + - $ref: '#/components/parameters/pathParamWrong1' + - $ref: '#/components/parameters/pathParamWrong2' + - $ref: '#/components/parameters/queryParamOk' + - $ref: '#/components/parameters/queryParamWrong1' + - $ref: '#/components/parameters/queryParamWrong2' + - $ref: '#/components/parameters/headerParam' + requestBody: + $ref: '#/components/requestBodies/PetsPostRequest' + responses: + 200: + $ref: '#/components/responses/PetsResponse' + put: + requestBody: + content: + application/json: + schema: + type: object + properties: + pet_name: # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: camelCase}} + type: string + petAge: + type: number + application/xml: + schema: + $ref: '#/components/schemas/Pet' + responses: + 200: + description: OK + content: + application/json: + schema: + type: object + properties: + pet_name: # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: camelCase}} + type: string + petAge: + type: number + application/xml: + schema: + $ref: '#/components/schemas/Pet' \ No newline at end of file diff --git a/src/test/resources/checks/v32/format/OAR012/kebab-case-plain.json b/src/test/resources/checks/v32/format/OAR012/kebab-case-plain.json new file mode 100644 index 00000000..8d726a20 --- /dev/null +++ b/src/test/resources/checks/v32/format/OAR012/kebab-case-plain.json @@ -0,0 +1,136 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/pets": { + "parameters": [ + { + "in": "path", + "name": "pet_id", # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: kebab-case}} + "schema": { + "type": "integer" + } + }, + { + "in": "path", + "name": "petId", # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: kebab-case}} + "schema": { + "type": "integer" + } + }, + { + "in": "path", + "name": "PET-ID", # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: kebab-case}} + "schema": { + "type": "integer" + } + }, + { + "in": "query", + "name": "expand_info", # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: kebab-case}} + "schema": { + "type": "integer" + } + }, + { + "in": "query", + "name": "expandInfo", # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: kebab-case}} + "schema": { + "type": "integer" + } + }, + { + "in": "query", + "name": "EXPAND-INFO", # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: kebab-case}} + "schema": { + "type": "integer" + } + }, + { + "in": "query", + "name": "expandInfo3", # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: kebab-case}} + "schema": { + "type": "integer" + } + }, + { + "in": "header", + "name": "X-Request-ID", + "schema": { + "type": "string" + }, + "required": true + } + ], + "get": { + "parameters": [ + { + "in": "path", + "name": "pet_id", # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: kebab-case}} + "schema": { + "type": "integer" + } + }, + { + "in": "path", + "name": "petId", # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: kebab-case}} + "schema": { + "type": "integer" + } + }, + { + "in": "path", + "name": "PET-ID", # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: kebab-case}} + "schema": { + "type": "integer" + } + }, + { + "in": "query", + "name": "expand_info", # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: kebab-case}} + "schema": { + "type": "integer" + } + }, + { + "in": "query", + "name": "expandInfo", # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: kebab-case}} + "schema": { + "type": "integer" + } + }, + { + "in": "query", + "name": "EXPAND-INFO", # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: kebab-case}} + "schema": { + "type": "integer" + } + }, + { + "in": "query", + "name": "expandInfo3", # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: kebab-case}} + "schema": { + "type": "integer" + } + }, + { + "in": "header", + "name": "X-Request-ID", + "schema": { + "type": "string" + }, + "required": true + } + ], + "responses": { + "200": { + "description": "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/format/OAR012/kebab-case-plain.yaml b/src/test/resources/checks/v32/format/OAR012/kebab-case-plain.yaml new file mode 100644 index 00000000..a1b924e6 --- /dev/null +++ b/src/test/resources/checks/v32/format/OAR012/kebab-case-plain.yaml @@ -0,0 +1,78 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: + parameters: + - in: path + name: pet_id # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: kebab-case}} + schema: + type: integer + - in: path + name: petId # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: kebab-case}} + schema: + type: integer + - in: path + name: PET-ID # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: kebab-case}} + schema: + type: integer + - in: query + name: expand_info # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: kebab-case}} + schema: + type: integer + - in: query + name: expandInfo # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: kebab-case}} + schema: + type: integer + - in: query + name: EXPAND-INFO # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: kebab-case}} + schema: + type: integer + - in: query + name: expandInfo3 # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: kebab-case}} + schema: + type: integer + - in: header + name: X-Request-ID + schema: + type: string + required: true + get: + parameters: + - in: path + name: pet_id # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: kebab-case}} + schema: + type: integer + - in: path + name: petId # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: kebab-case}} + schema: + type: integer + - in: path + name: PET-ID # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: kebab-case}} + schema: + type: integer + - in: query + name: expand_info # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: kebab-case}} + schema: + type: integer + - in: query + name: expandInfo # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: kebab-case}} + schema: + type: integer + - in: query + name: EXPAND-INFO # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: kebab-case}} + schema: + type: integer + - in: query + name: expandInfo3 # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: kebab-case}} + schema: + type: integer + - in: header + name: X-Request-ID + schema: + type: string + required: true + responses: + 200: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v32/format/OAR012/kebab-case-with-$ref.json b/src/test/resources/checks/v32/format/OAR012/kebab-case-with-$ref.json new file mode 100644 index 00000000..bedb4b36 --- /dev/null +++ b/src/test/resources/checks/v32/format/OAR012/kebab-case-with-$ref.json @@ -0,0 +1,209 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "components": { + "parameters": { + "petType": { + "in": "path", + "name": "pet-type", + "schema": { + "type": "integer" + } + }, + "pathParamOk": { + "in": "path", + "name": "petId", # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: kebab-case}} + "schema": { + "type": "integer" + } + }, + "pathParamWrong1": { + "in": "path", + "name": "pet_id", # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: kebab-case}} + "schema": { + "type": "integer" + } + }, + "pathParamWrong2": { + "in": "path", + "name": "PET-ID", # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: kebab-case}} + "schema": { + "type": "integer" + } + }, + "queryParamOk": { + "in": "query", + "name": "expandInfo", # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: kebab-case}} + "schema": { + "type": "integer" + } + }, + "queryParamWrong1": { + "in": "query", + "name": "expand_info", # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: kebab-case}} + "schema": { + "type": "integer" + } + }, + "queryParamWrong2": { + "in": "query", + "name": "expand-info", + "schema": { + "type": "integer" + } + }, + "headerParam": { + "in": "header", + "name": "X-Request-ID", + "schema": { + "type": "string" + }, + "required": true + } + }, + "schemas": { + "Pet": { + "type": "object", + "properties": { + "pet-type": { + "type": "string" + }, + "petAge": { # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: kebab-case}} + "type": "number" + }, + "pet_name": { # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: kebab-case}} + "type": "string" + } + } + } + }, + "requestBodies": { + "PetsPostRequest": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "pet_name": { # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: kebab-case}} + "type": "string" + } + } + } + } + } + } + }, + "responses": { + "PetsResponse": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "pet_name": { # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: kebab-case}} + "type": "string" + } + } + } + } + } + } + } + }, + "paths": { + "/pets": { + "parameters": [ + { + "$ref": "#/components/parameters/petType" + }, + { + "in": "path", + "name": "petName", # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: kebab-case}} + "schema": { + "type": "string" + } + } + ], + "post": { + "parameters": [ + { + "$ref": "#/components/parameters/pathParamOk" + }, + { + "$ref": "#/components/parameters/pathParamWrong1" + }, + { + "$ref": "#/components/parameters/pathParamWrong2" + }, + { + "$ref": "#/components/parameters/queryParamOk" + }, + { + "$ref": "#/components/parameters/queryParamWrong1" + }, + { + "$ref": "#/components/parameters/queryParamWrong2" + }, + { + "$ref": "#/components/parameters/headerParam" + } + ], + "requestBody": { + "$ref": "#/components/requestBodies/PetsPostRequest" + }, + "responses": { + "200": { + "$ref": "#/components/responses/PetsResponse" + } + } + }, + "put": { + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "pet_name": { # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: kebab-case}} + "type": "string" + } + } + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/Pet" + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "pet_name": { # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: kebab-case}} + "type": "string" + } + } + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/Pet" + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/format/OAR012/kebab-case-with-$ref.yaml b/src/test/resources/checks/v32/format/OAR012/kebab-case-with-$ref.yaml new file mode 100644 index 00000000..73975f4f --- /dev/null +++ b/src/test/resources/checks/v32/format/OAR012/kebab-case-with-$ref.yaml @@ -0,0 +1,130 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +components: + parameters: + petType: + in: path + name: pet-Type # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: kebab-case}} + schema: + type: integer + pathParamOk: + in: path + name: petId # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: kebab-case}} + schema: + type: integer + pathParamWrong1: + in: path + name: pet_id # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: kebab-case}} + schema: + type: integer + pathParamWrong2: + in: path + name: PET-ID # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: kebab-case}} + schema: + type: integer + queryParamOk: + in: query + name: expandInfo # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: kebab-case}} + schema: + type: integer + queryParamWrong1: + in: query + name: expand_info # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: kebab-case}} + schema: + type: integer + queryParamWrong2: + in: query + name: expand-info + schema: + type: integer + headerParam: + in: header + name: X-Request-ID + schema: + type: string + required: true + schemas: + Pet: + type: object + properties: + pet-type: + type: string + petAge: # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: kebab-case}} + type: number + pet_name: # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: kebab-case}} + type: string + requestBodies: + PetsPostRequest: + content: + application/json: + schema: + type: object + properties: + pet_name: # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: kebab-case}} + type: string + petAge: # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: kebab-case}} + type: number + responses: + PetsResponse: + description: OK + content: + application/json: + schema: + type: object + properties: + pet_name: # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: kebab-case}} + type: string + +paths: + /pets: + parameters: + - $ref: "#/components/parameters/petType" + - in: path + name: petName # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: kebab-case}} + schema: + type: string + post: + parameters: + - $ref: '#/components/parameters/pathParamOk' + - $ref: '#/components/parameters/pathParamWrong1' + - $ref: '#/components/parameters/pathParamWrong2' + - $ref: '#/components/parameters/queryParamOk' + - $ref: '#/components/parameters/queryParamWrong1' + - $ref: '#/components/parameters/queryParamWrong2' + - $ref: '#/components/parameters/headerParam' + requestBody: + $ref: '#/components/requestBodies/PetsPostRequest' + responses: + 200: + $ref: '#/components/responses/PetsResponse' + put: + requestBody: + content: + application/json: + schema: + type: object + properties: + pet_name: # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: kebab-case}} + type: string + petAge: # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: kebab-case}} + type: number + application/xml: + schema: + $ref: '#/components/schemas/Pet' + responses: + 200: + description: OK + content: + application/json: + schema: + type: object + properties: + pet_name: # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: kebab-case}} + type: string + petAge: # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: kebab-case}} + type: number + application/xml: + schema: + $ref: '#/components/schemas/Pet' \ No newline at end of file diff --git a/src/test/resources/checks/v32/format/OAR012/snake-case-plain.json b/src/test/resources/checks/v32/format/OAR012/snake-case-plain.json new file mode 100644 index 00000000..48e07f45 --- /dev/null +++ b/src/test/resources/checks/v32/format/OAR012/snake-case-plain.json @@ -0,0 +1,136 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/pets": { + "parameters": [ + { + "in": "path", + "name": "pet_id", + "schema": { + "type": "integer" + } + }, + { + "in": "path", + "name": "petId", # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: snake_case}} + "schema": { + "type": "integer" + } + }, + { + "in": "path", + "name": "PET-ID", # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: snake_case}} + "schema": { + "type": "integer" + } + }, + { + "in": "query", + "name": "expand_info", + "schema": { + "type": "integer" + } + }, + { + "in": "query", + "name": "expandInfo", # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: snake_case}} + "schema": { + "type": "integer" + } + }, + { + "in": "query", + "name": "EXPAND-INFO", # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: snake_case}} + "schema": { + "type": "integer" + } + }, + { + "in": "query", + "name": "expandInfo3", # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: snake_case}} + "schema": { + "type": "integer" + } + }, + { + "in": "header", + "name": "X-Request-ID", + "schema": { + "type": "string" + }, + "required": true + } + ], + "get": { + "parameters": [ + { + "in": "path", + "name": "pet_id", + "schema": { + "type": "integer" + } + }, + { + "in": "path", + "name": "petId", # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: snake_case}} + "schema": { + "type": "integer" + } + }, + { + "in": "path", + "name": "PET-ID", # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: snake_case}} + "schema": { + "type": "integer" + } + }, + { + "in": "query", + "name": "expand_info", + "schema": { + "type": "integer" + } + }, + { + "in": "query", + "name": "expandInfo", # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: snake_case}} + "schema": { + "type": "integer" + } + }, + { + "in": "query", + "name": "EXPAND-INFO", # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: snake_case}} + "schema": { + "type": "integer" + } + }, + { + "in": "query", + "name": "expandInfo3", # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: snake_case}} + "schema": { + "type": "integer" + } + }, + { + "in": "header", + "name": "X-Request-ID", + "schema": { + "type": "string" + }, + "required": true + } + ], + "responses": { + "200": { + "description": "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/format/OAR012/snake-case-plain.yaml b/src/test/resources/checks/v32/format/OAR012/snake-case-plain.yaml new file mode 100644 index 00000000..20bfa7f7 --- /dev/null +++ b/src/test/resources/checks/v32/format/OAR012/snake-case-plain.yaml @@ -0,0 +1,78 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: + parameters: + - in: path + name: pet_id + schema: + type: integer + - in: path + name: petId # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: snake_case}} + schema: + type: integer + - in: path + name: PET-ID # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: snake_case}} + schema: + type: integer + - in: query + name: expand_info + schema: + type: integer + - in: query + name: expandInfo # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: snake_case}} + schema: + type: integer + - in: query + name: EXPAND-INFO # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: snake_case}} + schema: + type: integer + - in: query + name: expandInfo3 # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: snake_case}} + schema: + type: integer + - in: header + name: X-Request-ID + schema: + type: string + required: true + get: + parameters: + - in: path + name: pet_id + schema: + type: integer + - in: path + name: petId # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: snake_case}} + schema: + type: integer + - in: path + name: PET-ID # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: snake_case}} + schema: + type: integer + - in: query + name: expand_info + schema: + type: integer + - in: query + name: expandInfo # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: snake_case}} + schema: + type: integer + - in: query + name: EXPAND-INFO # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: snake_case}} + schema: + type: integer + - in: query + name: expandInfo3 # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: snake_case}} + schema: + type: integer + - in: header + name: X-Request-ID + schema: + type: string + required: true + responses: + 200: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v32/format/OAR012/snake-case-with-$ref.json b/src/test/resources/checks/v32/format/OAR012/snake-case-with-$ref.json new file mode 100644 index 00000000..21c21650 --- /dev/null +++ b/src/test/resources/checks/v32/format/OAR012/snake-case-with-$ref.json @@ -0,0 +1,209 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "components": { + "parameters": { + "petType": { + "in": "path", + "name": "pet-Type", # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: snake_case}} + "schema": { + "type": "integer" + } + }, + "pathParamOk": { + "in": "path", + "name": "petId", # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: snake_case}} + "schema": { + "type": "integer" + } + }, + "pathParamWrong1": { + "in": "path", + "name": "pet_id", + "schema": { + "type": "integer" + } + }, + "pathParamWrong2": { + "in": "path", + "name": "PET-ID", # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: snake_case}} + "schema": { + "type": "integer" + } + }, + "queryParamOk": { + "in": "query", + "name": "expandInfo", # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: snake_case}} + "schema": { + "type": "integer" + } + }, + "queryParamWrong1": { + "in": "query", + "name": "expand_info", + "schema": { + "type": "integer" + } + }, + "queryParamWrong2": { + "in": "query", + "name": "expand-info", # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: snake_case}} + "schema": { + "type": "integer" + } + }, + "headerParam": { + "in": "header", + "name": "X-Request-ID", + "schema": { + "type": "string" + }, + "required": true + } + }, + "schemas": { + "Pet": { + "type": "object", + "properties": { + "pet-type": { # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: snake_case}} + "type": "string" + }, + "petAge": { # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: snake_case}} + "type": "number" + }, + "pet_name": { + "type": "string" + } + } + } + }, + "requestBodies": { + "PetsPostRequest": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "petName": { # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: snake_case}} + "type": "string" + } + } + } + } + } + } + }, + "responses": { + "PetsResponse": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "petName": { # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: snake_case}} + "type": "string" + } + } + } + } + } + } + } + }, + "paths": { + "/pets": { + "parameters": [ + { + "$ref": "#/components/parameters/petType" + }, + { + "in": "path", + "name": "petName", # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: snake_case}} + "schema": { + "type": "string" + } + } + ], + "post": { + "parameters": [ + { + "$ref": "#/components/parameters/pathParamOk" + }, + { + "$ref": "#/components/parameters/pathParamWrong1" + }, + { + "$ref": "#/components/parameters/pathParamWrong2" + }, + { + "$ref": "#/components/parameters/queryParamOk" + }, + { + "$ref": "#/components/parameters/queryParamWrong1" + }, + { + "$ref": "#/components/parameters/queryParamWrong2" + }, + { + "$ref": "#/components/parameters/headerParam" + } + ], + "requestBody": { + "$ref": "#/components/requestBodies/PetsPostRequest" + }, + "responses": { + "200": { + "$ref": "#/components/responses/PetsResponse" + } + } + }, + "put": { + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "pet_name": { + "type": "string" + } + } + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/Pet" + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "petName": { # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: snake_case}} + "type": "string" + } + } + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/Pet" + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/format/OAR012/snake-case-with-$ref.yaml b/src/test/resources/checks/v32/format/OAR012/snake-case-with-$ref.yaml new file mode 100644 index 00000000..c453758f --- /dev/null +++ b/src/test/resources/checks/v32/format/OAR012/snake-case-with-$ref.yaml @@ -0,0 +1,130 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +components: + parameters: + petType: + in: path + name: pet-Type # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: snake_case}} + schema: + type: integer + pathParamOk: + in: path + name: petId # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: snake_case}} + schema: + type: integer + pathParamWrong1: + in: path + name: pet_id + schema: + type: integer + pathParamWrong2: + in: path + name: PET-ID # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: snake_case}} + schema: + type: integer + queryParamOk: + in: query + name: expandInfo # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: snake_case}} + schema: + type: integer + queryParamWrong1: + in: query + name: expand_info + schema: + type: integer + queryParamWrong2: + in: query + name: expand-info # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: snake_case}} + schema: + type: integer + headerParam: + in: header + name: X-Request-ID + schema: + type: string + required: true + schemas: + Pet: + type: object + properties: + pet-type: # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: snake_case}} + type: string + petAge: # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: snake_case}} + type: number + pet_name: + type: string + requestBodies: + PetsPostRequest: + content: + application/json: + schema: + type: object + properties: + pet_name: + type: string + petAge: # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: snake_case}} + type: number + responses: + PetsResponse: + description: OK + content: + application/json: + schema: + type: object + properties: + petName: # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: snake_case}} + type: string + +paths: + /pets: + parameters: + - $ref: "#/components/parameters/petType" + - in: path + name: petName # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: snake_case}} + schema: + type: string + post: + parameters: + - $ref: '#/components/parameters/pathParamOk' + - $ref: '#/components/parameters/pathParamWrong1' + - $ref: '#/components/parameters/pathParamWrong2' + - $ref: '#/components/parameters/queryParamOk' + - $ref: '#/components/parameters/queryParamWrong1' + - $ref: '#/components/parameters/queryParamWrong2' + - $ref: '#/components/parameters/headerParam' + requestBody: + $ref: '#/components/requestBodies/PetsPostRequest' + responses: + 200: + $ref: '#/components/responses/PetsResponse' + put: + requestBody: + content: + application/json: + schema: + type: object + properties: + pet_name: + type: string + petAge: # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: snake_case}} + type: number + application/xml: + schema: + $ref: '#/components/schemas/Pet' + responses: + 200: + description: OK + content: + application/json: + schema: + type: object + properties: + pet_name: + type: string + petAge: # Noncompliant {{OAR012: Path params names, query params names, object names and property names with more than two words must be compliant with the standard naming convention: snake_case}} + type: number + application/xml: + schema: + $ref: '#/components/schemas/Pet' \ No newline at end of file diff --git a/src/test/resources/checks/v32/format/OAR016/nested.json b/src/test/resources/checks/v32/format/OAR016/nested.json new file mode 100644 index 00000000..3e10ecf6 --- /dev/null +++ b/src/test/resources/checks/v32/format/OAR016/nested.json @@ -0,0 +1,40 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/invoices": { + "get": { + "responses": { + "200": { + "description": "A invoice.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "price": { + "type": "number", + "format": "double" + }, + "nested": { + "type": "object", + "properties": { + "value": { + "type": "number", # Noncompliant {{OAR016: Numeric types requires a valid format}} + "format": "int64" + } + } + } + } + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/format/OAR016/nested.yaml b/src/test/resources/checks/v32/format/OAR016/nested.yaml new file mode 100644 index 00000000..99858ae1 --- /dev/null +++ b/src/test/resources/checks/v32/format/OAR016/nested.yaml @@ -0,0 +1,25 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /invoices: + get: + responses: + 200: + description: A invoice. + content: + application/json: + schema: + type: object + properties: + price: + type: number + format: double + nested: + type: object + properties: + value: + type: number # Noncompliant {{OAR016: Numeric types requires a valid format}} + format: int64 + diff --git a/src/test/resources/checks/v32/format/OAR016/plain.json b/src/test/resources/checks/v32/format/OAR016/plain.json new file mode 100644 index 00000000..d49aef02 --- /dev/null +++ b/src/test/resources/checks/v32/format/OAR016/plain.json @@ -0,0 +1,42 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/invoices": { + "get": { + "responses": { + "200": { + "description": "A invoice.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "product_id": { + "type": "integer", # Noncompliant {{OAR016: Numeric types requires a valid format}} + "format": "int128" + }, + "line": { + "type": "number", # Noncompliant {{OAR016: Numeric types requires a valid format}} + "format": "int32" + }, + "price": { + "type": "number", + "format": "double" + } + } + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/format/OAR016/plain.yaml b/src/test/resources/checks/v32/format/OAR016/plain.yaml new file mode 100644 index 00000000..004e61d7 --- /dev/null +++ b/src/test/resources/checks/v32/format/OAR016/plain.yaml @@ -0,0 +1,27 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /invoices: + get: + responses: + 200: + description: A invoice. + content: + application/json: + schema: + type: object + properties: + id: + type: integer + product_id: + type: integer # Noncompliant {{OAR016: Numeric types requires a valid format}} + format: int128 + line: + type: number # Noncompliant {{OAR016: Numeric types requires a valid format}} + format: int32 + price: + type: number + format: double + diff --git a/src/test/resources/checks/v32/format/OAR016/with-$ref.json b/src/test/resources/checks/v32/format/OAR016/with-$ref.json new file mode 100644 index 00000000..44d77260 --- /dev/null +++ b/src/test/resources/checks/v32/format/OAR016/with-$ref.json @@ -0,0 +1,47 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/invoices": { + "get": { + "responses": { + "200": { + "description": "A invoice.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "price": { + "type": "number", + "format": "double" + }, + "nested": { + "$ref": "#/components/schemas/nested" + } + } + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "nested": { + "type": "object", + "properties": { + "value": { + "type": "number", # Noncompliant {{OAR016: Numeric types requires a valid format}} + "format": "int64" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/format/OAR016/with-$ref.yaml b/src/test/resources/checks/v32/format/OAR016/with-$ref.yaml new file mode 100644 index 00000000..32be02fd --- /dev/null +++ b/src/test/resources/checks/v32/format/OAR016/with-$ref.yaml @@ -0,0 +1,29 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /invoices: + get: + responses: + 200: + description: A invoice. + content: + application/json: + schema: + type: object + properties: + price: + type: number + format: double + nested: + $ref: '#/components/schemas/nested' + +components: + schemas: + nested: + type: object + properties: + value: + type: number # Noncompliant {{OAR016: Numeric types requires a valid format}} + format: int64 diff --git a/src/test/resources/checks/v32/format/OAR037/complete.json b/src/test/resources/checks/v32/format/OAR037/complete.json new file mode 100644 index 00000000..dfefdf0b --- /dev/null +++ b/src/test/resources/checks/v32/format/OAR037/complete.json @@ -0,0 +1,116 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "components": { + "parameters": { + "paramOne": { + "in": "header", + "name": "paramOne", + "schema": { + "type": "string", # Noncompliant {{OAR037: String types requires a valid format}} + "format": "YYYY-MM-DD" + } + }, + "paramTwo": { + "in": "header", + "name": "paramTwo", + "schema": { + "type": "string", # Noncompliant {{OAR037: String types requires a valid format}} + "format": "YYYY-MM-DD" + } + } + } + }, + "paths": { + "/invoices": { + "parameters": [ + { + "$ref": "#/components/parameters/paramTwo" + }, + { + "in": "header", + "name": "paramThree", + "schema": { + "type": "string", # Noncompliant {{OAR037: String types requires a valid format}} + "format": "YYYY-MM-DD" + } + } + ], + "get": { + "parameters": [ + { + "$ref": "#/components/parameters/paramOne" + } + ], + "responses": { + "200": { + "description": "A invoice.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "without": { + "type": "string" + }, + "date": { + "type": "string", + "format": "date" + }, + "date-time": { + "type": "string", + "format": "date-time" + }, + "password": { + "type": "string", + "format": "password" + }, + "byte": { + "type": "string", + "format": "byte" + }, + "binary": { + "type": "string", + "format": "binary" + }, + "email": { + "type": "string", + "format": "email" + }, + "uuid": { + "type": "string", + "format": "uuid" + }, + "uri": { + "type": "string", + "format": "uri" + }, + "hostname": { + "type": "string", + "format": "hostname" + }, + "ipv4": { + "type": "string", + "format": "ipv4" + }, + "ipv6": { + "type": "string", + "format": "ipv6" + }, + "other": { + "type": "string", # Noncompliant {{OAR037: String types requires a valid format}} + "format": "YYYY-MM-DD" + } + } + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/format/OAR037/complete.yaml b/src/test/resources/checks/v32/format/OAR037/complete.yaml new file mode 100644 index 00000000..2e7b6f3f --- /dev/null +++ b/src/test/resources/checks/v32/format/OAR037/complete.yaml @@ -0,0 +1,76 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +components: + parameters: + paramOne: + in: header + name: paramOne + schema: + type: string # Noncompliant {{OAR037: String types requires a valid format}} + format: YYYY-MM-DD + paramTwo: + in: header + name: paramTwo + schema: + type: string # Noncompliant {{OAR037: String types requires a valid format}} + format: YYYY-MM-DD +paths: + /invoices: + parameters: + - $ref: '#/components/parameters/paramTwo' + - in: header + name: paramThree + schema: + type: string # Noncompliant {{OAR037: String types requires a valid format}} + format: YYYY-MM-DD + get: + parameters: + - $ref: '#/components/parameters/paramOne' + responses: + 200: + description: A invoice. + content: + application/json: + schema: + type: object + properties: + without: + type: string + date: + type: string + format: date + date-time: + type: string + format: date-time + password: + type: string + format: password + byte: + type: string + format: byte + binary: + type: string + format: binary + email: + type: string + format: email + uuid: + type: string + format: uuid + uri: + type: string + format: uri + hostname: + type: string + format: hostname + ipv4: + type: string + format: ipv4 + ipv6: + type: string + format: ipv6 + other: + type: string # Noncompliant {{OAR037: String types requires a valid format}} + format: YYYY-MM-DD diff --git a/src/test/resources/checks/v32/format/OAR037/nested.json b/src/test/resources/checks/v32/format/OAR037/nested.json new file mode 100644 index 00000000..4b6316e6 --- /dev/null +++ b/src/test/resources/checks/v32/format/OAR037/nested.json @@ -0,0 +1,36 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/invoices": { + "get": { + "responses": { + "200": { + "description": "A invoice.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "nested": { + "type": "object", + "properties": { + "value": { + "type": "string", # Noncompliant {{OAR037: String types requires a valid format}} + "format": "YYYY-MM-DD" + } + } + } + } + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/format/OAR037/nested.yaml b/src/test/resources/checks/v32/format/OAR037/nested.yaml new file mode 100644 index 00000000..e2ba0a91 --- /dev/null +++ b/src/test/resources/checks/v32/format/OAR037/nested.yaml @@ -0,0 +1,22 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /invoices: + get: + responses: + 200: + description: A invoice. + content: + application/json: + schema: + type: object + properties: + nested: + type: object + properties: + value: + type: string # Noncompliant {{OAR037: String types requires a valid format}} + format: YYYY-MM-DD + diff --git a/src/test/resources/checks/v32/format/OAR037/with-$ref.json b/src/test/resources/checks/v32/format/OAR037/with-$ref.json new file mode 100644 index 00000000..5707bfcb --- /dev/null +++ b/src/test/resources/checks/v32/format/OAR037/with-$ref.json @@ -0,0 +1,47 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/invoices": { + "get": { + "responses": { + "200": { + "description": "A invoice.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "price": { + "type": "number", + "format": "double" + }, + "nested": { + "$ref": "#/components/schemas/nested" + } + } + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "nested": { + "type": "object", + "properties": { + "value": { + "type": "string", # Noncompliant {{OAR037: String types requires a valid format}} + "format": "YYYY-MM-DD" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/format/OAR037/with-$ref.yaml b/src/test/resources/checks/v32/format/OAR037/with-$ref.yaml new file mode 100644 index 00000000..c7d2f1f4 --- /dev/null +++ b/src/test/resources/checks/v32/format/OAR037/with-$ref.yaml @@ -0,0 +1,29 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /invoices: + get: + responses: + 200: + description: A invoice. + content: + application/json: + schema: + type: object + properties: + price: + type: number + format: double + nested: + $ref: '#/components/schemas/nested' + +components: + schemas: + nested: + type: object + properties: + value: + type: string # Noncompliant {{OAR037: String types requires a valid format}} + format: YYYY-MM-DD diff --git a/src/test/resources/checks/v32/format/OAR042/incorrect-version.json b/src/test/resources/checks/v32/format/OAR042/incorrect-version.json new file mode 100644 index 00000000..74006c75 --- /dev/null +++ b/src/test/resources/checks/v32/format/OAR042/incorrect-version.json @@ -0,0 +1,13 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "servers" : [ + { + "url": "http://petstore.swagger.io/api-seguros/v1.0" # Noncompliant {{OAR042: Last path part must be the API version, indicated with the prefix 'v' and the version number as integer}} + } + ], + "paths" : { } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/format/OAR042/incorrect-version.yaml b/src/test/resources/checks/v32/format/OAR042/incorrect-version.yaml new file mode 100644 index 00000000..1a3a569a --- /dev/null +++ b/src/test/resources/checks/v32/format/OAR042/incorrect-version.yaml @@ -0,0 +1,7 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +servers: + - url: https://petstore.swagger.io/api-seguros/v1.0 # Noncompliant {{OAR042: Last path part must be the API version, indicated with the prefix 'v' and the version number as integer}} +paths: {} \ No newline at end of file diff --git a/src/test/resources/checks/v32/format/OAR042/too-long.json b/src/test/resources/checks/v32/format/OAR042/too-long.json new file mode 100644 index 00000000..8e22a1a2 --- /dev/null +++ b/src/test/resources/checks/v32/format/OAR042/too-long.json @@ -0,0 +1,13 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "servers" : [ + { + "url": "http://petstore.swagger.io/api-seguros/v1/vida" # Noncompliant {{OAR042: Path has to many parts}} + } + ], + "paths" : { } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/format/OAR042/too-long.yaml b/src/test/resources/checks/v32/format/OAR042/too-long.yaml new file mode 100644 index 00000000..a8df7af5 --- /dev/null +++ b/src/test/resources/checks/v32/format/OAR042/too-long.yaml @@ -0,0 +1,7 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +servers: + - url: https://petstore.swagger.io/api-seguros/v1/vida # Noncompliant {{OAR042: Path has to many parts}} +paths: {} \ No newline at end of file diff --git a/src/test/resources/checks/v32/format/OAR042/too-short.json b/src/test/resources/checks/v32/format/OAR042/too-short.json new file mode 100644 index 00000000..9f25cf4a --- /dev/null +++ b/src/test/resources/checks/v32/format/OAR042/too-short.json @@ -0,0 +1,13 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "servers" : [ + { + "url": "http://petstore.swagger.io/api-seguros" # Noncompliant {{OAR042: Path has to few parts}} + } + ], + "paths" : { } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/format/OAR042/too-short.yaml b/src/test/resources/checks/v32/format/OAR042/too-short.yaml new file mode 100644 index 00000000..cb29e522 --- /dev/null +++ b/src/test/resources/checks/v32/format/OAR042/too-short.yaml @@ -0,0 +1,7 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +servers: + - url: https://petstore.swagger.io/api-seguros # Noncompliant {{OAR042: Path has to few parts}} +paths: {} \ No newline at end of file diff --git a/src/test/resources/checks/v32/format/OAR042/valid.json b/src/test/resources/checks/v32/format/OAR042/valid.json new file mode 100644 index 00000000..6d48f8b4 --- /dev/null +++ b/src/test/resources/checks/v32/format/OAR042/valid.json @@ -0,0 +1,13 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "servers": [ + { + "url": "http://petstore.swagger.io/api-seguros/v1" + } + ], + "paths": { } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/format/OAR042/valid.yaml b/src/test/resources/checks/v32/format/OAR042/valid.yaml new file mode 100644 index 00000000..89bfccfb --- /dev/null +++ b/src/test/resources/checks/v32/format/OAR042/valid.yaml @@ -0,0 +1,7 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +servers: + - url: https://petstore.swagger.io/api-seguros/v1 +paths: {} \ No newline at end of file diff --git a/src/test/resources/checks/v32/format/OAR042/without-api-prefix.json b/src/test/resources/checks/v32/format/OAR042/without-api-prefix.json new file mode 100644 index 00000000..0f7cf628 --- /dev/null +++ b/src/test/resources/checks/v32/format/OAR042/without-api-prefix.json @@ -0,0 +1,13 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "servers" : [ + { + "url": "http://petstore.swagger.io/seguros/v1" # Noncompliant {{OAR042: API name must start with prefix 'api-'}} + } + ], + "paths" : { } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/format/OAR042/without-api-prefix.yaml b/src/test/resources/checks/v32/format/OAR042/without-api-prefix.yaml new file mode 100644 index 00000000..e026b5a3 --- /dev/null +++ b/src/test/resources/checks/v32/format/OAR042/without-api-prefix.yaml @@ -0,0 +1,7 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +servers: + - url: https://petstore.swagger.io/seguros/v1 # Noncompliant {{OAR042: API name must start with prefix 'api-'}} +paths: {} \ No newline at end of file diff --git a/src/test/resources/checks/v32/format/OAR052/nested.json b/src/test/resources/checks/v32/format/OAR052/nested.json new file mode 100644 index 00000000..42d01c17 --- /dev/null +++ b/src/test/resources/checks/v32/format/OAR052/nested.json @@ -0,0 +1,39 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/invoices": { + "get": { + "responses": { + "200": { + "description": "A invoice.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "price": { + "type": "number", + "format": "double" + }, + "nested": { + "type": "object", + "properties": { + "value": { + "type": "number" # Noncompliant {{OAR052: Numeric types requires a format}} + } + } + } + } + } + } + } + } + } + } + } + } +} diff --git a/src/test/resources/checks/v32/format/OAR052/nested.yaml b/src/test/resources/checks/v32/format/OAR052/nested.yaml new file mode 100644 index 00000000..9d3b88ee --- /dev/null +++ b/src/test/resources/checks/v32/format/OAR052/nested.yaml @@ -0,0 +1,24 @@ +openapi: 3.0.0 +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /invoices: + get: + responses: + '200': + description: A invoice. + content: + application/json: + schema: + type: object + properties: + price: + type: number + format: double + nested: + type: object + properties: + value: + type: number # Noncompliant {{OAR052: Numeric types requires a format}} + diff --git a/src/test/resources/checks/v32/format/OAR052/plain.json b/src/test/resources/checks/v32/format/OAR052/plain.json new file mode 100644 index 00000000..e1189a6e --- /dev/null +++ b/src/test/resources/checks/v32/format/OAR052/plain.json @@ -0,0 +1,40 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/invoices": { + "get": { + "responses": { + "200": { + "description": "A invoice.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int32" + }, + "product_id": { + "type": "integer" # Noncompliant {{OAR052: Numeric types requires a format}} + }, + "line": { + "type": "integer" # Noncompliant {{OAR052: Numeric types requires a format}} + }, + "price": { + "type": "number" # Noncompliant {{OAR052: Numeric types requires a format}} + } + } + } + } + } + } + } + } + } + } +} diff --git a/src/test/resources/checks/v32/format/OAR052/plain.yaml b/src/test/resources/checks/v32/format/OAR052/plain.yaml new file mode 100644 index 00000000..498442a5 --- /dev/null +++ b/src/test/resources/checks/v32/format/OAR052/plain.yaml @@ -0,0 +1,24 @@ +openapi: 3.0.0 +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /invoices: + get: + responses: + '200': + description: A invoice. + content: + application/json: + schema: + type: object + properties: + id: + type: integer + format: int32 + product_id: + type: integer # Noncompliant {{OAR052: Numeric types requires a format}} + line: + type: integer # Noncompliant {{OAR052: Numeric types requires a format}} + price: + type: number # Noncompliant {{OAR052: Numeric types requires a format}} diff --git a/src/test/resources/checks/v32/format/OAR052/with-$ref.json b/src/test/resources/checks/v32/format/OAR052/with-$ref.json new file mode 100644 index 00000000..f6d48586 --- /dev/null +++ b/src/test/resources/checks/v32/format/OAR052/with-$ref.json @@ -0,0 +1,46 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/invoices": { + "get": { + "responses": { + "200": { + "description": "A invoice.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "price": { + "type": "number", + "format": "double" + }, + "nested": { + "$ref": "#/components/schemas/nested" + } + } + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "nested": { + "type": "object", + "properties": { + "value": { + "type": "number" # Noncompliant {{OAR052: Numeric types requires a format}} + } + } + } + } + } +} diff --git a/src/test/resources/checks/v32/format/OAR052/with-$ref.yaml b/src/test/resources/checks/v32/format/OAR052/with-$ref.yaml new file mode 100644 index 00000000..5db4e652 --- /dev/null +++ b/src/test/resources/checks/v32/format/OAR052/with-$ref.yaml @@ -0,0 +1,28 @@ +openapi: 3.0.0 +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /invoices: + get: + responses: + '200': + description: A invoice. + content: + application/json: + schema: + type: object + properties: + price: + type: number + format: double + nested: + $ref: '#/components/schemas/nested' + +components: + schemas: + nested: + type: object + properties: + value: + type: number # Noncompliant {{OAR052: Numeric types requires a format}} diff --git a/src/test/resources/checks/v32/format/OAR066/snake-case-error.json b/src/test/resources/checks/v32/format/OAR066/snake-case-error.json new file mode 100644 index 00000000..5362c7f2 --- /dev/null +++ b/src/test/resources/checks/v32/format/OAR066/snake-case-error.json @@ -0,0 +1,42 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/user": { + "post": { + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "firstName": { "type": "string" }, # Noncompliant {{OAR066: RequestBody and Responses schema property names must be compliant with the snake_case naming convention}} + "last_name": { "type": "string" } + } + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "userID": { "type": "integer" }, # Noncompliant {{OAR066: RequestBody and Responses schema property names must be compliant with the snake_case naming convention}} + "user_name": { "type": "string" } + } + } + } + } + } + } + } + } + } + } \ No newline at end of file diff --git a/src/test/resources/checks/v32/format/OAR066/snake-case-error.yaml b/src/test/resources/checks/v32/format/OAR066/snake-case-error.yaml new file mode 100644 index 00000000..6bf327fb --- /dev/null +++ b/src/test/resources/checks/v32/format/OAR066/snake-case-error.yaml @@ -0,0 +1,29 @@ +openapi: 3.0.0 +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /user: + post: + requestBody: + content: + application/json: + schema: + type: object + properties: + firstName: # Noncompliant {{OAR066: RequestBody and Responses schema property names must be compliant with the snake_case naming convention}} + type: string + last_name: + type: string + responses: + '200': + description: Success + content: + application/json: + schema: + type: object + properties: + userID: # Noncompliant {{OAR066: RequestBody and Responses schema property names must be compliant with the snake_case naming convention}} + type: integer + user_name: + type: string \ No newline at end of file diff --git a/src/test/resources/checks/v32/format/OAR066/valid.json b/src/test/resources/checks/v32/format/OAR066/valid.json new file mode 100644 index 00000000..67217b92 --- /dev/null +++ b/src/test/resources/checks/v32/format/OAR066/valid.json @@ -0,0 +1,40 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/user": { + "post": { + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "last_name": { "type": "string" } + } + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "user_name": { "type": "string" } + } + } + } + } + } + } + } + } + } + } \ No newline at end of file diff --git a/src/test/resources/checks/v32/format/OAR066/valid.yaml b/src/test/resources/checks/v32/format/OAR066/valid.yaml new file mode 100644 index 00000000..04c50530 --- /dev/null +++ b/src/test/resources/checks/v32/format/OAR066/valid.yaml @@ -0,0 +1,25 @@ +openapi: 3.0.0 +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /user: + post: + requestBody: + content: + application/json: + schema: + type: object + properties: + last_name: + type: string + responses: + '200': + description: Success + content: + application/json: + schema: + type: object + properties: + user_name: + type: string \ No newline at end of file diff --git a/src/test/resources/checks/v32/format/OAR067/camel-case-error.json b/src/test/resources/checks/v32/format/OAR067/camel-case-error.json new file mode 100644 index 00000000..4307fccb --- /dev/null +++ b/src/test/resources/checks/v32/format/OAR067/camel-case-error.json @@ -0,0 +1,42 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/user": { + "post": { + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "first_name": { "type": "string" }, # Noncompliant {{OAR067: RequestBody and Responses schema property names must be compliant with the camelCase naming convention}} + "lastName": { "type": "string" } + } + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "user_id": { "type": "integer" }, # Noncompliant {{OAR067: RequestBody and Responses schema property names must be compliant with the camelCase naming convention}} + "userName": { "type": "string" } + } + } + } + } + } + } + } + } + } + } \ No newline at end of file diff --git a/src/test/resources/checks/v32/format/OAR067/camel-case-error.yaml b/src/test/resources/checks/v32/format/OAR067/camel-case-error.yaml new file mode 100644 index 00000000..ff6ba5c0 --- /dev/null +++ b/src/test/resources/checks/v32/format/OAR067/camel-case-error.yaml @@ -0,0 +1,29 @@ +openapi: 3.0.0 +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /user: + post: + requestBody: + content: + application/json: + schema: + type: object + properties: + first_name: # Noncompliant {{OAR067: RequestBody and Responses schema property names must be compliant with the camelCase naming convention}} + type: string + lastName: + type: string + responses: + '200': + description: Success + content: + application/json: + schema: + type: object + properties: + user_id: # Noncompliant {{OAR067: RequestBody and Responses schema property names must be compliant with the camelCase naming convention}} + type: integer + userName: + type: string \ No newline at end of file diff --git a/src/test/resources/checks/v32/format/OAR067/valid.json b/src/test/resources/checks/v32/format/OAR067/valid.json new file mode 100644 index 00000000..337a2f9b --- /dev/null +++ b/src/test/resources/checks/v32/format/OAR067/valid.json @@ -0,0 +1,40 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/user": { + "post": { + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "lastName": { "type": "string" } + } + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "userName": { "type": "string" } + } + } + } + } + } + } + } + } + } + } \ No newline at end of file diff --git a/src/test/resources/checks/v32/format/OAR067/valid.yaml b/src/test/resources/checks/v32/format/OAR067/valid.yaml new file mode 100644 index 00000000..8c80f35d --- /dev/null +++ b/src/test/resources/checks/v32/format/OAR067/valid.yaml @@ -0,0 +1,25 @@ +openapi: 3.0.0 +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /user: + post: + requestBody: + content: + application/json: + schema: + type: object + properties: + lastName: + type: string + responses: + '200': + description: Success + content: + application/json: + schema: + type: object + properties: + userName: + type: string \ No newline at end of file diff --git a/src/test/resources/checks/v32/format/OAR068/externalref.yaml b/src/test/resources/checks/v32/format/OAR068/externalref.yaml new file mode 100644 index 00000000..5035f52c --- /dev/null +++ b/src/test/resources/checks/v32/format/OAR068/externalref.yaml @@ -0,0 +1,62 @@ +openapi: 3.0.1 +info: + title: Sample-API_efc2b9f76813_V + contact: + name: Nombre del Contacto. + email: contact@mail.com + version: 1.0.12 +servers: + - url: https://api.example.es/api-sample/v1 +paths: + /datos-usuarios: + get: + summary: Listado de usuarios + parameters: + - name: desde + in: query + schema: + type: string + format: date + required: false + - name: hasta + in: query + schema: + type: string + format: date + required: false + responses: + '200': + description: OK. + headers: + X-Correlation-Id: + description: Cabecera 'X-Correlation-Id' + schema: + type: string + content: + application/json: + schema: # Noncompliant {{OAR068: RequestBody and Responses schema property names must be compliant with the PascalCase naming convention}} + $ref: >- + https://raw.githubusercontent.com/apiaddicts/sonaropenapi-rules/refs/heads/master/src/test/resources/externalRef/OAR068.yaml#/components/schemas/datosUsuario + '400': + description: Bad Request. + headers: + X-Correlation-Id: + description: Cabecera 'X-Correlation-Id' + schema: + type: string + content: + application/json: + schema: # Noncompliant {{OAR068: RequestBody and Responses schema property names must be compliant with the PascalCase naming convention}} + $ref: >- + https://raw.githubusercontent.com/apiaddicts/sonaropenapi-rules/refs/heads/master/src/test/resources/externalRef/OAR086.yaml#/components/schemas/ErrorMessage + example: + error: + status: '400' + message: Bad Request + path: /datos-usuario + type: https://docs.example.es/x/A1D8Aw + operationId: '10004' + errors: + - code: '101' + message: Invalid format + location: desde \ No newline at end of file diff --git a/src/test/resources/checks/v32/format/OAR068/pascal-case-error.json b/src/test/resources/checks/v32/format/OAR068/pascal-case-error.json new file mode 100644 index 00000000..b5f9521e --- /dev/null +++ b/src/test/resources/checks/v32/format/OAR068/pascal-case-error.json @@ -0,0 +1,41 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/user": { + "post": { + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "first_name": { "type": "string" }, # Noncompliant {{OAR068: RequestBody and Responses schema property names must be compliant with the PascalCase naming convention}} + } + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "user_id": { "type": "integer" }, # Noncompliant {{OAR068: RequestBody and Responses schema property names must be compliant with the PascalCase naming convention}} + "UserName": { "type": "string" } + } + } + } + } + } + } + } + } + } + } \ No newline at end of file diff --git a/src/test/resources/checks/v32/format/OAR068/pascal-case-error.yaml b/src/test/resources/checks/v32/format/OAR068/pascal-case-error.yaml new file mode 100644 index 00000000..eed1491d --- /dev/null +++ b/src/test/resources/checks/v32/format/OAR068/pascal-case-error.yaml @@ -0,0 +1,29 @@ +openapi: 3.0.0 +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /user: + post: + requestBody: + content: + application/json: + schema: + type: object + properties: + first_name: # Noncompliant {{OAR068: RequestBody and Responses schema property names must be compliant with the PascalCase naming convention}} + type: string + LastName: + type: string + responses: + '200': + description: Success + content: + application/json: + schema: + type: object + properties: + user_Id: # Noncompliant {{OAR068: RequestBody and Responses schema property names must be compliant with the PascalCase naming convention}} + type: integer + UserName: + type: string \ No newline at end of file diff --git a/src/test/resources/checks/v32/format/OAR068/valid.json b/src/test/resources/checks/v32/format/OAR068/valid.json new file mode 100644 index 00000000..f6204f15 --- /dev/null +++ b/src/test/resources/checks/v32/format/OAR068/valid.json @@ -0,0 +1,40 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/user": { + "post": { + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "LastName": { "type": "string" } + } + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "UserName": { "type": "string" } + } + } + } + } + } + } + } + } + } + } \ No newline at end of file diff --git a/src/test/resources/checks/v32/format/OAR068/valid.yaml b/src/test/resources/checks/v32/format/OAR068/valid.yaml new file mode 100644 index 00000000..b99b3dcc --- /dev/null +++ b/src/test/resources/checks/v32/format/OAR068/valid.yaml @@ -0,0 +1,25 @@ +openapi: 3.0.0 +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /user: + post: + requestBody: + content: + application/json: + schema: + type: object + properties: + LastName: + type: string + responses: + '200': + description: Success + content: + application/json: + schema: + type: object + properties: + UserName: + type: string \ No newline at end of file diff --git a/src/test/resources/checks/v32/format/OAR077/not-valid-in-query.json b/src/test/resources/checks/v32/format/OAR077/not-valid-in-query.json new file mode 100644 index 00000000..29dddea3 --- /dev/null +++ b/src/test/resources/checks/v32/format/OAR077/not-valid-in-query.json @@ -0,0 +1,34 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "API que cumple" + }, + "paths": { + "/usuarios": { + "get": { + "parameters": [ + { + "name": "username", + "in": "query", + "schema": { + "type": "string" + } + }, + { + "name": "userFirstName", # Noncompliant {{OAR077: All parameters in query must be snake_case}} + "in": "query", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/format/OAR077/not-valid-in-query.yaml b/src/test/resources/checks/v32/format/OAR077/not-valid-in-query.yaml new file mode 100644 index 00000000..6c43154d --- /dev/null +++ b/src/test/resources/checks/v32/format/OAR077/not-valid-in-query.yaml @@ -0,0 +1,19 @@ + openapi: "3.0.0" + info: + version: "1.0.0" + title: "API que cumple" + paths: + /usuarios: + get: + parameters: + - name: username + in: query + schema: + type: string + - name: userFirstName # Noncompliant {{OAR077: All parameters in query must be snake_case}} + in: query + schema: + type: string + responses: + 200: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v32/format/OAR077/valid-in-query.json b/src/test/resources/checks/v32/format/OAR077/valid-in-query.json new file mode 100644 index 00000000..bd383fd9 --- /dev/null +++ b/src/test/resources/checks/v32/format/OAR077/valid-in-query.json @@ -0,0 +1,34 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "API que cumple" + }, + "paths": { + "/usuarios": { + "get": { + "parameters": [ + { + "name": "username", + "in": "query", + "schema": { + "type": "string" + } + }, + { + "name": "user_first_name", + "in": "query", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/format/OAR077/valid-in-query.yaml b/src/test/resources/checks/v32/format/OAR077/valid-in-query.yaml new file mode 100644 index 00000000..286bf500 --- /dev/null +++ b/src/test/resources/checks/v32/format/OAR077/valid-in-query.yaml @@ -0,0 +1,19 @@ + openapi: "3.0.0" + info: + version: "1.0.0" + title: "API que cumple" + paths: + /usuarios: + get: + parameters: + - name: username + in: query + schema: + type: string + - name: hola_hola + in: query + schema: + type: string + responses: + 200: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v32/format/OAR086/external-refexample.yaml b/src/test/resources/checks/v32/format/OAR086/external-refexample.yaml new file mode 100644 index 00000000..942a056b --- /dev/null +++ b/src/test/resources/checks/v32/format/OAR086/external-refexample.yaml @@ -0,0 +1,62 @@ +openapi: 3.0.1 +info: + title: Sample-API_efc2b9f76813_V + contact: + name: Nombre del Contacto. + email: contact@mail.com + version: 1.0.12 +servers: + - url: https://api.example.es/api-sample/v1 +paths: + /datos-usuarios: + get: + summary: Listado de usuarios + parameters: + - name: desde + in: query + schema: + type: string + format: date + required: false + - name: hasta + in: query + schema: + type: string + format: date + required: false + responses: + '200': + description: OK. + headers: + X-Correlation-Id: + description: Cabecera 'X-Correlation-Id' + schema: + type: string + content: + application/json: + schema: + $ref: >- # Noncompliant {{OAR086: Descriptions must begin with a capital letter, end with a period and not be empty}} + https://raw.githubusercontent.com/apiaddicts/sonaropenapi-rules/refs/heads/master/src/test/resources/externalRef/OAR086.yaml#/components/schemas/datosUsuario + '400': + description: Bad Request. + headers: + X-Correlation-Id: + description: Cabecera 'X-Correlation-Id' + schema: + type: string + content: + application/json: + schema: + $ref: >- # Noncompliant {{OAR086: Descriptions must begin with a capital letter, end with a period and not be empty}} + https://raw.githubusercontent.com/apiaddicts/sonaropenapi-rules/refs/heads/master/src/test/resources/externalRef/OAR086.yaml#/components/schemas/ErrorMessage + example: + error: + status: '400' + message: Bad Request + path: /datos-usuario + type: https://docs.example.es/x/A1D8Aw + operationId: '10004' + errors: + - code: '101' + message: Invalid format + location: desde \ No newline at end of file diff --git a/src/test/resources/checks/v32/format/OAR086/internal-refexample.yaml b/src/test/resources/checks/v32/format/OAR086/internal-refexample.yaml new file mode 100644 index 00000000..940aa7ce --- /dev/null +++ b/src/test/resources/checks/v32/format/OAR086/internal-refexample.yaml @@ -0,0 +1,66 @@ +openapi: 3.0.1 +info: + title: Sample-API_efc2b9f76813_V + contact: + name: Nombre del Contacto. + email: contact@mail.com + version: 1.0.12 +servers: + - url: https://api.example.es/api-sample/v1 +paths: + /datos-usuarios: + get: + summary: Listado de usuarios. + description: Método que permite obtener un listado con datos básicos de un usuario. + parameters: + - name: desde + in: query + schema: + type: string + format: date + required: false + - name: hasta + in: query + schema: + type: string + format: date + required: false + responses: + '200': + description: OK. + headers: + X-Correlation-Id: + description: Cabecera 'X-Correlation-Id' + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/errorMessage' +components: + schemas: + errorMessage: + required: + - message + - status + type: object + properties: + status: + type: string + description: Especifica el status code HTTP al que se traducirá la excepción # Noncompliant {{OAR086: Descriptions must begin with a capital letter, end with a period and not be empty}} + message: + type: string + description: Mensaje descriptivo del error. + path: + type: string + description: URL path de la petición que originó el error. + type: + type: string + description: URL que apunta a una descripción de los códigos de error. + operationId: + type: string + description: Id de negocio de la operación realizada. + errors: + type: array + description: Listado de suberrores usado para dar información más detallada, + como en el caso de errores de validación. diff --git a/src/test/resources/checks/v32/format/OAR086/invalid-example.json b/src/test/resources/checks/v32/format/OAR086/invalid-example.json new file mode 100644 index 00000000..8321f08a --- /dev/null +++ b/src/test/resources/checks/v32/format/OAR086/invalid-example.json @@ -0,0 +1,60 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "Sample API", + "version": "1.0.0", + "description": "esta es la descripción de la API." # Noncompliant {{OAR086: Descriptions must begin with a capital letter, end with a period and not be empty}} + }, + "paths": { + "/pets": { + "get": { + "summary": "lista de mascotas.", + "description": "", # Noncompliant {{OAR086: Descriptions must begin with a capital letter, end with a period and not be empty}} + "parameters": [ + { + "name": "desde", + "in": "query", + "schema": { + "type": "string", + "format": "date" + }, + "required": false, + "description": "describe init time" # Noncompliant {{OAR086: Descriptions must begin with a capital letter, end with a period and not be empty}} + }, + { + "name": "hasta", + "in": "query", + "schema": { + "type": "string", + "format": "date" + }, + "required": false, + "description": "descibe parameter" # Noncompliant {{OAR086: Descriptions must begin with a capital letter, end with a period and not be empty}} + } + ], + "responses": { + "200": { + "description": "una lista de mascotas." # Noncompliant {{OAR086: Descriptions must begin with a capital letter, end with a period and not be empty}} + } + } + } + } + }, + "components": { + "schemas": { + "Pet": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "name": { + "type": "string" + } + }, + "description": "Representa una mascota" # Noncompliant {{OAR086: Descriptions must begin with a capital letter, end with a period and not be empty}} + } + } + } + } \ No newline at end of file diff --git a/src/test/resources/checks/v32/format/OAR086/invalid-example.yaml b/src/test/resources/checks/v32/format/OAR086/invalid-example.yaml new file mode 100644 index 00000000..6c04e09d --- /dev/null +++ b/src/test/resources/checks/v32/format/OAR086/invalid-example.yaml @@ -0,0 +1,41 @@ +openapi: 3.0.0 +info: + title: Sample API + version: 1.0.0 + description: Esta es la descripción de la API # Noncompliant {{OAR086: Descriptions must begin with a capital letter, end with a period and not be empty}} + +paths: + /pets: + get: + summary: lista de mascotas. + description: esta ruta devuelve una lista de mascotas # Noncompliant {{OAR086: Descriptions must begin with a capital letter, end with a period and not be empty}} + parameters: + - name: desde + in: query + schema: + type: string + format: date + required: false + description: describe init time # Noncompliant {{OAR086: Descriptions must begin with a capital letter, end with a period and not be empty}} + - name: hasta + in: query + schema: + type: string + format: date + required: false + description: descibe parameter # Noncompliant {{OAR086: Descriptions must begin with a capital letter, end with a period and not be empty}} + responses: + '200': + description: Una lista de mascotas # Noncompliant {{OAR086: Descriptions must begin with a capital letter, end with a period and not be empty}} + +components: + schemas: + Pet: + type: object + properties: + id: + type: integer + format: int64 + name: + type: string + description: Representa una mascota # Noncompliant {{OAR086: Descriptions must begin with a capital letter, end with a period and not be empty}} \ No newline at end of file diff --git a/src/test/resources/checks/v32/format/OAR086/valid-example.json b/src/test/resources/checks/v32/format/OAR086/valid-example.json new file mode 100644 index 00000000..01e82101 --- /dev/null +++ b/src/test/resources/checks/v32/format/OAR086/valid-example.json @@ -0,0 +1,60 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "Sample API", + "version": "1.0.0", + "description": "Esta es la descripción de la API." + }, + "paths": { + "/pets": { + "get": { + "summary": "Lista de mascotas.", + "description": "Esta ruta devuelve una lista de mascotas.", + "parameters": [ + { + "name": "desde", + "in": "query", + "schema": { + "type": "string", + "format": "date" + }, + "required": false, + "description": "Especifica el parámetro." + }, + { + "name": "hasta", + "in": "query", + "schema": { + "type": "string", + "format": "date" + }, + "required": false, + "description": "Especifica el parámetro." + } + ], + "responses": { + "200": { + "description": "Una lista de mascotas." + } + } + } + } + }, + "components": { + "schemas": { + "Pet": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "name": { + "type": "string" + } + }, + "description": "Representa una mascota." + } + } + } + } \ No newline at end of file diff --git a/src/test/resources/checks/v32/format/OAR086/valid-example.yaml b/src/test/resources/checks/v32/format/OAR086/valid-example.yaml new file mode 100644 index 00000000..ef4ed2a8 --- /dev/null +++ b/src/test/resources/checks/v32/format/OAR086/valid-example.yaml @@ -0,0 +1,69 @@ +openapi: 3.0.1 +info: + title: Sample-API_efc2b9f76813_V + description: API de ejemplo para pruebas. + contact: + name: Nombre del Contacto. + email: contact@mail.com + version: 1.0.12 +servers: + - url: https://api.example.es/api-sample/v1 +paths: + /datos-usuarios: + get: + summary: Listado de usuarios. + description: Método que permite obtener un listado con datos básicos de un usuario. + parameters: + - name: desde + in: query + schema: + type: string + format: date + required: false + description: Especifica el parámetro. + - name: hasta + in: query + schema: + type: string + format: date + required: false + description: Especifica el parámetro. + responses: + '200': + description: OK. + headers: + X-Correlation-Id: + description: Cabecera 'X-Correlation-Id' + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/errorMessage' +components: + schemas: + errorMessage: + required: + - message + - status + type: object + properties: + status: + type: string + description: Especifica el status code HTTP al que se traducirá la excepción. + message: + type: string + description: Mensaje descriptivo del error. + path: + type: string + description: URL path de la petición que originó el error. + type: + type: string + description: URL que apunta a una descripción de los códigos de error. + operationId: + type: string + description: Id de negocio de la operación realizada. + errors: + type: array + description: Listado de suberrores usado para dar información más detallada, + como en el caso de errores de validación. diff --git a/src/test/resources/checks/v32/format/OAR087/invalid-example.json b/src/test/resources/checks/v32/format/OAR087/invalid-example.json new file mode 100644 index 00000000..afcb9b95 --- /dev/null +++ b/src/test/resources/checks/v32/format/OAR087/invalid-example.json @@ -0,0 +1,38 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "Sample API", + "version": "1.0.0", + "description": "Esta es la descripción de la API.", + }, + "paths": { + "/pets": { + "get": { + "summary": "Lista de mascotas", # Noncompliant {{OAR087: Summaries must begin with a capital letter, end with a period and not be empty}} + "description": "Esta ruta devuelve una lista de mascotas.", + "responses": { + "200": { + "description": "Una lista de mascotas retornada con éxito." + } + } + } + } + }, + "components": { + "schemas": { + "Pet": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "name": { + "type": "string" + } + }, + "description": "Representa una mascota.", + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/format/OAR087/invalid-example.yaml b/src/test/resources/checks/v32/format/OAR087/invalid-example.yaml new file mode 100644 index 00000000..32d303bf --- /dev/null +++ b/src/test/resources/checks/v32/format/OAR087/invalid-example.yaml @@ -0,0 +1,26 @@ +openapi: 3.0.0 +info: + title: Sample API + version: 1.0.0 + description: Esta es la descripción de la API. + +paths: + /pets: + get: + summary: lista de mascotas. # Noncompliant {{OAR087: Summaries must begin with a capital letter, end with a period and not be empty}} + description: Esta ruta devuelve una lista de mascotas. + responses: + '200': + description: Una lista de mascotas retornada con éxito. + +components: + schemas: + Pet: + type: object + properties: + id: + type: integer + format: int64 + name: + type: string + description: Representa una mascota. diff --git a/src/test/resources/checks/v32/format/OAR087/valid-example.json b/src/test/resources/checks/v32/format/OAR087/valid-example.json new file mode 100644 index 00000000..e5974b79 --- /dev/null +++ b/src/test/resources/checks/v32/format/OAR087/valid-example.json @@ -0,0 +1,38 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "Sample API", + "version": "1.0.0", + "description": "Esta es la descripción de la API.", + }, + "paths": { + "/pets": { + "get": { + "summary": "Lista de mascotas.", + "description": "Esta ruta devuelve una lista de mascotas.", + "responses": { + "200": { + "description": "Una lista de mascotas retornada con éxito." + } + } + } + } + }, + "components": { + "schemas": { + "Pet": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "name": { + "type": "string" + } + }, + "description": "Representa una mascota.", + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/format/OAR087/valid-example.yaml b/src/test/resources/checks/v32/format/OAR087/valid-example.yaml new file mode 100644 index 00000000..640a360c --- /dev/null +++ b/src/test/resources/checks/v32/format/OAR087/valid-example.yaml @@ -0,0 +1,26 @@ +openapi: 3.0.0 +info: + title: Sample API + version: 1.0.0 + description: Esta es la descripción de la API. + +paths: + /pets: + get: + summary: Lista de mascotas. + description: Esta ruta devuelve una lista de mascotas. + responses: + '200': + description: Una lista de mascotas retornada con éxito. + +components: + schemas: + Pet: + type: object + properties: + id: + type: integer + format: int64 + name: + type: string + description: Representa una mascota. diff --git a/src/test/resources/checks/v32/format/OAR088/invalid-ref.json b/src/test/resources/checks/v32/format/OAR088/invalid-ref.json new file mode 100644 index 00000000..0c64ff1b --- /dev/null +++ b/src/test/resources/checks/v32/format/OAR088/invalid-ref.json @@ -0,0 +1,35 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "API de ejemplo", + "version": "1.0" + }, + "paths": { + "/mascotas": { + "get": { + "parameters": [ + { + "$ref": "#/components/parameters/idMascotaRef" # Noncompliant {{OAR088: The $ref of a parameter must end with the suffix Param}} + } + ], + "responses": { + "200": { + "description": "Lista de mascotas" + } + } + } + } + }, + "components": { + "parameters": { + "idMascotaRef": { + "name": "idMascota", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + } + } + } + } \ No newline at end of file diff --git a/src/test/resources/checks/v32/format/OAR088/invalid-ref.yaml b/src/test/resources/checks/v32/format/OAR088/invalid-ref.yaml new file mode 100644 index 00000000..1fcb570d --- /dev/null +++ b/src/test/resources/checks/v32/format/OAR088/invalid-ref.yaml @@ -0,0 +1,20 @@ +openapi: 3.0.0 +info: + title: API de ejemplo + version: "1.0" +paths: + /mascotas: + get: + parameters: + - $ref: '#/components/parameters/idMascotaRef' # Noncompliant {{OAR088: The $ref of a parameter must end with the suffix Param}} + responses: + '200': + description: Lista de mascotas +components: + parameters: + idMascotaRef: + name: idMascota + in: query + required: true + schema: + type: string \ No newline at end of file diff --git a/src/test/resources/checks/v32/format/OAR088/valid-ref.json b/src/test/resources/checks/v32/format/OAR088/valid-ref.json new file mode 100644 index 00000000..c113399f --- /dev/null +++ b/src/test/resources/checks/v32/format/OAR088/valid-ref.json @@ -0,0 +1,35 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "API de ejemplo", + "version": "1.0" + }, + "paths": { + "/mascotas": { + "get": { + "parameters": [ + { + "$ref": "#/components/parameters/idMascotaParam" + } + ], + "responses": { + "200": { + "description": "Lista de mascotas" + } + } + } + } + }, + "components": { + "parameters": { + "idMascotaParam": { + "name": "idMascota", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + } + } + } + } \ No newline at end of file diff --git a/src/test/resources/checks/v32/format/OAR088/valid-ref.yaml b/src/test/resources/checks/v32/format/OAR088/valid-ref.yaml new file mode 100644 index 00000000..3a2d8abe --- /dev/null +++ b/src/test/resources/checks/v32/format/OAR088/valid-ref.yaml @@ -0,0 +1,20 @@ +openapi: 3.0.0 +info: + title: API de ejemplo + version: "1.0" +paths: + /mascotas: + get: + parameters: + - $ref: '#/components/parameters/idMascotaParam' + responses: + '200': + description: Lista de mascotas +components: + parameters: + idMascotaParam: + name: idMascota + in: query + required: true + schema: + type: string \ No newline at end of file diff --git a/src/test/resources/checks/v32/format/OAR089/invalid-ref.json b/src/test/resources/checks/v32/format/OAR089/invalid-ref.json new file mode 100644 index 00000000..9c316602 --- /dev/null +++ b/src/test/resources/checks/v32/format/OAR089/invalid-ref.json @@ -0,0 +1,49 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "API Sample", + "version": "1.0.0" + }, + "paths": { + "/pets": { + "get": { + "parameters": [ + { + "name": "petId", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Successful response" + } + }, + "requestBody": { + "$ref": "#/components/requestBodies/PetDetailsIncorrect" # Noncompliant {{OAR089: The $ref of a request body must end with the suffix Body}} + } + } + } + }, + "components": { + "requestBodies": { + "PetDetailsIncorrect": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string" + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/format/OAR089/invalid-ref.yaml b/src/test/resources/checks/v32/format/OAR089/invalid-ref.yaml new file mode 100644 index 00000000..21fe46df --- /dev/null +++ b/src/test/resources/checks/v32/format/OAR089/invalid-ref.yaml @@ -0,0 +1,28 @@ +openapi: '3.0.0' +info: + title: API Sample + version: '1.0.0' +paths: + /pets: + get: + parameters: + - name: petId + in: path + required: true + schema: + type: string + responses: + '200': + description: Successful response + requestBody: + $ref: '#/components/requestBodies/PetDetailsIncorrect' # Noncompliant {{OAR089: The $ref of a request body must end with the suffix Body}} +components: + requestBodies: + PetDetailsIncorrect: + content: + application/json: + schema: + type: object + properties: + name: + type: string \ No newline at end of file diff --git a/src/test/resources/checks/v32/format/OAR089/valid-ref.json b/src/test/resources/checks/v32/format/OAR089/valid-ref.json new file mode 100644 index 00000000..0dcbcfa9 --- /dev/null +++ b/src/test/resources/checks/v32/format/OAR089/valid-ref.json @@ -0,0 +1,49 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "API Sample", + "version": "1.0.0" + }, + "paths": { + "/pets": { + "get": { + "parameters": [ + { + "name": "petId", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Successful response" + } + }, + "requestBody": { + "$ref": "#/components/requestBodies/PetDetailsBody" + } + } + } + }, + "components": { + "requestBodies": { + "PetDetailsBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string" + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/format/OAR089/valid-ref.yaml b/src/test/resources/checks/v32/format/OAR089/valid-ref.yaml new file mode 100644 index 00000000..df379934 --- /dev/null +++ b/src/test/resources/checks/v32/format/OAR089/valid-ref.yaml @@ -0,0 +1,28 @@ +openapi: '3.0.0' +info: + title: API Sample + version: '1.0.0' +paths: + /pets: + get: + parameters: + - name: petId + in: path + required: true + schema: + type: string + responses: + '200': + description: Successful response + requestBody: + $ref: '#/components/requestBodies/PetDetailsBody' +components: + requestBodies: + PetDetailsBody: + content: + application/json: + schema: + type: object + properties: + name: + type: string \ No newline at end of file diff --git a/src/test/resources/checks/v32/format/OAR090/invalid-ref.json b/src/test/resources/checks/v32/format/OAR090/invalid-ref.json new file mode 100644 index 00000000..497987b9 --- /dev/null +++ b/src/test/resources/checks/v32/format/OAR090/invalid-ref.json @@ -0,0 +1,25 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "Sample API", + "version": "1.0.0" + }, + "paths": { + "/sample": { + "get": { + "responses": { + "200": { + "$ref": "#/components/responses/InvalidRef" # Noncompliant {{OAR090: The $ref of a response must end with the suffix Response}} + } + } + } + } + }, + "components": { + "responses": { + "InvalidRef": { + "description": "Successful response" + } + } + } + } \ No newline at end of file diff --git a/src/test/resources/checks/v32/format/OAR090/invalid-ref.yaml b/src/test/resources/checks/v32/format/OAR090/invalid-ref.yaml new file mode 100644 index 00000000..8bcdbea7 --- /dev/null +++ b/src/test/resources/checks/v32/format/OAR090/invalid-ref.yaml @@ -0,0 +1,14 @@ +openapi: 3.0.0 +info: + title: Sample API + version: 1.0.0 +paths: + /sample: + get: + responses: + '200': + $ref: '#/components/responses/InvalidRef' # Noncompliant {{OAR090: The $ref of a response must end with the suffix Response}} +components: + responses: + InvalidRef: + description: Successful response \ No newline at end of file diff --git a/src/test/resources/checks/v32/format/OAR090/valid-ref.json b/src/test/resources/checks/v32/format/OAR090/valid-ref.json new file mode 100644 index 00000000..304be99f --- /dev/null +++ b/src/test/resources/checks/v32/format/OAR090/valid-ref.json @@ -0,0 +1,25 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "Sample API", + "version": "1.0.0" + }, + "paths": { + "/sample": { + "get": { + "responses": { + "200": { + "$ref": "#/components/responses/SuccessResponse" + } + } + } + } + }, + "components": { + "responses": { + "SuccessResponse": { + "description": "Successful response" + } + } + } + } \ No newline at end of file diff --git a/src/test/resources/checks/v32/format/OAR090/valid-ref.yaml b/src/test/resources/checks/v32/format/OAR090/valid-ref.yaml new file mode 100644 index 00000000..a93e0313 --- /dev/null +++ b/src/test/resources/checks/v32/format/OAR090/valid-ref.yaml @@ -0,0 +1,14 @@ +openapi: 3.0.0 +info: + title: Sample API + version: 1.0.0 +paths: + /sample: + get: + responses: + '200': + $ref: '#/components/responses/SuccessResponse' +components: + responses: + SuccessResponse: + description: Successful response \ No newline at end of file diff --git a/src/test/resources/checks/v32/format/OAR097/too-short.json b/src/test/resources/checks/v32/format/OAR097/too-short.json new file mode 100644 index 00000000..aefcb581 --- /dev/null +++ b/src/test/resources/checks/v32/format/OAR097/too-short.json @@ -0,0 +1,13 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "servers" : [ + { + "url": "http://petstore.swagger.io/api-seguros" # Noncompliant {{OAR097: Path has to few parts}} + } + ], + "paths" : { } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/format/OAR097/too-short.yaml b/src/test/resources/checks/v32/format/OAR097/too-short.yaml new file mode 100644 index 00000000..8ace3d73 --- /dev/null +++ b/src/test/resources/checks/v32/format/OAR097/too-short.yaml @@ -0,0 +1,7 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +servers: + - url: https://petstore.swagger.io/api-seguros # Noncompliant {{OAR097: Path has to few parts}} +paths: {} \ No newline at end of file diff --git a/src/test/resources/checks/v32/format/OAR097/valid.json b/src/test/resources/checks/v32/format/OAR097/valid.json new file mode 100644 index 00000000..6d48f8b4 --- /dev/null +++ b/src/test/resources/checks/v32/format/OAR097/valid.json @@ -0,0 +1,13 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "servers": [ + { + "url": "http://petstore.swagger.io/api-seguros/v1" + } + ], + "paths": { } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/format/OAR097/valid.yaml b/src/test/resources/checks/v32/format/OAR097/valid.yaml new file mode 100644 index 00000000..89bfccfb --- /dev/null +++ b/src/test/resources/checks/v32/format/OAR097/valid.yaml @@ -0,0 +1,7 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +servers: + - url: https://petstore.swagger.io/api-seguros/v1 +paths: {} \ No newline at end of file diff --git a/src/test/resources/checks/v32/format/OAR098/too-long.json b/src/test/resources/checks/v32/format/OAR098/too-long.json new file mode 100644 index 00000000..c142c217 --- /dev/null +++ b/src/test/resources/checks/v32/format/OAR098/too-long.json @@ -0,0 +1,13 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "servers" : [ + { + "url": "http://petstore.swagger.io/api-seguros/v1/vida" # Noncompliant {{OAR098: Path has to many parts}} + } + ], + "paths" : { } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/format/OAR098/too-long.yaml b/src/test/resources/checks/v32/format/OAR098/too-long.yaml new file mode 100644 index 00000000..a24776c2 --- /dev/null +++ b/src/test/resources/checks/v32/format/OAR098/too-long.yaml @@ -0,0 +1,7 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +servers: + - url: https://petstore.swagger.io/api-seguros/v1/vida # Noncompliant {{OAR098: Path has to many parts}} +paths: {} \ No newline at end of file diff --git a/src/test/resources/checks/v32/format/OAR098/valid.json b/src/test/resources/checks/v32/format/OAR098/valid.json new file mode 100644 index 00000000..6d48f8b4 --- /dev/null +++ b/src/test/resources/checks/v32/format/OAR098/valid.json @@ -0,0 +1,13 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "servers": [ + { + "url": "http://petstore.swagger.io/api-seguros/v1" + } + ], + "paths": { } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/format/OAR098/valid.yaml b/src/test/resources/checks/v32/format/OAR098/valid.yaml new file mode 100644 index 00000000..89bfccfb --- /dev/null +++ b/src/test/resources/checks/v32/format/OAR098/valid.yaml @@ -0,0 +1,7 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +servers: + - url: https://petstore.swagger.io/api-seguros/v1 +paths: {} \ No newline at end of file diff --git a/src/test/resources/checks/v32/format/OAR099/valid.json b/src/test/resources/checks/v32/format/OAR099/valid.json new file mode 100644 index 00000000..6d48f8b4 --- /dev/null +++ b/src/test/resources/checks/v32/format/OAR099/valid.json @@ -0,0 +1,13 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "servers": [ + { + "url": "http://petstore.swagger.io/api-seguros/v1" + } + ], + "paths": { } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/format/OAR099/valid.yaml b/src/test/resources/checks/v32/format/OAR099/valid.yaml new file mode 100644 index 00000000..89bfccfb --- /dev/null +++ b/src/test/resources/checks/v32/format/OAR099/valid.yaml @@ -0,0 +1,7 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +servers: + - url: https://petstore.swagger.io/api-seguros/v1 +paths: {} \ No newline at end of file diff --git a/src/test/resources/checks/v32/format/OAR099/without-api-prefix.json b/src/test/resources/checks/v32/format/OAR099/without-api-prefix.json new file mode 100644 index 00000000..f3940f84 --- /dev/null +++ b/src/test/resources/checks/v32/format/OAR099/without-api-prefix.json @@ -0,0 +1,13 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "servers" : [ + { + "url": "http://petstore.swagger.io/seguros/v1" # Noncompliant {{OAR099: API name must start with prefix 'api-'}} + } + ], + "paths" : { } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/format/OAR099/without-api-prefix.yaml b/src/test/resources/checks/v32/format/OAR099/without-api-prefix.yaml new file mode 100644 index 00000000..f774c12e --- /dev/null +++ b/src/test/resources/checks/v32/format/OAR099/without-api-prefix.yaml @@ -0,0 +1,7 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +servers: + - url: https://petstore.swagger.io/seguros/v1 # Noncompliant {{OAR099: API name must start with prefix 'api-'}} +paths: {} \ No newline at end of file diff --git a/src/test/resources/checks/v32/format/OAR100/incorrect-version.json b/src/test/resources/checks/v32/format/OAR100/incorrect-version.json new file mode 100644 index 00000000..c2673393 --- /dev/null +++ b/src/test/resources/checks/v32/format/OAR100/incorrect-version.json @@ -0,0 +1,13 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "servers" : [ + { + "url": "http://petstore.swagger.io/api-seguros/v1.0" # Noncompliant {{OAR100: Last path part must be the API version, indicated with the prefix 'v' and the version number as integer}} + } + ], + "paths" : { } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/format/OAR100/incorrect-version.yaml b/src/test/resources/checks/v32/format/OAR100/incorrect-version.yaml new file mode 100644 index 00000000..9c20380c --- /dev/null +++ b/src/test/resources/checks/v32/format/OAR100/incorrect-version.yaml @@ -0,0 +1,7 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +servers: + - url: https://petstore.swagger.io/api-seguros/v1.0 # Noncompliant {{OAR100: Last path part must be the API version, indicated with the prefix 'v' and the version number as integer}} +paths: {} \ No newline at end of file diff --git a/src/test/resources/checks/v32/format/OAR100/valid.json b/src/test/resources/checks/v32/format/OAR100/valid.json new file mode 100644 index 00000000..6d48f8b4 --- /dev/null +++ b/src/test/resources/checks/v32/format/OAR100/valid.json @@ -0,0 +1,13 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "servers": [ + { + "url": "http://petstore.swagger.io/api-seguros/v1" + } + ], + "paths": { } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/format/OAR100/valid.yaml b/src/test/resources/checks/v32/format/OAR100/valid.yaml new file mode 100644 index 00000000..89bfccfb --- /dev/null +++ b/src/test/resources/checks/v32/format/OAR100/valid.yaml @@ -0,0 +1,7 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +servers: + - url: https://petstore.swagger.io/api-seguros/v1 +paths: {} \ No newline at end of file diff --git a/src/test/resources/checks/v32/format/OAR101/empty-path.json b/src/test/resources/checks/v32/format/OAR101/empty-path.json new file mode 100644 index 00000000..6341fc10 --- /dev/null +++ b/src/test/resources/checks/v32/format/OAR101/empty-path.json @@ -0,0 +1,13 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "servers": [ + { + "url": "http://petstore.swagger.io/" + } + ], + "paths": {} +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/format/OAR101/empty-path.yaml b/src/test/resources/checks/v32/format/OAR101/empty-path.yaml new file mode 100644 index 00000000..8925b6e8 --- /dev/null +++ b/src/test/resources/checks/v32/format/OAR101/empty-path.yaml @@ -0,0 +1,7 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +servers: + - url: https://petstore.swagger.io/ +paths: {} \ No newline at end of file diff --git a/src/test/resources/checks/v32/format/OAR101/invalid.json b/src/test/resources/checks/v32/format/OAR101/invalid.json new file mode 100644 index 00000000..0ab8f8ab --- /dev/null +++ b/src/test/resources/checks/v32/format/OAR101/invalid.json @@ -0,0 +1,13 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "servers": [ + { + "url": "http://petstore.swagger.io/wrong/v1" # Noncompliant {{OAR101: The first part of the path is not allowed. Allowed values are: wrong}} + } + ], + "paths": {} +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/format/OAR101/invalid.yaml b/src/test/resources/checks/v32/format/OAR101/invalid.yaml new file mode 100644 index 00000000..d06571ea --- /dev/null +++ b/src/test/resources/checks/v32/format/OAR101/invalid.yaml @@ -0,0 +1,7 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +servers: + - url: https://petstore.swagger.io/wrong/v1 # Noncompliant {{OAR101: The first part of the path is not allowed. Allowed values are: wrong}} +paths: {} \ No newline at end of file diff --git a/src/test/resources/checks/v32/format/OAR101/valid-with-values.json b/src/test/resources/checks/v32/format/OAR101/valid-with-values.json new file mode 100644 index 00000000..3ea07fc5 --- /dev/null +++ b/src/test/resources/checks/v32/format/OAR101/valid-with-values.json @@ -0,0 +1,13 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "servers": [ + { + "url": "http://petstore.swagger.io/api-seguros/v1" + } + ], + "paths": {} +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/format/OAR101/valid-with-values.yaml b/src/test/resources/checks/v32/format/OAR101/valid-with-values.yaml new file mode 100644 index 00000000..89bfccfb --- /dev/null +++ b/src/test/resources/checks/v32/format/OAR101/valid-with-values.yaml @@ -0,0 +1,7 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +servers: + - url: https://petstore.swagger.io/api-seguros/v1 +paths: {} \ No newline at end of file diff --git a/src/test/resources/checks/v32/format/OAR101/valid.json b/src/test/resources/checks/v32/format/OAR101/valid.json new file mode 100644 index 00000000..6d48f8b4 --- /dev/null +++ b/src/test/resources/checks/v32/format/OAR101/valid.json @@ -0,0 +1,13 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "servers": [ + { + "url": "http://petstore.swagger.io/api-seguros/v1" + } + ], + "paths": { } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/format/OAR101/valid.yaml b/src/test/resources/checks/v32/format/OAR101/valid.yaml new file mode 100644 index 00000000..89bfccfb --- /dev/null +++ b/src/test/resources/checks/v32/format/OAR101/valid.yaml @@ -0,0 +1,7 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +servers: + - url: https://petstore.swagger.io/api-seguros/v1 +paths: {} \ No newline at end of file diff --git a/src/test/resources/checks/v32/format/OAR102/invalid.json b/src/test/resources/checks/v32/format/OAR102/invalid.json new file mode 100644 index 00000000..ee51dd65 --- /dev/null +++ b/src/test/resources/checks/v32/format/OAR102/invalid.json @@ -0,0 +1,13 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "servers": [ + { + "url": "http://petstore.swagger.io/api-seguros/wrong" # Noncompliant {{OAR102: The second part of the path is not allowed. Allowed values are: wrong}} + } + ], + "paths": {} +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/format/OAR102/invalid.yaml b/src/test/resources/checks/v32/format/OAR102/invalid.yaml new file mode 100644 index 00000000..ca2c1240 --- /dev/null +++ b/src/test/resources/checks/v32/format/OAR102/invalid.yaml @@ -0,0 +1,7 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +servers: + - url: https://petstore.swagger.io/api-seguros/wrong # Noncompliant {{OAR102: The second part of the path is not allowed. Allowed values are: wrong}} +paths: {} \ No newline at end of file diff --git a/src/test/resources/checks/v32/format/OAR102/one-part-path.json b/src/test/resources/checks/v32/format/OAR102/one-part-path.json new file mode 100644 index 00000000..3679b681 --- /dev/null +++ b/src/test/resources/checks/v32/format/OAR102/one-part-path.json @@ -0,0 +1,13 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "servers": [ + { + "url": "http://petstore.swagger.io/api-seguros" + } + ], + "paths": {} +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/format/OAR102/one-part-path.yaml b/src/test/resources/checks/v32/format/OAR102/one-part-path.yaml new file mode 100644 index 00000000..84c7df71 --- /dev/null +++ b/src/test/resources/checks/v32/format/OAR102/one-part-path.yaml @@ -0,0 +1,7 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +servers: + - url: https://petstore.swagger.io/api-seguros +paths: {} \ No newline at end of file diff --git a/src/test/resources/checks/v32/format/OAR102/valid-with-values.json b/src/test/resources/checks/v32/format/OAR102/valid-with-values.json new file mode 100644 index 00000000..3ea07fc5 --- /dev/null +++ b/src/test/resources/checks/v32/format/OAR102/valid-with-values.json @@ -0,0 +1,13 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "servers": [ + { + "url": "http://petstore.swagger.io/api-seguros/v1" + } + ], + "paths": {} +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/format/OAR102/valid-with-values.yaml b/src/test/resources/checks/v32/format/OAR102/valid-with-values.yaml new file mode 100644 index 00000000..89bfccfb --- /dev/null +++ b/src/test/resources/checks/v32/format/OAR102/valid-with-values.yaml @@ -0,0 +1,7 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +servers: + - url: https://petstore.swagger.io/api-seguros/v1 +paths: {} \ No newline at end of file diff --git a/src/test/resources/checks/v32/format/OAR102/valid.json b/src/test/resources/checks/v32/format/OAR102/valid.json new file mode 100644 index 00000000..6d48f8b4 --- /dev/null +++ b/src/test/resources/checks/v32/format/OAR102/valid.json @@ -0,0 +1,13 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "servers": [ + { + "url": "http://petstore.swagger.io/api-seguros/v1" + } + ], + "paths": { } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/format/OAR102/valid.yaml b/src/test/resources/checks/v32/format/OAR102/valid.yaml new file mode 100644 index 00000000..89bfccfb --- /dev/null +++ b/src/test/resources/checks/v32/format/OAR102/valid.yaml @@ -0,0 +1,7 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +servers: + - url: https://petstore.swagger.io/api-seguros/v1 +paths: {} \ No newline at end of file diff --git a/src/test/resources/checks/v32/format/OAR110/valid.json b/src/test/resources/checks/v32/format/OAR110/valid.json new file mode 100644 index 00000000..0828cc2f --- /dev/null +++ b/src/test/resources/checks/v32/format/OAR110/valid.json @@ -0,0 +1,19 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "API de Ejemplo", + "version": "1.0.0", + "description": "Esta es una API de ejemplo.", + "termsOfService": "http://ejemplo.com/terminos/", + "contact": { + "name": "Soporte de API", + "url": "http://ejemplo.com/contacto", + "email": "contacto@ejemplo.com" + }, + "license": { + "name": "Apache 2.0", + "url": "https://www.apache.org/licenses/LICENSE-2.0.html" + } + }, + "paths": {} + } \ No newline at end of file diff --git a/src/test/resources/checks/v32/format/OAR110/valid.yaml b/src/test/resources/checks/v32/format/OAR110/valid.yaml new file mode 100644 index 00000000..0185cb17 --- /dev/null +++ b/src/test/resources/checks/v32/format/OAR110/valid.yaml @@ -0,0 +1,14 @@ +openapi: 3.0.0 +info: + title: API de Ejemplo + version: 1.0.0 + description: Esta es una API de ejemplo. + termsOfService: http://ejemplo.com/terminos/ + contact: + name: Soporte de API + url: http://ejemplo.com/contacto + email: contacto@ejemplo.com + license: + name: aaa + url: awss +paths: {} \ No newline at end of file diff --git a/src/test/resources/checks/v32/format/OAR111/valid.json b/src/test/resources/checks/v32/format/OAR111/valid.json new file mode 100644 index 00000000..0828cc2f --- /dev/null +++ b/src/test/resources/checks/v32/format/OAR111/valid.json @@ -0,0 +1,19 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "API de Ejemplo", + "version": "1.0.0", + "description": "Esta es una API de ejemplo.", + "termsOfService": "http://ejemplo.com/terminos/", + "contact": { + "name": "Soporte de API", + "url": "http://ejemplo.com/contacto", + "email": "contacto@ejemplo.com" + }, + "license": { + "name": "Apache 2.0", + "url": "https://www.apache.org/licenses/LICENSE-2.0.html" + } + }, + "paths": {} + } \ No newline at end of file diff --git a/src/test/resources/checks/v32/format/OAR111/valid.yaml b/src/test/resources/checks/v32/format/OAR111/valid.yaml new file mode 100644 index 00000000..5b95c019 --- /dev/null +++ b/src/test/resources/checks/v32/format/OAR111/valid.yaml @@ -0,0 +1,14 @@ +openapi: 3.0.0 +info: + title: API de Ejemplo + version: 1.0.0 + description: Esta es una API de ejemplo. + termsOfService: http://ejemplo.com/terminos/ + contact: + name: Soporte de API + url: http://ejemplo.com/contacto + email: contacto@ejemplo.com + license: + name: Apache 2.0 + url: https://www.apache.org/licenses/LICENSE-2.0.html +paths: {} \ No newline at end of file diff --git a/src/test/resources/checks/v32/format/OAR113/invalid.json b/src/test/resources/checks/v32/format/OAR113/invalid.json new file mode 100644 index 00000000..8fc8181f --- /dev/null +++ b/src/test/resources/checks/v32/format/OAR113/invalid.json @@ -0,0 +1,26 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Sample API" + }, + "paths": { + "/example": { # Noncompliant {{OAR113: Field or extension x-custom-example must be at the assigned location}} + "get": { # Noncompliant {{OAR113: Field or extension x-custom-example must be at the assigned location}} + "description": "Get example", + "responses": { + "200": { # Noncompliant {{OAR113: Field or extension x-custom-example must be at the assigned location}} + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExampleObject" + } + } + } + } + } + } + } + } +} diff --git a/src/test/resources/checks/v32/format/OAR113/invalid.yaml b/src/test/resources/checks/v32/format/OAR113/invalid.yaml new file mode 100644 index 00000000..eaab54bb --- /dev/null +++ b/src/test/resources/checks/v32/format/OAR113/invalid.yaml @@ -0,0 +1,16 @@ +openapi: "3.0.0" +info: + version: "1.0.0" + title: "Sample API" +paths: + /example: # Noncompliant {{OAR113: Field or extension x-custom-example must be at the assigned location}} + get: # Noncompliant {{OAR113: Field or extension x-custom-example must be at the assigned location}} + description: "Get example" + responses: + "200": # Noncompliant {{OAR113: Field or extension x-custom-example must be at the assigned location}} + description: "Successful response" + content: + application/json: + schema: + $ref: "#/components/schemas/ExampleObject" + diff --git a/src/test/resources/checks/v32/format/OAR113/valid.json b/src/test/resources/checks/v32/format/OAR113/valid.json new file mode 100644 index 00000000..3c078dc6 --- /dev/null +++ b/src/test/resources/checks/v32/format/OAR113/valid.json @@ -0,0 +1,45 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Sample API", + }, + "paths": { + "/example": { + "get": { + "x-custom-example": "example value", + "description": "Get example", + "responses": { + "200": { + "x-custom-example": "example value", + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExampleObject" + } + } + } + } + } + }, + "x-custom-example": "example value" + } + }, + "components": { + "schemas": { + "ExampleObject": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + } + } + + } + } + } +} diff --git a/src/test/resources/checks/v32/format/OAR113/valid.yaml b/src/test/resources/checks/v32/format/OAR113/valid.yaml new file mode 100644 index 00000000..be171009 --- /dev/null +++ b/src/test/resources/checks/v32/format/OAR113/valid.yaml @@ -0,0 +1,27 @@ +openapi: "3.0.0" +info: + version: "1.0.0" + title: "Sample API" +paths: + /example: + get: + x-custom-example: "example" + description: "Get example" + responses: + "200": + x-custom-example: "example" + description: "Successful response" + content: + application/json: + schema: + $ref: "#/components/schemas/ExampleObject" + x-custom-example: "example" +components: + schemas: + ExampleObject: + type: object + properties: + id: + type: string + name: + type: string diff --git a/src/test/resources/checks/v32/format/OAR115/invalid.json b/src/test/resources/checks/v32/format/OAR115/invalid.json new file mode 100644 index 00000000..5b686976 --- /dev/null +++ b/src/test/resources/checks/v32/format/OAR115/invalid.json @@ -0,0 +1,45 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "API de ejemplo", + "version": "1.0.0" + }, + "paths": { + "/users": { + "get": { + "summary": "Obtener lista de usuarios", + "responses": { + "200": { + "description": "OK" + }, + "400": { + "description": "Error de validación", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "ErrorResponse": { + "type": "object", + "properties": { + "code": { "type": "integer" }, + "message": { "type": "string" } + }, + "required":[ + "code", + "message", + "otherfield" # Noncompliant {{OAR115: This value does not exist, it must be defined in the schema properties}} + ] + } + } + } +} diff --git a/src/test/resources/checks/v32/format/OAR115/invalid.yaml b/src/test/resources/checks/v32/format/OAR115/invalid.yaml new file mode 100644 index 00000000..5f3876b2 --- /dev/null +++ b/src/test/resources/checks/v32/format/OAR115/invalid.yaml @@ -0,0 +1,30 @@ +openapi: 3.0.0 +info: + title: API de ejemplo + version: "1.0.0" +paths: + /users: + get: + summary: Obtener lista de usuarios + responses: + '200': + description: OK + '400': + description: Error de validación + content: + application/json: + schema: + $ref: "#/components/schemas/ErrorResponse" +components: + schemas: + ErrorResponse: + type: object + properties: + code: + type: integer + message: + type: string + required: + - code + - message + - otherfield # Noncompliant {{OAR115: This value does not exist, it must be defined in the schema properties}} diff --git a/src/test/resources/checks/v32/format/OAR115/valid.json b/src/test/resources/checks/v32/format/OAR115/valid.json new file mode 100644 index 00000000..1574947e --- /dev/null +++ b/src/test/resources/checks/v32/format/OAR115/valid.json @@ -0,0 +1,44 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "API de ejemplo", + "version": "1.0.0" + }, + "paths": { + "/users": { + "get": { + "summary": "Obtener lista de usuarios", + "responses": { + "200": { + "description": "OK" + }, + "400": { + "description": "Error de validación", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "ErrorResponse": { + "type": "object", + "properties": { + "code": { "type": "integer" }, + "message": { "type": "string" } + }, + "required":[ + "code", + "message" + ] + } + } + } +} diff --git a/src/test/resources/checks/v32/format/OAR115/valid.yaml b/src/test/resources/checks/v32/format/OAR115/valid.yaml new file mode 100644 index 00000000..c97cfb50 --- /dev/null +++ b/src/test/resources/checks/v32/format/OAR115/valid.yaml @@ -0,0 +1,29 @@ +openapi: 3.0.0 +info: + title: API de ejemplo + version: "1.0.0" +paths: + /users: + get: + summary: Obtener lista de usuarios + responses: + '200': + description: OK + '400': + description: Error de validación + content: + application/json: + schema: + $ref: "#/components/schemas/ErrorResponse" +components: + schemas: + ErrorResponse: + type: object + properties: + code: + type: integer + message: + type: string + required: + - code + - message diff --git a/src/test/resources/checks/v32/operations/OAR045/defined-response.json b/src/test/resources/checks/v32/operations/OAR045/defined-response.json new file mode 100644 index 00000000..f86d6ac4 --- /dev/null +++ b/src/test/resources/checks/v32/operations/OAR045/defined-response.json @@ -0,0 +1,78 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/pets": { + "get": { + "responses": { + "200": { + "description": "some response" // Noncompliant {{OAR045: Define the model of your response}} + }, + "202": { + "description": "some response", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + }, + "401": { // Noncompliant {{OAR045: Define the model of your response}} + "description": "error response", + "$ref": "#/components/responses/MyErroneousResponse" + } + } + }, + "post": { + "responses": {} // Noncompliant {{OAR045: Define the responses of your operations}} + }, + "put": { + "responses": { + "default": { + "description": "default response", + "content": { + "application/json": { + "schema": { + "type": "object" + } + } + } + }, + "200": { // Noncompliant {{OAR045: Define the model of your response}} + "description": "success response" + } + } + } + }, + "/other": { + "delete": { + "responses": { + "204": { + "description": "No content" + } + } + } + } + }, + "components": { + "responses": { + "MyErroneousResponse": { + "description": "an example response missing a model" + }, + "MyOtherResponse": { + "description": "some response", + "content": { + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } +} diff --git a/src/test/resources/checks/v32/operations/OAR045/defined-response.yaml b/src/test/resources/checks/v32/operations/OAR045/defined-response.yaml new file mode 100644 index 00000000..4370ac6c --- /dev/null +++ b/src/test/resources/checks/v32/operations/OAR045/defined-response.yaml @@ -0,0 +1,48 @@ +openapi: 3.0.0 +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: + get: + responses: + # Noncompliant@+1 {{OAR045: Define the model of your response}} + '200': + description: some response + '202': + description: some response + content: + application/json: + schema: + type: string + '401': # Noncompliant {{OAR045: Define the model of your response}} + description: error response + $ref: '#/components/responses/MyErroneousResponse' + post: + # Noncompliant@+1 {{OAR045: Define the responses of your operations}} + responses: {} + put: + responses: + default: + description: default response + content: + application/json: + schema: + type: object + '200': # Noncompliant {{OAR045: Define the model of your response}} + description: success response + /other: + delete: + responses: + '204': + description: No content +components: + responses: + MyErroneousResponse: + description: an example response missing a model + MyOtherResponse: + description: some response + content: + application/json: + schema: + type: object diff --git a/src/test/resources/checks/v32/operations/OAR048/many-body-params.json b/src/test/resources/checks/v32/operations/OAR048/many-body-params.json new file mode 100644 index 00000000..6efb018b --- /dev/null +++ b/src/test/resources/checks/v32/operations/OAR048/many-body-params.json @@ -0,0 +1,75 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/pets": { + "get": { + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + }, + "responses": { + "default": { + "description": "the default response" + } + } + }, + "post": { # Noncompliant {{OAR048: An operation can have at most one body parameter}} + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "otherParam": { + "type": "string" + } + }, + "required": ["otherParam"] + } + } + } + }, + "x-extraRequestBody": { + "description": "Simulated second body param (invalid by spec)", + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "toto": { + "type": "string" + } + }, + "required": ["toto"] + } + } + } + }, + "responses": { + "default": { + "description": "the default response" + } + } + } + } + }, + "components": { + "schemas": { + "Used": { + "type": "string" + } + } + } +} diff --git a/src/test/resources/checks/v32/operations/OAR048/many-body-params.yaml b/src/test/resources/checks/v32/operations/OAR048/many-body-params.yaml new file mode 100644 index 00000000..6e4df5b8 --- /dev/null +++ b/src/test/resources/checks/v32/operations/OAR048/many-body-params.yaml @@ -0,0 +1,47 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: + get: + requestBody: + required: true + content: + application/json: + schema: + type: string + responses: + default: + description: the default response + post: # Noncompliant {{OAR048: An operation can have at most one body parameter}} + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + otherParam: + type: string + required: + - otherParam + x-extraRequestBody: + description: Simulated second body param (invalid by spec) + required: true + content: + application/json: + schema: + type: object + properties: + toto: + type: string + required: + - toto + responses: + default: + description: the default response +components: + schemas: + Used: + type: string diff --git a/src/test/resources/checks/v32/operations/OAR061/insuficent-response-codes.json b/src/test/resources/checks/v32/operations/OAR061/insuficent-response-codes.json new file mode 100644 index 00000000..d6afd0b7 --- /dev/null +++ b/src/test/resources/checks/v32/operations/OAR061/insuficent-response-codes.json @@ -0,0 +1,39 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/status": { + "get": { + "summary": "Get API status", + "responses": { + "400": { + "description": "error" + } + } + } + }, + "/another": { + "get": { + "summary": "Get another API status", + "responses": { + "400": { + "description": "error" + } + } + } + }, + "/users": { + "get": { + "summary": "Get all users", + "responses": { # Noncompliant {{OAR061: Response code 200, 202, 206 must be defined}} + "400": { + "description": "Error" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/operations/OAR061/insuficent-response-codes.yaml b/src/test/resources/checks/v32/operations/OAR061/insuficent-response-codes.yaml new file mode 100644 index 00000000..be4253c1 --- /dev/null +++ b/src/test/resources/checks/v32/operations/OAR061/insuficent-response-codes.yaml @@ -0,0 +1,23 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /status: + get: + summary: Get API status + responses: + 400: + description: error + /another: + get: + summary: Get another API status + responses: + 400: + description: error + /users: + get: + summary: Get all users + responses: # Noncompliant {{OAR061: Response code 200, 202, 206 must be defined}} + 400: + description: Error \ No newline at end of file diff --git a/src/test/resources/checks/v32/operations/OAR061/valid.json b/src/test/resources/checks/v32/operations/OAR061/valid.json new file mode 100644 index 00000000..eebb26a9 --- /dev/null +++ b/src/test/resources/checks/v32/operations/OAR061/valid.json @@ -0,0 +1,41 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/status": { + "get": { + "summary": "Get API status", + "responses": { + "200": { + "description": "OK" + }, + "202": { + "description": "Accepted" + }, + "206": { + "description": "Partial Content" + } + } + } + }, + "/users": { + "get": { + "summary": "Get all users", + "responses": { + "200": { + "description": "OK" + }, + "202": { + "description": "Accepted" + }, + "206": { + "description": "Partial Content" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/operations/OAR061/valid.yaml b/src/test/resources/checks/v32/operations/OAR061/valid.yaml new file mode 100644 index 00000000..46fd051f --- /dev/null +++ b/src/test/resources/checks/v32/operations/OAR061/valid.yaml @@ -0,0 +1,25 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /status: + get: + summary: Get API status + responses: + 200: + description: OK + 202: + description: Accepted + 206: + description: Partial Content + /users: + get: + summary: Get all users + responses: + 200: + description: OK + 202: + description: Accepted + 206: + description: Partial Content diff --git a/src/test/resources/checks/v32/operations/OAR062/insuficent-response-codes.json b/src/test/resources/checks/v32/operations/OAR062/insuficent-response-codes.json new file mode 100644 index 00000000..5c5c07f3 --- /dev/null +++ b/src/test/resources/checks/v32/operations/OAR062/insuficent-response-codes.json @@ -0,0 +1,39 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/status": { + "post": { + "summary": "Get API status", + "responses": { + "400": { + "description": "error" + } + } + } + }, + "/another": { + "post": { + "summary": "Get another API status", + "responses": { + "400": { + "description": "error" + } + } + } + }, + "/users": { + "post": { + "summary": "Get all users", + "responses": { # Noncompliant {{OAR062: Response code 200, 201, 202, 204, 206 must be defined}} + "400": { + "description": "Error" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/operations/OAR062/insuficent-response-codes.yaml b/src/test/resources/checks/v32/operations/OAR062/insuficent-response-codes.yaml new file mode 100644 index 00000000..b6afd0f4 --- /dev/null +++ b/src/test/resources/checks/v32/operations/OAR062/insuficent-response-codes.yaml @@ -0,0 +1,23 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /status: + post: + summary: Get API status + responses: + 400: + description: error + /another: + post: + summary: Get another API status + responses: + 400: + description: error + /users: + post: + summary: Get all users + responses: # Noncompliant {{OAR062: Response code 200, 201, 202, 204, 206 must be defined}} + 400: + description: Error \ No newline at end of file diff --git a/src/test/resources/checks/v32/operations/OAR062/valid.json b/src/test/resources/checks/v32/operations/OAR062/valid.json new file mode 100644 index 00000000..41369536 --- /dev/null +++ b/src/test/resources/checks/v32/operations/OAR062/valid.json @@ -0,0 +1,41 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/status": { + "post": { + "summary": "Get API status", + "responses": { + "200": { + "description": "OK" + }, + "202": { + "description": "Accepted" + }, + "206": { + "description": "Partial Content" + } + } + } + }, + "/users": { + "post": { + "summary": "Get all users", + "responses": { + "200": { + "description": "OK" + }, + "202": { + "description": "Accepted" + }, + "206": { + "description": "Partial Content" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/operations/OAR062/valid.yaml b/src/test/resources/checks/v32/operations/OAR062/valid.yaml new file mode 100644 index 00000000..cbd378fe --- /dev/null +++ b/src/test/resources/checks/v32/operations/OAR062/valid.yaml @@ -0,0 +1,25 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /status: + post: + summary: Get API status + responses: + 200: + description: OK + 202: + description: Accepted + 206: + description: Partial Content + /users: + post: + summary: Get all users + responses: + 200: + description: OK + 202: + description: Accepted + 206: + description: Partial Content diff --git a/src/test/resources/checks/v32/operations/OAR063/insuficent-response-codes.json b/src/test/resources/checks/v32/operations/OAR063/insuficent-response-codes.json new file mode 100644 index 00000000..fd50ba37 --- /dev/null +++ b/src/test/resources/checks/v32/operations/OAR063/insuficent-response-codes.json @@ -0,0 +1,39 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/status": { + "put": { + "summary": "Get API status", + "responses": { + "400": { + "description": "error" + } + } + } + }, + "/another": { + "put": { + "summary": "Get another API status", + "responses": { + "400": { + "description": "error" + } + } + } + }, + "/users": { + "put": { + "summary": "Get all users", + "responses": { # Noncompliant {{OAR063: Response code 200, 202, 204, 206 must be defined}} + "400": { + "description": "Error" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/operations/OAR063/insuficent-response-codes.yaml b/src/test/resources/checks/v32/operations/OAR063/insuficent-response-codes.yaml new file mode 100644 index 00000000..46cb15dd --- /dev/null +++ b/src/test/resources/checks/v32/operations/OAR063/insuficent-response-codes.yaml @@ -0,0 +1,23 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /status: + put: + summary: Get API status + responses: + 400: + description: error + /another: + put: + summary: Get another API status + responses: + 400: + description: error + /users: + put: + summary: Get all users + responses: # Noncompliant {{OAR063: Response code 200, 202, 204, 206 must be defined}} + 400: + description: Error \ No newline at end of file diff --git a/src/test/resources/checks/v32/operations/OAR063/valid.json b/src/test/resources/checks/v32/operations/OAR063/valid.json new file mode 100644 index 00000000..5f3a20ed --- /dev/null +++ b/src/test/resources/checks/v32/operations/OAR063/valid.json @@ -0,0 +1,41 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/status": { + "put": { + "summary": "Get API status", + "responses": { + "200": { + "description": "OK" + }, + "202": { + "description": "Accepted" + }, + "206": { + "description": "Partial Content" + } + } + } + }, + "/users": { + "put": { + "summary": "Get all users", + "responses": { + "200": { + "description": "OK" + }, + "202": { + "description": "Accepted" + }, + "206": { + "description": "Partial Content" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/operations/OAR063/valid.yaml b/src/test/resources/checks/v32/operations/OAR063/valid.yaml new file mode 100644 index 00000000..d61b7b23 --- /dev/null +++ b/src/test/resources/checks/v32/operations/OAR063/valid.yaml @@ -0,0 +1,25 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /status: + put: + summary: Get API status + responses: + 200: + description: OK + 202: + description: Accepted + 206: + description: Partial Content + /users: + put: + summary: Get all users + responses: + 200: + description: OK + 202: + description: Accepted + 206: + description: Partial Content diff --git a/src/test/resources/checks/v32/operations/OAR064/insuficent-response-codes.json b/src/test/resources/checks/v32/operations/OAR064/insuficent-response-codes.json new file mode 100644 index 00000000..d72c819c --- /dev/null +++ b/src/test/resources/checks/v32/operations/OAR064/insuficent-response-codes.json @@ -0,0 +1,39 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/status": { + "patch": { + "summary": "Get API status", + "responses": { + "400": { + "description": "error" + } + } + } + }, + "/another": { + "patch": { + "summary": "Get another API status", + "responses": { + "400": { + "description": "error" + } + } + } + }, + "/users": { + "patch": { + "summary": "Get all users", + "responses": { # Noncompliant {{OAR064: Response code 200, 202, 204, 206 must be defined}} + "400": { + "description": "Error" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/operations/OAR064/insuficent-response-codes.yaml b/src/test/resources/checks/v32/operations/OAR064/insuficent-response-codes.yaml new file mode 100644 index 00000000..84beaded --- /dev/null +++ b/src/test/resources/checks/v32/operations/OAR064/insuficent-response-codes.yaml @@ -0,0 +1,23 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /status: + patch: + summary: Get API status + responses: + 400: + description: error + /another: + patch: + summary: Get another API status + responses: + 400: + description: error + /users: + patch: + summary: Get all users + responses: # Noncompliant {{OAR064: Response code 200, 202, 204, 206 must be defined}} + 400: + description: Error \ No newline at end of file diff --git a/src/test/resources/checks/v32/operations/OAR064/valid.json b/src/test/resources/checks/v32/operations/OAR064/valid.json new file mode 100644 index 00000000..4109a3e7 --- /dev/null +++ b/src/test/resources/checks/v32/operations/OAR064/valid.json @@ -0,0 +1,41 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/status": { + "patch": { + "summary": "Get API status", + "responses": { + "200": { + "description": "OK" + }, + "202": { + "description": "Accepted" + }, + "206": { + "description": "Partial Content" + } + } + } + }, + "/users": { + "patch": { + "summary": "Get all users", + "responses": { + "200": { + "description": "OK" + }, + "202": { + "description": "Accepted" + }, + "206": { + "description": "Partial Content" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/operations/OAR064/valid.yaml b/src/test/resources/checks/v32/operations/OAR064/valid.yaml new file mode 100644 index 00000000..fb387b6e --- /dev/null +++ b/src/test/resources/checks/v32/operations/OAR064/valid.yaml @@ -0,0 +1,25 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /status: + patch: + summary: Get API status + responses: + 200: + description: OK + 202: + description: Accepted + 206: + description: Partial Content + /users: + patch: + summary: Get all users + responses: + 200: + description: OK + 202: + description: Accepted + 206: + description: Partial Content diff --git a/src/test/resources/checks/v32/operations/OAR065/insuficent-response-codes.json b/src/test/resources/checks/v32/operations/OAR065/insuficent-response-codes.json new file mode 100644 index 00000000..e246e5a4 --- /dev/null +++ b/src/test/resources/checks/v32/operations/OAR065/insuficent-response-codes.json @@ -0,0 +1,39 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/status": { + "delete": { + "summary": "Get API status", + "responses": { + "400": { + "description": "error" + } + } + } + }, + "/another": { + "delete": { + "summary": "Get another API status", + "responses": { + "400": { + "description": "error" + } + } + } + }, + "/users": { + "delete": { + "summary": "Get all users", + "responses": { # Noncompliant {{OAR065: Response code 200, 202, 204 must be defined}} + "400": { + "description": "Error" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/operations/OAR065/insuficent-response-codes.yaml b/src/test/resources/checks/v32/operations/OAR065/insuficent-response-codes.yaml new file mode 100644 index 00000000..9ef40629 --- /dev/null +++ b/src/test/resources/checks/v32/operations/OAR065/insuficent-response-codes.yaml @@ -0,0 +1,24 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /status: + delete: + summary: Get API status + responses: + 400: + description: error + /another: + delete: + summary: Get another API status + responses: + 400: + description: error + /users: + delete: + summary: Get all users + responses: # Noncompliant {{OAR065: Response code 200, 202, 204 must be defined}} + 400: + description: Error + diff --git a/src/test/resources/checks/v32/operations/OAR065/valid.json b/src/test/resources/checks/v32/operations/OAR065/valid.json new file mode 100644 index 00000000..f4e0b010 --- /dev/null +++ b/src/test/resources/checks/v32/operations/OAR065/valid.json @@ -0,0 +1,41 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/status": { + "delete": { + "summary": "Get API status", + "responses": { + "200": { + "description": "OK" + }, + "202": { + "description": "Accepted" + }, + "206": { + "description": "Partial Content" + } + } + } + }, + "/users": { + "delete": { + "summary": "Get all users", + "responses": { + "200": { + "description": "OK" + }, + "202": { + "description": "Accepted" + }, + "206": { + "description": "Partial Content" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/operations/OAR065/valid.yaml b/src/test/resources/checks/v32/operations/OAR065/valid.yaml new file mode 100644 index 00000000..5b7b3230 --- /dev/null +++ b/src/test/resources/checks/v32/operations/OAR065/valid.yaml @@ -0,0 +1,25 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /status: + delete: + summary: Get API status + responses: + 200: + description: OK + 202: + description: Accepted + 206: + description: Partial Content + /users: + delete: + summary: Get all users + responses: + 200: + description: OK + 202: + description: Accepted + 206: + description: Partial Content diff --git a/src/test/resources/checks/v32/operations/OAR071/missing-query-params.json b/src/test/resources/checks/v32/operations/OAR071/missing-query-params.json new file mode 100644 index 00000000..a3c5fe59 --- /dev/null +++ b/src/test/resources/checks/v32/operations/OAR071/missing-query-params.json @@ -0,0 +1,59 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "My API" + }, + "paths": { + "/examples": { + "get": { + "summary": "Get a list of items", + "parameters": [ # Noncompliant {{OAR071: Query parameters param3 must be defined}} + { + "name": "param1", + "in": "query", + "schema": { + "type": "string" + } + }, + { + "name": "param2", + "in": "query", + "schema": { + "type": "integer" + } + }, + { + "name": "param4", + "in": "query", + "schema": { + "type": "string" + } + }, + { + "name": "param5", + "in": "query", + "schema": { + "type": "number" + } + } + ], + "responses": { + "200": { + "description": "A list of items", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/operations/OAR071/missing-query-params.yaml b/src/test/resources/checks/v32/operations/OAR071/missing-query-params.yaml new file mode 100644 index 00000000..fef15e36 --- /dev/null +++ b/src/test/resources/checks/v32/operations/OAR071/missing-query-params.yaml @@ -0,0 +1,34 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: My API +paths: + /examples: + get: + summary: Get a list of items + parameters: # Noncompliant {{OAR071: Query parameters param3 must be defined}} + - name: param1 + in: query + schema: + type: string + - name: param2 + in: query + schema: + type: integer + - name: param4 + in: query + schema: + type: string + - name: param5 + in: query + schema: + type: number + responses: + 200: + description: A list of items + content: + application/json: + schema: + type: array + items: + type: string \ No newline at end of file diff --git a/src/test/resources/checks/v32/operations/OAR071/valid-query-params.json b/src/test/resources/checks/v32/operations/OAR071/valid-query-params.json new file mode 100644 index 00000000..5dcdf248 --- /dev/null +++ b/src/test/resources/checks/v32/operations/OAR071/valid-query-params.json @@ -0,0 +1,66 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "My API" + }, + "paths": { + "/items": { + "get": { + "summary": "Get a list of items", + "parameters": [ + { + "name": "param1", + "in": "query", + "schema": { + "type": "string" + } + }, + { + "name": "param2", + "in": "query", + "schema": { + "type": "integer" + } + }, + { + "name": "param3", + "in": "query", + "schema": { + "type": "boolean" + } + }, + { + "name": "param4", + "in": "query", + "schema": { + "type": "string" + } + }, + { + "name": "param5", + "in": "query", + "schema": { + "type": "number" + } + } + ], + "responses": { + "200": { + "description": "A list of items", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/operations/OAR071/valid-query-params.yaml b/src/test/resources/checks/v32/operations/OAR071/valid-query-params.yaml new file mode 100644 index 00000000..7a8d8899 --- /dev/null +++ b/src/test/resources/checks/v32/operations/OAR071/valid-query-params.yaml @@ -0,0 +1,38 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: My API +paths: + /items: + get: + summary: Get a list of items + parameters: + - name: param1 + in: query + schema: + type: string + - name: param2 + in: query + schema: + type: integer + - name: param3 + in: query + schema: + type: boolean + - name: param4 + in: query + schema: + type: string + - name: param5 + in: query + schema: + type: number + responses: + 200: + description: A list of items + content: + application/json: + schema: + type: array + items: + type: string \ No newline at end of file diff --git a/src/test/resources/checks/v32/operations/OAR091/no-ref.json b/src/test/resources/checks/v32/operations/OAR091/no-ref.json new file mode 100644 index 00000000..0a13ec43 --- /dev/null +++ b/src/test/resources/checks/v32/operations/OAR091/no-ref.json @@ -0,0 +1,37 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "Sample API", + "version": "1.0.0" + }, + "paths": { + "/sample": { + "get": { + "parameters": [ # Noncompliant {{OAR091: Parameters must contain only references ($ref)}} + { + "name": "user", + "in": "query", + "description": "User information", + "required": true, + "schema": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "name": { + "type": "string" + } + } + } + } + ], + "responses": { + "200": { + "description": "Successful response" + } + } + } + } + } + } \ No newline at end of file diff --git a/src/test/resources/checks/v32/operations/OAR091/no-ref.yaml b/src/test/resources/checks/v32/operations/OAR091/no-ref.yaml new file mode 100644 index 00000000..cf71ac9a --- /dev/null +++ b/src/test/resources/checks/v32/operations/OAR091/no-ref.yaml @@ -0,0 +1,22 @@ +openapi: 3.0.0 +info: + title: Sample API + version: 1.0.0 +paths: + /sample: + get: + parameters: # Noncompliant {{OAR091: Parameters must contain only references ($ref)}} + - name: user + in: query + description: User information + required: true + schema: + type: object + properties: + id: + type: integer + name: + type: string + responses: + '200': + description: Successful response \ No newline at end of file diff --git a/src/test/resources/checks/v32/operations/OAR091/with-ref.json b/src/test/resources/checks/v32/operations/OAR091/with-ref.json new file mode 100644 index 00000000..262538cd --- /dev/null +++ b/src/test/resources/checks/v32/operations/OAR091/with-ref.json @@ -0,0 +1,44 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "Sample API", + "version": "1.0.0" + }, + "paths": { + "/sample": { + "get": { + "parameters": [ + { + "$ref": "#/components/parameters/UserParam" + } + ], + "responses": { + "200": { + "description": "Successful response" + } + } + } + } + }, + "components": { + "parameters": { + "UserParam": { + "name": "user", + "in": "query", + "description": "User information", + "required": true, + "schema": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "name": { + "type": "string" + } + } + } + } + } + } + } \ No newline at end of file diff --git a/src/test/resources/checks/v32/operations/OAR091/with-ref.yaml b/src/test/resources/checks/v32/operations/OAR091/with-ref.yaml new file mode 100644 index 00000000..ad4061d5 --- /dev/null +++ b/src/test/resources/checks/v32/operations/OAR091/with-ref.yaml @@ -0,0 +1,26 @@ +openapi: 3.0.0 +info: + title: Sample API + version: 1.0.0 +paths: + /sample: + get: + parameters: + - $ref: '#/components/parameters/UserParam' + responses: + '200': + description: Successful response +components: + parameters: + UserParam: + name: user + in: query + description: User information + required: true + schema: + type: object + properties: + id: + type: integer + name: + type: string \ No newline at end of file diff --git a/src/test/resources/checks/v32/operations/OAR092/no-ref.json b/src/test/resources/checks/v32/operations/OAR092/no-ref.json new file mode 100644 index 00000000..b46235db --- /dev/null +++ b/src/test/resources/checks/v32/operations/OAR092/no-ref.json @@ -0,0 +1,52 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "Sample API", + "version": "1.0.0" + }, + "paths": { + "/pets": { + "post": { + "summary": "Create a pet", + "requestBody": { # Noncompliant {{OAR092: Request body must contain only references ($ref)}} + "description": "The pet to create", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "name": { + "type": "string" + } + } + } + } + } + }, + "responses": { + "201": { + "description": "Pet created successfully", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "name": { + "type": "string" + } + } + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/operations/OAR092/no-ref.yaml b/src/test/resources/checks/v32/operations/OAR092/no-ref.yaml new file mode 100644 index 00000000..a44925c1 --- /dev/null +++ b/src/test/resources/checks/v32/operations/OAR092/no-ref.yaml @@ -0,0 +1,579 @@ +openapi: 3.0.1 +info: + title: Sample-API_efc2b9f76813_V + description: API de ejemplo para pruebas + contact: + name: Nombre del Contacto + email: contact@mail.com + version: 1.0.0 +servers: + - url: https://api.example.es/api-sample/v1 +paths: + /datos-usuarios: + get: + summary: Listado de usuarios + description: Método que permite obtener un listado con datos básicos de un usuario + parameters: + - name: desde + in: query + schema: + type: string + format: date + required: false + - name: hasta + in: query + schema: + type: string + format: date + required: false + responses: + '200': + description: OK + headers: + X-Correlation-Id: + description: Cabecera 'X-Correlation-Id' + schema: + type: string + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/datosUsuario' + '400': + description: Bad Request + headers: + X-Correlation-Id: + description: Cabecera 'X-Correlation-Id' + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/errorMessage' + example: + error: + status: '400' + message: Bad Request + path: /datos-usuario + type: https://docs.example.es/x/A1D8Aw + operationId: '10004' + errors: + - code: '101' + message: Invalid format + location: desde + '429': + description: Too many requests + headers: + X-Correlation-Id: + description: Cabecera 'X-Correlation-Id' + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/errorMessage' + example: + error: + status: '429' + message: Too many requests + path: /datos-usuario + type: https://docs.example.es/x/A1D8Aw + operationId: '10005' + errors: + - code: '105' + message: >- + The user has sent too many requests in a given amount of + time + default: + description: Server Error (50X) + headers: + X-Correlation-Id: + description: Cabecera 'X-Correlation-Id' + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/errorMessage' + example: + error: + status: '500' + message: Internal server error + path: /datos-usuario + type: https://docs.example.es/x/5008Aw + operationId: '10004' + errors: + - code: '501' + message: Internal server error + post: + summary: Alta de los datos de un usuario + description: Método que permite dar de alta los datos básicos de un usuario + requestBody: # Noncompliant {{OAR092: Request body must contain only references ($ref)}} + description: Datos del usuario + content: + application/json: + schema: + $ref: '#/components/schemas/datosUsuario' + responses: + '201': + description: OK + headers: + location: + description: RFC 7231 - The new resource which was created by the request. + schema: + type: string + example: /datos-usuarios/a2649c29-48c6-4c48-b64d-0455346efbbd + X-Correlation-Id: + description: Cabecera 'X-Correlation-Id' + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/datosUsuario' + '400': + description: Bad Request + headers: + X-Correlation-Id: + description: Cabecera 'X-Correlation-Id' + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/errorMessage' + example: + error: + status: '400' + message: Bad Request + path: /datos-usuario + type: https://docs.example.es/x/A1D8Aw + operationId: '10004' + errors: + - code: '101' + message: Invalid format + location: emailUsuario + '429': + description: Too many requests + headers: + X-Correlation-Id: + description: Cabecera 'X-Correlation-Id' + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/errorMessage' + example: + error: + status: '429' + message: Too many requests + path: /datos-usuario + type: https://docs.example.es/x/A1D8Aw + operationId: '10005' + errors: + - code: '105' + message: >- + The user has sent too many requests in a given amount of + time + default: + description: Server Error (50X) + headers: + X-Correlation-Id: + description: Cabecera 'X-Correlation-Id' + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/errorMessage' + example: + error: + status: '500' + message: Internal server error + path: /datos-usuario + type: https://docs.example.es/x/5008Aw + operationId: '10004' + errors: + - code: '501' + message: Internal server error + x-codegen-request-body-name: body + /datos-usuarios/{idUsuario}: + get: + summary: Recuperación de los datos de un usuario por su id + description: >- + Método que permite recuperar la información básica de un usuario por su + id + parameters: + - name: idUsuario + in: path + description: Identificador del usuario + required: true + schema: + type: string + minLength: 5 + maxLength: 255 + format: ^[0-9]*$ + responses: + '200': + description: OK + headers: + X-Correlation-Id: + description: Cabecera 'X-Correlation-Id' + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/datosUsuario' + '400': + description: Bad Request + headers: + X-Correlation-Id: + description: Cabecera 'X-Correlation-Id' + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/errorMessage' + example: + error: + status: '400' + message: Bad Request + path: /datos-usuario/0 + type: https://docs.example.es/x/A1D8Aw + operationId: '10001' + errors: + - code: '101' + message: Invalid format + location: idUsuario + '404': + description: Not found (404) + headers: + X-Correlation-Id: + description: Cabecera 'X-Correlation-Id' + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/errorMessage' + example: + error: + status: '404' + message: Not found + path: /datos-usuario/0 + type: https://docs.example.es/x/A1D8Aw + operationId: '10002' + errors: + - code: '102' + message: Entity not found + location: idUsuario + '429': + description: Too many requests + headers: + X-Correlation-Id: + description: Cabecera 'X-Correlation-Id' + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/errorMessage' + example: + error: + status: '429' + message: Too many requests + path: /datos-usuario + type: https://docs.example.es/x/A1D8Aw + operationId: '10005' + errors: + - code: '105' + message: >- + The user has sent too many requests in a given amount of + time + default: + description: Server Error (50X) + headers: + X-Correlation-Id: + description: Cabecera 'X-Correlation-Id' + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/errorMessage' + put: + summary: Modificación de los datos de un usuario + description: Método que permite modificar los datos básicos de un usuario + parameters: + - name: idUsuario + in: path + description: Identificador del usuario + required: true + schema: + type: string + minLength: 5 + maxLength: 255 + format: ^[0-9]*$ + requestBody: # Noncompliant {{OAR092: Request body must contain only references ($ref)}} + description: Datos del usuario + content: + application/json: + schema: + $ref: '#/components/schemas/datosUsuario' + responses: + '200': + description: OK + headers: + X-Correlation-Id: + description: Cabecera 'X-Correlation-Id' + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/datosUsuario' + '400': + description: Bad Request + headers: + X-Correlation-Id: + description: Cabecera 'X-Correlation-Id' + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/errorMessage' + example: + error: + status: '400' + message: Bad Request + path: /datos-usuario/0 + type: https://docs.example.es/x/A1D8Aw + operationId: '10002' + errors: + - code: '101' + message: Invalid format + location: idUsuario + '404': + description: Not found (404) + headers: + X-Correlation-Id: + description: Cabecera 'X-Correlation-Id' + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/errorMessage' + '429': + description: Too many requests + headers: + X-Correlation-Id: + description: Cabecera 'X-Correlation-Id' + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/errorMessage' + example: + error: + status: '429' + message: Too many requests + path: /datos-usuario + type: https://docs.example.es/x/A1D8Aw + operationId: '10005' + errors: + - code: '105' + message: >- + The user has sent too many requests in a given amount of + time + default: + description: Server Error (50X) + headers: + X-Correlation-Id: + description: Cabecera 'X-Correlation-Id' + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/errorMessage' + x-codegen-request-body-name: body + delete: + summary: Borrado de los datos de un usuario + description: Método que permite borrar los datos básicos de un usuario + parameters: + - name: idUsuario + in: path + description: Identificador del usuario + required: true + schema: + type: string + minLength: 5 + maxLength: 255 + format: ^[0-9]*$ + responses: + '204': + description: No content + headers: + X-Correlation-Id: + description: Cabecera 'X-Correlation-Id' + schema: + type: string + '400': + description: Bad Request + headers: + X-Correlation-Id: + description: Cabecera 'X-Correlation-Id' + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/errorMessage' + example: + error: + status: '400' + message: Bad Request + path: /datos-usuario/0 + type: https://docs.example.es/x/A1D8Aw + operationId: '10003' + errors: + - code: '101' + message: Invalid format + location: idUsuario + '404': + description: Not found (404) + headers: + X-Correlation-Id: + description: Cabecera 'X-Correlation-Id' + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/errorMessage' + '429': + description: Too many requests + headers: + X-Correlation-Id: + description: Cabecera 'X-Correlation-Id' + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/errorMessage' + example: + error: + status: '429' + message: Too many requests + path: /datos-usuario + type: https://docs.example.es/x/A1D8Aw + operationId: '10005' + errors: + - code: '105' + message: >- + The user has sent too many requests in a given amount of + time + default: + description: Server Error (50X) + headers: + X-Correlation-Id: + description: Cabecera 'X-Correlation-Id' + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/errorMessage' +components: + schemas: + datosUsuario: + title: datosUsuario + type: object + required: + - nombreUsuario + - emailUsuario + properties: + idUsuario: + type: string + description: ID del usuario + example: '12' + readOnly: true + nombreUsuario: + type: string + description: Nombre del usuario + minLength: 5 + maxLength: 255 + example: Pedro + emailUsuario: + type: string + description: Email del usuario + minLength: 5 + maxLength: 255 + example: pedro@mail.com + fechaNacimiento: + type: string + description: Fecha de nacimiento + format: date + example: 1980-10-11T00:00:00.000Z + alta: + type: string + description: Fecha de alta + format: date-time + example: 2022-05-10T12:00:27.870Z + description: Datos básicos de un usuario + errorMessage: + required: + - message + - status + type: object + properties: + status: + type: string + description: Especifica el status code HTTP al que se traducirá la excepción. + message: + type: string + description: Mensaje descriptivo del error. + path: + type: string + description: URL path de la petición que originó el error. + type: + type: string + description: URL que apunta a una descripción de los códigos de error. + operationId: + type: string + description: Id de negocio de la operación realizada. + errors: + type: array + description: >- + Listado de suberrores usado para dar información más detallada, como + en el caso de errores de validación. + items: + $ref: '#/components/schemas/errors' + description: Datamodel refleja el formato de respuesta de error + errors: + required: + - message + type: object + properties: + message: + type: string + description: Detalle del suberror. + code: + type: string + description: Código de error (en errores de validación indica el tipo de error). + location: + type: string + description: >- + Localización del error (en errores de validación indica el campo + donde se produce el error). + description: >- + Listado de suberrores usado para dar información más detallada, como en + el caso de errores de validación. diff --git a/src/test/resources/checks/v32/operations/OAR092/with-ref.json b/src/test/resources/checks/v32/operations/OAR092/with-ref.json new file mode 100644 index 00000000..bfda972c --- /dev/null +++ b/src/test/resources/checks/v32/operations/OAR092/with-ref.json @@ -0,0 +1,44 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "Sample API", + "version": "1.0.0" + }, + "paths": { + "/pets": { + "post": { + "summary": "Create a pet", + "requestBody": { + "$ref": "#/components/requestBodies/Pet" + }, + "responses": { + "201": { + "description": "Pet created successfully" + } + } + } + } + }, + "components": { + "requestBodies": { + "Pet": { + "description": "The pet to create", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "name": { + "type": "string" + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/operations/OAR092/with-ref.yaml b/src/test/resources/checks/v32/operations/OAR092/with-ref.yaml new file mode 100644 index 00000000..aa5503ab --- /dev/null +++ b/src/test/resources/checks/v32/operations/OAR092/with-ref.yaml @@ -0,0 +1,33 @@ +openapi: 3.0.0 +info: + title: Sample API + version: '1.0.0' +paths: + /pets: + post: + summary: Create a pet + requestBody: + $ref: '#/components/requestBodies/PetBody' + responses: + '201': + description: Pet created successfully + content: + application/json: + schema: + $ref: '#/components/schemas/Pet' +components: + requestBodies: + PetBody: + description: The pet to create + content: + application/json: + schema: + $ref: '#/components/schemas/Pet' + schemas: + Pet: + type: object + properties: + id: + type: integer + name: + type: string \ No newline at end of file diff --git a/src/test/resources/checks/v32/operations/OAR093/no-ref.json b/src/test/resources/checks/v32/operations/OAR093/no-ref.json new file mode 100644 index 00000000..a03de219 --- /dev/null +++ b/src/test/resources/checks/v32/operations/OAR093/no-ref.json @@ -0,0 +1,37 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "Sample API", + "version": "1.0.0" + }, + "paths": { + "/pets": { + "get": { + "summary": "Get all pets", + "responses": { # Noncompliant {{OAR093: Responses must contain only references ($ref)}} + "200": { + "description": "A list of pets", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "name": { + "type": "string" + } + } + } + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/operations/OAR093/no-ref.yaml b/src/test/resources/checks/v32/operations/OAR093/no-ref.yaml new file mode 100644 index 00000000..ba07aaf3 --- /dev/null +++ b/src/test/resources/checks/v32/operations/OAR093/no-ref.yaml @@ -0,0 +1,22 @@ +openapi: 3.0.0 +info: + title: Sample API + version: 1.0.0 +paths: + /pets: + get: + summary: Get all pets + responses: # Noncompliant {{OAR093: Responses must contain only references ($ref)}} + '200': + description: A list of pets + content: + application/json: + schema: + type: array + items: + type: object + properties: + id: + type: integer + name: + type: string \ No newline at end of file diff --git a/src/test/resources/checks/v32/operations/OAR093/with-ref.json b/src/test/resources/checks/v32/operations/OAR093/with-ref.json new file mode 100644 index 00000000..1a4fa488 --- /dev/null +++ b/src/test/resources/checks/v32/operations/OAR093/with-ref.json @@ -0,0 +1,44 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "Sample API", + "version": "1.0.0" + }, + "paths": { + "/pets": { + "get": { + "summary": "Get all pets", + "responses": { + "200": { + "$ref": "#/components/responses/AllPets" + } + } + } + } + }, + "components": { + "responses": { + "AllPets": { + "description": "A list of pets", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "name": { + "type": "string" + } + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/operations/OAR093/with-ref.yaml b/src/test/resources/checks/v32/operations/OAR093/with-ref.yaml new file mode 100644 index 00000000..44518a95 --- /dev/null +++ b/src/test/resources/checks/v32/operations/OAR093/with-ref.yaml @@ -0,0 +1,26 @@ +openapi: 3.0.0 +info: + title: Sample API + version: 1.0.0 +paths: + /pets: + get: + summary: Get all pets + responses: + '200': + $ref: '#/components/responses/AllPets' +components: + responses: + AllPets: + description: A list of pets + content: + application/json: + schema: + type: array + items: + type: object + properties: + id: + type: integer + name: + type: string \ No newline at end of file diff --git a/src/test/resources/checks/v32/operations/OAR103/plain.json b/src/test/resources/checks/v32/operations/OAR103/plain.json new file mode 100644 index 00000000..2d2671b6 --- /dev/null +++ b/src/test/resources/checks/v32/operations/OAR103/plain.json @@ -0,0 +1,63 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore (GETs only)" + }, + "paths": { + "/resources": { + "get": { + "responses": { + "200": { + "description": "Ok" + } + } + } + }, + "/resources/{r_id}": { + "get": { + "responses": { + "200": { + "description": "Ok" + } + } + } + }, + "/resources/get": { + "get": { # Noncompliant {{OAR103: Operation not recommended for resource path: resources/get}} + "responses": { + "200": { + "description": "Ok" + } + } + } + }, + "/resources/delete": { + "get": { # Noncompliant {{OAR103: Operation not recommended for resource path: resources/delete}} + "responses": { + "200": { + "description": "Ok" + } + } + } + }, + "/resources/{r_id}/other": { + "get": { + "responses": { + "200": { + "description": "Ok" + } + } + } + }, + "/resources/me": { + "get": { + "responses": { + "200": { + "description": "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/operations/OAR103/plain.yaml b/src/test/resources/checks/v32/operations/OAR103/plain.yaml new file mode 100644 index 00000000..a06d2246 --- /dev/null +++ b/src/test/resources/checks/v32/operations/OAR103/plain.yaml @@ -0,0 +1,35 @@ +openapi: 3.0.0 +info: + version: '1.0.0' + title: Swagger Petstore (GETs only) +paths: + /resources: + get: + responses: + '200': + description: Ok + /resources/{r_id}: + get: + responses: + '200': + description: Ok + /resources/get: + get: # Noncompliant {{OAR103: Operation not recommended for resource path: resources/get}} + responses: + '200': + description: Ok + /resources/{delete}: + get: # Noncompliant {{OAR103: Operation not recommended for resource path: resources/{delete}}} + responses: + '200': + description: Ok + /hola/{r_id}/other: + get: + responses: + '200': + description: Ok + /resources/me: + get: + responses: + '200': + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v32/operations/OAR104/plain.yaml b/src/test/resources/checks/v32/operations/OAR104/plain.yaml new file mode 100644 index 00000000..521a52ca --- /dev/null +++ b/src/test/resources/checks/v32/operations/OAR104/plain.yaml @@ -0,0 +1,40 @@ +openapi: 3.0.0 +info: + version: '1.0.0' + title: Swagger Petstore (Posts only) +paths: + /resources: + post: + responses: + '200': + description: Ok + /resources/me/cars: + post: + responses: + '200': + description: Ok + /resources/get: + post: # Noncompliant {{OAR104: Operation not recommended for resource path: resources/get}} + responses: + '200': + description: Ok + /resources/hello: + post: # Noncompliant {{OAR104: Operation not recommended for resource path: resources/hello}} + responses: + '200': + description: Ok + /resources/{r_id}/other: + post: + responses: + '200': + description: Ok + /resources/me: + post: + responses: + '200': + description: Ok + /resources/search: + post: + responses: + '200': + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v32/operations/OAR105/plain.json b/src/test/resources/checks/v32/operations/OAR105/plain.json new file mode 100644 index 00000000..ff990d20 --- /dev/null +++ b/src/test/resources/checks/v32/operations/OAR105/plain.json @@ -0,0 +1,63 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore (POSTs only)" + }, + "paths": { + "/resources": { + "put": { + "responses": { + "200": { + "description": "Ok" + } + } + } + }, + "/resources/{r_id}": { + "put": { + "responses": { + "200": { + "description": "Ok" + } + } + } + }, + "/resources/get": { + "put": { # Noncompliant {{OAR105: Operation not recommended for resource path: resources/get}} + "responses": { + "200": { + "description": "Ok" + } + } + } + }, + "/resources/delete": { + "put": { # Noncompliant {{OAR105: Operation not recommended for resource path: resources/delete}} + "responses": { + "200": { + "description": "Ok" + } + } + } + }, + "/resources/{r_id}/other": { + "put": { + "responses": { + "200": { + "description": "Ok" + } + } + } + }, + "/resources/me": { + "put": { + "responses": { + "200": { + "description": "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/operations/OAR105/plain.yaml b/src/test/resources/checks/v32/operations/OAR105/plain.yaml new file mode 100644 index 00000000..0708ff20 --- /dev/null +++ b/src/test/resources/checks/v32/operations/OAR105/plain.yaml @@ -0,0 +1,35 @@ +openapi: 3.0.0 +info: + version: '1.0.0' + title: Swagger Petstore (Posts only) +paths: + /resources: + put: + responses: + '200': + description: Ok + /resources/{r_id}: + put: + responses: + '200': + description: Ok + /resources/get: + put: # Noncompliant {{OAR105: Operation not recommended for resource path: resources/get}} + responses: + '200': + description: Ok + /resources/delete: + put: # Noncompliant {{OAR105: Operation not recommended for resource path: resources/delete}} + responses: + '200': + description: Ok + /resources/{r_id}/other: + put: + responses: + '200': + description: Ok + /resources/me: + put: + responses: + '200': + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v32/operations/OAR106/plain.json b/src/test/resources/checks/v32/operations/OAR106/plain.json new file mode 100644 index 00000000..7cf21ad0 --- /dev/null +++ b/src/test/resources/checks/v32/operations/OAR106/plain.json @@ -0,0 +1,63 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore (POSTs only)" + }, + "paths": { + "/resources": { + "patch": { + "responses": { + "200": { + "description": "Ok" + } + } + } + }, + "/resources/{r_id}": { + "patch": { + "responses": { + "200": { + "description": "Ok" + } + } + } + }, + "/resources/get": { + "patch": { # Noncompliant {{OAR106: Operation not recommended for resource path: resources/get}} + "responses": { + "200": { + "description": "Ok" + } + } + } + }, + "/resources/delete": { + "patch": { # Noncompliant {{OAR106: Operation not recommended for resource path: resources/delete}} + "responses": { + "200": { + "description": "Ok" + } + } + } + }, + "/resources/{r_id}/other": { + "patch": { + "responses": { + "200": { + "description": "Ok" + } + } + } + }, + "/resources/me": { + "patch": { + "responses": { + "200": { + "description": "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/operations/OAR106/plain.yaml b/src/test/resources/checks/v32/operations/OAR106/plain.yaml new file mode 100644 index 00000000..7072bd07 --- /dev/null +++ b/src/test/resources/checks/v32/operations/OAR106/plain.yaml @@ -0,0 +1,35 @@ +openapi: 3.0.0 +info: + version: '1.0.0' + title: Swagger Petstore (Posts only) +paths: + /resources: + patch: + responses: + '200': + description: Ok + /resources/{r_id}: + patch: + responses: + '200': + description: Ok + /resources/get: + patch: # Noncompliant {{OAR106: Operation not recommended for resource path: resources/get}} + responses: + '200': + description: Ok + /resources/delete: + patch: # Noncompliant {{OAR106: Operation not recommended for resource path: resources/delete}} + responses: + '200': + description: Ok + /resources/{r_id}/other: + patch: + responses: + '200': + description: Ok + /resources/me: + patch: + responses: + '200': + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v32/operations/OAR107/plain.json b/src/test/resources/checks/v32/operations/OAR107/plain.json new file mode 100644 index 00000000..6bd61a1d --- /dev/null +++ b/src/test/resources/checks/v32/operations/OAR107/plain.json @@ -0,0 +1,63 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore (POSTs only)" + }, + "paths": { + "/resources": { + "delete": { + "responses": { + "200": { + "description": "Ok" + } + } + } + }, + "/resources/{r_id}": { + "delete": { + "responses": { + "200": { + "description": "Ok" + } + } + } + }, + "/resources/get": { + "delete": { # Noncompliant {{OAR107: Operation not recommended for resource path: resources/get}} + "responses": { + "200": { + "description": "Ok" + } + } + } + }, + "/resources/delete": { + "delete": { # Noncompliant {{OAR107: Operation not recommended for resource path: resources/delete}} + "responses": { + "200": { + "description": "Ok" + } + } + } + }, + "/resources/{r_id}/other": { + "delete": { + "responses": { + "200": { + "description": "Ok" + } + } + } + }, + "/resources/me": { + "delete": { + "responses": { + "200": { + "description": "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/operations/OAR107/plain.yaml b/src/test/resources/checks/v32/operations/OAR107/plain.yaml new file mode 100644 index 00000000..7b87298e --- /dev/null +++ b/src/test/resources/checks/v32/operations/OAR107/plain.yaml @@ -0,0 +1,35 @@ +openapi: 3.0.0 +info: + version: '1.0.0' + title: Swagger Petstore (Posts only) +paths: + /resources: + delete: + responses: + '200': + description: Ok + /resources/{r_id}: + delete: + responses: + '200': + description: Ok + /resources/get: + delete: # Noncompliant {{OAR107: Operation not recommended for resource path: resources/get}} + responses: + '200': + description: Ok + /resources/delete: + delete: # Noncompliant {{OAR107: Operation not recommended for resource path: resources/delete}} + responses: + '200': + description: Ok + /resources/{r_id}/other: + delete: + responses: + '200': + description: Ok + /resources/me: + delete: + responses: + '200': + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v32/operations/OAR109/plain.json b/src/test/resources/checks/v32/operations/OAR109/plain.json new file mode 100644 index 00000000..1d2a84df --- /dev/null +++ b/src/test/resources/checks/v32/operations/OAR109/plain.json @@ -0,0 +1,42 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/status": { + "delete": { + "summary": "Get API status", + "responses": { + "400": { + "description": "error" + } + } + } + }, + "/another": { + "delete": { + "summary": "Get another API status", + "responses": { + "400": { + "description": "error" + } + } + } + }, + "/users": { + "delete": { + "summary": "Get all users", + "responses": { # Noncompliant {{OAR109: Use default instead of directly specifying 5XX codes}} + "400": { + "description": "Error" + }, + "500": { + "description": "Internal Server Error" + } + } + } + } + } + } \ No newline at end of file diff --git a/src/test/resources/checks/v32/operations/OAR109/plain.yaml b/src/test/resources/checks/v32/operations/OAR109/plain.yaml new file mode 100644 index 00000000..97cdd572 --- /dev/null +++ b/src/test/resources/checks/v32/operations/OAR109/plain.yaml @@ -0,0 +1,25 @@ +openapi: 3.0.0 +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /status: + delete: + summary: Get API status + responses: + '400': + description: error + /another: + delete: + summary: Get another API status + responses: + '400': + description: error + /users: + delete: + summary: Get all users + responses: # Noncompliant {{OAR109: Use default instead of directly specifying 5XX codes}} + '400': + description: Error + '500': + description: Internal Server Error \ No newline at end of file diff --git a/src/test/resources/checks/v32/owasp/OAR070/no-numeric.json b/src/test/resources/checks/v32/owasp/OAR070/no-numeric.json new file mode 100644 index 00000000..6c4d7036 --- /dev/null +++ b/src/test/resources/checks/v32/owasp/OAR070/no-numeric.json @@ -0,0 +1,42 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/items/{param1}": { + "get": { + "summary": "Get a list of items", + "parameters": [ + { + "name": "param1", + "in": "path", + "required": false, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "A list of items", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + }, + "400": { + "description": "error" + } + } + } + } + } + } \ No newline at end of file diff --git a/src/test/resources/checks/v32/owasp/OAR070/no-numeric.yaml b/src/test/resources/checks/v32/owasp/OAR070/no-numeric.yaml new file mode 100644 index 00000000..b561d78e --- /dev/null +++ b/src/test/resources/checks/v32/owasp/OAR070/no-numeric.yaml @@ -0,0 +1,25 @@ + openapi: "3.0.0" + info: + version: 1.0.0 + title: Swagger Petstore + paths: + /items/{param1}: + get: + summary: Get a list of items + parameters: + - name: param1 + in: path + required: false + schema: + type: string + responses: + 200: + description: A list of items + content: + application/json: + schema: + type: array + items: + type: string + 400: + description: error \ No newline at end of file diff --git a/src/test/resources/checks/v32/owasp/OAR070/numeric.json b/src/test/resources/checks/v32/owasp/OAR070/numeric.json new file mode 100644 index 00000000..95833d45 --- /dev/null +++ b/src/test/resources/checks/v32/owasp/OAR070/numeric.json @@ -0,0 +1,42 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/items/{param1}": { + "get": { + "summary": "Get a list of items", + "parameters": [ + { + "name": "param1", + "in": "path", + "required": false, + "schema": { + "type": "integer" # Noncompliant {{OAR070: Parameters in path shouldnt be numeric}} + } + } + ], + "responses": { + "200": { + "description": "A list of items", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + }, + "400": { + "description": "error" + } + } + } + } + } + } \ No newline at end of file diff --git a/src/test/resources/checks/v32/owasp/OAR070/numeric.yaml b/src/test/resources/checks/v32/owasp/OAR070/numeric.yaml new file mode 100644 index 00000000..c71f0c38 --- /dev/null +++ b/src/test/resources/checks/v32/owasp/OAR070/numeric.yaml @@ -0,0 +1,25 @@ + openapi: "3.0.0" + info: + version: 1.0.0 + title: Swagger Petstore + paths: + /items/{param1}: + get: + summary: Get a list of items + parameters: + - name: param1 + in: path + required: false + schema: + type: integer # Noncompliant {{OAR070: Parameters in path shouldnt be numeric}} + responses: + 200: + description: A list of items + content: + application/json: + schema: + type: array + items: + type: string + 400: + description: error \ No newline at end of file diff --git a/src/test/resources/checks/v32/owasp/OAR073/no-rate-limit.json b/src/test/resources/checks/v32/owasp/OAR073/no-rate-limit.json new file mode 100644 index 00000000..6416f160 --- /dev/null +++ b/src/test/resources/checks/v32/owasp/OAR073/no-rate-limit.json @@ -0,0 +1,29 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Non-compliant API" + }, + "paths": { + "/items": { + "get": { + "summary": "Get a list of items", + "responses": { # Noncompliant {{OAR073: API should include a 429 response to indicate rate limiting}} + "200": { + "description": "A list of items", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/owasp/OAR073/no-rate-limit.yaml b/src/test/resources/checks/v32/owasp/OAR073/no-rate-limit.yaml new file mode 100644 index 00000000..e8cf9dae --- /dev/null +++ b/src/test/resources/checks/v32/owasp/OAR073/no-rate-limit.yaml @@ -0,0 +1,17 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Non-compliant API +paths: + /param2: + get: + summary: Get a list of items + responses: # Noncompliant {{OAR073: API should include a 429 response to indicate rate limiting}} + 200: + description: A list of items + content: + application/json: + schema: + type: array + items: + type: string \ No newline at end of file diff --git a/src/test/resources/checks/v32/owasp/OAR073/no-responses.json b/src/test/resources/checks/v32/owasp/OAR073/no-responses.json new file mode 100644 index 00000000..e0294c8b --- /dev/null +++ b/src/test/resources/checks/v32/owasp/OAR073/no-responses.json @@ -0,0 +1,14 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Compliant API" + }, + "paths": { + "/items": { + "get": { + "summary": "Get a list of items with no responses key" + } + } + } +} diff --git a/src/test/resources/checks/v32/owasp/OAR073/no-responses.yaml b/src/test/resources/checks/v32/owasp/OAR073/no-responses.yaml new file mode 100644 index 00000000..2575f439 --- /dev/null +++ b/src/test/resources/checks/v32/owasp/OAR073/no-responses.yaml @@ -0,0 +1,8 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Compliant API +paths: + /items: + get: + summary: Get a list of items with no responses key diff --git a/src/test/resources/checks/v32/owasp/OAR073/rate-limit.json b/src/test/resources/checks/v32/owasp/OAR073/rate-limit.json new file mode 100644 index 00000000..3103396f --- /dev/null +++ b/src/test/resources/checks/v32/owasp/OAR073/rate-limit.json @@ -0,0 +1,39 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Compliant API" + }, + "paths": { + "/items": { + "get": { + "summary": "Get a list of items", + "responses": { + "200": { + "description": "A list of items", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + }, + "429": { + "description": "Too Many Requests", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error_response" + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/owasp/OAR073/rate-limit.yaml b/src/test/resources/checks/v32/owasp/OAR073/rate-limit.yaml new file mode 100644 index 00000000..d01f36ad --- /dev/null +++ b/src/test/resources/checks/v32/owasp/OAR073/rate-limit.yaml @@ -0,0 +1,23 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Compliant API +paths: + /items: + get: + summary: Get a list of items + responses: + 200: + description: A list of items + content: + application/json: + schema: + type: array + items: + type: string + 429: + description: Too Many Requests + content: + application/json: + schema: + $ref: '#/components/schemas/error_response' \ No newline at end of file diff --git a/src/test/resources/checks/v32/parameters/OAR019/excluded.json b/src/test/resources/checks/v32/parameters/OAR019/excluded.json new file mode 100644 index 00000000..7b77042f --- /dev/null +++ b/src/test/resources/checks/v32/parameters/OAR019/excluded.json @@ -0,0 +1,37 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/status" : { + "get" : { + "parameters" : [ { + "in" : "query", + "name" : "other", + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + }, { + "in" : "query", + "name" : "select", + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + } ], + "responses" : { + "206" : { + "description" : "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/parameters/OAR019/excluded.yaml b/src/test/resources/checks/v32/parameters/OAR019/excluded.yaml new file mode 100644 index 00000000..7758deac --- /dev/null +++ b/src/test/resources/checks/v32/parameters/OAR019/excluded.yaml @@ -0,0 +1,23 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /another: + get: + parameters: + - in: query + name: other + schema: + type: array + items: + type: string + - in: query + name: select + schema: + type: array + items: + type: string + responses: + 206: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v32/parameters/OAR019/plain-without.json b/src/test/resources/checks/v32/parameters/OAR019/plain-without.json new file mode 100644 index 00000000..2e628a27 --- /dev/null +++ b/src/test/resources/checks/v32/parameters/OAR019/plain-without.json @@ -0,0 +1,37 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/examples" : { + "get" : { # Noncompliant {{OAR019: $select must be defined as a parameter in this operation}} + "parameters" : [ { + "in" : "query", + "name" : "other", + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + }, { + "in" : "query", + "name" : "select", + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + } ], + "responses" : { + "206" : { + "description" : "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/parameters/OAR019/plain-without.yaml b/src/test/resources/checks/v32/parameters/OAR019/plain-without.yaml new file mode 100644 index 00000000..2f1bd5d6 --- /dev/null +++ b/src/test/resources/checks/v32/parameters/OAR019/plain-without.yaml @@ -0,0 +1,23 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /examples: + get: # Noncompliant {{OAR019: $select must be defined as a parameter in this operation}} + parameters: + - in: query + name: other + schema: + type: array + items: + type: string + - in: query + name: select + schema: + type: array + items: + type: string + responses: + 206: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v32/parameters/OAR019/plain.json b/src/test/resources/checks/v32/parameters/OAR019/plain.json new file mode 100644 index 00000000..18138264 --- /dev/null +++ b/src/test/resources/checks/v32/parameters/OAR019/plain.json @@ -0,0 +1,37 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/examples" : { + "get" : { + "parameters" : [ { + "in" : "query", + "name" : "$select", + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + }, { + "in" : "query", + "name" : "$select", + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + } ], + "responses" : { + "206" : { + "description" : "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/parameters/OAR019/plain.yaml b/src/test/resources/checks/v32/parameters/OAR019/plain.yaml new file mode 100644 index 00000000..af676143 --- /dev/null +++ b/src/test/resources/checks/v32/parameters/OAR019/plain.yaml @@ -0,0 +1,23 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /examples: + get: + parameters: + - in: query + name: $select + schema: + type: array + items: + type: string + - in: query + name: $select + schema: + type: array + items: + type: string + responses: + 206: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v32/parameters/OAR019/with-$ref-without.json b/src/test/resources/checks/v32/parameters/OAR019/with-$ref-without.json new file mode 100644 index 00000000..4b111e51 --- /dev/null +++ b/src/test/resources/checks/v32/parameters/OAR019/with-$ref-without.json @@ -0,0 +1,47 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "components": { + "parameters" : { + "other" : { + "in" : "query", + "name" : "other", + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + }, + "select" : { + "in" : "query", + "name" : "select", + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + } + } + }, + "paths" : { + "/pets" : { + "get" : { + "parameters" : [ { # Noncompliant {{OAR019: $select must be defined as a parameter in this operation}} + "$ref" : "#/components/parameters/other" + }, { + "$ref" : "#/components/parameters/select" + } ], + "responses" : { + "206" : { + "description" : "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/parameters/OAR019/with-$ref-without.yaml b/src/test/resources/checks/v32/parameters/OAR019/with-$ref-without.yaml new file mode 100644 index 00000000..40bd84a8 --- /dev/null +++ b/src/test/resources/checks/v32/parameters/OAR019/with-$ref-without.yaml @@ -0,0 +1,29 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +components: + parameters: + other: + in: query + name: other + schema: + type: array + items: + type: string + select: + in: query + name: select + schema: + type: array + items: + type: string +paths: + /pets: + get: + parameters: # Noncompliant {{OAR019: $select must be defined as a parameter in this operation}} + - $ref: '#/components/parameters/other' + - $ref: '#/components/parameters/select' + responses: + 206: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v32/parameters/OAR019/with-$ref.json b/src/test/resources/checks/v32/parameters/OAR019/with-$ref.json new file mode 100644 index 00000000..44519b76 --- /dev/null +++ b/src/test/resources/checks/v32/parameters/OAR019/with-$ref.json @@ -0,0 +1,47 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "components": { + "parameters" : { + "other" : { + "in" : "query", + "name" : "other", + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + }, + "select" : { + "in" : "query", + "name" : "$select", + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + } + } + }, + "paths" : { + "/pets" : { + "get" : { + "parameters" : [ { + "$ref" : "#/components/parameters/other" + }, { + "$ref" : "#/components/parameters/select" + } ], + "responses" : { + "206" : { + "description" : "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/parameters/OAR019/with-$ref.yaml b/src/test/resources/checks/v32/parameters/OAR019/with-$ref.yaml new file mode 100644 index 00000000..8144cd2f --- /dev/null +++ b/src/test/resources/checks/v32/parameters/OAR019/with-$ref.yaml @@ -0,0 +1,29 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +components: + parameters: + other: + in: query + name: other + schema: + type: array + items: + type: string + select: + in: query + name: $select + schema: + type: array + items: + type: string +paths: + /pets: + get: + parameters: + - $ref: '#/components/parameters/other' + - $ref: '#/components/parameters/select' + responses: + 206: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v32/parameters/OAR019/with-param.json b/src/test/resources/checks/v32/parameters/OAR019/with-param.json new file mode 100644 index 00000000..1097b436 --- /dev/null +++ b/src/test/resources/checks/v32/parameters/OAR019/with-param.json @@ -0,0 +1,27 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "Swagger Petstore", + "version": "1.0.0" + }, + "paths": { + "/examples/{id}": { + "get": { + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/examples/{id}/items/{id}": { + "get": { + "responses": { + "200": { + "description": "OK" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/parameters/OAR019/with-param.yaml b/src/test/resources/checks/v32/parameters/OAR019/with-param.yaml new file mode 100644 index 00000000..8b012753 --- /dev/null +++ b/src/test/resources/checks/v32/parameters/OAR019/with-param.yaml @@ -0,0 +1,15 @@ +openapi: 3.0.0 +info: + title: Swagger Petstore + version: 1.0.0 +paths: + /examples/{id}: + get: + responses: + '200': + description: OK + /examples/{id}/items/{id}: + get: + responses: + '200': + description: OK \ No newline at end of file diff --git a/src/test/resources/checks/v32/parameters/OAR019/with-ref.json b/src/test/resources/checks/v32/parameters/OAR019/with-ref.json new file mode 100644 index 00000000..e6772a42 --- /dev/null +++ b/src/test/resources/checks/v32/parameters/OAR019/with-ref.json @@ -0,0 +1,37 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "components": { + "parameters": { + "selectParameter": { + "in": "query", + "name": "$select", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + }, + "paths": { + "/examples": { + "get": { + "parameters": [ + { + "$ref": "#/components/parameters/selectParameter" + } + ], + "responses": { + "206": { + "description": "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/parameters/OAR019/with-ref.yaml b/src/test/resources/checks/v32/parameters/OAR019/with-ref.yaml new file mode 100644 index 00000000..dfc1b239 --- /dev/null +++ b/src/test/resources/checks/v32/parameters/OAR019/with-ref.yaml @@ -0,0 +1,23 @@ +openapi: 3.0.0 +info: + version: 1.0.0 + title: Swagger Petstore + +components: + parameters: + selectParameter: + in: query + name: $select + schema: + type: array + items: + type: string + +paths: + /examples: + get: + parameters: + - $ref: '#/components/parameters/selectParameter' + responses: + 206: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v32/parameters/OAR019/without-parameters.json b/src/test/resources/checks/v32/parameters/OAR019/without-parameters.json new file mode 100644 index 00000000..5fc9f4c1 --- /dev/null +++ b/src/test/resources/checks/v32/parameters/OAR019/without-parameters.json @@ -0,0 +1,18 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/pets" : { + "get" : { # Noncompliant {{OAR019: $select must be defined as a parameter in this operation}} + "responses" : { + "206" : { + "description" : "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/parameters/OAR019/without-parameters.yaml b/src/test/resources/checks/v32/parameters/OAR019/without-parameters.yaml new file mode 100644 index 00000000..7d1f1941 --- /dev/null +++ b/src/test/resources/checks/v32/parameters/OAR019/without-parameters.yaml @@ -0,0 +1,10 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: + get: # Noncompliant {{OAR019: $select must be defined as a parameter in this operation}} + responses: + 206: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v32/parameters/OAR020/excluded.json b/src/test/resources/checks/v32/parameters/OAR020/excluded.json new file mode 100644 index 00000000..abb1867f --- /dev/null +++ b/src/test/resources/checks/v32/parameters/OAR020/excluded.json @@ -0,0 +1,37 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/status" : { + "get" : { + "parameters" : [ { + "in" : "query", + "name" : "other", + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + }, { + "in" : "query", + "name" : "$expand", + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + } ], + "responses" : { + "206" : { + "description" : "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/parameters/OAR020/excluded.yaml b/src/test/resources/checks/v32/parameters/OAR020/excluded.yaml new file mode 100644 index 00000000..528f119e --- /dev/null +++ b/src/test/resources/checks/v32/parameters/OAR020/excluded.yaml @@ -0,0 +1,23 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /status: + get: + parameters: + - in: query + name: other + schema: + type: array + items: + type: string + - in: query + name: $expand + schema: + type: array + items: + type: string + responses: + 206: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v32/parameters/OAR020/excluded2.json b/src/test/resources/checks/v32/parameters/OAR020/excluded2.json new file mode 100644 index 00000000..7b77042f --- /dev/null +++ b/src/test/resources/checks/v32/parameters/OAR020/excluded2.json @@ -0,0 +1,37 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/status" : { + "get" : { + "parameters" : [ { + "in" : "query", + "name" : "other", + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + }, { + "in" : "query", + "name" : "select", + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + } ], + "responses" : { + "206" : { + "description" : "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/parameters/OAR020/excluded2.yaml b/src/test/resources/checks/v32/parameters/OAR020/excluded2.yaml new file mode 100644 index 00000000..5bb25ac8 --- /dev/null +++ b/src/test/resources/checks/v32/parameters/OAR020/excluded2.yaml @@ -0,0 +1,23 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /status: + get: + parameters: + - in: query + name: other + schema: + type: array + items: + type: string + - in: query + name: select + schema: + type: array + items: + type: string + responses: + 206: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v32/parameters/OAR020/plain-without.json b/src/test/resources/checks/v32/parameters/OAR020/plain-without.json new file mode 100644 index 00000000..ac05e24d --- /dev/null +++ b/src/test/resources/checks/v32/parameters/OAR020/plain-without.json @@ -0,0 +1,37 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/pets" : { + "get" : { + "parameters" : [ { # Noncompliant {{OAR020: $expand must be defined as a parameter in this operation}} + "in" : "query", + "name" : "other", + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + }, { + "in" : "query", + "name" : "expand", + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + } ], + "responses" : { + "206" : { + "description" : "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/parameters/OAR020/plain-without.yaml b/src/test/resources/checks/v32/parameters/OAR020/plain-without.yaml new file mode 100644 index 00000000..aadbb6e3 --- /dev/null +++ b/src/test/resources/checks/v32/parameters/OAR020/plain-without.yaml @@ -0,0 +1,23 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: + get: + parameters: # Noncompliant {{OAR020: $expand must be defined as a parameter in this operation}} + - in: query + name: other + schema: + type: array + items: + type: string + - in: query + name: expand + schema: + type: array + items: + type: string + responses: + 206: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v32/parameters/OAR020/plain-without2.json b/src/test/resources/checks/v32/parameters/OAR020/plain-without2.json new file mode 100644 index 00000000..96bdfe49 --- /dev/null +++ b/src/test/resources/checks/v32/parameters/OAR020/plain-without2.json @@ -0,0 +1,37 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/examples" : { + "get" : { # Noncompliant {{OAR020: $expand must be defined as a parameter in this operation}} + "parameters" : [ { + "in" : "query", + "name" : "other", + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + }, { + "in" : "query", + "name" : "select", + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + } ], + "responses" : { + "206" : { + "description" : "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/parameters/OAR020/plain-without2.yaml b/src/test/resources/checks/v32/parameters/OAR020/plain-without2.yaml new file mode 100644 index 00000000..798c326e --- /dev/null +++ b/src/test/resources/checks/v32/parameters/OAR020/plain-without2.yaml @@ -0,0 +1,23 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /examples: + get: # Noncompliant {{OAR020: $expand must be defined as a parameter in this operation}} + parameters: + - in: query + name: other + schema: + type: array + items: + type: string + - in: query + name: select + schema: + type: array + items: + type: string + responses: + 206: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v32/parameters/OAR020/plain.json b/src/test/resources/checks/v32/parameters/OAR020/plain.json new file mode 100644 index 00000000..bdb3c7d1 --- /dev/null +++ b/src/test/resources/checks/v32/parameters/OAR020/plain.json @@ -0,0 +1,37 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/pets" : { + "get" : { + "parameters" : [ { + "in" : "query", + "name" : "other", + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + }, { + "in" : "query", + "name" : "$expand", + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + } ], + "responses" : { + "206" : { + "description" : "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/parameters/OAR020/plain.yaml b/src/test/resources/checks/v32/parameters/OAR020/plain.yaml new file mode 100644 index 00000000..ad2fc836 --- /dev/null +++ b/src/test/resources/checks/v32/parameters/OAR020/plain.yaml @@ -0,0 +1,23 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: + get: + parameters: + - in: query + name: other + schema: + type: array + items: + type: string + - in: query + name: $expand + schema: + type: array + items: + type: string + responses: + 206: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v32/parameters/OAR020/plain2.json b/src/test/resources/checks/v32/parameters/OAR020/plain2.json new file mode 100644 index 00000000..b349d610 --- /dev/null +++ b/src/test/resources/checks/v32/parameters/OAR020/plain2.json @@ -0,0 +1,37 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/examples" : { + "get" : { + "parameters" : [ { + "in" : "query", + "name" : "$expand", + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + }, { + "in" : "query", + "name" : "$expand", + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + } ], + "responses" : { + "206" : { + "description" : "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/parameters/OAR020/plain2.yaml b/src/test/resources/checks/v32/parameters/OAR020/plain2.yaml new file mode 100644 index 00000000..d6c6860b --- /dev/null +++ b/src/test/resources/checks/v32/parameters/OAR020/plain2.yaml @@ -0,0 +1,23 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /examples: + get: + parameters: + - in: query + name: $expand + schema: + type: array + items: + type: string + - in: query + name: $expand + schema: + type: array + items: + type: string + responses: + 206: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v32/parameters/OAR020/with-$ref-without.json b/src/test/resources/checks/v32/parameters/OAR020/with-$ref-without.json new file mode 100644 index 00000000..33a10da9 --- /dev/null +++ b/src/test/resources/checks/v32/parameters/OAR020/with-$ref-without.json @@ -0,0 +1,47 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "components": { + "parameters" : { + "other" : { + "in" : "query", + "name" : "other", + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + }, + "expand" : { + "in" : "query", + "name" : "expand", + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + } + } + }, + "paths" : { + "/pets" : { + "get" : { + "parameters" : [ { # Noncompliant {{OAR020: $expand must be defined as a parameter in this operation}} + "$ref" : "#/components/parameters/other" + }, { + "$ref" : "#/components/parameters/expand" + } ], + "responses" : { + "206" : { + "description" : "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/parameters/OAR020/with-$ref-without.yaml b/src/test/resources/checks/v32/parameters/OAR020/with-$ref-without.yaml new file mode 100644 index 00000000..6080512e --- /dev/null +++ b/src/test/resources/checks/v32/parameters/OAR020/with-$ref-without.yaml @@ -0,0 +1,29 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +components: + parameters: + other: + in: query + name: other + schema: + type: array + items: + type: string + expand: + in: query + name: expand + schema: + type: array + items: + type: string +paths: + /pets: + get: + parameters: # Noncompliant {{OAR020: $expand must be defined as a parameter in this operation}} + - $ref: '#/components/parameters/other' + - $ref: '#/components/parameters/expand' + responses: + 206: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v32/parameters/OAR020/with-$ref.json b/src/test/resources/checks/v32/parameters/OAR020/with-$ref.json new file mode 100644 index 00000000..1354ddee --- /dev/null +++ b/src/test/resources/checks/v32/parameters/OAR020/with-$ref.json @@ -0,0 +1,47 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "components": { + "parameters" : { + "other" : { + "in" : "query", + "name" : "other", + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + }, + "expand" : { + "in" : "query", + "name" : "$expand", + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + } + } + }, + "paths" : { + "/pets" : { + "get" : { + "parameters" : [ { + "$ref" : "#/components/parameters/other" + }, { + "$ref" : "#/components/parameters/expand" + } ], + "responses" : { + "206" : { + "description" : "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/parameters/OAR020/with-$ref.yaml b/src/test/resources/checks/v32/parameters/OAR020/with-$ref.yaml new file mode 100644 index 00000000..04c46fa9 --- /dev/null +++ b/src/test/resources/checks/v32/parameters/OAR020/with-$ref.yaml @@ -0,0 +1,29 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +components: + parameters: + other: + in: query + name: other + schema: + type: array + items: + type: string + expand: + in: query + name: $expand + schema: + type: array + items: + type: string +paths: + /pets: + get: + parameters: + - $ref: '#/components/parameters/other' + - $ref: '#/components/parameters/expand' + responses: + 206: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v32/parameters/OAR020/with-param.json b/src/test/resources/checks/v32/parameters/OAR020/with-param.json new file mode 100644 index 00000000..1097b436 --- /dev/null +++ b/src/test/resources/checks/v32/parameters/OAR020/with-param.json @@ -0,0 +1,27 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "Swagger Petstore", + "version": "1.0.0" + }, + "paths": { + "/examples/{id}": { + "get": { + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/examples/{id}/items/{id}": { + "get": { + "responses": { + "200": { + "description": "OK" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/parameters/OAR020/with-param.yaml b/src/test/resources/checks/v32/parameters/OAR020/with-param.yaml new file mode 100644 index 00000000..8b012753 --- /dev/null +++ b/src/test/resources/checks/v32/parameters/OAR020/with-param.yaml @@ -0,0 +1,15 @@ +openapi: 3.0.0 +info: + title: Swagger Petstore + version: 1.0.0 +paths: + /examples/{id}: + get: + responses: + '200': + description: OK + /examples/{id}/items/{id}: + get: + responses: + '200': + description: OK \ No newline at end of file diff --git a/src/test/resources/checks/v32/parameters/OAR020/with-ref.json b/src/test/resources/checks/v32/parameters/OAR020/with-ref.json new file mode 100644 index 00000000..52a22a10 --- /dev/null +++ b/src/test/resources/checks/v32/parameters/OAR020/with-ref.json @@ -0,0 +1,37 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "components": { + "parameters": { + "selectParameter": { + "in": "query", + "name": "$expand", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + }, + "paths": { + "/examples": { + "get": { + "parameters": [ + { + "$ref": "#/components/parameters/selectParameter" + } + ], + "responses": { + "206": { + "description": "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/parameters/OAR020/with-ref.yaml b/src/test/resources/checks/v32/parameters/OAR020/with-ref.yaml new file mode 100644 index 00000000..315ab8f9 --- /dev/null +++ b/src/test/resources/checks/v32/parameters/OAR020/with-ref.yaml @@ -0,0 +1,23 @@ +openapi: 3.0.0 +info: + version: 1.0.0 + title: Swagger Petstore + +components: + parameters: + selectParameter: + in: query + name: $expand + schema: + type: array + items: + type: string + +paths: + /examples: + get: + parameters: + - $ref: '#/components/parameters/selectParameter' + responses: + 206: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v32/parameters/OAR020/without-parameters.json b/src/test/resources/checks/v32/parameters/OAR020/without-parameters.json new file mode 100644 index 00000000..dd4f0781 --- /dev/null +++ b/src/test/resources/checks/v32/parameters/OAR020/without-parameters.json @@ -0,0 +1,18 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/pets" : { + "get" : { # Noncompliant {{OAR020: $expand must be defined as a parameter in this operation}} + "responses" : { + "206" : { + "description" : "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/parameters/OAR020/without-parameters.yaml b/src/test/resources/checks/v32/parameters/OAR020/without-parameters.yaml new file mode 100644 index 00000000..17256a1a --- /dev/null +++ b/src/test/resources/checks/v32/parameters/OAR020/without-parameters.yaml @@ -0,0 +1,10 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: + get: # Noncompliant {{OAR020: $expand must be defined as a parameter in this operation}} + responses: + 206: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v32/parameters/OAR021/excluded.json b/src/test/resources/checks/v32/parameters/OAR021/excluded.json new file mode 100644 index 00000000..7b77042f --- /dev/null +++ b/src/test/resources/checks/v32/parameters/OAR021/excluded.json @@ -0,0 +1,37 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/status" : { + "get" : { + "parameters" : [ { + "in" : "query", + "name" : "other", + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + }, { + "in" : "query", + "name" : "select", + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + } ], + "responses" : { + "206" : { + "description" : "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/parameters/OAR021/excluded.yaml b/src/test/resources/checks/v32/parameters/OAR021/excluded.yaml new file mode 100644 index 00000000..5bb25ac8 --- /dev/null +++ b/src/test/resources/checks/v32/parameters/OAR021/excluded.yaml @@ -0,0 +1,23 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /status: + get: + parameters: + - in: query + name: other + schema: + type: array + items: + type: string + - in: query + name: select + schema: + type: array + items: + type: string + responses: + 206: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v32/parameters/OAR021/plain-without.json b/src/test/resources/checks/v32/parameters/OAR021/plain-without.json new file mode 100644 index 00000000..78c3e87b --- /dev/null +++ b/src/test/resources/checks/v32/parameters/OAR021/plain-without.json @@ -0,0 +1,37 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/examples" : { + "get" : { # Noncompliant {{OAR021: $exclude must be defined as a parameter in this operation}} + "parameters" : [ { + "in" : "query", + "name" : "other", + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + }, { + "in" : "query", + "name" : "select", + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + } ], + "responses" : { + "206" : { + "description" : "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/parameters/OAR021/plain-without.yaml b/src/test/resources/checks/v32/parameters/OAR021/plain-without.yaml new file mode 100644 index 00000000..72854964 --- /dev/null +++ b/src/test/resources/checks/v32/parameters/OAR021/plain-without.yaml @@ -0,0 +1,23 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /examples: + get: # Noncompliant {{OAR021: $exclude must be defined as a parameter in this operation}} + parameters: + - in: query + name: other + schema: + type: array + items: + type: string + - in: query + name: select + schema: + type: array + items: + type: string + responses: + 206: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v32/parameters/OAR021/plain.json b/src/test/resources/checks/v32/parameters/OAR021/plain.json new file mode 100644 index 00000000..f07e2f8a --- /dev/null +++ b/src/test/resources/checks/v32/parameters/OAR021/plain.json @@ -0,0 +1,37 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/examples" : { + "get" : { + "parameters" : [ { + "in" : "query", + "name" : "$exclude", + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + }, { + "in" : "query", + "name" : "$exclude", + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + } ], + "responses" : { + "206" : { + "description" : "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/parameters/OAR021/plain.yaml b/src/test/resources/checks/v32/parameters/OAR021/plain.yaml new file mode 100644 index 00000000..f5d21041 --- /dev/null +++ b/src/test/resources/checks/v32/parameters/OAR021/plain.yaml @@ -0,0 +1,23 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /examples: + get: + parameters: + - in: query + name: $exclude + schema: + type: array + items: + type: string + - in: query + name: $exclude + schema: + type: array + items: + type: string + responses: + 206: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v32/parameters/OAR021/with-$ref-without.json b/src/test/resources/checks/v32/parameters/OAR021/with-$ref-without.json new file mode 100644 index 00000000..a9531c2f --- /dev/null +++ b/src/test/resources/checks/v32/parameters/OAR021/with-$ref-without.json @@ -0,0 +1,47 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "components": { + "parameters" : { + "other" : { + "in" : "query", + "name" : "other", + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + }, + "exclude" : { + "in" : "query", + "name" : "exclude", + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + } + } + }, + "paths" : { + "/pets" : { + "get" : { + "parameters" : [ { # Noncompliant {{OAR021: $exclude must be defined as a parameter in this operation}} + "$ref" : "#/components/parameters/other" + }, { + "$ref" : "#/components/parameters/exclude" + } ], + "responses" : { + "206" : { + "description" : "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/parameters/OAR021/with-$ref-without.yaml b/src/test/resources/checks/v32/parameters/OAR021/with-$ref-without.yaml new file mode 100644 index 00000000..c31ca64e --- /dev/null +++ b/src/test/resources/checks/v32/parameters/OAR021/with-$ref-without.yaml @@ -0,0 +1,29 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +components: + parameters: + other: + in: query + name: other + schema: + type: array + items: + type: string + exclude: + in: query + name: exclude + schema: + type: array + items: + type: string +paths: + /pets: + get: + parameters: # Noncompliant {{OAR021: $exclude must be defined as a parameter in this operation}} + - $ref: '#/components/parameters/other' + - $ref: '#/components/parameters/exclude' + responses: + 206: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v32/parameters/OAR021/with-$ref.json b/src/test/resources/checks/v32/parameters/OAR021/with-$ref.json new file mode 100644 index 00000000..60b07834 --- /dev/null +++ b/src/test/resources/checks/v32/parameters/OAR021/with-$ref.json @@ -0,0 +1,47 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "components": { + "parameters" : { + "other" : { + "in" : "query", + "name" : "other", + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + }, + "exclude" : { + "in" : "query", + "name" : "$exclude", + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + } + } + }, + "paths" : { + "/pets" : { + "get" : { + "parameters" : [ { + "$ref" : "#/components/parameters/other" + }, { + "$ref" : "#/components/parameters/exclude" + } ], + "responses" : { + "206" : { + "description" : "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/parameters/OAR021/with-$ref.yaml b/src/test/resources/checks/v32/parameters/OAR021/with-$ref.yaml new file mode 100644 index 00000000..967c1d7d --- /dev/null +++ b/src/test/resources/checks/v32/parameters/OAR021/with-$ref.yaml @@ -0,0 +1,29 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +components: + parameters: + other: + in: query + name: other + schema: + type: array + items: + type: string + exclude: + in: query + name: $exclude + schema: + type: array + items: + type: string +paths: + /pets: + get: + parameters: + - $ref: '#/components/parameters/other' + - $ref: '#/components/parameters/exclude' + responses: + 206: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v32/parameters/OAR021/with-param.json b/src/test/resources/checks/v32/parameters/OAR021/with-param.json new file mode 100644 index 00000000..1097b436 --- /dev/null +++ b/src/test/resources/checks/v32/parameters/OAR021/with-param.json @@ -0,0 +1,27 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "Swagger Petstore", + "version": "1.0.0" + }, + "paths": { + "/examples/{id}": { + "get": { + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/examples/{id}/items/{id}": { + "get": { + "responses": { + "200": { + "description": "OK" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/parameters/OAR021/with-param.yaml b/src/test/resources/checks/v32/parameters/OAR021/with-param.yaml new file mode 100644 index 00000000..8b012753 --- /dev/null +++ b/src/test/resources/checks/v32/parameters/OAR021/with-param.yaml @@ -0,0 +1,15 @@ +openapi: 3.0.0 +info: + title: Swagger Petstore + version: 1.0.0 +paths: + /examples/{id}: + get: + responses: + '200': + description: OK + /examples/{id}/items/{id}: + get: + responses: + '200': + description: OK \ No newline at end of file diff --git a/src/test/resources/checks/v32/parameters/OAR021/with-ref.json b/src/test/resources/checks/v32/parameters/OAR021/with-ref.json new file mode 100644 index 00000000..f3a1eb3d --- /dev/null +++ b/src/test/resources/checks/v32/parameters/OAR021/with-ref.json @@ -0,0 +1,37 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "components": { + "parameters": { + "selectParameter": { + "in": "query", + "name": "$exclude", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + }, + "paths": { + "/examples": { + "get": { + "parameters": [ + { + "$ref": "#/components/parameters/selectParameter" + } + ], + "responses": { + "206": { + "description": "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/parameters/OAR021/with-ref.yaml b/src/test/resources/checks/v32/parameters/OAR021/with-ref.yaml new file mode 100644 index 00000000..382897e5 --- /dev/null +++ b/src/test/resources/checks/v32/parameters/OAR021/with-ref.yaml @@ -0,0 +1,23 @@ +openapi: 3.0.0 +info: + version: 1.0.0 + title: Swagger Petstore + +components: + parameters: + selectParameter: + in: query + name: $exclude + schema: + type: array + items: + type: string + +paths: + /examples: + get: + parameters: + - $ref: '#/components/parameters/selectParameter' + responses: + 206: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v32/parameters/OAR021/without-parameters.json b/src/test/resources/checks/v32/parameters/OAR021/without-parameters.json new file mode 100644 index 00000000..fb4f3709 --- /dev/null +++ b/src/test/resources/checks/v32/parameters/OAR021/without-parameters.json @@ -0,0 +1,18 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/pets" : { + "get" : { # Noncompliant {{OAR021: $exclude must be defined as a parameter in this operation}} + "responses" : { + "206" : { + "description" : "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/parameters/OAR021/without-parameters.yaml b/src/test/resources/checks/v32/parameters/OAR021/without-parameters.yaml new file mode 100644 index 00000000..f9ca221f --- /dev/null +++ b/src/test/resources/checks/v32/parameters/OAR021/without-parameters.yaml @@ -0,0 +1,10 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: + get: # Noncompliant {{OAR021: $exclude must be defined as a parameter in this operation}} + responses: + 206: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v32/parameters/OAR022/excluded.json b/src/test/resources/checks/v32/parameters/OAR022/excluded.json new file mode 100644 index 00000000..7b77042f --- /dev/null +++ b/src/test/resources/checks/v32/parameters/OAR022/excluded.json @@ -0,0 +1,37 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/status" : { + "get" : { + "parameters" : [ { + "in" : "query", + "name" : "other", + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + }, { + "in" : "query", + "name" : "select", + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + } ], + "responses" : { + "206" : { + "description" : "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/parameters/OAR022/excluded.yaml b/src/test/resources/checks/v32/parameters/OAR022/excluded.yaml new file mode 100644 index 00000000..5bb25ac8 --- /dev/null +++ b/src/test/resources/checks/v32/parameters/OAR022/excluded.yaml @@ -0,0 +1,23 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /status: + get: + parameters: + - in: query + name: other + schema: + type: array + items: + type: string + - in: query + name: select + schema: + type: array + items: + type: string + responses: + 206: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v32/parameters/OAR022/plain-without.json b/src/test/resources/checks/v32/parameters/OAR022/plain-without.json new file mode 100644 index 00000000..e263f6bb --- /dev/null +++ b/src/test/resources/checks/v32/parameters/OAR022/plain-without.json @@ -0,0 +1,37 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/examples" : { + "get" : { # Noncompliant {{OAR022: $orderby must be defined as a parameter in this operation}} + "parameters" : [ { + "in" : "query", + "name" : "other", + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + }, { + "in" : "query", + "name" : "select", + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + } ], + "responses" : { + "206" : { + "description" : "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/parameters/OAR022/plain-without.yaml b/src/test/resources/checks/v32/parameters/OAR022/plain-without.yaml new file mode 100644 index 00000000..a284f1f4 --- /dev/null +++ b/src/test/resources/checks/v32/parameters/OAR022/plain-without.yaml @@ -0,0 +1,23 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /examples: + get: # Noncompliant {{OAR022: $orderby must be defined as a parameter in this operation}} + parameters: + - in: query + name: other + schema: + type: array + items: + type: string + - in: query + name: select + schema: + type: array + items: + type: string + responses: + 206: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v32/parameters/OAR022/plain.json b/src/test/resources/checks/v32/parameters/OAR022/plain.json new file mode 100644 index 00000000..dcf5ec3b --- /dev/null +++ b/src/test/resources/checks/v32/parameters/OAR022/plain.json @@ -0,0 +1,37 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/examples" : { + "get" : { + "parameters" : [ { + "in" : "query", + "name" : "$orderby", + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + }, { + "in" : "query", + "name" : "$orderby", + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + } ], + "responses" : { + "206" : { + "description" : "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/parameters/OAR022/plain.yaml b/src/test/resources/checks/v32/parameters/OAR022/plain.yaml new file mode 100644 index 00000000..173955f8 --- /dev/null +++ b/src/test/resources/checks/v32/parameters/OAR022/plain.yaml @@ -0,0 +1,23 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /examples: + get: + parameters: + - in: query + name: $orderby + schema: + type: array + items: + type: string + - in: query + name: $orderby + schema: + type: array + items: + type: string + responses: + 206: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v32/parameters/OAR022/with-$ref-without.json b/src/test/resources/checks/v32/parameters/OAR022/with-$ref-without.json new file mode 100644 index 00000000..64cfcc5e --- /dev/null +++ b/src/test/resources/checks/v32/parameters/OAR022/with-$ref-without.json @@ -0,0 +1,47 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "components": { + "parameters" : { + "other" : { + "in" : "query", + "name" : "other", + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + }, + "orderby" : { + "in" : "query", + "name" : "orderby", + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + } + } + }, + "paths" : { + "/pets" : { + "get" : { + "parameters" : [ { # Noncompliant {{OAR022: $orderby must be defined as a parameter in this operation}} + "$ref" : "#/components/parameters/other" + }, { + "$ref" : "#/components/parameters/orderby" + } ], + "responses" : { + "206" : { + "description" : "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/parameters/OAR022/with-$ref-without.yaml b/src/test/resources/checks/v32/parameters/OAR022/with-$ref-without.yaml new file mode 100644 index 00000000..7c120401 --- /dev/null +++ b/src/test/resources/checks/v32/parameters/OAR022/with-$ref-without.yaml @@ -0,0 +1,29 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +components: + parameters: + other: + in: query + name: other + schema: + type: array + items: + type: string + orderby: + in: query + name: orderby + schema: + type: array + items: + type: string +paths: + /pets: + get: + parameters: # Noncompliant {{OAR022: $orderby must be defined as a parameter in this operation}} + - $ref: '#/components/parameters/other' + - $ref: '#/components/parameters/orderby' + responses: + 206: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v32/parameters/OAR022/with-$ref.json b/src/test/resources/checks/v32/parameters/OAR022/with-$ref.json new file mode 100644 index 00000000..de939029 --- /dev/null +++ b/src/test/resources/checks/v32/parameters/OAR022/with-$ref.json @@ -0,0 +1,47 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "components": { + "parameters" : { + "other" : { + "in" : "query", + "name" : "other", + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + }, + "orderby" : { + "in" : "query", + "name" : "$orderby", + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + } + } + }, + "paths" : { + "/pets" : { + "get" : { + "parameters" : [ { + "$ref" : "#/components/parameters/other" + }, { + "$ref" : "#/components/parameters/orderby" + } ], + "responses" : { + "206" : { + "description" : "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/parameters/OAR022/with-$ref.yaml b/src/test/resources/checks/v32/parameters/OAR022/with-$ref.yaml new file mode 100644 index 00000000..f4c69d5b --- /dev/null +++ b/src/test/resources/checks/v32/parameters/OAR022/with-$ref.yaml @@ -0,0 +1,29 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +components: + parameters: + other: + in: query + name: other + schema: + type: array + items: + type: string + orderby: + in: query + name: $orderby + schema: + type: array + items: + type: string +paths: + /pets: + get: + parameters: + - $ref: '#/components/parameters/other' + - $ref: '#/components/parameters/orderby' + responses: + 206: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v32/parameters/OAR022/without-parameters.json b/src/test/resources/checks/v32/parameters/OAR022/without-parameters.json new file mode 100644 index 00000000..be5c3701 --- /dev/null +++ b/src/test/resources/checks/v32/parameters/OAR022/without-parameters.json @@ -0,0 +1,18 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/pets" : { + "get" : { # Noncompliant {{OAR022: $orderby must be defined as a parameter in this operation}} + "responses" : { + "206" : { + "description" : "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/parameters/OAR022/without-parameters.yaml b/src/test/resources/checks/v32/parameters/OAR022/without-parameters.yaml new file mode 100644 index 00000000..3e65a579 --- /dev/null +++ b/src/test/resources/checks/v32/parameters/OAR022/without-parameters.yaml @@ -0,0 +1,10 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: + get: # Noncompliant {{OAR022: $orderby must be defined as a parameter in this operation}} + responses: + 206: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v32/parameters/OAR023/excluded.json b/src/test/resources/checks/v32/parameters/OAR023/excluded.json new file mode 100644 index 00000000..7b77042f --- /dev/null +++ b/src/test/resources/checks/v32/parameters/OAR023/excluded.json @@ -0,0 +1,37 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/status" : { + "get" : { + "parameters" : [ { + "in" : "query", + "name" : "other", + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + }, { + "in" : "query", + "name" : "select", + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + } ], + "responses" : { + "206" : { + "description" : "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/parameters/OAR023/excluded.yaml b/src/test/resources/checks/v32/parameters/OAR023/excluded.yaml new file mode 100644 index 00000000..5bb25ac8 --- /dev/null +++ b/src/test/resources/checks/v32/parameters/OAR023/excluded.yaml @@ -0,0 +1,23 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /status: + get: + parameters: + - in: query + name: other + schema: + type: array + items: + type: string + - in: query + name: select + schema: + type: array + items: + type: string + responses: + 206: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v32/parameters/OAR023/plain-without.json b/src/test/resources/checks/v32/parameters/OAR023/plain-without.json new file mode 100644 index 00000000..871eddb2 --- /dev/null +++ b/src/test/resources/checks/v32/parameters/OAR023/plain-without.json @@ -0,0 +1,37 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/examples" : { + "get" : { # Noncompliant {{OAR023: $total must be defined as a parameter in this operation}} + "parameters" : [ { + "in" : "query", + "name" : "other", + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + }, { + "in" : "query", + "name" : "select", + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + } ], + "responses" : { + "206" : { + "description" : "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/parameters/OAR023/plain-without.yaml b/src/test/resources/checks/v32/parameters/OAR023/plain-without.yaml new file mode 100644 index 00000000..6f8d8d99 --- /dev/null +++ b/src/test/resources/checks/v32/parameters/OAR023/plain-without.yaml @@ -0,0 +1,23 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /examples: + get: # Noncompliant {{OAR023: $total must be defined as a parameter in this operation}} + parameters: + - in: query + name: other + schema: + type: array + items: + type: string + - in: query + name: select + schema: + type: array + items: + type: string + responses: + 206: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v32/parameters/OAR023/plain.json b/src/test/resources/checks/v32/parameters/OAR023/plain.json new file mode 100644 index 00000000..93ef330b --- /dev/null +++ b/src/test/resources/checks/v32/parameters/OAR023/plain.json @@ -0,0 +1,37 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/examples" : { + "get" : { + "parameters" : [ { + "in" : "query", + "name" : "$total", + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + }, { + "in" : "query", + "name" : "$total", + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + } ], + "responses" : { + "206" : { + "description" : "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/parameters/OAR023/plain.yaml b/src/test/resources/checks/v32/parameters/OAR023/plain.yaml new file mode 100644 index 00000000..e3b89931 --- /dev/null +++ b/src/test/resources/checks/v32/parameters/OAR023/plain.yaml @@ -0,0 +1,23 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /examples: + get: + parameters: + - in: query + name: $total + schema: + type: array + items: + type: string + - in: query + name: $total + schema: + type: array + items: + type: string + responses: + 206: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v32/parameters/OAR023/with-$ref-without.json b/src/test/resources/checks/v32/parameters/OAR023/with-$ref-without.json new file mode 100644 index 00000000..16176996 --- /dev/null +++ b/src/test/resources/checks/v32/parameters/OAR023/with-$ref-without.json @@ -0,0 +1,44 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "components": { + "parameters" : { + "other" : { + "in" : "query", + "name" : "other", + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + }, + "total" : { + "in" : "query", + "name" : "total", + "schema": { + "type" : "boolean" + } + } + } + }, + "paths" : { + "/pets" : { + "get" : { + "parameters" : [ { # Noncompliant {{OAR023: $total must be defined as a parameter in this operation}} + "$ref" : "#/components/parameters/other" + }, { + "$ref" : "#/components/parameters/total" + } ], + "responses" : { + "206" : { + "description" : "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/parameters/OAR023/with-$ref-without.yaml b/src/test/resources/checks/v32/parameters/OAR023/with-$ref-without.yaml new file mode 100644 index 00000000..fd019cc6 --- /dev/null +++ b/src/test/resources/checks/v32/parameters/OAR023/with-$ref-without.yaml @@ -0,0 +1,27 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +components: + parameters: + other: + in: query + name: other + schema: + type: array + items: + type: string + total: + in: query + name: total + schema: + type: boolean +paths: + /pets: + get: + parameters: # Noncompliant {{OAR023: $total must be defined as a parameter in this operation}} + - $ref: '#/components/parameters/other' + - $ref: '#/components/parameters/total' + responses: + 206: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v32/parameters/OAR023/with-$ref.json b/src/test/resources/checks/v32/parameters/OAR023/with-$ref.json new file mode 100644 index 00000000..db373f26 --- /dev/null +++ b/src/test/resources/checks/v32/parameters/OAR023/with-$ref.json @@ -0,0 +1,44 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "components": { + "parameters" : { + "other" : { + "in" : "query", + "name" : "other", + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + }, + "total" : { + "in" : "query", + "name" : "$total", + "schema": { + "type" : "boolean" + } + } + } + }, + "paths" : { + "/pets" : { + "get" : { + "parameters" : [ { + "$ref" : "#/components/parameters/other" + }, { + "$ref" : "#/components/parameters/total" + } ], + "responses" : { + "206" : { + "description" : "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/parameters/OAR023/with-$ref.yaml b/src/test/resources/checks/v32/parameters/OAR023/with-$ref.yaml new file mode 100644 index 00000000..702bb880 --- /dev/null +++ b/src/test/resources/checks/v32/parameters/OAR023/with-$ref.yaml @@ -0,0 +1,27 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +components: + parameters: + other: + in: query + name: other + schema: + type: array + items: + type: string + total: + in: query + name: $total + schema: + type: boolean +paths: + /pets: + get: + parameters: + - $ref: '#/components/parameters/other' + - $ref: '#/components/parameters/total' + responses: + 206: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v32/parameters/OAR023/without-parameters.json b/src/test/resources/checks/v32/parameters/OAR023/without-parameters.json new file mode 100644 index 00000000..f2376bff --- /dev/null +++ b/src/test/resources/checks/v32/parameters/OAR023/without-parameters.json @@ -0,0 +1,18 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/pets" : { + "get" : { # Noncompliant {{OAR023: $total must be defined as a parameter in this operation}} + "responses" : { + "206" : { + "description" : "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/parameters/OAR023/without-parameters.yaml b/src/test/resources/checks/v32/parameters/OAR023/without-parameters.yaml new file mode 100644 index 00000000..76a349a0 --- /dev/null +++ b/src/test/resources/checks/v32/parameters/OAR023/without-parameters.yaml @@ -0,0 +1,10 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: + get: # Noncompliant {{OAR023: $total must be defined as a parameter in this operation}} + responses: + 206: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v32/parameters/OAR024/excluded.json b/src/test/resources/checks/v32/parameters/OAR024/excluded.json new file mode 100644 index 00000000..7b77042f --- /dev/null +++ b/src/test/resources/checks/v32/parameters/OAR024/excluded.json @@ -0,0 +1,37 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/status" : { + "get" : { + "parameters" : [ { + "in" : "query", + "name" : "other", + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + }, { + "in" : "query", + "name" : "select", + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + } ], + "responses" : { + "206" : { + "description" : "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/parameters/OAR024/excluded.yaml b/src/test/resources/checks/v32/parameters/OAR024/excluded.yaml new file mode 100644 index 00000000..5bb25ac8 --- /dev/null +++ b/src/test/resources/checks/v32/parameters/OAR024/excluded.yaml @@ -0,0 +1,23 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /status: + get: + parameters: + - in: query + name: other + schema: + type: array + items: + type: string + - in: query + name: select + schema: + type: array + items: + type: string + responses: + 206: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v32/parameters/OAR024/plain-without.json b/src/test/resources/checks/v32/parameters/OAR024/plain-without.json new file mode 100644 index 00000000..d3533f31 --- /dev/null +++ b/src/test/resources/checks/v32/parameters/OAR024/plain-without.json @@ -0,0 +1,37 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/examples" : { + "get" : { # Noncompliant {{OAR024: $start must be defined as a parameter in this operation}} + "parameters" : [ { + "in" : "query", + "name" : "other", + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + }, { + "in" : "query", + "name" : "select", + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + } ], + "responses" : { + "206" : { + "description" : "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/parameters/OAR024/plain-without.yaml b/src/test/resources/checks/v32/parameters/OAR024/plain-without.yaml new file mode 100644 index 00000000..4e44fb6e --- /dev/null +++ b/src/test/resources/checks/v32/parameters/OAR024/plain-without.yaml @@ -0,0 +1,23 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /examples: + get: # Noncompliant {{OAR024: $start must be defined as a parameter in this operation}} + parameters: + - in: query + name: other + schema: + type: array + items: + type: string + - in: query + name: select + schema: + type: array + items: + type: string + responses: + 206: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v32/parameters/OAR024/plain.json b/src/test/resources/checks/v32/parameters/OAR024/plain.json new file mode 100644 index 00000000..0e100ef0 --- /dev/null +++ b/src/test/resources/checks/v32/parameters/OAR024/plain.json @@ -0,0 +1,37 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/examples" : { + "get" : { + "parameters" : [ { + "in" : "query", + "name" : "$start", + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + }, { + "in" : "query", + "name" : "$start", + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + } ], + "responses" : { + "206" : { + "description" : "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/parameters/OAR024/plain.yaml b/src/test/resources/checks/v32/parameters/OAR024/plain.yaml new file mode 100644 index 00000000..59d15dba --- /dev/null +++ b/src/test/resources/checks/v32/parameters/OAR024/plain.yaml @@ -0,0 +1,23 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /examples: + get: + parameters: + - in: query + name: $start + schema: + type: array + items: + type: string + - in: query + name: $start + schema: + type: array + items: + type: string + responses: + 206: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v32/parameters/OAR024/with-$ref-without.json b/src/test/resources/checks/v32/parameters/OAR024/with-$ref-without.json new file mode 100644 index 00000000..da1de6a6 --- /dev/null +++ b/src/test/resources/checks/v32/parameters/OAR024/with-$ref-without.json @@ -0,0 +1,45 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "components": { + "parameters" : { + "other" : { + "in" : "query", + "name" : "other", + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + }, + "init" : { + "in" : "query", + "name" : "init", + "schema": { + "type" : "integer", + "format" : "int64" + } + } + } + }, + "paths" : { + "/pets" : { + "get" : { + "parameters" : [ { # Noncompliant {{OAR024: $start must be defined as a parameter in this operation}} + "$ref" : "#/components/parameters/other" + }, { + "$ref" : "#/components/parameters/init" + } ], + "responses" : { + "206" : { + "description" : "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/parameters/OAR024/with-$ref-without.yaml b/src/test/resources/checks/v32/parameters/OAR024/with-$ref-without.yaml new file mode 100644 index 00000000..09efcc5a --- /dev/null +++ b/src/test/resources/checks/v32/parameters/OAR024/with-$ref-without.yaml @@ -0,0 +1,28 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +components: + parameters: + other: + in: query + name: other + schema: + type: array + items: + type: string + init: + in: query + name: init + schema: + type: integer + format: int64 +paths: + /pets: + get: + parameters: # Noncompliant {{OAR024: $start must be defined as a parameter in this operation}} + - $ref: '#/components/parameters/other' + - $ref: '#/components/parameters/init' + responses: + 206: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v32/parameters/OAR024/with-$ref.json b/src/test/resources/checks/v32/parameters/OAR024/with-$ref.json new file mode 100644 index 00000000..4e4888fd --- /dev/null +++ b/src/test/resources/checks/v32/parameters/OAR024/with-$ref.json @@ -0,0 +1,45 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "components": { + "parameters" : { + "other" : { + "in" : "query", + "name" : "other", + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + }, + "init" : { + "in" : "query", + "name" : "$start", + "schema": { + "type" : "integer", + "format" : "int64" + } + } + } + }, + "paths" : { + "/pets" : { + "get" : { + "parameters" : [ { + "$ref" : "#/components/parameters/other" + }, { + "$ref" : "#/components/parameters/init" + } ], + "responses" : { + "206" : { + "description" : "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/parameters/OAR024/with-$ref.yaml b/src/test/resources/checks/v32/parameters/OAR024/with-$ref.yaml new file mode 100644 index 00000000..32148ae7 --- /dev/null +++ b/src/test/resources/checks/v32/parameters/OAR024/with-$ref.yaml @@ -0,0 +1,28 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +components: + parameters: + other: + in: query + name: other + schema: + type: array + items: + type: string + init: + in: query + name: $start + schema: + type: integer + format: int64 +paths: + /pets: + get: + parameters: + - $ref: '#/components/parameters/other' + - $ref: '#/components/parameters/init' + responses: + 206: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v32/parameters/OAR024/without-parameters.json b/src/test/resources/checks/v32/parameters/OAR024/without-parameters.json new file mode 100644 index 00000000..1d44370b --- /dev/null +++ b/src/test/resources/checks/v32/parameters/OAR024/without-parameters.json @@ -0,0 +1,18 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/pets" : { + "get" : { # Noncompliant {{OAR024: $start must be defined as a parameter in this operation}} + "responses" : { + "206" : { + "description" : "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/parameters/OAR024/without-parameters.yaml b/src/test/resources/checks/v32/parameters/OAR024/without-parameters.yaml new file mode 100644 index 00000000..eb66f92f --- /dev/null +++ b/src/test/resources/checks/v32/parameters/OAR024/without-parameters.yaml @@ -0,0 +1,10 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: + get: # Noncompliant {{OAR024: $start must be defined as a parameter in this operation}} + responses: + 206: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v32/parameters/OAR025/excluded.json b/src/test/resources/checks/v32/parameters/OAR025/excluded.json new file mode 100644 index 00000000..7b77042f --- /dev/null +++ b/src/test/resources/checks/v32/parameters/OAR025/excluded.json @@ -0,0 +1,37 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/status" : { + "get" : { + "parameters" : [ { + "in" : "query", + "name" : "other", + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + }, { + "in" : "query", + "name" : "select", + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + } ], + "responses" : { + "206" : { + "description" : "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/parameters/OAR025/excluded.yaml b/src/test/resources/checks/v32/parameters/OAR025/excluded.yaml new file mode 100644 index 00000000..5bb25ac8 --- /dev/null +++ b/src/test/resources/checks/v32/parameters/OAR025/excluded.yaml @@ -0,0 +1,23 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /status: + get: + parameters: + - in: query + name: other + schema: + type: array + items: + type: string + - in: query + name: select + schema: + type: array + items: + type: string + responses: + 206: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v32/parameters/OAR025/plain-without.json b/src/test/resources/checks/v32/parameters/OAR025/plain-without.json new file mode 100644 index 00000000..e255f777 --- /dev/null +++ b/src/test/resources/checks/v32/parameters/OAR025/plain-without.json @@ -0,0 +1,37 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/examples" : { + "get" : { # Noncompliant {{OAR025: $limit must be defined as a parameter in this operation}} + "parameters" : [ { + "in" : "query", + "name" : "other", + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + }, { + "in" : "query", + "name" : "select", + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + } ], + "responses" : { + "206" : { + "description" : "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/parameters/OAR025/plain-without.yaml b/src/test/resources/checks/v32/parameters/OAR025/plain-without.yaml new file mode 100644 index 00000000..aba5d2c0 --- /dev/null +++ b/src/test/resources/checks/v32/parameters/OAR025/plain-without.yaml @@ -0,0 +1,23 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /examples: + get: # Noncompliant {{OAR025: $limit must be defined as a parameter in this operation}} + parameters: + - in: query + name: other + schema: + type: array + items: + type: string + - in: query + name: select + schema: + type: array + items: + type: string + responses: + 206: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v32/parameters/OAR025/plain.json b/src/test/resources/checks/v32/parameters/OAR025/plain.json new file mode 100644 index 00000000..b853da7f --- /dev/null +++ b/src/test/resources/checks/v32/parameters/OAR025/plain.json @@ -0,0 +1,37 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/examples" : { + "get" : { + "parameters" : [ { + "in" : "query", + "name" : "$limit", + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + }, { + "in" : "query", + "name" : "$limit", + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + } ], + "responses" : { + "206" : { + "description" : "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/parameters/OAR025/plain.yaml b/src/test/resources/checks/v32/parameters/OAR025/plain.yaml new file mode 100644 index 00000000..7eebb8fa --- /dev/null +++ b/src/test/resources/checks/v32/parameters/OAR025/plain.yaml @@ -0,0 +1,23 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /examples: + get: + parameters: + - in: query + name: $limit + schema: + type: array + items: + type: string + - in: query + name: $limit + schema: + type: array + items: + type: string + responses: + 206: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v32/parameters/OAR025/with-$ref-without.json b/src/test/resources/checks/v32/parameters/OAR025/with-$ref-without.json new file mode 100644 index 00000000..864d968a --- /dev/null +++ b/src/test/resources/checks/v32/parameters/OAR025/with-$ref-without.json @@ -0,0 +1,45 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "components": { + "parameters" : { + "other" : { + "in" : "query", + "name" : "other", + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + }, + "limit" : { + "in" : "query", + "name" : "limit", + "schema": { + "type" : "integer", + "format" : "int64" + } + } + } + }, + "paths" : { + "/pets" : { + "get" : { + "parameters" : [ { # Noncompliant {{OAR025: $limit must be defined as a parameter in this operation}} + "$ref" : "#/components/parameters/other" + }, { + "$ref" : "#/components/parameters/limit" + } ], + "responses" : { + "206" : { + "description" : "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/parameters/OAR025/with-$ref-without.yaml b/src/test/resources/checks/v32/parameters/OAR025/with-$ref-without.yaml new file mode 100644 index 00000000..36ceb535 --- /dev/null +++ b/src/test/resources/checks/v32/parameters/OAR025/with-$ref-without.yaml @@ -0,0 +1,28 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +components: + parameters: + other: + in: query + name: other + schema: + type: array + items: + type: string + limit: + in: query + name: limit + schema: + type: integer + format: int64 +paths: + /pets: + get: + parameters: # Noncompliant {{OAR025: $limit must be defined as a parameter in this operation}} + - $ref: '#/components/parameters/other' + - $ref: '#/components/parameters/limit' + responses: + 206: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v32/parameters/OAR025/with-$ref.json b/src/test/resources/checks/v32/parameters/OAR025/with-$ref.json new file mode 100644 index 00000000..8ebf79a9 --- /dev/null +++ b/src/test/resources/checks/v32/parameters/OAR025/with-$ref.json @@ -0,0 +1,46 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "components": { + "parameters" : { + "other" : { + "in" : "query", + "name" : "other", + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + }, + "limit" : { + "in" : "query", + "name" : "$limit", + "schema": { + "type" : "integer", + "format" : "int64" + } + } + } + }, + + "paths" : { + "/pets" : { + "get" : { + "parameters" : [ { + "$ref" : "#/components/parameters/other" + }, { + "$ref" : "#/components/parameters/limit" + } ], + "responses" : { + "206" : { + "description" : "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/parameters/OAR025/with-$ref.yaml b/src/test/resources/checks/v32/parameters/OAR025/with-$ref.yaml new file mode 100644 index 00000000..ae38c08d --- /dev/null +++ b/src/test/resources/checks/v32/parameters/OAR025/with-$ref.yaml @@ -0,0 +1,28 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +components: + parameters: + other: + in: query + name: other + schema: + type: array + items: + type: string + limit: + in: query + name: $limit + schema: + type: integer + format: int64 +paths: + /pets: + get: + parameters: + - $ref: '#/components/parameters/other' + - $ref: '#/components/parameters/limit' + responses: + 206: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v32/parameters/OAR025/without-parameters.json b/src/test/resources/checks/v32/parameters/OAR025/without-parameters.json new file mode 100644 index 00000000..2c99e1ea --- /dev/null +++ b/src/test/resources/checks/v32/parameters/OAR025/without-parameters.json @@ -0,0 +1,18 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/pets" : { + "get" : { # Noncompliant {{OAR025: $limit must be defined as a parameter in this operation}} + "responses" : { + "206" : { + "description" : "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/parameters/OAR025/without-parameters.yaml b/src/test/resources/checks/v32/parameters/OAR025/without-parameters.yaml new file mode 100644 index 00000000..729668f0 --- /dev/null +++ b/src/test/resources/checks/v32/parameters/OAR025/without-parameters.yaml @@ -0,0 +1,10 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: + get: # Noncompliant {{OAR025: $limit must be defined as a parameter in this operation}} + responses: + 206: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v32/parameters/OAR026/plain-with-$total-with-defval-false.json b/src/test/resources/checks/v32/parameters/OAR026/plain-with-$total-with-defval-false.json new file mode 100644 index 00000000..1b477763 --- /dev/null +++ b/src/test/resources/checks/v32/parameters/OAR026/plain-with-$total-with-defval-false.json @@ -0,0 +1,35 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/pets" : { + "get" : { + "parameters" : [ { + "in" : "query", + "name" : "other", + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + }, { + "in" : "query", + "name" : "$total", + "schema": { + "type" : "boolean", + "default" : false + } + } ], + "responses" : { + "206" : { + "description" : "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/parameters/OAR026/plain-with-$total-with-defval-false.yaml b/src/test/resources/checks/v32/parameters/OAR026/plain-with-$total-with-defval-false.yaml new file mode 100644 index 00000000..c33165c9 --- /dev/null +++ b/src/test/resources/checks/v32/parameters/OAR026/plain-with-$total-with-defval-false.yaml @@ -0,0 +1,22 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: + get: + parameters: + - in: query + name: other + schema: + type: array + items: + type: string + - in: query + name: $total + schema: + type: boolean + default: false + responses: + 206: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v32/parameters/OAR026/plain-with-$total-with-defval-true.json b/src/test/resources/checks/v32/parameters/OAR026/plain-with-$total-with-defval-true.json new file mode 100644 index 00000000..0295039e --- /dev/null +++ b/src/test/resources/checks/v32/parameters/OAR026/plain-with-$total-with-defval-true.json @@ -0,0 +1,35 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/pets" : { + "get" : { + "parameters" : [ { + "in" : "query", + "name" : "other", + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + }, { + "in" : "query", + "name" : "$total", + "schema": { + "type" : "boolean", + "default" : true # Noncompliant {{OAR026: The $total parameter default value should be false}} + } + } ], + "responses" : { + "206" : { + "description" : "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/parameters/OAR026/plain-with-$total-with-defval-true.yaml b/src/test/resources/checks/v32/parameters/OAR026/plain-with-$total-with-defval-true.yaml new file mode 100644 index 00000000..3324a5a2 --- /dev/null +++ b/src/test/resources/checks/v32/parameters/OAR026/plain-with-$total-with-defval-true.yaml @@ -0,0 +1,22 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: + get: + parameters: + - in: query + name: other + schema: + type: array + items: + type: string + - in: query + name: $total + schema: + type: boolean + default: true # Noncompliant {{OAR026: The $total parameter default value should be false}} + responses: + 206: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v32/parameters/OAR026/plain-with-$total-without-defval.json b/src/test/resources/checks/v32/parameters/OAR026/plain-with-$total-without-defval.json new file mode 100644 index 00000000..d756597f --- /dev/null +++ b/src/test/resources/checks/v32/parameters/OAR026/plain-with-$total-without-defval.json @@ -0,0 +1,34 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/pets" : { + "get" : { + "parameters" : [ { + "in" : "query", + "name" : "other", + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + }, { # Noncompliant {{OAR026: The $total parameter default value should be false}} + "in" : "query", + "name" : "$total", + "schema": { + "type" : "boolean" + } + } ], + "responses" : { + "206" : { + "description" : "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/parameters/OAR026/plain-with-$total-without-defval.yaml b/src/test/resources/checks/v32/parameters/OAR026/plain-with-$total-without-defval.yaml new file mode 100644 index 00000000..c2580dc0 --- /dev/null +++ b/src/test/resources/checks/v32/parameters/OAR026/plain-with-$total-without-defval.yaml @@ -0,0 +1,21 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: + get: + parameters: + - in: query + name: other + schema: + type: array + items: + type: string + - in: query # Noncompliant {{OAR026: The $total parameter default value should be false}} + name: $total + schema: + type: boolean + responses: + 206: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v32/parameters/OAR026/plain-without-$total.json b/src/test/resources/checks/v32/parameters/OAR026/plain-without-$total.json new file mode 100644 index 00000000..03c10cc8 --- /dev/null +++ b/src/test/resources/checks/v32/parameters/OAR026/plain-without-$total.json @@ -0,0 +1,34 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/pets" : { + "get" : { + "parameters" : [ { + "in" : "query", + "name" : "other", + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + }, { + "in" : "query", + "name" : "total", + "schema": { + "type" : "boolean" + } + } ], + "responses" : { + "206" : { + "description" : "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/parameters/OAR026/plain-without-$total.yaml b/src/test/resources/checks/v32/parameters/OAR026/plain-without-$total.yaml new file mode 100644 index 00000000..bf36bc7d --- /dev/null +++ b/src/test/resources/checks/v32/parameters/OAR026/plain-without-$total.yaml @@ -0,0 +1,21 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: + get: + parameters: + - in: query + name: other + schema: + type: array + items: + type: string + - in: query + name: total + schema: + type: boolean + responses: + 206: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v32/parameters/OAR026/with-$ref-with-$total-with-defval-false.json b/src/test/resources/checks/v32/parameters/OAR026/with-$ref-with-$total-with-defval-false.json new file mode 100644 index 00000000..ac0d6d53 --- /dev/null +++ b/src/test/resources/checks/v32/parameters/OAR026/with-$ref-with-$total-with-defval-false.json @@ -0,0 +1,45 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "components": { + "parameters" : { + "other" : { + "in" : "query", + "name" : "other", + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + }, + "total" : { + "in" : "query", + "name" : "$total", + "schema": { + "type" : "boolean", + "default" : false + } + } + } + }, + "paths" : { + "/pets" : { + "get" : { + "parameters" : [ { + "$ref" : "#/components/parameters/other" + }, { + "$ref" : "#/components/parameters/total" + } ], + "responses" : { + "206" : { + "description" : "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/parameters/OAR026/with-$ref-with-$total-with-defval-false.yaml b/src/test/resources/checks/v32/parameters/OAR026/with-$ref-with-$total-with-defval-false.yaml new file mode 100644 index 00000000..1e0b553f --- /dev/null +++ b/src/test/resources/checks/v32/parameters/OAR026/with-$ref-with-$total-with-defval-false.yaml @@ -0,0 +1,28 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +components: + parameters: + other: + in: query + name: other + schema: + type: array + items: + type: string + total: + in: query + name: $total + schema: + type: boolean + default: false +paths: + /pets: + get: + parameters: + - $ref: '#/components/parameters/other' + - $ref: '#/components/parameters/total' + responses: + 206: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v32/parameters/OAR026/with-$ref-with-$total-with-defval-true.json b/src/test/resources/checks/v32/parameters/OAR026/with-$ref-with-$total-with-defval-true.json new file mode 100644 index 00000000..45028091 --- /dev/null +++ b/src/test/resources/checks/v32/parameters/OAR026/with-$ref-with-$total-with-defval-true.json @@ -0,0 +1,45 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "components": { + "parameters" : { + "other" : { + "in" : "query", + "name" : "other", + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + }, + "total" : { + "in" : "query", + "name" : "$total", + "schema": { + "type" : "boolean", + "default" : true # Noncompliant {{OAR026: The $total parameter default value should be false}} + } + } + }, + }, + "paths" : { + "/pets" : { + "get" : { + "parameters" : [ { + "$ref" : "#/components/parameters/other" + }, { + "$ref" : "#/components/parameters/total" + } ], + "responses" : { + "206" : { + "description" : "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/parameters/OAR026/with-$ref-with-$total-with-defval-true.yaml b/src/test/resources/checks/v32/parameters/OAR026/with-$ref-with-$total-with-defval-true.yaml new file mode 100644 index 00000000..4936969a --- /dev/null +++ b/src/test/resources/checks/v32/parameters/OAR026/with-$ref-with-$total-with-defval-true.yaml @@ -0,0 +1,28 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +components: + parameters: + other: + in: query + name: other + schema: + type: array + items: + type: string + total: + in: query + name: $total + schema: + type: boolean + default: true # Noncompliant {{OAR026: The $total parameter default value should be false}} +paths: + /pets: + get: + parameters: + - $ref: '#/components/parameters/other' + - $ref: '#/components/parameters/total' + responses: + 206: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v32/parameters/OAR026/with-$ref-with-$total-without-defval.json b/src/test/resources/checks/v32/parameters/OAR026/with-$ref-with-$total-without-defval.json new file mode 100644 index 00000000..9c5ef562 --- /dev/null +++ b/src/test/resources/checks/v32/parameters/OAR026/with-$ref-with-$total-without-defval.json @@ -0,0 +1,44 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "components": { + "parameters" : { + "other" : { + "in" : "query", + "name" : "other", + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + }, + "total" : { # Noncompliant {{OAR026: The $total parameter default value should be false}} + "in" : "query", + "name" : "$total", + "schema": { + "type" : "boolean" + } + } + }, + }, + "paths" : { + "/pets" : { + "get" : { + "parameters" : [ { + "$ref" : "#/components/parameters/other" + }, { + "$ref" : "#/components/parameters/total" + } ], + "responses" : { + "206" : { + "description" : "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/parameters/OAR026/with-$ref-with-$total-without-defval.yaml b/src/test/resources/checks/v32/parameters/OAR026/with-$ref-with-$total-without-defval.yaml new file mode 100644 index 00000000..68f5a74b --- /dev/null +++ b/src/test/resources/checks/v32/parameters/OAR026/with-$ref-with-$total-without-defval.yaml @@ -0,0 +1,27 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +components: + parameters: + other: + in: query + name: other + schema: + type: array + items: + type: string + total: # Noncompliant {{OAR026: The $total parameter default value should be false}} + in: query + name: $total + schema: + type: boolean +paths: + /pets: + get: + parameters: + - $ref: '#/components/parameters/other' + - $ref: '#/components/parameters/total' + responses: + 206: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v32/parameters/OAR026/with-$ref-without-$total.json b/src/test/resources/checks/v32/parameters/OAR026/with-$ref-without-$total.json new file mode 100644 index 00000000..e32862b7 --- /dev/null +++ b/src/test/resources/checks/v32/parameters/OAR026/with-$ref-without-$total.json @@ -0,0 +1,44 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "components": { + "parameters" : { + "other" : { + "in" : "query", + "name" : "other", + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + }, + "total" : { + "in" : "query", + "name" : "total", + "schema": { + "type" : "boolean" + } + } + }, + }, + "paths" : { + "/pets" : { + "get" : { + "parameters" : [ { + "$ref" : "#/components/parameters/other" + }, { + "$ref" : "#/components/parameters/total" + } ], + "responses" : { + "206" : { + "description" : "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/parameters/OAR026/with-$ref-without-$total.yaml b/src/test/resources/checks/v32/parameters/OAR026/with-$ref-without-$total.yaml new file mode 100644 index 00000000..0b0047cb --- /dev/null +++ b/src/test/resources/checks/v32/parameters/OAR026/with-$ref-without-$total.yaml @@ -0,0 +1,27 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +components: + parameters: + other: + in: query + name: other + schema: + type: array + items: + type: string + total: + in: query + name: total + schema: + type: boolean +paths: + /pets: + get: + parameters: + - $ref: '#/components/parameters/other' + - $ref: '#/components/parameters/total' + responses: + 206: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v32/parameters/OAR026/without-parameters.json b/src/test/resources/checks/v32/parameters/OAR026/without-parameters.json new file mode 100644 index 00000000..6eb95f76 --- /dev/null +++ b/src/test/resources/checks/v32/parameters/OAR026/without-parameters.json @@ -0,0 +1,18 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/pets" : { + "get" : { + "responses" : { + "206" : { + "description" : "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/parameters/OAR026/without-parameters.yaml b/src/test/resources/checks/v32/parameters/OAR026/without-parameters.yaml new file mode 100644 index 00000000..28190798 --- /dev/null +++ b/src/test/resources/checks/v32/parameters/OAR026/without-parameters.yaml @@ -0,0 +1,10 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: + get: + responses: + 206: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v32/parameters/OAR028/components-param.json b/src/test/resources/checks/v32/parameters/OAR028/components-param.json new file mode 100644 index 00000000..38b3f30a --- /dev/null +++ b/src/test/resources/checks/v32/parameters/OAR028/components-param.json @@ -0,0 +1,29 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "components" : { + "parameters" : { + "filterParam" : { + "in" : "query", + "name" : "other", + "schema" : { + "type" : "string" + } + } + } + }, + "paths" : { + "/examples" : { + "get" : { + "responses" : { + "200" : { + "description" : "Ok" + } + } + } + } + } +} diff --git a/src/test/resources/checks/v32/parameters/OAR028/components-param.yaml b/src/test/resources/checks/v32/parameters/OAR028/components-param.yaml new file mode 100644 index 00000000..18bc4ac4 --- /dev/null +++ b/src/test/resources/checks/v32/parameters/OAR028/components-param.yaml @@ -0,0 +1,17 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +components: + parameters: + filterParam: + in: query + name: other + schema: + type: string +paths: + /examples: + get: + responses: + 200: + description: Ok diff --git a/src/test/resources/checks/v32/parameters/OAR028/exclude-noncompliant.json b/src/test/resources/checks/v32/parameters/OAR028/exclude-noncompliant.json new file mode 100644 index 00000000..ec73f987 --- /dev/null +++ b/src/test/resources/checks/v32/parameters/OAR028/exclude-noncompliant.json @@ -0,0 +1,37 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/status" : { + "get" : { + "parameters" : [ { + "in" : "query", + "name" : "other", # Noncompliant {{OAR028: $filter must be defined as a parameter in this operation}} + "schema" : { + "type" : "array", + "items" : { + "type" : "string" + } + } + }, { + "in" : "query", + "name" : "select", # Noncompliant {{OAR028: $filter must be defined as a parameter in this operation}} + "schema" : { + "type" : "array", + "items" : { + "type" : "string" + } + } + } ], + "responses" : { + "206" : { + "description" : "Ok" + } + } + } + } + } +} diff --git a/src/test/resources/checks/v32/parameters/OAR028/exclude-noncompliant.yaml b/src/test/resources/checks/v32/parameters/OAR028/exclude-noncompliant.yaml new file mode 100644 index 00000000..bc7139de --- /dev/null +++ b/src/test/resources/checks/v32/parameters/OAR028/exclude-noncompliant.yaml @@ -0,0 +1,23 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /status: + get: + parameters: + - in: query + name: other # Noncompliant {{OAR028: $filter must be defined as a parameter in this operation}} + schema: + type: array + items: + type: string + - in: query + name: select # Noncompliant {{OAR028: $filter must be defined as a parameter in this operation}} + schema: + type: array + items: + type: string + responses: + 206: + description: Ok diff --git a/src/test/resources/checks/v32/parameters/OAR028/excluded.json b/src/test/resources/checks/v32/parameters/OAR028/excluded.json new file mode 100644 index 00000000..7b77042f --- /dev/null +++ b/src/test/resources/checks/v32/parameters/OAR028/excluded.json @@ -0,0 +1,37 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/status" : { + "get" : { + "parameters" : [ { + "in" : "query", + "name" : "other", + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + }, { + "in" : "query", + "name" : "select", + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + } ], + "responses" : { + "206" : { + "description" : "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/parameters/OAR028/excluded.yaml b/src/test/resources/checks/v32/parameters/OAR028/excluded.yaml new file mode 100644 index 00000000..5bb25ac8 --- /dev/null +++ b/src/test/resources/checks/v32/parameters/OAR028/excluded.yaml @@ -0,0 +1,23 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /status: + get: + parameters: + - in: query + name: other + schema: + type: array + items: + type: string + - in: query + name: select + schema: + type: array + items: + type: string + responses: + 206: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v32/parameters/OAR028/plain-without.json b/src/test/resources/checks/v32/parameters/OAR028/plain-without.json new file mode 100644 index 00000000..56ec4af2 --- /dev/null +++ b/src/test/resources/checks/v32/parameters/OAR028/plain-without.json @@ -0,0 +1,37 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/examples" : { + "get" : { + "parameters" : [ { + "in" : "query", + "name" : "other", # Noncompliant {{OAR028: $filter must be defined as a parameter in this operation}} + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + }, { + "in" : "query", + "name" : "select", # Noncompliant {{OAR028: $filter must be defined as a parameter in this operation}} + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + } ], + "responses" : { + "206" : { + "description" : "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/parameters/OAR028/plain-without.yaml b/src/test/resources/checks/v32/parameters/OAR028/plain-without.yaml new file mode 100644 index 00000000..e756f798 --- /dev/null +++ b/src/test/resources/checks/v32/parameters/OAR028/plain-without.yaml @@ -0,0 +1,23 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /examples: + get: + parameters: + - in: query + name: other # Noncompliant {{OAR028: $filter must be defined as a parameter in this operation}} + schema: + type: array + items: + type: string + - in: query + name: select # Noncompliant {{OAR028: $filter must be defined as a parameter in this operation}} + schema: + type: array + items: + type: string + responses: + 206: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v32/parameters/OAR028/plain.json b/src/test/resources/checks/v32/parameters/OAR028/plain.json new file mode 100644 index 00000000..aadfd6a9 --- /dev/null +++ b/src/test/resources/checks/v32/parameters/OAR028/plain.json @@ -0,0 +1,37 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/examples" : { + "get" : { + "parameters" : [ { + "in" : "query", + "name" : "$filter", + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + }, { + "in" : "query", + "name" : "$filter", + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + } ], + "responses" : { + "206" : { + "description" : "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/parameters/OAR028/plain.yaml b/src/test/resources/checks/v32/parameters/OAR028/plain.yaml new file mode 100644 index 00000000..69e65b70 --- /dev/null +++ b/src/test/resources/checks/v32/parameters/OAR028/plain.yaml @@ -0,0 +1,23 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /examples: + get: + parameters: + - in: query + name: $filter + schema: + type: array + items: + type: string + - in: query + name: $filter + schema: + type: array + items: + type: string + responses: + 206: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v32/parameters/OAR028/with-$ref-without.json b/src/test/resources/checks/v32/parameters/OAR028/with-$ref-without.json new file mode 100644 index 00000000..e045953f --- /dev/null +++ b/src/test/resources/checks/v32/parameters/OAR028/with-$ref-without.json @@ -0,0 +1,47 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "components": { + "parameters" : { + "other" : { + "in" : "query", + "name" : "other", + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + }, + "orderby" : { + "in" : "query", + "name" : "orderby", + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + } + } + }, + "paths" : { + "/pets" : { + "get" : { + "parameters" : [ { # Noncompliant {{OAR028: $filter must be defined as a parameter in this operation}} + "$ref" : "#/components/parameters/other" + }, { + "$ref" : "#/components/parameters/orderby" + } ], + "responses" : { + "206" : { + "description" : "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/parameters/OAR028/with-$ref-without.yaml b/src/test/resources/checks/v32/parameters/OAR028/with-$ref-without.yaml new file mode 100644 index 00000000..74206e3d --- /dev/null +++ b/src/test/resources/checks/v32/parameters/OAR028/with-$ref-without.yaml @@ -0,0 +1,29 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +components: + parameters: + other: + in: query + name: other + schema: + type: array + items: + type: string + orderby: + in: query + name: orderby + schema: + type: array + items: + type: string +paths: + /pets: + get: + parameters: # Noncompliant {{OAR028: $filter must be defined as a parameter in this operation}} + - $ref: '#/components/parameters/other' + - $ref: '#/components/parameters/orderby' + responses: + 206: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v32/parameters/OAR028/with-$ref.json b/src/test/resources/checks/v32/parameters/OAR028/with-$ref.json new file mode 100644 index 00000000..02cd1cb9 --- /dev/null +++ b/src/test/resources/checks/v32/parameters/OAR028/with-$ref.json @@ -0,0 +1,47 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "components": { + "parameters" : { + "other" : { + "in" : "query", + "name" : "other", + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + }, + "orderby" : { + "in" : "query", + "name" : "$filter", + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + } + } + }, + "paths" : { + "/pets" : { + "get" : { + "parameters" : [ { + "$ref" : "#/components/parameters/other" + }, { + "$ref" : "#/components/parameters/orderby" + } ], + "responses" : { + "206" : { + "description" : "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/parameters/OAR028/with-$ref.yaml b/src/test/resources/checks/v32/parameters/OAR028/with-$ref.yaml new file mode 100644 index 00000000..1cddb613 --- /dev/null +++ b/src/test/resources/checks/v32/parameters/OAR028/with-$ref.yaml @@ -0,0 +1,29 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +components: + parameters: + other: + in: query + name: other + schema: + type: array + items: + type: string + orderby: + in: query + name: $filter + schema: + type: array + items: + type: string +paths: + /pets: + get: + parameters: + - $ref: '#/components/parameters/other' + - $ref: '#/components/parameters/orderby' + responses: + 206: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v32/parameters/OAR028/without-parameters.json b/src/test/resources/checks/v32/parameters/OAR028/without-parameters.json new file mode 100644 index 00000000..cd9cbea6 --- /dev/null +++ b/src/test/resources/checks/v32/parameters/OAR028/without-parameters.json @@ -0,0 +1,18 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/pets" : { + "get" : { # Noncompliant {{OAR028: $filter must be defined as a parameter in this operation}} + "responses" : { + "206" : { + "description" : "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/parameters/OAR028/without-parameters.yaml b/src/test/resources/checks/v32/parameters/OAR028/without-parameters.yaml new file mode 100644 index 00000000..12c50ca8 --- /dev/null +++ b/src/test/resources/checks/v32/parameters/OAR028/without-parameters.yaml @@ -0,0 +1,10 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: + get: # Noncompliant {{OAR028: $filter must be defined as a parameter in this operation}} + responses: + 206: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v32/parameters/OAR060/required-false.json b/src/test/resources/checks/v32/parameters/OAR060/required-false.json new file mode 100644 index 00000000..e0608d51 --- /dev/null +++ b/src/test/resources/checks/v32/parameters/OAR060/required-false.json @@ -0,0 +1,39 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/status" : { + "get" : { + "parameters" : [ { + "in" : "query", + "name" : "other", + "required": false, + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + }, { + "in" : "query", + "name" : "$filter", + "required": false, + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + } ], + "responses" : { + "206" : { + "description" : "Ok" + } + } + } + } + } + } \ No newline at end of file diff --git a/src/test/resources/checks/v32/parameters/OAR060/required-false.yaml b/src/test/resources/checks/v32/parameters/OAR060/required-false.yaml new file mode 100644 index 00000000..5537b3e6 --- /dev/null +++ b/src/test/resources/checks/v32/parameters/OAR060/required-false.yaml @@ -0,0 +1,25 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /status: + get: + parameters: + - in: query + name: other + required: false + schema: + type: array + items: + type: string + - in: query + name: $filter + required: false + schema: + type: array + items: + type: string + responses: + 206: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v32/parameters/OAR060/required-true.json b/src/test/resources/checks/v32/parameters/OAR060/required-true.json new file mode 100644 index 00000000..c57cdd06 --- /dev/null +++ b/src/test/resources/checks/v32/parameters/OAR060/required-true.json @@ -0,0 +1,39 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/status" : { + "get" : { + "parameters" : [ { + "in" : "query", + "name" : "other", + "required": true, # Noncompliant {{OAR060: All parameters in query must be defined as optional}} + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + }, { + "in" : "query", + "name" : "$filter", + "required": true, # Noncompliant {{OAR060: All parameters in query must be defined as optional}} + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + } ], + "responses" : { + "206" : { + "description" : "Ok" + } + } + } + } + } + } \ No newline at end of file diff --git a/src/test/resources/checks/v32/parameters/OAR060/required-true.yaml b/src/test/resources/checks/v32/parameters/OAR060/required-true.yaml new file mode 100644 index 00000000..00a697fb --- /dev/null +++ b/src/test/resources/checks/v32/parameters/OAR060/required-true.yaml @@ -0,0 +1,25 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /status: + get: + parameters: + - in: query + name: other + required: true # Noncompliant {{OAR060: All parameters in query must be defined as optional}} + schema: + type: array + items: + type: string + - in: query + name: $filter + required: true # Noncompliant {{OAR060: All parameters in query must be defined as optional}} + schema: + type: array + items: + type: string + responses: + 206: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v32/parameters/OAR069/bad-request400.json b/src/test/resources/checks/v32/parameters/OAR069/bad-request400.json new file mode 100644 index 00000000..5f9e2b7c --- /dev/null +++ b/src/test/resources/checks/v32/parameters/OAR069/bad-request400.json @@ -0,0 +1,42 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths": { + "/items": { + "get": { + "summary": "Get a list of items", + "parameters": [ + { + "name": "param1", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "A list of items", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + }, + "400": { + "description": "Bad Request" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/parameters/OAR069/bad-request400.yaml b/src/test/resources/checks/v32/parameters/OAR069/bad-request400.yaml new file mode 100644 index 00000000..8e3ad04a --- /dev/null +++ b/src/test/resources/checks/v32/parameters/OAR069/bad-request400.yaml @@ -0,0 +1,25 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /items: + get: + summary: Get a list of items + parameters: + - name: param1 + in: query + required: false + schema: + type: string + responses: + 200: + description: A list of items + content: + application/json: + schema: + type: array + items: + type: string + 400: + description: Bad Request \ No newline at end of file diff --git a/src/test/resources/checks/v32/parameters/OAR069/no-bad-request400.json b/src/test/resources/checks/v32/parameters/OAR069/no-bad-request400.json new file mode 100644 index 00000000..54ace04f --- /dev/null +++ b/src/test/resources/checks/v32/parameters/OAR069/no-bad-request400.json @@ -0,0 +1,38 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths": { + "/items": { + "get": { + "parameters": [ + { # Noncompliant {{OAR069: Any param in PATH or QUERY should have a Bad Request (400) response.}} + "name": "param1", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "A list of items", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + } + } + } + } + } \ No newline at end of file diff --git a/src/test/resources/checks/v32/parameters/OAR069/no-bad-request400.yaml b/src/test/resources/checks/v32/parameters/OAR069/no-bad-request400.yaml new file mode 100644 index 00000000..44c1d8ad --- /dev/null +++ b/src/test/resources/checks/v32/parameters/OAR069/no-bad-request400.yaml @@ -0,0 +1,22 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /items: + get: + parameters: + - name: param1 # Noncompliant {{OAR069: Any param in PATH or QUERY should have a Bad Request (400) response.}} + in: query + required: false + schema: + type: string + responses: + 200: + description: A list of items + content: + application/json: + schema: + type: array + items: + type: string diff --git a/src/test/resources/checks/v32/regex/OAR112/external-docs-invalid.json b/src/test/resources/checks/v32/regex/OAR112/external-docs-invalid.json new file mode 100644 index 00000000..17586e7f --- /dev/null +++ b/src/test/resources/checks/v32/regex/OAR112/external-docs-invalid.json @@ -0,0 +1,12 @@ +{ + "openapi" : "3.0.3", + "info" : { + "title" : "Test API", + "version" : "1.0.0" + }, + "externalDocs" : { + "description" : "lowercase external documentation", # Noncompliant {{OAR112: The field must start with an uppercase letter.}} + "url" : "https://example.com" + }, + "paths" : {} +} diff --git a/src/test/resources/checks/v32/regex/OAR112/external-docs-invalid.yaml b/src/test/resources/checks/v32/regex/OAR112/external-docs-invalid.yaml new file mode 100644 index 00000000..587823ce --- /dev/null +++ b/src/test/resources/checks/v32/regex/OAR112/external-docs-invalid.yaml @@ -0,0 +1,8 @@ +openapi: 3.0.3 +info: + title: Test API + version: 1.0.0 +externalDocs: + description: lowercase external documentation # Noncompliant {{OAR112: The field must start with an uppercase letter.}} + url: https://example.com +paths: {} diff --git a/src/test/resources/checks/v32/regex/OAR112/external-docs-valid.json b/src/test/resources/checks/v32/regex/OAR112/external-docs-valid.json new file mode 100644 index 00000000..b557673e --- /dev/null +++ b/src/test/resources/checks/v32/regex/OAR112/external-docs-valid.json @@ -0,0 +1,12 @@ +{ + "openapi" : "3.0.3", + "info" : { + "title" : "Test API", + "version" : "1.0.0" + }, + "externalDocs" : { + "description" : "Valid external documentation", + "url" : "https://example.com" + }, + "paths" : {} +} diff --git a/src/test/resources/checks/v32/regex/OAR112/external-docs-valid.yaml b/src/test/resources/checks/v32/regex/OAR112/external-docs-valid.yaml new file mode 100644 index 00000000..a273f219 --- /dev/null +++ b/src/test/resources/checks/v32/regex/OAR112/external-docs-valid.yaml @@ -0,0 +1,8 @@ +openapi: 3.0.3 +info: + title: Test API + version: 1.0.0 +externalDocs: + description: Valid external documentation + url: https://example.com +paths: {} diff --git a/src/test/resources/checks/v32/regex/OAR112/info-invalid.json b/src/test/resources/checks/v32/regex/OAR112/info-invalid.json new file mode 100644 index 00000000..1febb6b1 --- /dev/null +++ b/src/test/resources/checks/v32/regex/OAR112/info-invalid.json @@ -0,0 +1,9 @@ +{ + "openapi" : "3.0.3", + "info" : { + "title" : "Test API", + "version" : "1.0.0", + "description" : "lowercase description" # Noncompliant {{OAR112: The field must start with an uppercase letter.}} + }, + "paths" : {} +} diff --git a/src/test/resources/checks/v32/regex/OAR112/info-invalid.yaml b/src/test/resources/checks/v32/regex/OAR112/info-invalid.yaml new file mode 100644 index 00000000..32fbcf71 --- /dev/null +++ b/src/test/resources/checks/v32/regex/OAR112/info-invalid.yaml @@ -0,0 +1,6 @@ +openapi: 3.0.3 +info: + title: Test API + version: 1.0.0 + description: lowercase description # Noncompliant {{OAR112: The field must start with an uppercase letter.}} +paths: {} diff --git a/src/test/resources/checks/v32/regex/OAR112/minimal.json b/src/test/resources/checks/v32/regex/OAR112/minimal.json new file mode 100644 index 00000000..2c084747 --- /dev/null +++ b/src/test/resources/checks/v32/regex/OAR112/minimal.json @@ -0,0 +1,8 @@ +{ + "openapi" : "3.0.3", + "info" : { + "title" : "Test API", + "version" : "1.0.0" + }, + "paths" : {} +} diff --git a/src/test/resources/checks/v32/regex/OAR112/minimal.yaml b/src/test/resources/checks/v32/regex/OAR112/minimal.yaml new file mode 100644 index 00000000..f379c272 --- /dev/null +++ b/src/test/resources/checks/v32/regex/OAR112/minimal.yaml @@ -0,0 +1,5 @@ +openapi: 3.0.3 +info: + title: Test API + version: 1.0.0 +paths: {} diff --git a/src/test/resources/checks/v32/regex/OAR112/missing-description.json b/src/test/resources/checks/v32/regex/OAR112/missing-description.json new file mode 100644 index 00000000..f2549007 --- /dev/null +++ b/src/test/resources/checks/v32/regex/OAR112/missing-description.json @@ -0,0 +1,8 @@ +{ + "openapi" : "3.0.3", + "info" : { # Noncompliant {{OAR112: Expected to find a value but didn't.}} + "title" : "Test API", + "version" : "1.0.0" + }, + "paths" : {} +} diff --git a/src/test/resources/checks/v32/regex/OAR112/missing-description.yaml b/src/test/resources/checks/v32/regex/OAR112/missing-description.yaml new file mode 100644 index 00000000..db4ae777 --- /dev/null +++ b/src/test/resources/checks/v32/regex/OAR112/missing-description.yaml @@ -0,0 +1,5 @@ +openapi: 3.0.3 +info: # Noncompliant {{OAR112: Expected to find a value but didn't.}} + title: Test API + version: 1.0.0 +paths: {} diff --git a/src/test/resources/checks/v32/regex/OAR112/operation-invalid.json b/src/test/resources/checks/v32/regex/OAR112/operation-invalid.json new file mode 100644 index 00000000..8bfbed2b --- /dev/null +++ b/src/test/resources/checks/v32/regex/OAR112/operation-invalid.json @@ -0,0 +1,19 @@ +{ + "openapi" : "3.0.3", + "info" : { + "title" : "Test API", + "version" : "1.0.0" + }, + "paths" : { + "/test" : { + "get" : { + "summary" : "lowercase operation summary", # Noncompliant {{OAR112: The field must start with an uppercase letter.}} + "responses" : { + "200" : { + "description" : "OK" + } + } + } + } + } +} diff --git a/src/test/resources/checks/v32/regex/OAR112/operation-invalid.yaml b/src/test/resources/checks/v32/regex/OAR112/operation-invalid.yaml new file mode 100644 index 00000000..0bc1243b --- /dev/null +++ b/src/test/resources/checks/v32/regex/OAR112/operation-invalid.yaml @@ -0,0 +1,11 @@ +openapi: 3.0.3 +info: + title: Test API + version: 1.0.0 +paths: + /test: + get: + summary: lowercase operation summary # Noncompliant {{OAR112: The field must start with an uppercase letter.}} + responses: + '200': + description: OK diff --git a/src/test/resources/checks/v32/regex/OAR112/operation-valid.json b/src/test/resources/checks/v32/regex/OAR112/operation-valid.json new file mode 100644 index 00000000..84ad7faa --- /dev/null +++ b/src/test/resources/checks/v32/regex/OAR112/operation-valid.json @@ -0,0 +1,19 @@ +{ + "openapi" : "3.0.3", + "info" : { + "title" : "Test API", + "version" : "1.0.0" + }, + "paths" : { + "/test" : { + "get" : { + "summary" : "Valid Operation Summary", + "responses" : { + "200" : { + "description" : "OK" + } + } + } + } + } +} diff --git a/src/test/resources/checks/v32/regex/OAR112/operation-valid.yaml b/src/test/resources/checks/v32/regex/OAR112/operation-valid.yaml new file mode 100644 index 00000000..9b62b40c --- /dev/null +++ b/src/test/resources/checks/v32/regex/OAR112/operation-valid.yaml @@ -0,0 +1,11 @@ +openapi: 3.0.3 +info: + title: Test API + version: 1.0.0 +paths: + /test: + get: + summary: Valid Operation Summary + responses: + '200': + description: OK diff --git a/src/test/resources/checks/v32/regex/OAR112/parameters-invalid.json b/src/test/resources/checks/v32/regex/OAR112/parameters-invalid.json new file mode 100644 index 00000000..46495733 --- /dev/null +++ b/src/test/resources/checks/v32/regex/OAR112/parameters-invalid.json @@ -0,0 +1,26 @@ +{ + "openapi" : "3.0.3", + "info" : { + "title" : "Test API", + "version" : "1.0.0" + }, + "paths" : { + "/test" : { + "get" : { + "parameters" : [ { + "name" : "page", + "in" : "query", + "description" : "lowercase parameter description", # Noncompliant {{OAR112: The field must start with an uppercase letter.}} + "schema" : { + "type" : "integer" + } + } ], + "responses" : { + "200" : { + "description" : "OK" + } + } + } + } + } +} diff --git a/src/test/resources/checks/v32/regex/OAR112/parameters-invalid.yaml b/src/test/resources/checks/v32/regex/OAR112/parameters-invalid.yaml new file mode 100644 index 00000000..86159506 --- /dev/null +++ b/src/test/resources/checks/v32/regex/OAR112/parameters-invalid.yaml @@ -0,0 +1,16 @@ +openapi: 3.0.3 +info: + title: Test API + version: 1.0.0 +paths: + /test: + get: + parameters: + - name: page + in: query + description: lowercase parameter description # Noncompliant {{OAR112: The field must start with an uppercase letter.}} + schema: + type: integer + responses: + '200': + description: OK diff --git a/src/test/resources/checks/v32/regex/OAR112/parameters-valid.json b/src/test/resources/checks/v32/regex/OAR112/parameters-valid.json new file mode 100644 index 00000000..27af1750 --- /dev/null +++ b/src/test/resources/checks/v32/regex/OAR112/parameters-valid.json @@ -0,0 +1,26 @@ +{ + "openapi" : "3.0.3", + "info" : { + "title" : "Test API", + "version" : "1.0.0" + }, + "paths" : { + "/test" : { + "get" : { + "parameters" : [ { + "name" : "page", + "in" : "query", + "description" : "Valid parameter description", + "schema" : { + "type" : "integer" + } + } ], + "responses" : { + "200" : { + "description" : "OK" + } + } + } + } + } +} diff --git a/src/test/resources/checks/v32/regex/OAR112/parameters-valid.yaml b/src/test/resources/checks/v32/regex/OAR112/parameters-valid.yaml new file mode 100644 index 00000000..9ec6ebd6 --- /dev/null +++ b/src/test/resources/checks/v32/regex/OAR112/parameters-valid.yaml @@ -0,0 +1,16 @@ +openapi: 3.0.3 +info: + title: Test API + version: 1.0.0 +paths: + /test: + get: + parameters: + - name: page + in: query + description: Valid parameter description + schema: + type: integer + responses: + '200': + description: OK diff --git a/src/test/resources/checks/v32/regex/OAR112/plain.json b/src/test/resources/checks/v32/regex/OAR112/plain.json new file mode 100644 index 00000000..aab1e213 --- /dev/null +++ b/src/test/resources/checks/v32/regex/OAR112/plain.json @@ -0,0 +1,37 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/examples" : { + "get" : { + "parameters" : [ { + "in" : "query", + "name" : "$select", + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + }, { + "in" : "query", + "name" : "$select", + "schema": { + "type" : "array", + "items" : { + "type" : "string" + } + } + } ], + "responses" : { + "206" : { + "description" : "Ok" + } + } + } + } + } + } \ No newline at end of file diff --git a/src/test/resources/checks/v32/regex/OAR112/plain.yaml b/src/test/resources/checks/v32/regex/OAR112/plain.yaml new file mode 100644 index 00000000..4621ff6f --- /dev/null +++ b/src/test/resources/checks/v32/regex/OAR112/plain.yaml @@ -0,0 +1,46 @@ +openapi: 3.0.3 +info: + title: Ejemplo de API + version: 1.0.0 + description: Una API de ejemplo para ilustrar la estructura de OpenAPI. +servers: + - url: https://api.ejemplo.com/v1 +paths: + /usuarios: + get: + summary: Obtiene una lista de usuarios + description: Retorna una lista completa de usuarios registrados. + operationId: getUsuarios + tags: + - Usuarios + parameters: + - name: "page" + in: "query" + description: "Número de página para la paginación" + required: false + schema: + type: "integer" + format: "int32" + responses: + '200': + description: ana lista de usuarios se retorna en caso de éxito. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Usuario' + '404': + description: No se encontraron usuarios. +components: + schemas: + Usuario: + type: object + properties: + id: + type: integer + format: int64 + description: El ID único del usuario. + nombre: + type: string + description: El nombre del usuario. \ No newline at end of file diff --git a/src/test/resources/checks/v32/regex/OAR112/servers-invalid.json b/src/test/resources/checks/v32/regex/OAR112/servers-invalid.json new file mode 100644 index 00000000..c5cda036 --- /dev/null +++ b/src/test/resources/checks/v32/regex/OAR112/servers-invalid.json @@ -0,0 +1,12 @@ +{ + "openapi" : "3.0.3", + "info" : { + "title" : "Test API", + "version" : "1.0.0" + }, + "servers" : [ { + "url" : "https://api.example.com", + "description" : "lowercase server description" # Noncompliant {{OAR112: The field must start with an uppercase letter.}} + } ], + "paths" : {} +} diff --git a/src/test/resources/checks/v32/regex/OAR112/servers-invalid.yaml b/src/test/resources/checks/v32/regex/OAR112/servers-invalid.yaml new file mode 100644 index 00000000..835f2b06 --- /dev/null +++ b/src/test/resources/checks/v32/regex/OAR112/servers-invalid.yaml @@ -0,0 +1,8 @@ +openapi: 3.0.3 +info: + title: Test API + version: 1.0.0 +servers: + - url: https://api.example.com + description: lowercase server description # Noncompliant {{OAR112: The field must start with an uppercase letter.}} +paths: {} diff --git a/src/test/resources/checks/v32/regex/OAR112/servers-valid.json b/src/test/resources/checks/v32/regex/OAR112/servers-valid.json new file mode 100644 index 00000000..735983f4 --- /dev/null +++ b/src/test/resources/checks/v32/regex/OAR112/servers-valid.json @@ -0,0 +1,12 @@ +{ + "openapi" : "3.0.3", + "info" : { + "title" : "Test API", + "version" : "1.0.0" + }, + "servers" : [ { + "url" : "https://api.example.com", + "description" : "Valid server description" + } ], + "paths" : {} +} diff --git a/src/test/resources/checks/v32/regex/OAR112/servers-valid.yaml b/src/test/resources/checks/v32/regex/OAR112/servers-valid.yaml new file mode 100644 index 00000000..511f93d7 --- /dev/null +++ b/src/test/resources/checks/v32/regex/OAR112/servers-valid.yaml @@ -0,0 +1,8 @@ +openapi: 3.0.3 +info: + title: Test API + version: 1.0.0 +servers: + - url: https://api.example.com + description: Valid server description +paths: {} diff --git a/src/test/resources/checks/v32/regex/OAR112/tags-invalid.json b/src/test/resources/checks/v32/regex/OAR112/tags-invalid.json new file mode 100644 index 00000000..5995f7ba --- /dev/null +++ b/src/test/resources/checks/v32/regex/OAR112/tags-invalid.json @@ -0,0 +1,11 @@ +{ + "openapi" : "3.0.3", + "info" : { + "title" : "Test API", + "version" : "1.0.0" + }, + "tags" : [ { + "name" : "invalidTag" # Noncompliant {{OAR112: The field must start with an uppercase letter.}} + } ], + "paths" : {} +} diff --git a/src/test/resources/checks/v32/regex/OAR112/tags-invalid.yaml b/src/test/resources/checks/v32/regex/OAR112/tags-invalid.yaml new file mode 100644 index 00000000..48c06b71 --- /dev/null +++ b/src/test/resources/checks/v32/regex/OAR112/tags-invalid.yaml @@ -0,0 +1,7 @@ +openapi: 3.0.3 +info: + title: Test API + version: 1.0.0 +tags: + - name: invalidTag # Noncompliant {{OAR112: The field must start with an uppercase letter.}} +paths: {} diff --git a/src/test/resources/checks/v32/regex/OAR112/tags-valid.json b/src/test/resources/checks/v32/regex/OAR112/tags-valid.json new file mode 100644 index 00000000..f28ad145 --- /dev/null +++ b/src/test/resources/checks/v32/regex/OAR112/tags-valid.json @@ -0,0 +1,11 @@ +{ + "openapi" : "3.0.3", + "info" : { + "title" : "Test API", + "version" : "1.0.0" + }, + "tags" : [ { + "name" : "ValidTag" + } ], + "paths" : {} +} diff --git a/src/test/resources/checks/v32/regex/OAR112/tags-valid.yaml b/src/test/resources/checks/v32/regex/OAR112/tags-valid.yaml new file mode 100644 index 00000000..045b483f --- /dev/null +++ b/src/test/resources/checks/v32/regex/OAR112/tags-valid.yaml @@ -0,0 +1,7 @@ +openapi: 3.0.3 +info: + title: Test API + version: 1.0.0 +tags: + - name: ValidTag +paths: {} diff --git a/src/test/resources/checks/v32/resources/OAR008/plain.json b/src/test/resources/checks/v32/resources/OAR008/plain.json new file mode 100644 index 00000000..9b40ba23 --- /dev/null +++ b/src/test/resources/checks/v32/resources/OAR008/plain.json @@ -0,0 +1,60 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/pets" : { + "patch" : { + "responses" : { + "200" : { + "description" : "Ok" + } + } + }, + "get" : { + "responses" : { + "200" : { + "description" : "Ok" + } + } + }, + "post" : { + "responses" : { + "200" : { + "description" : "Ok" + } + } + }, + "put" : { + "responses" : { + "200" : { + "description" : "Ok" + } + } + }, + "delete" : { + "responses" : { + "200" : { + "description" : "Ok" + } + } + }, + "head" : { # Noncompliant {{OAR008: Http verb (head) not encouraged}} + "responses" : { + "200" : { + "description" : "Ok" + } + } + }, + "options" : { # Noncompliant {{OAR008: Http verb (options) not encouraged}} + "responses" : { + "200" : { + "description" : "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/resources/OAR008/plain.yaml b/src/test/resources/checks/v32/resources/OAR008/plain.yaml new file mode 100644 index 00000000..fa0fc5fc --- /dev/null +++ b/src/test/resources/checks/v32/resources/OAR008/plain.yaml @@ -0,0 +1,35 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: + patch: + responses: + 200: + description: Ok + get: + responses: + 200: + description: Ok + post: + responses: + 200: + description: Ok + put: + responses: + 200: + description: Ok + delete: + responses: + 200: + description: Ok + head: # Noncompliant {{OAR008: Http verb (head) not encouraged}} + responses: + 200: + description: Ok + options: # Noncompliant {{OAR008: Http verb (options) not encouraged}} + responses: + 200: + description: Ok + diff --git a/src/test/resources/checks/v32/resources/OAR013/plain.json b/src/test/resources/checks/v32/resources/OAR013/plain.json new file mode 100644 index 00000000..78e9374c --- /dev/null +++ b/src/test/resources/checks/v32/resources/OAR013/plain.json @@ -0,0 +1,25 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/pets" : { + "get" : { + "responses" : { # Noncompliant {{OAR013: Default response is required}} + "200" : { + "description" : "Ok" + } + } + }, + "post" : { + "responses" : { + "default" : { + "description" : "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/resources/OAR013/plain.yaml b/src/test/resources/checks/v32/resources/OAR013/plain.yaml new file mode 100644 index 00000000..a58371d8 --- /dev/null +++ b/src/test/resources/checks/v32/resources/OAR013/plain.yaml @@ -0,0 +1,14 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: + get: + responses: # Noncompliant {{OAR013: Default response is required}} + 200: + description: Ok + post: + responses: + default: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v32/resources/OAR014/plain.json b/src/test/resources/checks/v32/resources/OAR014/plain.json new file mode 100644 index 00000000..ec717959 --- /dev/null +++ b/src/test/resources/checks/v32/resources/OAR014/plain.json @@ -0,0 +1,54 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/one": { + "get": { + "responses": { + "default": { + "description": "Ok" + } + } + } + }, + "/one/two": { + "get": { + "responses": { + "default": { + "description": "Ok" + } + } + } + }, + "/one/two/three": { + "get": { + "responses": { + "default": { + "description": "Ok" + } + } + } + }, + "/one/two/three/four": { # Noncompliant {{OAR014: Resources depth level should be smaller}} + "get": { + "responses": { + "default": { + "description": "Ok" + } + } + } + }, + "/one/two/three/four/five": { # Noncompliant {{OAR014: Resources depth level should be smaller}} + "get": { + "responses": { + "default": { + "description": "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/resources/OAR014/plain.yaml b/src/test/resources/checks/v32/resources/OAR014/plain.yaml new file mode 100644 index 00000000..08c7baa0 --- /dev/null +++ b/src/test/resources/checks/v32/resources/OAR014/plain.yaml @@ -0,0 +1,30 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /one: + get: + responses: + default: + description: Ok + /one/two: + get: + responses: + default: + description: Ok + /one/two/three: + get: + responses: + default: + description: Ok + /one/two/three/four: # Noncompliant {{OAR014: Resources depth level should be smaller}} + get: + responses: + default: + description: Ok + /one/two/three/four/five: # Noncompliant {{OAR014: Resources depth level should be smaller}} + get: + responses: + default: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v32/resources/OAR015/plain.json b/src/test/resources/checks/v32/resources/OAR015/plain.json new file mode 100644 index 00000000..258325fe --- /dev/null +++ b/src/test/resources/checks/v32/resources/OAR015/plain.json @@ -0,0 +1,72 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/one": { + "get": { + "responses": { + "default": { + "description": "Ok" + } + } + } + }, + "/one/two": { + "get": { + "responses": { + "default": { + "description": "Ok" + } + } + } + }, + "/one/two/three": { + "get": { + "responses": { + "default": { + "description": "Ok" + } + } + } + }, + "/one/two/three/four": { + "get": { + "responses": { + "default": { + "description": "Ok" + } + } + } + }, + "/one/two/three/four/five": { + "get": { + "responses": { + "default": { + "description": "Ok" + } + } + } + }, + "/one/two/three/four/five/six": { # Noncompliant {{OAR015: Resources depth level should be smaller}} + "get": { + "responses": { + "default": { + "description": "Ok" + } + } + } + }, + "/one/two/three/four/five/six/seven": { # Noncompliant {{OAR015: Resources depth level should be smaller}} + "get": { + "responses": { + "default": { + "description": "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/resources/OAR015/plain.yaml b/src/test/resources/checks/v32/resources/OAR015/plain.yaml new file mode 100644 index 00000000..94edfe5d --- /dev/null +++ b/src/test/resources/checks/v32/resources/OAR015/plain.yaml @@ -0,0 +1,40 @@ +openapi: 3.0.0 +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /one: + get: + responses: + default: + description: Ok + /one/two: + get: + responses: + default: + description: Ok + /one/two/three: + get: + responses: + default: + description: Ok + /one/two/three/four: + get: + responses: + default: + description: Ok + /one/two/three/four/five: + get: + responses: + default: + description: Ok + /one/two/three/four/five/six: # Noncompliant {{OAR015: Resources depth level should be smaller}} + get: + responses: + default: + description: Ok + /one/two/three/four/five/six/seven: # Noncompliant {{OAR015: Resources depth level should be smaller}} + get: + responses: + default: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v32/resources/OAR017/plain.json b/src/test/resources/checks/v32/resources/OAR017/plain.json new file mode 100644 index 00000000..1106c56c --- /dev/null +++ b/src/test/resources/checks/v32/resources/OAR017/plain.json @@ -0,0 +1,63 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/one" : { + "get" : { + "responses" : { + "200" : { + "description" : "Ok" + } + } + } + }, + "/{one}" : { # Noncompliant {{OAR017: Resource path should alternate static and parametrized parts}} + "get" : { + "responses" : { + "200" : { + "description" : "Ok" + } + } + } + }, + "/one/two" : { # Noncompliant {{OAR017: Resource path should alternate static and parametrized parts}} + "get" : { + "responses" : { + "200" : { + "description" : "Ok" + } + } + } + }, + "/one/{two}" : { + "get" : { + "responses" : { + "200" : { + "description" : "Ok" + } + } + } + }, + "/one/{two}/three" : { + "get" : { + "responses" : { + "200" : { + "description" : "Ok" + } + } + } + }, + "/one/{two}/{three}" : { # Noncompliant {{OAR017: Resource path should alternate static and parametrized parts}} + "get" : { + "responses" : { + "200" : { + "description" : "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/resources/OAR017/plain.yaml b/src/test/resources/checks/v32/resources/OAR017/plain.yaml new file mode 100644 index 00000000..29c02541 --- /dev/null +++ b/src/test/resources/checks/v32/resources/OAR017/plain.yaml @@ -0,0 +1,52 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /one: + get: + responses: + 200: + description: Ok + + /{one}: # Noncompliant {{OAR017: Resource path should alternate static and parametrized parts}} + get: + responses: + 200: + description: Ok + + /one/two: # Noncompliant {{OAR017: Resource path should alternate static and parametrized parts}} + get: + responses: + 200: + description: Ok + + /one/{two}: + get: + responses: + 200: + description: Ok + + /one/{two}/three: + get: + responses: + 200: + description: Ok + + /one/me: + get: + responses: + 200: + description: Ok + + /one/me/three: + get: + responses: + 200: + description: Ok + + /one/{two}/{three}: # Noncompliant {{OAR017: Resource path should alternate static and parametrized parts}} + get: + responses: + 200: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v32/resources/OAR018/plain.json b/src/test/resources/checks/v32/resources/OAR018/plain.json new file mode 100644 index 00000000..691f21b9 --- /dev/null +++ b/src/test/resources/checks/v32/resources/OAR018/plain.json @@ -0,0 +1,194 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/resources": { + "get": { + "responses": { + "200": { + "description": "Ok" + } + } + }, + "post": { + "responses": { + "200": { + "description": "Ok" + } + } + }, + "put": { # Noncompliant {{OAR018: Operation not recommended for resource path: PUT /resources}} + "responses": { + "200": { + "description": "Ok" + } + } + }, + "patch": { # Noncompliant {{OAR018: Operation not recommended for resource path: PATCH /resources}} + "responses": { + "200": { + "description": "Ok" + } + } + }, + "delete": { # Noncompliant {{OAR018: Operation not recommended for resource path: DELETE /resources}} + "responses": { + "200": { + "description": "Ok" + } + } + } + }, + "/resources/{r_id}": { + "get": { + "responses": { + "200": { + "description": "Ok" + } + } + }, + "post": { # Noncompliant {{OAR018: Operation not recommended for resource path: POST /resources/{r_id}}} + "responses": { + "200": { + "description": "Ok" + } + } + }, + "put": { + "responses": { + "200": { + "description": "Ok" + } + } + }, + "patch": { + "responses": { + "200": { + "description": "Ok" + } + } + }, + "delete": { + "responses": { + "200": { + "description": "Ok" + } + } + } + }, + "/resources/get": { + "get": { # Noncompliant {{OAR018: Operation not recommended for resource path: GET /resources/get}} + "responses": { + "200": { + "description": "Ok" + } + } + }, + "post": { + "responses": { + "200": { + "description": "Ok" + } + } + }, + "put": { # Noncompliant {{OAR018: Operation not recommended for resource path: PUT /resources/get}} + "responses": { + "200": { + "description": "Ok" + } + } + }, + "patch": { # Noncompliant {{OAR018: Operation not recommended for resource path: PATCH /resources/get}} + "responses": { + "200": { + "description": "Ok" + } + } + }, + "delete": { # Noncompliant {{OAR018: Operation not recommended for resource path: DELETE /resources/get}} + "responses": { + "200": { + "description": "Ok" + } + } + } + }, + "/resources/delete": { + "get": { # Noncompliant {{OAR018: Operation not recommended for resource path: GET /resources/delete}} + "responses": { + "200": { + "description": "Ok" + } + } + }, + "post": { + "responses": { + "200": { + "description": "Ok" + } + } + }, + "put": { # Noncompliant {{OAR018: Operation not recommended for resource path: PUT /resources/delete}} + "responses": { + "200": { + "description": "Ok" + } + } + }, + "patch": { # Noncompliant {{OAR018: Operation not recommended for resource path: PATCH /resources/delete}} + "responses": { + "200": { + "description": "Ok" + } + } + }, + "delete": { # Noncompliant {{OAR018: Operation not recommended for resource path: DELETE /resources/delete}} + "responses": { + "200": { + "description": "Ok" + } + } + } + }, + "/resources/{r_id}/other": { + "get": { + "responses": { + "200": { + "description": "Ok" + } + } + }, + "post": { + "responses": { + "200": { + "description": "Ok" + } + } + }, + "put": { # Noncompliant {{OAR018: Operation not recommended for resource path: PUT /resources/{r_id}/other}} + "responses": { + "200": { + "description": "Ok" + } + } + }, + "patch": { # Noncompliant {{OAR018: Operation not recommended for resource path: PATCH /resources/{r_id}/other}} + "responses": { + "200": { + "description": "Ok" + } + } + }, + "delete": { # Noncompliant {{OAR018: Operation not recommended for resource path: DELETE /resources/{r_id}/other}} + "responses": { + "200": { + "description": "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/resources/OAR018/plain.yaml b/src/test/resources/checks/v32/resources/OAR018/plain.yaml new file mode 100644 index 00000000..bed03643 --- /dev/null +++ b/src/test/resources/checks/v32/resources/OAR018/plain.yaml @@ -0,0 +1,114 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /resources: + get: + responses: + 200: + description: Ok + post: + responses: + 200: + description: Ok + put: # Noncompliant {{OAR018: Operation not recommended for resource path: PUT /resources}} + responses: + 200: + description: Ok + patch: # Noncompliant {{OAR018: Operation not recommended for resource path: PATCH /resources}} + responses: + 200: + description: Ok + delete: # Noncompliant {{OAR018: Operation not recommended for resource path: DELETE /resources}} + responses: + 200: + description: Ok + + /resources/{r_id}: + get: + responses: + 200: + description: Ok + post: # Noncompliant {{OAR018: Operation not recommended for resource path: POST /resources/{r_id}}} + responses: + 200: + description: Ok + put: + responses: + 200: + description: Ok + patch: + responses: + 200: + description: Ok + delete: + responses: + 200: + description: Ok + + /resources/get: + get: # Noncompliant {{OAR018: Operation not recommended for resource path: GET /resources/get}} + responses: + 200: + description: Ok + post: + responses: + 200: + description: Ok + put: # Noncompliant {{OAR018: Operation not recommended for resource path: PUT /resources/get}} + responses: + 200: + description: Ok + patch: # Noncompliant {{OAR018: Operation not recommended for resource path: PATCH /resources/get}} + responses: + 200: + description: Ok + delete: # Noncompliant {{OAR018: Operation not recommended for resource path: DELETE /resources/get}} + responses: + 200: + description: Ok + + /resources/delete: + get: # Noncompliant {{OAR018: Operation not recommended for resource path: GET /resources/delete}} + responses: + 200: + description: Ok + post: + responses: + 200: + description: Ok + put: # Noncompliant {{OAR018: Operation not recommended for resource path: PUT /resources/delete}} + responses: + 200: + description: Ok + patch: # Noncompliant {{OAR018: Operation not recommended for resource path: PATCH /resources/delete}} + responses: + 200: + description: Ok + delete: # Noncompliant {{OAR018: Operation not recommended for resource path: DELETE /resources/delete}} + responses: + 200: + description: Ok + + /resources/{r_id}/other: + get: + responses: + 200: + description: Ok + post: + responses: + 200: + description: Ok + put: # Noncompliant {{OAR018: Operation not recommended for resource path: PUT /resources/{r_id}/other}} + responses: + 200: + description: Ok + patch: # Noncompliant {{OAR018: Operation not recommended for resource path: PATCH /resources/{r_id}/other}} + responses: + 200: + description: Ok + delete: # Noncompliant {{OAR018: Operation not recommended for resource path: DELETE /resources/{r_id}/other}} + responses: + 200: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v32/resources/OAR027/no-post.json b/src/test/resources/checks/v32/resources/OAR027/no-post.json new file mode 100644 index 00000000..06e93395 --- /dev/null +++ b/src/test/resources/checks/v32/resources/OAR027/no-post.json @@ -0,0 +1,18 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/pets" : { + "get" : { + "responses" : { + "201" : { + "description" : "Found" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/resources/OAR027/no-post.yaml b/src/test/resources/checks/v32/resources/OAR027/no-post.yaml new file mode 100644 index 00000000..9e1d488a --- /dev/null +++ b/src/test/resources/checks/v32/resources/OAR027/no-post.yaml @@ -0,0 +1,10 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: + get: + responses: + 201: + description: Found \ No newline at end of file diff --git a/src/test/resources/checks/v32/resources/OAR027/post-201-with-location.json b/src/test/resources/checks/v32/resources/OAR027/post-201-with-location.json new file mode 100644 index 00000000..1911e07c --- /dev/null +++ b/src/test/resources/checks/v32/resources/OAR027/post-201-with-location.json @@ -0,0 +1,25 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/pets/" : { + "post" : { + "responses" : { + "201" : { + "description" : "Created", + "headers" : { + "Location" : { + "schema": { + "type" : "string" + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/resources/OAR027/post-201-with-location.yaml b/src/test/resources/checks/v32/resources/OAR027/post-201-with-location.yaml new file mode 100644 index 00000000..9b065b0a --- /dev/null +++ b/src/test/resources/checks/v32/resources/OAR027/post-201-with-location.yaml @@ -0,0 +1,14 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets/: + post: + responses: + 201: + description: Created + headers: + Location: + schema: + type: string \ No newline at end of file diff --git a/src/test/resources/checks/v32/resources/OAR027/post-201-with-other-headers.json b/src/test/resources/checks/v32/resources/OAR027/post-201-with-other-headers.json new file mode 100644 index 00000000..6e423478 --- /dev/null +++ b/src/test/resources/checks/v32/resources/OAR027/post-201-with-other-headers.json @@ -0,0 +1,25 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/pets/" : { + "post" : { + "responses" : { + "201" : { + "description" : "Created", + "headers" : { # Noncompliant {{OAR027: Location header is required in responses with code 201 from POST operations}} + "X-Location" : { + "schema": { + "type" : "string" + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/resources/OAR027/post-201-with-other-headers.yaml b/src/test/resources/checks/v32/resources/OAR027/post-201-with-other-headers.yaml new file mode 100644 index 00000000..a080d8ed --- /dev/null +++ b/src/test/resources/checks/v32/resources/OAR027/post-201-with-other-headers.yaml @@ -0,0 +1,14 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets/: + post: + responses: + 201: + description: Created + headers: # Noncompliant {{OAR027: Location header is required in responses with code 201 from POST operations}} + X-Location: + schema: + type: string \ No newline at end of file diff --git a/src/test/resources/checks/v32/resources/OAR027/post-201-without-location.json b/src/test/resources/checks/v32/resources/OAR027/post-201-without-location.json new file mode 100644 index 00000000..3c46c6a4 --- /dev/null +++ b/src/test/resources/checks/v32/resources/OAR027/post-201-without-location.json @@ -0,0 +1,18 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/pets" : { + "post" : { + "responses" : { + "201" : { # Noncompliant {{OAR027: Location header is required in responses with code 201 from POST operations}} + "description" : "Created" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/resources/OAR027/post-201-without-location.yaml b/src/test/resources/checks/v32/resources/OAR027/post-201-without-location.yaml new file mode 100644 index 00000000..eb45ccf1 --- /dev/null +++ b/src/test/resources/checks/v32/resources/OAR027/post-201-without-location.yaml @@ -0,0 +1,10 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: + post: + responses: + 201: # Noncompliant {{OAR027: Location header is required in responses with code 201 from POST operations}} + description: Created \ No newline at end of file diff --git a/src/test/resources/checks/v32/resources/OAR027/post-no-201.json b/src/test/resources/checks/v32/resources/OAR027/post-no-201.json new file mode 100644 index 00000000..680dc49d --- /dev/null +++ b/src/test/resources/checks/v32/resources/OAR027/post-no-201.json @@ -0,0 +1,18 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/pets" : { + "post" : { + "responses" : { + "200" : { + "description" : "OK" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/resources/OAR027/post-no-201.yaml b/src/test/resources/checks/v32/resources/OAR027/post-no-201.yaml new file mode 100644 index 00000000..bef9c590 --- /dev/null +++ b/src/test/resources/checks/v32/resources/OAR027/post-no-201.yaml @@ -0,0 +1,10 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: + post: + responses: + 200: + description: OK \ No newline at end of file diff --git a/src/test/resources/checks/v32/resources/OAR029/valid-all-of-md.json b/src/test/resources/checks/v32/resources/OAR029/valid-all-of-md.json new file mode 100644 index 00000000..d39ce425 --- /dev/null +++ b/src/test/resources/checks/v32/resources/OAR029/valid-all-of-md.json @@ -0,0 +1,134 @@ +{ + "openapi": "3.0.1", + "info": { + "title": "Swagger Petstore", + "version": "1.0.0" + }, + "servers": [ + { + "url": "/" + } + ], + "paths": { + "/endpoint": { + "get": { + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/response" + } + } + } + }, + "204": { + "description": "No content", + "content": { + } + }, + "400": { + "description": "Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/response" + } + } + } + }, + "default": { + "description": "Unknown", + "content": { + } + } + } + } + } + }, + "components": { + "schemas": { + "response": { + "allOf": [ + { + "$ref": "#/components/schemas/standard_response" + } + ], + "properties" : { + "data" : { + "type" : "object", + "properties" : { + "tipos" : { + "type" : "array", + "items" : { + "type" : "string" + } + } + } + } + } + }, + "standard_response": { + "allOf": [ + { + "$ref": "#/components/schemas/standard_response_result" + }, + { + "$ref": "#/components/schemas/standard_response_metadata" + } + ] + }, + "standard_response_result": { + "type": "object", + "properties": { + "result": { + "required": [ + "http_code", + "status", + "trace_id" + ], + "type": "object", + "properties": { + "status": { + "type": "boolean" + }, + "http_code": { + "type": "integer" + }, + "errors": { + "type": "array", + "items": { + "required": [ + "code", + "message" + ], + "type": "object", + "properties": { + "code": { + "type": "integer" + }, + "message": { + "type": "string" + } + } + } + }, + "trace_id": { + "type": "string" + } + } + } + } + }, + "standard_response_metadata": { + "type": "object", + "properties": { + "metadata": { + "type": "string" + } + } + } + } + } + } \ No newline at end of file diff --git a/src/test/resources/checks/v32/resources/OAR029/valid-all-of-md.yaml b/src/test/resources/checks/v32/resources/OAR029/valid-all-of-md.yaml new file mode 100644 index 00000000..5413414a --- /dev/null +++ b/src/test/resources/checks/v32/resources/OAR029/valid-all-of-md.yaml @@ -0,0 +1,78 @@ +openapi: 3.0.1 +info: + title: Swagger Petstore + version: 1.0.0 +servers: +- url: / +paths: + /endpoint: + get: + responses: + 200: + description: Ok + content: + 'application/json': + schema: + $ref: '#/components/schemas/response' + 204: + description: No content + content: {} + 400: + description: Error + content: + 'application/json': + schema: + $ref: '#/components/schemas/response' + default: + description: Unknown + content: {} +components: + schemas: + response: + allOf: + - $ref: '#/components/schemas/standard_response' + properties: + data: + type: object + properties: + tipos: + type: array + items: + type: string + standard_response: + allOf: + - $ref: '#/components/schemas/standard_response_result' + - $ref: '#/components/schemas/standard_response_metadata' + standard_response_result: + type: object + properties: + result: + required: + - http_code + - status + - trace_id + type: object + properties: + status: + type: boolean + http_code: + type: integer + errors: + type: array + items: + required: + - code + - message + type: object + properties: + code: + type: integer + message: + type: string + trace_id: + type: string + standard_response_metadata: + type: object + properties: + metadata: + type: string diff --git a/src/test/resources/checks/v32/resources/OAR029/valid-all-of.json b/src/test/resources/checks/v32/resources/OAR029/valid-all-of.json new file mode 100644 index 00000000..cae30865 --- /dev/null +++ b/src/test/resources/checks/v32/resources/OAR029/valid-all-of.json @@ -0,0 +1,116 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/endpoint" : { + "get" : { + "responses" : { + "200" : { + "description" : "Ok", + "content": { + "application/json": { + "schema" : { + "$ref" : "#/components/schemas/response" + } + } + } + }, + "204" : { + "description" : "No content" + }, + "400" : { + "description" : "Error", + "content": { + "application/json": { + "schema" : { + "$ref" : "#/components/schemas/response" + } + } + } + }, + "default" : { + "description" : "Unknown" + } + } + } + } + }, + "components": { + "schemas" : { + "response" : { + "type" : "object", + "allOf" : [ { + "$ref" : "#/components/schemas/standard_response" + } ], + "properties" : { + "data" : { + "type" : "object", + "properties" : { + "tipos" : { + "type" : "array", + "items" : { + "type" : "string" + } + } + } + } + } + }, + "standard_response" : { + "allOf" : [ { + "$ref" : "#/components/schemas/standard_response_result" + }, { + "$ref" : "#/components/schemas/standard_response_metadata" + } ], + "required" : [ "status" ] + }, + "standard_response_result" : { + "type" : "object", + "properties" : { + "status" : { + "type" : "object", + "properties" : { + "http_status" : { + "type" : "string" + }, + "code" : { + "type" : "integer" + }, + "errors" : { + "type" : "array", + "items" : { + "type" : "object", + "properties": { + "name": { + "type": "string" + }, + "value": { + "type": "string" + } + } + } + }, + "description" : { + "type" : "string" + }, + "internal_code" : { + "type" : "string" + } + }, + "required" : [ "http_status", "code", "description", "errors" ] + } + } + }, + "standard_response_metadata" : { + "properties" : { + "metadata" : { + "type" : "string" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/resources/OAR029/valid-all-of.yaml b/src/test/resources/checks/v32/resources/OAR029/valid-all-of.yaml new file mode 100644 index 00000000..a7203f72 --- /dev/null +++ b/src/test/resources/checks/v32/resources/OAR029/valid-all-of.yaml @@ -0,0 +1,76 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /endpoint: + get: + responses: + 200: + description: Ok + content: + application/json: + schema: + $ref: '#/components/schemas/response' + 204: + description: No content + 400: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/response' + default: + description: Unknown +components: + schemas: + response: + type: object + allOf: + - $ref: '#/components/schemas/standard_response' + properties: + data: + type: object + properties: + tipos: + type: array + items: + type: string + standard_response: + allOf: + - $ref: '#/components/schemas/standard_response_result' + - $ref: '#/components/schemas/standard_response_metadata' + required: + - status + standard_response_result: + type: object + properties: + status: + type: object + properties: + http_status: + type: string + code: + type: integer + errors: + type: array + items: + type: object + properties: + name: + type: string + value: + type: string + description: + type: string + internal_code: + type: string + required: + - http_status + - code + - description + - errors + standard_response_metadata: + properties: + metadata: + type: string \ No newline at end of file diff --git a/src/test/resources/checks/v32/resources/OAR029/valid-md.json b/src/test/resources/checks/v32/resources/OAR029/valid-md.json new file mode 100644 index 00000000..dab6fe31 --- /dev/null +++ b/src/test/resources/checks/v32/resources/OAR029/valid-md.json @@ -0,0 +1,116 @@ +{ + "openapi": "3.0.1", + "info": { + "title": "Swagger Petstore", + "version": "1.0.0" + }, + "servers": [ + { + "url": "/" + } + ], + "paths": { + "/endpoint": { + "get": { + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/response" + } + } + } + }, + "204": { + "description": "No content", + "content": { + } + }, + "400": { + "description": "Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/response" + } + } + } + }, + "default": { + "description": "Unknown", + "content": { + } + } + } + } + } + }, + "components": { + "schemas": { + "response": { + "allOf": [ + { + "$ref": "#/components/schemas/standard_response" + } + ], + "properties" : { + "data" : { + "type" : "object", + "properties" : { + "tipos" : { + "type" : "array", + "items" : { + "type" : "string" + } + } + } + } + } + }, + "standard_response": { + "type": "object", + "properties": { + "result": { + "required": [ + "http_code", + "status", + "trace_id" + ], + "type": "object", + "properties": { + "status": { + "type": "boolean" + }, + "http_code": { + "type": "integer" + }, + "errors": { + "type": "array", + "items": { + "required": [ + "code", + "message" + ], + "type": "object", + "properties": { + "code": { + "type": "integer" + }, + "message": { + "type": "string" + } + } + } + }, + "trace_id": { + "type": "string" + } + } + } + } + } + } + } + } \ No newline at end of file diff --git a/src/test/resources/checks/v32/resources/OAR029/valid-md.yaml b/src/test/resources/checks/v32/resources/OAR029/valid-md.yaml new file mode 100644 index 00000000..7df432ae --- /dev/null +++ b/src/test/resources/checks/v32/resources/OAR029/valid-md.yaml @@ -0,0 +1,69 @@ +openapi: 3.0.1 +info: + title: Swagger Petstore + version: 1.0.0 +servers: +- url: / +paths: + /endpoint: + get: + responses: + 200: + description: Ok + content: + 'application/json': + schema: + $ref: '#/components/schemas/response' + 204: + description: No content + content: {} + 400: + description: Error + content: + 'application/json': + schema: + $ref: '#/components/schemas/response' + default: + description: Unknown + content: {} +components: + schemas: + response: + allOf: + - $ref: '#/components/schemas/standard_response' + properties: + data: + type: object + properties: + tipos: + type: array + items: + type: string + standard_response: + type: object + properties: + result: + required: + - http_code + - status + - trace_id + type: object + properties: + status: + type: boolean + http_code: + type: integer + errors: + type: array + items: + required: + - code + - message + type: object + properties: + code: + type: integer + message: + type: string + trace_id: + type: string diff --git a/src/test/resources/checks/v32/resources/OAR029/valid-r.json b/src/test/resources/checks/v32/resources/OAR029/valid-r.json new file mode 100644 index 00000000..95ea5878 --- /dev/null +++ b/src/test/resources/checks/v32/resources/OAR029/valid-r.json @@ -0,0 +1,96 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/endpoint": { + "get": { + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/successResponseData" + } + } + } + }, + "204": { + "description": "No content" + }, + "400": { + "$ref": "#/components/responses/errorResponse" + }, + "default": { + "description": "Unknown" + } + } + } + } + }, + "components": { + "schemas": { + "successResponseData": { + "type": "object", + "properties": { + "payload": { + "type": "object", + "properties": { + "tipos": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + }, + "errorResponseData": { + "type": "object", + "properties": { + "error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "message": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "type": "string" + } + }, + "httpStatus": { + "type": "integer" + } + }, + "required": [ + "code", + "message", + "httpStatus" + ] + } + } + } + }, + "responses": { + "errorResponse": { + "description": "Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errorResponseData" + } + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/resources/OAR029/valid-r.yaml b/src/test/resources/checks/v32/resources/OAR029/valid-r.yaml new file mode 100644 index 00000000..f3c42c5c --- /dev/null +++ b/src/test/resources/checks/v32/resources/OAR029/valid-r.yaml @@ -0,0 +1,59 @@ +openapi: 3.0.0 +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /endpoint: + get: + responses: + 200: + description: Ok + content: + application/json: + schema: + $ref: '#/components/schemas/successResponseData' + 204: + description: No content + 400: + $ref: '#/components/responses/errorResponse' + default: + description: Unknown +components: + schemas: + successResponseData: + type: object + properties: + payload: + type: object + properties: + tipos: + type: array + items: + type: string + errorResponseData: + type: object + properties: + error: + type: object + properties: + code: + type: string + message: + type: string + details: + type: array + items: + type: string + httpStatus: + type: integer + required: + - code + - message + - httpStatus + responses: + errorResponse: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/errorResponseData' diff --git a/src/test/resources/checks/v32/resources/OAR029/valid.json b/src/test/resources/checks/v32/resources/OAR029/valid.json new file mode 100644 index 00000000..dc03b61e --- /dev/null +++ b/src/test/resources/checks/v32/resources/OAR029/valid.json @@ -0,0 +1,105 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/endpoint" : { + "get" : { + "responses" : { + "200" : { + "description" : "Ok", + "content": { + "application/json": { + "schema" : { + "$ref" : "#/components/schemas/response" + } + } + } + }, + "204" : { + "description" : "No content" + }, + "400" : { + "description" : "Error", + "content": { + "application/json": { + "schema" : { + "$ref" : "#/components/schemas/response" + } + } + } + }, + "default" : { + "description" : "Unknown" + } + } + } + } + }, + "components": { + "schemas" : { + "response" : { + "type" : "object", + "allOf" : [ { + "$ref" : "#/components/schemas/standard_response" + } ], + "properties" : { + "data" : { + "type" : "object", + "properties" : { + "tipos" : { + "type" : "array", + "items" : { + "type" : "string" + } + } + } + } + }, + "required": [ + "status", + "data" + ] + }, + "standard_response" : { + "type" : "object", + "properties" : { + "status" : { + "type" : "object", + "properties" : { + "http_status" : { + "type" : "string" + }, + "code" : { + "type" : "integer" + }, + "errors" : { + "type" : "array", + "items" : { + "type" : "object", + "properties": { + "name": { + "type": "string" + }, + "value": { + "type": "string" + } + } + } + }, + "description" : { + "type" : "string" + }, + "internal_code" : { + "type" : "string" + } + }, + "required" : [ "http_status", "code", "description", "errors" ] + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/resources/OAR029/valid.yaml b/src/test/resources/checks/v32/resources/OAR029/valid.yaml new file mode 100644 index 00000000..8aa93539 --- /dev/null +++ b/src/test/resources/checks/v32/resources/OAR029/valid.yaml @@ -0,0 +1,69 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /endpoint: + get: + responses: + 200: + description: Ok + content: + application/json: + schema: + $ref: '#/components/schemas/response' + 204: + description: No content + 400: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/response' + default: + description: Unknown +components: + schemas: + response: + type: object + allOf: + - $ref: '#/components/schemas/standard_response' + properties: + data: + type: object + properties: + tipos: + type: array + items: + type: string + required: + - data + - status + standard_response: + type: object + properties: + status: + type: object + properties: + http_status: + type: string + code: + type: integer + errors: + type: array + items: + type: object + properties: + name: + type: string + value: + type: string + description: + type: string + internal_code: + type: string + required: + - http_status + - code + - description + - errors diff --git a/src/test/resources/checks/v32/resources/OAR029/with-error-with-properties-wrong-type-r.json b/src/test/resources/checks/v32/resources/OAR029/with-error-with-properties-wrong-type-r.json new file mode 100644 index 00000000..6a2f1e5e --- /dev/null +++ b/src/test/resources/checks/v32/resources/OAR029/with-error-with-properties-wrong-type-r.json @@ -0,0 +1,88 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/endpoint": { + "get": { + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/successResponse" + } + } + } + }, + "204": { + "description": "No content" + }, + "400": { + "description": "Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errorResponse" + } + } + } + }, + "default": { + "description": "Unknown" + } + } + } + } + }, + "components": { + "schemas": { + "successResponse": { + "type": "object", + "properties": { + "payload": { + "type": "object", + "properties": { + "tipos": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + }, + "errorResponse": { + "type": "object", + "properties": { + "error": { + "type": "object", + "properties": { + "code": { + "type": "integer" # Noncompliant {{OAR029: 'code' must be of type string}} + }, + "message": { + "type": "integer" # Noncompliant {{OAR029: 'message' must be of type string}} + }, + "details": { + "type": "integer" # Noncompliant {{OAR029: 'details' must be of type array}} + }, + "httpStatus": { + "type": "string" # Noncompliant {{OAR029: 'httpStatus' must be of type integer}} + } + }, + "required": [ + "code", + "message", + "httpStatus" + ] + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/resources/OAR029/with-error-with-properties-wrong-type-r.yaml b/src/test/resources/checks/v32/resources/OAR029/with-error-with-properties-wrong-type-r.yaml new file mode 100644 index 00000000..32eabe95 --- /dev/null +++ b/src/test/resources/checks/v32/resources/OAR029/with-error-with-properties-wrong-type-r.yaml @@ -0,0 +1,55 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /endpoint: + get: + responses: + 200: + description: Ok + content: + application/json: + schema: + $ref: '#/components/schemas/successResponse' + 204: + description: No content + 400: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/errorResponse' + default: + description: Unknown + +components: + schemas: + successResponse: + type: object + properties: + payload: + type: object + properties: + tipos: + type: array + items: + type: string + errorResponse: + type: object + properties: + error: + type: object + properties: + code: + type: integer # Noncompliant {{OAR029: 'code' must be of type string}} + message: + type: integer # Noncompliant {{OAR029: 'message' must be of type string}} + details: + type: integer # Noncompliant {{OAR029: 'details' must be of type array}} + httpStatus: + type: string # Noncompliant {{OAR029: 'httpStatus' must be of type integer}} + required: + - code + - message + - httpStatus diff --git a/src/test/resources/checks/v32/resources/OAR029/with-error-without-properties-r.json b/src/test/resources/checks/v32/resources/OAR029/with-error-without-properties-r.json new file mode 100644 index 00000000..d8ea6754 --- /dev/null +++ b/src/test/resources/checks/v32/resources/OAR029/with-error-without-properties-r.json @@ -0,0 +1,75 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/endpoint": { + "get": { + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/successResponse" + } + } + } + }, + "204": { + "description": "No content" + }, + "400": { + "description": "Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errorResponse" + } + } + } + }, + "default": { + "description": "Unknown" + } + } + } + } + }, + "components": { + "schemas": { + "successResponse": { + "type": "object", + "properties": { + "payload": { + "type": "object", + "properties": { + "tipos": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + }, + "errorResponse": { + "type": "object", + "properties": { + "error": { # Noncompliant {{OAR029: 'code' property is missing}} {{OAR029: 'details' property is missing}} {{OAR029: 'httpStatus' property is missing}} {{OAR029: 'message' property is missing}} + "type": "object", + "properties": {}, + "required": [ + "code", + "message", + "httpStatus" + ] + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/resources/OAR029/with-error-without-properties-r.yaml b/src/test/resources/checks/v32/resources/OAR029/with-error-without-properties-r.yaml new file mode 100644 index 00000000..16e83e55 --- /dev/null +++ b/src/test/resources/checks/v32/resources/OAR029/with-error-without-properties-r.yaml @@ -0,0 +1,47 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /endpoint: + get: + responses: + 200: + description: Ok + content: + application/json: + schema: + $ref: '#/components/schemas/successResponse' + 204: + description: No content + 400: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/errorResponse' + default: + description: Unknown + +components: + schemas: + successResponse: + type: object + properties: + payload: + type: object + properties: + tipos: + type: array + items: + type: string + errorResponse: + type: object + properties: + error: # Noncompliant {{OAR029: 'code' property is missing}} {{OAR029: 'details' property is missing}} {{OAR029: 'httpStatus' property is missing}} {{OAR029: 'message' property is missing}} + type: object + properties: {} + required: + - code + - message + - httpStatus \ No newline at end of file diff --git a/src/test/resources/checks/v32/resources/OAR029/with-error-wrong-type-r.json b/src/test/resources/checks/v32/resources/OAR029/with-error-wrong-type-r.json new file mode 100644 index 00000000..2ed7ec61 --- /dev/null +++ b/src/test/resources/checks/v32/resources/OAR029/with-error-wrong-type-r.json @@ -0,0 +1,91 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/endpoint": { + "get": { + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/successResponse" + } + } + } + }, + "204": { + "description": "No content" + }, + "400": { + "description": "Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errorResponse" + } + } + } + }, + "default": { + "description": "Unknown" + } + } + } + } + }, + "components": { + "schemas": { + "successResponse": { + "type": "object", + "properties": { + "payload": { + "type": "object", + "properties": { + "tipos": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + }, + "errorResponse": { + "type": "object", + "properties": { + "error": { + "type": "integer", # Noncompliant {{OAR029: 'error' must be of type object}} + "properties": { + "code": { + "type": "string" + }, + "message": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "type": "string" + } + }, + "httpStatus": { + "type": "integer" + } + }, + "required": [ + "code", + "message", + "httpStatus" + ] + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/resources/OAR029/with-error-wrong-type-r.yaml b/src/test/resources/checks/v32/resources/OAR029/with-error-wrong-type-r.yaml new file mode 100644 index 00000000..ac0cbfcf --- /dev/null +++ b/src/test/resources/checks/v32/resources/OAR029/with-error-wrong-type-r.yaml @@ -0,0 +1,57 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /endpoint: + get: + responses: + 200: + description: Ok + content: + application/json: + schema: + $ref: '#/components/schemas/successResponse' + 204: + description: No content + 400: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/errorResponse' + default: + description: Unknown + +components: + schemas: + successResponse: + type: object + properties: + payload: + type: object + properties: + tipos: + type: array + items: + type: string + errorResponse: + type: object + properties: + error: + type: integer # Noncompliant {{OAR029: 'error' must be of type object}} + properties: + code: + type: string + message: + type: string + details: + type: array + items: + type: string + httpStatus: + type: integer + required: + - code + - message + - httpStatus \ No newline at end of file diff --git a/src/test/resources/checks/v32/resources/OAR029/with-result-with-properties-wrong-type-md.json b/src/test/resources/checks/v32/resources/OAR029/with-result-with-properties-wrong-type-md.json new file mode 100644 index 00000000..fbdfa315 --- /dev/null +++ b/src/test/resources/checks/v32/resources/OAR029/with-result-with-properties-wrong-type-md.json @@ -0,0 +1,96 @@ +{ + "openapi": "3.0.1", + "info": { + "title": "Swagger Petstore", + "version": "1.0.0" + }, + "servers": [ + { + "url": "/" + } + ], + "paths": { + "/endpoint": { + "get": { + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/response" + } + } + } + }, + "204": { + "description": "No content", + "content": { + } + }, + "400": { + "description": "Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/response" + } + } + } + }, + "default": { + "description": "Unknown", + "content": { + } + } + } + } + } + }, + "components": { + "schemas": { + "response": { + "allOf": [ + { + "$ref": "#/components/schemas/standard_response" + } + ] + }, + "standard_response": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "id": { + "type": "string" + } + } + }, + "result": { + "required": [ + "http_code", + "status", + "trace_id" + ], + "type": "object", + "properties": { + "status": { + "type": "string" # Noncompliant {{OAR029: 'status' must be of type boolean}} + }, + "http_code": { + "type": "string" # Noncompliant {{OAR029: 'http_code' must be of type integer}} + }, + "errors": { + "type": "string" # Noncompliant {{OAR029: 'errors' must be of type array}} + }, + "trace_id": { + "type": "integer" # Noncompliant {{OAR029: 'trace_id' must be of type string}} + } + } + } + } + } + } + } + } \ No newline at end of file diff --git a/src/test/resources/checks/v32/resources/OAR029/with-result-with-properties-wrong-type-md.yaml b/src/test/resources/checks/v32/resources/OAR029/with-result-with-properties-wrong-type-md.yaml new file mode 100644 index 00000000..21b31cd5 --- /dev/null +++ b/src/test/resources/checks/v32/resources/OAR029/with-result-with-properties-wrong-type-md.yaml @@ -0,0 +1,56 @@ +openapi: 3.0.1 +info: + title: Swagger Petstore + version: 1.0.0 +servers: +- url: / +paths: + /endpoint: + get: + responses: + 200: + description: Ok + content: + 'application/json': + schema: + $ref: '#/components/schemas/response' + 204: + description: No content + content: {} + 400: + description: Error + content: + 'application/json': + schema: + $ref: '#/components/schemas/response' + default: + description: Unknown + content: {} +components: + schemas: + response: + allOf: + - $ref: '#/components/schemas/standard_response' + standard_response: + type: object + properties: + data: + type: object + properties: + id: + type: string + result: + required: + - http_code + - status + - trace_id + type: object + properties: + status: + type: string # Noncompliant {{OAR029: 'status' must be of type boolean}} + http_code: + type: string # Noncompliant {{OAR029: 'http_code' must be of type integer}} + errors: + type: string # Noncompliant {{OAR029: 'errors' must be of type array}} + trace_id: + type: integer # Noncompliant {{OAR029: 'trace_id' must be of type string}} diff --git a/src/test/resources/checks/v32/resources/OAR029/with-result-without-properties-md.json b/src/test/resources/checks/v32/resources/OAR029/with-result-without-properties-md.json new file mode 100644 index 00000000..5b02c8a8 --- /dev/null +++ b/src/test/resources/checks/v32/resources/OAR029/with-result-without-properties-md.json @@ -0,0 +1,80 @@ +{ + "openapi": "3.0.1", + "info": { + "title": "Swagger Petstore", + "version": "1.0.0" + }, + "servers": [ + { + "url": "/" + } + ], + "paths": { + "/endpoint": { + "get": { + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/response" + } + } + } + }, + "204": { + "description": "No content", + "content": { + } + }, + "400": { + "description": "Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/response" + } + } + } + }, + "default": { + "description": "Unknown", + "content": { + } + } + } + } + } + }, + "components": { + "schemas": { + "response": { + "allOf": [ + { + "$ref": "#/components/schemas/standard_response" + } + ] + }, + "standard_response": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "id": { + "type": "string" + } + } + }, + "result": { # Noncompliant {{OAR029: 'errors' property is missing}} {{OAR029: 'http_code' property is missing}} {{OAR029: 'status' property is missing}} {{OAR029: 'trace_id' property is missing}} + "type": "object", + "properties": { + }, + "required": ["http_code", "status", "trace_id"] + } + } + } + } + } + } \ No newline at end of file diff --git a/src/test/resources/checks/v32/resources/OAR029/with-result-without-properties-md.yaml b/src/test/resources/checks/v32/resources/OAR029/with-result-without-properties-md.yaml new file mode 100644 index 00000000..6434b79c --- /dev/null +++ b/src/test/resources/checks/v32/resources/OAR029/with-result-without-properties-md.yaml @@ -0,0 +1,48 @@ +openapi: 3.0.1 +info: + title: Swagger Petstore + version: 1.0.0 +servers: +- url: / +paths: + /endpoint: + get: + responses: + 200: + description: Ok + content: + 'application/json': + schema: + $ref: '#/components/schemas/response' + 204: + description: No content + content: {} + 400: + description: Error + content: + 'application/json': + schema: + $ref: '#/components/schemas/response' + default: + description: Unknown + content: {} +components: + schemas: + response: + allOf: + - $ref: '#/components/schemas/standard_response' + standard_response: + type: object + properties: + data: + type: object + properties: + id: + type: string + result: # Noncompliant {{OAR029: 'errors' property is missing}} {{OAR029: 'http_code' property is missing}} {{OAR029: 'status' property is missing}} {{OAR029: 'trace_id' property is missing}} + type: object + properties: {} + required: + - http_code + - status + - trace_id diff --git a/src/test/resources/checks/v32/resources/OAR029/with-result-wrong-type-md.json b/src/test/resources/checks/v32/resources/OAR029/with-result-wrong-type-md.json new file mode 100644 index 00000000..c24b20fd --- /dev/null +++ b/src/test/resources/checks/v32/resources/OAR029/with-result-wrong-type-md.json @@ -0,0 +1,101 @@ +{ + "openapi": "3.0.1", + "info": { + "title": "Swagger Petstore", + "version": "1.0.0" + }, + "servers": [ + { + "url": "/" + } + ], + "paths": { + "/endpoint": { + "get": { + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/response" + } + } + } + }, + "204": { + "description": "No content", + "content": { + } + }, + "400": { + "description": "Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/response" + } + } + } + }, + "default": { + "description": "Unknown", + "content": { + } + } + } + } + } + }, + "components": { + "schemas": { + "response": { + "allOf": [ + { + "$ref": "#/components/schemas/standard_response" + } + ] + }, + "standard_response": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "id": { + "type": "string" + } + } + }, + "result": { + "required": [ + "http_code", + "status", + "trace_id" + ], + "type": "integer", # Noncompliant {{OAR029: 'result' must be of type object}} + "properties": { + "status": { + "type": "boolean" + }, + "http_code": { + "type": "integer" + }, + "errors": { + "type": "array", + "items": { + "type": "object", + "properties": { + } + } + }, + "trace_id": { + "type": "string" + } + } + } + } + } + } + } + } \ No newline at end of file diff --git a/src/test/resources/checks/v32/resources/OAR029/with-result-wrong-type-md.yaml b/src/test/resources/checks/v32/resources/OAR029/with-result-wrong-type-md.yaml new file mode 100644 index 00000000..37e75c1b --- /dev/null +++ b/src/test/resources/checks/v32/resources/OAR029/with-result-wrong-type-md.yaml @@ -0,0 +1,59 @@ +openapi: 3.0.1 +info: + title: Swagger Petstore + version: 1.0.0 +servers: +- url: / +paths: + /endpoint: + get: + responses: + 200: + description: Ok + content: + 'application/json': + schema: + $ref: '#/components/schemas/response' + 204: + description: No content + content: {} + 400: + description: Error + content: + 'application/json': + schema: + $ref: '#/components/schemas/response' + default: + description: Unknown + content: {} +components: + schemas: + response: + allOf: + - $ref: '#/components/schemas/standard_response' + standard_response: + type: object + properties: + data: + type: object + properties: + id: + type: string + result: + required: + - http_code + - status + - trace_id + type: integer # Noncompliant {{OAR029: 'result' must be of type object}} + properties: + status: + type: boolean + http_code: + type: integer + errors: + type: array + items: + type: object + properties: {} + trace_id: + type: string diff --git a/src/test/resources/checks/v32/resources/OAR029/with-status-with-properties-wrong-type.json b/src/test/resources/checks/v32/resources/OAR029/with-status-with-properties-wrong-type.json new file mode 100644 index 00000000..af6d6d23 --- /dev/null +++ b/src/test/resources/checks/v32/resources/OAR029/with-status-with-properties-wrong-type.json @@ -0,0 +1,90 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/endpoint" : { + "get" : { + "responses" : { + "200" : { + "description" : "Ok", + "content": { + "application/json": { + "schema" : { + "$ref" : "#/components/schemas/response" + } + } + } + }, + "204" : { + "description" : "No content" + }, + "400" : { + "description" : "Error", + "content": { + "application/json": { + "schema" : { + "$ref" : "#/components/schemas/response" + } + } + } + }, + "default" : { + "description" : "Unknown" + } + } + } + } + }, + "components": { + "schemas" : { + "response" : { + "type" : "object", + "allOf" : [ { + "$ref" : "#/components/schemas/standard_response" + } ], + "properties" : { + "data" : { + "type" : "object", + "properties" : { + "tipos" : { + "type" : "array", + "items" : { + "type" : "string" + } + } + } + } + } + }, + "standard_response" : { + "type" : "object", + "properties" : { + "status" : { + "type" : "object", + "properties" : { + "http_status" : { + "type" : "boolean" # Noncompliant {{OAR029: 'http_status' must be of type string}} + }, + "code" : { + "type" : "string" # Noncompliant {{OAR029: 'code' must be of type integer}} + }, + "errors" : { + "type" : "string" # Noncompliant {{OAR029: 'errors' must be of type array}} + }, + "description" : { + "type" : "integer" # Noncompliant {{OAR029: 'description' must be of type string}} + }, + "internal_code" : { + "type" : "integer" # Noncompliant {{OAR029: 'internal_code' must be of type string}} + } + }, + "required" : [ "http_status", "code", "description", "errors" ] + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/resources/OAR029/with-status-with-properties-wrong-type.yaml b/src/test/resources/checks/v32/resources/OAR029/with-status-with-properties-wrong-type.yaml new file mode 100644 index 00000000..68e59b91 --- /dev/null +++ b/src/test/resources/checks/v32/resources/OAR029/with-status-with-properties-wrong-type.yaml @@ -0,0 +1,59 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /endpoint: + get: + responses: + 200: + description: Ok + content: + application/json: + schema: + $ref: '#/components/schemas/response' + 204: + description: No content + 400: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/response' + default: + description: Unknown +components: + schemas: + response: + type: object + allOf: + - $ref: '#/components/schemas/standard_response' + properties: + data: + type: object + properties: + tipos: + type: array + items: + type: string + standard_response: + type: object + properties: + status: + type: object + properties: + http_status: + type: boolean # Noncompliant {{OAR029: 'http_status' must be of type string}} + code: + type: string # Noncompliant {{OAR029: 'code' must be of type integer}} + errors: + type: string # Noncompliant {{OAR029: 'errors' must be of type array}} + description: + type: integer # Noncompliant {{OAR029: 'description' must be of type string}} + internal_code: + type: integer # Noncompliant {{OAR029: 'internal_code' must be of type string}} + required: + - http_status + - code + - description + - errors diff --git a/src/test/resources/checks/v32/resources/OAR029/with-status-without-properties.json b/src/test/resources/checks/v32/resources/OAR029/with-status-without-properties.json new file mode 100644 index 00000000..80e9dbf2 --- /dev/null +++ b/src/test/resources/checks/v32/resources/OAR029/with-status-without-properties.json @@ -0,0 +1,74 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/endpoint" : { + "get" : { + "responses" : { + "200" : { + "description" : "Ok", + "content": { + "application/json": { + "schema" : { + "$ref" : "#/components/schemas/response" + } + } + } + }, + "204" : { + "description" : "No content" + }, + "400" : { + "description" : "Error", + "content": { + "application/json": { + "schema" : { + "$ref" : "#/components/schemas/response" + } + } + } + }, + "default" : { + "description" : "Unknown" + } + } + } + } + }, + "components": { + "schemas" : { + "response" : { + "type" : "object", + "allOf" : [ { + "$ref" : "#/components/schemas/standard_response" + } ], + "properties" : { + "data" : { + "type" : "object", + "properties" : { + "tipos" : { + "type" : "array", + "items" : { + "type" : "string" + } + } + } + } + } + }, + "standard_response" : { + "type" : "object", + "properties" : { + "status" : { # Noncompliant {{OAR029: 'code' property is missing}} {{OAR029: 'description' property is missing}} {{OAR029: 'errors' property is missing}} {{OAR029: 'http_status' property is missing}} {{OAR029: 'internal_code' property is missing}} + "type" : "object", + "properties" : { }, + "required" : [ "http_status", "code", "description", "errors" ] + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/resources/OAR029/with-status-without-properties.yaml b/src/test/resources/checks/v32/resources/OAR029/with-status-without-properties.yaml new file mode 100644 index 00000000..2437684e --- /dev/null +++ b/src/test/resources/checks/v32/resources/OAR029/with-status-without-properties.yaml @@ -0,0 +1,49 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /endpoint: + get: + responses: + 200: + description: Ok + content: + application/json: + schema: + $ref: '#/components/schemas/response' + 204: + description: No content + 400: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/response' + default: + description: Unknown +components: + schemas: + response: + type: object + allOf: + - $ref: '#/components/schemas/standard_response' + properties: + data: + type: object + properties: + tipos: + type: array + items: + type: string + standard_response: + type: object + properties: + status: # Noncompliant {{OAR029: 'code' property is missing}} {{OAR029: 'description' property is missing}} {{OAR029: 'errors' property is missing}} {{OAR029: 'http_status' property is missing}} {{OAR029: 'internal_code' property is missing}} + type: object + properties: {} + required: + - http_status + - code + - description + - errors diff --git a/src/test/resources/checks/v32/resources/OAR029/with-status-wrong-type.json b/src/test/resources/checks/v32/resources/OAR029/with-status-wrong-type.json new file mode 100644 index 00000000..014223c9 --- /dev/null +++ b/src/test/resources/checks/v32/resources/OAR029/with-status-wrong-type.json @@ -0,0 +1,101 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/endpoint" : { + "get" : { + "responses" : { + "200" : { + "description" : "Ok", + "content": { + "application/json": { + "schema" : { + "$ref" : "#/components/schemas/response" + } + } + } + }, + "204" : { + "description" : "No content" + }, + "400" : { + "description" : "Error", + "content": { + "application/json": { + "schema" : { + "$ref" : "#/components/schemas/response" + } + } + } + }, + "default" : { + "description" : "Unknown" + } + } + } + } + }, + "components": { + "schemas" : { + "response" : { + "type" : "object", + "allOf" : [ { + "$ref" : "#/components/schemas/standard_response" + } ], + "properties" : { + "data" : { + "type" : "object", + "properties" : { + "tipos" : { + "type" : "array", + "items" : { + "type" : "string" + } + } + } + } + } + }, + "standard_response" : { + "type" : "object", + "properties" : { + "status" : { + "type" : "integer", # Noncompliant {{OAR029: 'status' must be of type object}} + "properties" : { + "http_status" : { + "type" : "string" + }, + "code" : { + "type" : "integer" + }, + "errors" : { + "type" : "array", + "items" : { + "type" : "object", + "properties": { + "name": { + "type": "string" + }, + "value": { + "type": "string" + } + } + } + }, + "description" : { + "type" : "string" + }, + "internal_code" : { + "type" : "string" + } + }, + "required" : [ "http_status", "code", "description", "errors" ] + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/resources/OAR029/with-status-wrong-type.yaml b/src/test/resources/checks/v32/resources/OAR029/with-status-wrong-type.yaml new file mode 100644 index 00000000..13bce453 --- /dev/null +++ b/src/test/resources/checks/v32/resources/OAR029/with-status-wrong-type.yaml @@ -0,0 +1,66 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /endpoint: + get: + responses: + 200: + description: Ok + content: + application/json: + schema: + $ref: '#/components/schemas/response' + 204: + description: No content + 400: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/response' + default: + description: Unknown +components: + schemas: + response: + type: object + allOf: + - $ref: '#/components/schemas/standard_response' + properties: + data: + type: object + properties: + tipos: + type: array + items: + type: string + standard_response: + type: object + properties: + status: + type: integer # Noncompliant {{OAR029: 'status' must be of type object}} + properties: + http_status: + type: string + code: + type: integer + errors: + type: array + items: + type: object + properties: + name: + type: string + value: + type: string + description: + type: string + internal_code: + type: string + required: + - http_status + - code + - description + - errors \ No newline at end of file diff --git a/src/test/resources/checks/v32/resources/OAR029/without-data-md.json b/src/test/resources/checks/v32/resources/OAR029/without-data-md.json new file mode 100644 index 00000000..8262dd65 --- /dev/null +++ b/src/test/resources/checks/v32/resources/OAR029/without-data-md.json @@ -0,0 +1,103 @@ +{ + "openapi": "3.0.1", + "info": { + "title": "Swagger Petstore", + "version": "1.0.0" + }, + "servers": [ + { + "url": "/" + } + ], + "paths": { + "/endpoint": { + "get": { + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/response" + } + } + } + }, + "204": { + "description": "No content", + "content": { + } + }, + "400": { + "description": "Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/response" + } + } + } + }, + "default": { + "description": "Unknown", + "content": { + } + } + } + } + } + }, + "components": { + "schemas": { + "response": { # Noncompliant {{OAR029: 'data' property is missing}} + "allOf": [ + { + "$ref": "#/components/schemas/standard_response" + } + ] + }, + "standard_response": { + "type": "object", + "properties": { + "result": { + "required": [ + "http_code", + "status", + "trace_id" + ], + "type": "object", + "properties": { + "status": { + "type": "boolean" + }, + "http_code": { + "type": "integer" + }, + "errors": { + "type": "array", + "items": { + "required": [ + "code", + "message" + ], + "type": "object", + "properties": { + "code": { + "type": "integer" + }, + "message": { + "type": "string" + } + } + } + }, + "trace_id": { + "type": "string" + } + } + } + } + } + } + } + } \ No newline at end of file diff --git a/src/test/resources/checks/v32/resources/OAR029/without-data-md.yaml b/src/test/resources/checks/v32/resources/OAR029/without-data-md.yaml new file mode 100644 index 00000000..950439cb --- /dev/null +++ b/src/test/resources/checks/v32/resources/OAR029/without-data-md.yaml @@ -0,0 +1,61 @@ +openapi: 3.0.1 +info: + title: Swagger Petstore + version: 1.0.0 +servers: +- url: / +paths: + /endpoint: + get: + responses: + 200: + description: Ok + content: + 'application/json': + schema: + $ref: '#/components/schemas/response' + 204: + description: No content + content: {} + 400: + description: Error + content: + 'application/json': + schema: + $ref: '#/components/schemas/response' + default: + description: Unknown + content: {} +components: + schemas: + response: # Noncompliant {{OAR029: 'data' property is missing}} + allOf: + - $ref: '#/components/schemas/standard_response' + standard_response: + type: object + properties: + result: + required: + - http_code + - status + - trace_id + type: object + properties: + status: + type: boolean + http_code: + type: integer + errors: + type: array + items: + required: + - code + - message + type: object + properties: + code: + type: integer + message: + type: string + trace_id: + type: string diff --git a/src/test/resources/checks/v32/resources/OAR029/without-data.json b/src/test/resources/checks/v32/resources/OAR029/without-data.json new file mode 100644 index 00000000..4c36767a --- /dev/null +++ b/src/test/resources/checks/v32/resources/OAR029/without-data.json @@ -0,0 +1,101 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/endpoint" : { + "get" : { + "responses" : { + "200" : { + "description" : "Ok", + "content": { + "application/json": { + "schema" : { + "$ref" : "#/components/schemas/response" + } + } + } + }, + "204" : { + "description" : "No content" + }, + "400" : { + "description" : "Error", + "content": { + "application/json": { + "schema" : { + "$ref" : "#/components/schemas/response" + } + } + } + }, + "default" : { + "description" : "Unknown" + } + } + } + } + }, + "components": { + "schemas" : { + "response" : { # Noncompliant {{OAR029: 'data' property is missing}} + "type" : "object", + "allOf" : [ { + "$ref" : "#/components/schemas/standard_response" + } ], + "properties" : { + "value" : { + "type" : "object", + "properties" : { + "tipos" : { + "type" : "array", + "items" : { + "type" : "string" + } + } + } + } + } + }, + "standard_response" : { + "type" : "object", + "properties" : { + "status" : { + "type" : "object", + "properties" : { + "http_status" : { + "type" : "string" + }, + "code" : { + "type" : "integer" + }, + "errors" : { + "type" : "array", + "items" : { + "type" : "object", + "properties": { + "name": { + "type": "string" + }, + "value": { + "type": "string" + } + } + } + }, + "description" : { + "type" : "string" + }, + "internal_code" : { + "type" : "string" + } + }, + "required" : [ "http_status", "code", "description", "errors" ] + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/resources/OAR029/without-data.yaml b/src/test/resources/checks/v32/resources/OAR029/without-data.yaml new file mode 100644 index 00000000..02cb167f --- /dev/null +++ b/src/test/resources/checks/v32/resources/OAR029/without-data.yaml @@ -0,0 +1,66 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /endpoint: + get: + responses: + 200: + description: Ok + content: + application/json: + schema: + $ref: '#/components/schemas/response' + 204: + description: No content + 400: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/response' + default: + description: Unknown +components: + schemas: + response: # Noncompliant {{OAR029: 'data' property is missing}} + type: object + allOf: + - $ref: '#/components/schemas/standard_response' + properties: + value: + type: object + properties: + tipos: + type: array + items: + type: string + standard_response: + type: object + properties: + status: + type: object + properties: + http_status: + type: string + code: + type: integer + errors: + type: array + items: + type: object + properties: + name: + type: string + value: + type: string + description: + type: string + internal_code: + type: string + required: + - http_status + - code + - description + - errors diff --git a/src/test/resources/checks/v32/resources/OAR029/without-error-r.json b/src/test/resources/checks/v32/resources/OAR029/without-error-r.json new file mode 100644 index 00000000..4a2978a7 --- /dev/null +++ b/src/test/resources/checks/v32/resources/OAR029/without-error-r.json @@ -0,0 +1,91 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/endpoint" : { + "get" : { + "responses" : { + "200" : { + "description" : "Ok", + "content": { + "application/json": { + "schema" : { + "$ref" : "#/components/schemas/successResponse" + } + } + } + }, + "204" : { + "description" : "No content" + }, + "400" : { + "description" : "Error", + "content": { + "application/json": { + "schema" : { + "$ref" : "#/components/schemas/errorResponse" + } + } + } + }, + "default" : { + "description" : "Unknown" + } + } + } + } + }, + "components": { + "schemas": { + "successResponse": { + "type": "object", + "properties": { + "payload": { + "type": "object", + "properties": { + "tipos": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + }, + "errorResponse": { # Noncompliant {{OAR029: 'error' property is missing}} + "type": "object", + "properties": { + "result": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "message": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "type": "string" + } + }, + "httpStatus": { + "type": "integer" + } + }, + "required": [ + "code", + "message", + "httpStatus" + ] + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/resources/OAR029/without-error-r.yaml b/src/test/resources/checks/v32/resources/OAR029/without-error-r.yaml new file mode 100644 index 00000000..fdaf26ad --- /dev/null +++ b/src/test/resources/checks/v32/resources/OAR029/without-error-r.yaml @@ -0,0 +1,57 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /endpoint: + get: + responses: + 200: + description: Ok + content: + application/json: + schema: + $ref: '#/components/schemas/successResponse' + 204: + description: No content + 400: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/errorResponse' + default: + description: Unknown + +components: + schemas: + successResponse: + type: object + properties: + payload: + type: object + properties: + tipos: + type: array + items: + type: string + errorResponse: # Noncompliant {{OAR029: 'error' property is missing}} + type: object + properties: + result: + type: object + properties: + code: + type: string + message: + type: string + details: + type: array + items: + type: string + httpStatus: + type: integer + required: + - code + - message + - httpStatus diff --git a/src/test/resources/checks/v32/resources/OAR029/without-payload-r.json b/src/test/resources/checks/v32/resources/OAR029/without-payload-r.json new file mode 100644 index 00000000..f2ee25c9 --- /dev/null +++ b/src/test/resources/checks/v32/resources/OAR029/without-payload-r.json @@ -0,0 +1,91 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/endpoint" : { + "get" : { + "responses" : { + "200" : { + "description" : "Ok", + "content": { + "application/json": { + "schema" : { + "$ref" : "#/components/schemas/successResponse" + } + } + } + }, + "204" : { + "description" : "No content" + }, + "400" : { + "description" : "Error", + "content": { + "application/json": { + "schema" : { + "$ref" : "#/components/schemas/errorResponse" + } + } + } + }, + "default" : { + "description" : "Unknown" + } + } + } + } + }, + "components": { + "schemas": { + "successResponse": { # Noncompliant {{OAR029: 'payload' property is missing}} + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "tipos": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + }, + "errorResponse": { + "type": "object", + "properties": { + "error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "message": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "type": "string" + } + }, + "httpStatus": { + "type": "integer" + } + }, + "required": [ + "code", + "message", + "httpStatus" + ] + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/resources/OAR029/without-payload-r.yaml b/src/test/resources/checks/v32/resources/OAR029/without-payload-r.yaml new file mode 100644 index 00000000..0993f891 --- /dev/null +++ b/src/test/resources/checks/v32/resources/OAR029/without-payload-r.yaml @@ -0,0 +1,57 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /endpoint: + get: + responses: + 200: + description: Ok + content: + application/json: + schema: + $ref: '#/components/schemas/successResponse' + 204: + description: No content + 400: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/errorResponse' + default: + description: Unknown + +components: + schemas: + successResponse: # Noncompliant {{OAR029: 'payload' property is missing}} + type: object + properties: + data: + type: object + properties: + tipos: + type: array + items: + type: string + errorResponse: + type: object + properties: + error: + type: object + properties: + code: + type: string + message: + type: string + details: + type: array + items: + type: string + httpStatus: + type: integer + required: + - code + - message + - httpStatus diff --git a/src/test/resources/checks/v32/resources/OAR029/without-required-fields-md.json b/src/test/resources/checks/v32/resources/OAR029/without-required-fields-md.json new file mode 100644 index 00000000..63d7a3bb --- /dev/null +++ b/src/test/resources/checks/v32/resources/OAR029/without-required-fields-md.json @@ -0,0 +1,107 @@ +{ + "openapi": "3.0.1", + "info": { + "title": "Swagger Petstore", + "version": "1.0.0" + }, + "servers": [ + { + "url": "/" + } + ], + "paths": { + "/endpoint": { + "get": { + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/response" + } + } + } + }, + "204": { + "description": "No content", + "content": { + } + }, + "400": { + "description": "Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/response" + } + } + } + }, + "default": { + "description": "Unknown", + "content": { + } + } + } + } + } + }, + "components": { + "schemas": { + "response": { + "allOf": [ + { + "$ref": "#/components/schemas/standard_response" + } + ] + }, + "standard_response": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "id": { + "type": "string" + } + } + }, + "result": { + "required": ["status"], # Noncompliant {{OAR029: The following fields must be required: http_code, status, trace_id}} + "type": "object", + "properties": { + "status": { + "type": "boolean" + }, + "http_code": { + "type": "integer" + }, + "errors": { + "type": "array", + "items": { + "required": [ + "code", + "message" + ], + "type": "object", + "properties": { + "code": { + "type": "integer" + }, + "message": { + "type": "string" + } + } + } + }, + "trace_id": { + "type": "string" + } + } + } + } + } + } + } + } \ No newline at end of file diff --git a/src/test/resources/checks/v32/resources/OAR029/without-required-fields-md.yaml b/src/test/resources/checks/v32/resources/OAR029/without-required-fields-md.yaml new file mode 100644 index 00000000..efecd06f --- /dev/null +++ b/src/test/resources/checks/v32/resources/OAR029/without-required-fields-md.yaml @@ -0,0 +1,64 @@ +openapi: 3.0.1 +info: + title: Swagger Petstore + version: 1.0.0 +servers: +- url: / +paths: + /endpoint: + get: + responses: + 200: + description: Ok + content: + 'application/json': + schema: + $ref: '#/components/schemas/response' + 204: + description: No content + content: {} + 400: + description: Error + content: + 'application/json': + schema: + $ref: '#/components/schemas/response' + default: + description: Unknown + content: {} +components: + schemas: + response: + allOf: + - $ref: '#/components/schemas/standard_response' + standard_response: + type: object + properties: + data: + type: object + properties: + id: + type: string + result: + required: # Noncompliant {{OAR029: The following fields must be required: http_code, status, trace_id}} + - status + type: object + properties: + status: + type: boolean + http_code: + type: integer + errors: + type: array + items: + required: + - code + - message + type: object + properties: + code: + type: integer + message: + type: string + trace_id: + type: string diff --git a/src/test/resources/checks/v32/resources/OAR029/without-required-fields-r.json b/src/test/resources/checks/v32/resources/OAR029/without-required-fields-r.json new file mode 100644 index 00000000..ea97f57f --- /dev/null +++ b/src/test/resources/checks/v32/resources/OAR029/without-required-fields-r.json @@ -0,0 +1,89 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/endpoint": { + "get": { + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/successResponse" + } + } + } + }, + "204": { + "description": "No content" + }, + "400": { + "description": "Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errorResponse" + } + } + } + }, + "default": { + "description": "Unknown" + } + } + } + } + }, + "components": { + "schemas": { + "successResponse": { + "type": "object", + "properties": { + "payload": { + "type": "object", + "properties": { + "tipos": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + }, + "errorResponse": { + "type": "object", + "properties": { + "error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "message": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "type": "string" + } + }, + "httpStatus": { + "type": "integer" + } + }, + "required": [ # Noncompliant {{OAR029: The following fields must be required: code, httpStatus, message}} + "httpStatus" + ] + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/resources/OAR029/without-required-fields-r.yaml b/src/test/resources/checks/v32/resources/OAR029/without-required-fields-r.yaml new file mode 100644 index 00000000..8ee987d5 --- /dev/null +++ b/src/test/resources/checks/v32/resources/OAR029/without-required-fields-r.yaml @@ -0,0 +1,55 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /endpoint: + get: + responses: + 200: + description: Ok + content: + application/json: + schema: + $ref: '#/components/schemas/successResponse' + 204: + description: No content + 400: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/errorResponse' + default: + description: Unknown + +components: + schemas: + successResponse: + type: object + properties: + payload: + type: object + properties: + tipos: + type: array + items: + type: string + errorResponse: + type: object + properties: + error: + type: object + properties: + code: + type: string + message: + type: string + details: + type: array + items: + type: string + httpStatus: + type: integer + required: # Noncompliant {{OAR029: The following fields must be required: code, httpStatus, message}} + - httpStatus diff --git a/src/test/resources/checks/v32/resources/OAR029/without-required-fields.json b/src/test/resources/checks/v32/resources/OAR029/without-required-fields.json new file mode 100644 index 00000000..350d748a --- /dev/null +++ b/src/test/resources/checks/v32/resources/OAR029/without-required-fields.json @@ -0,0 +1,101 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/endpoint" : { + "get" : { + "responses" : { + "200" : { + "description" : "Ok", + "content": { + "application/json": { + "schema" : { + "$ref" : "#/components/schemas/response" + } + } + } + }, + "204" : { + "description" : "No content" + }, + "400" : { + "description" : "Error", + "content": { + "application/json": { + "schema" : { + "$ref" : "#/components/schemas/response" + } + } + } + }, + "default" : { + "description" : "Unknown" + } + } + } + } + }, + "components": { + "schemas" : { + "response" : { + "type" : "object", + "allOf" : [ { + "$ref" : "#/components/schemas/standard_response" + } ], + "properties" : { + "data" : { + "type" : "object", + "properties" : { + "tipos" : { + "type" : "array", + "items" : { + "type" : "string" + } + } + } + } + } + }, + "standard_response" : { + "type" : "object", + "properties" : { + "status" : { + "type" : "object", + "properties" : { + "http_status" : { + "type" : "string" + }, + "code" : { + "type" : "integer" + }, + "errors" : { + "type" : "array", + "items" : { + "type" : "object", + "properties": { + "name": { + "type": "string" + }, + "value": { + "type": "string" + } + } + } + }, + "description" : { + "type" : "string" + }, + "internal_code" : { + "type" : "string" + } + }, + "required" : [ "http_status" ] # Noncompliant {{OAR029: The following fields must be required: code, description, errors, http_status}} + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/resources/OAR029/without-required-fields.yaml b/src/test/resources/checks/v32/resources/OAR029/without-required-fields.yaml new file mode 100644 index 00000000..234683f0 --- /dev/null +++ b/src/test/resources/checks/v32/resources/OAR029/without-required-fields.yaml @@ -0,0 +1,63 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /endpoint: + get: + responses: + 200: + description: Ok + content: + application/json: + schema: + $ref: '#/components/schemas/response' + 204: + description: No content + 400: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/response' + default: + description: Unknown +components: + schemas: + response: + type: object + allOf: + - $ref: '#/components/schemas/standard_response' + properties: + data: + type: object + properties: + tipos: + type: array + items: + type: string + standard_response: + type: object + properties: + status: + type: object + properties: + http_status: + type: string + code: + type: integer + errors: + type: array + items: + type: object + properties: + name: + type: string + value: + type: string + description: + type: string + internal_code: + type: string + required: # Noncompliant {{OAR029: The following fields must be required: code, description, errors, http_status}} + - http_status diff --git a/src/test/resources/checks/v32/resources/OAR029/without-result-md.json b/src/test/resources/checks/v32/resources/OAR029/without-result-md.json new file mode 100644 index 00000000..136cf12d --- /dev/null +++ b/src/test/resources/checks/v32/resources/OAR029/without-result-md.json @@ -0,0 +1,101 @@ +{ + "openapi": "3.0.1", + "info": { + "title": "Swagger Petstore", + "version": "1.0.0" + }, + "servers": [ + { + "url": "/" + } + ], + "paths": { + "/endpoint": { + "get": { + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/response" + } + } + } + }, + "204": { + "description": "No content", + "content": { + } + }, + "400": { + "description": "Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/response" + } + } + } + }, + "default": { + "description": "Unknown", + "content": { + } + } + } + } + } + }, + "components": { + "schemas": { + "response": { # Noncompliant {{OAR029: 'result' property is missing}} + "allOf": [ + { + "$ref": "#/components/schemas/standard_response" + } + ] + }, + "standard_response": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "id": { + "type": "string" + } + } + }, + "response": { + "required": [ + "http_code", + "status", + "trace_id" + ], + "type": "object", + "properties": { + "status": { + "type": "boolean" + }, + "http_code": { + "type": "integer" + }, + "errors": { + "type": "array", + "items": { + "type": "object", + "properties": { + } + } + }, + "trace_id": { + "type": "string" + } + } + } + } + } + } + } + } \ No newline at end of file diff --git a/src/test/resources/checks/v32/resources/OAR029/without-result-md.yaml b/src/test/resources/checks/v32/resources/OAR029/without-result-md.yaml new file mode 100644 index 00000000..81cebda9 --- /dev/null +++ b/src/test/resources/checks/v32/resources/OAR029/without-result-md.yaml @@ -0,0 +1,59 @@ +openapi: 3.0.1 +info: + title: Swagger Petstore + version: 1.0.0 +servers: +- url: / +paths: + /endpoint: + get: + responses: + 200: + description: Ok + content: + 'application/json': + schema: + $ref: '#/components/schemas/response' + 204: + description: No content + content: {} + 400: + description: Error + content: + 'application/json': + schema: + $ref: '#/components/schemas/response' + default: + description: Unknown + content: {} +components: + schemas: + response: # Noncompliant {{OAR029: 'result' property is missing}} + allOf: + - $ref: '#/components/schemas/standard_response' + standard_response: + type: object + properties: + data: + type: object + properties: + id: + type: string + response: + required: + - http_code + - status + - trace_id + type: object + properties: + status: + type: boolean + http_code: + type: integer + errors: + type: array + items: + type: object + properties: {} + trace_id: + type: string diff --git a/src/test/resources/checks/v32/resources/OAR029/without-status.json b/src/test/resources/checks/v32/resources/OAR029/without-status.json new file mode 100644 index 00000000..6e0d5fcb --- /dev/null +++ b/src/test/resources/checks/v32/resources/OAR029/without-status.json @@ -0,0 +1,101 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/endpoint" : { + "get" : { + "responses" : { + "200" : { + "description" : "Ok", + "content": { + "application/json": { + "schema" : { + "$ref" : "#/components/schemas/response" + } + } + } + }, + "204" : { + "description" : "No content" + }, + "400" : { + "description" : "Error", + "content": { + "application/json": { + "schema" : { + "$ref" : "#/components/schemas/response" + } + } + } + }, + "default" : { + "description" : "Unknown" + } + } + } + } + }, + "components": { + "schemas" : { + "response" : { # Noncompliant {{OAR029: 'status' property is missing}} + "type" : "object", + "allOf" : [ { + "$ref" : "#/components/schemas/standard_response" + } ], + "properties" : { + "data" : { + "type" : "object", + "properties" : { + "tipos" : { + "type" : "array", + "items" : { + "type" : "string" + } + } + } + } + } + }, + "standard_response" : { + "type" : "object", + "properties" : { + "response" : { + "type" : "object", + "properties" : { + "http_status" : { + "type" : "string" + }, + "code" : { + "type" : "integer" + }, + "errors" : { + "type" : "array", + "items" : { + "type" : "object", + "properties": { + "name": { + "type": "string" + }, + "value": { + "type": "string" + } + } + } + }, + "description" : { + "type" : "string" + }, + "internal_code" : { + "type" : "string" + } + }, + "required" : [ "http_status", "code", "description", "errors" ] + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/resources/OAR029/without-status.yaml b/src/test/resources/checks/v32/resources/OAR029/without-status.yaml new file mode 100644 index 00000000..de0781dd --- /dev/null +++ b/src/test/resources/checks/v32/resources/OAR029/without-status.yaml @@ -0,0 +1,66 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /endpoint: + get: + responses: + 200: + description: Ok + content: + application/json: + schema: + $ref: '#/components/schemas/response' + 204: + description: No content + 400: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/response' + default: + description: Unknown +components: + schemas: + response: # Noncompliant {{OAR029: 'status' property is missing}} + type: object + allOf: + - $ref: '#/components/schemas/standard_response' + properties: + data: + type: object + properties: + tipos: + type: array + items: + type: string + standard_response: + type: object + properties: + response: + type: object + properties: + http_status: + type: string + code: + type: integer + errors: + type: array + items: + type: object + properties: + name: + type: string + value: + type: string + description: + type: string + internal_code: + type: string + required: + - http_status + - code + - description + - errors diff --git a/src/test/resources/checks/v32/resources/OAR030/valid.json b/src/test/resources/checks/v32/resources/OAR030/valid.json new file mode 100644 index 00000000..69748c50 --- /dev/null +++ b/src/test/resources/checks/v32/resources/OAR030/valid.json @@ -0,0 +1,27 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/status" : { + "get" : { + "responses" : { + "200" : { + "description" : "Ok" + } + } + } + }, + "/other" : { + "get" : { + "responses" : { + "200" : { + "description" : "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/resources/OAR030/valid.yaml b/src/test/resources/checks/v32/resources/OAR030/valid.yaml new file mode 100644 index 00000000..1f15c90e --- /dev/null +++ b/src/test/resources/checks/v32/resources/OAR030/valid.yaml @@ -0,0 +1,15 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /status: + get: + responses: + 200: + description: Ok + /other: + get: + responses: + 200: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v32/resources/OAR030/with-status-without-get.json b/src/test/resources/checks/v32/resources/OAR030/with-status-without-get.json new file mode 100644 index 00000000..c3694e1b --- /dev/null +++ b/src/test/resources/checks/v32/resources/OAR030/with-status-without-get.json @@ -0,0 +1,27 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/status" : { # Noncompliant {{OAR030: Method get must be declared}} + "post" : { + "responses" : { + "200" : { + "description" : "Ok" + } + } + } + }, + "/other" : { + "get" : { + "responses" : { + "200" : { + "description" : "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/resources/OAR030/with-status-without-get.yaml b/src/test/resources/checks/v32/resources/OAR030/with-status-without-get.yaml new file mode 100644 index 00000000..e7b5a51f --- /dev/null +++ b/src/test/resources/checks/v32/resources/OAR030/with-status-without-get.yaml @@ -0,0 +1,15 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /status: # Noncompliant {{OAR030: Method get must be declared}} + post: + responses: + 200: + description: Ok + /other: + get: + responses: + 200: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v32/resources/OAR030/without-status.json b/src/test/resources/checks/v32/resources/OAR030/without-status.json new file mode 100644 index 00000000..5ae26a3c --- /dev/null +++ b/src/test/resources/checks/v32/resources/OAR030/without-status.json @@ -0,0 +1,18 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { # Noncompliant {{OAR030: The path '/status' must be declared}} + "/other" : { + "get" : { + "responses" : { + "200" : { + "description" : "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/resources/OAR030/without-status.yaml b/src/test/resources/checks/v32/resources/OAR030/without-status.yaml new file mode 100644 index 00000000..2a015345 --- /dev/null +++ b/src/test/resources/checks/v32/resources/OAR030/without-status.yaml @@ -0,0 +1,10 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: # Noncompliant {{OAR030: The path '/status' must be declared}} + /other: + get: + responses: + 200: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v32/resources/OAR031/valid.json b/src/test/resources/checks/v32/resources/OAR031/valid.json new file mode 100644 index 00000000..2beb36a3 --- /dev/null +++ b/src/test/resources/checks/v32/resources/OAR031/valid.json @@ -0,0 +1,170 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/pets": { + "post": { + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/pet" + }, + "example": { + "name": "Puppy", + "type": "dog" + } + } + } + }, + "responses": { + "201": { + "description": "Pet list", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/pet" + }, + "example": { + "name": "Puppy", + "type": "dog" + } + } + } + }, + "default": { + "$ref": "#/components/responses/server_error_response" + } + } + }, + "get": { + "responses": { + "206": { + "description": "Pet created", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/pets" + }, + "example": { + "size": 2, + "pets": [ + { + "name": "Fluffy", + "type": "cat" + }, + { + "name": "Sparky", + "type": "dog" + } + ] + } + } + } + }, + "default": { + "$ref": "#/components/responses/server_error_response" + } + } + } + }, + "/pets/{id}": { + "get": { + "parameters": [ + { + "$ref": "#/components/parameters/id" + } + ], + "responses": { + "200": { + "description": "One pet", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/pet" + }, + "example": { + "name": "Fluffy", + "type": "cat" + } + } + } + }, + "default": { + "$ref": "#/components/responses/server_error_response" + } + } + } + } + }, + "components": { + "parameters": { + "id": { + "in": "path", + "name": "id", + "schema": { + "type": "integer", + "format": "int64", + "maxLength": 22 + }, + "description": "Identificador del tipo de centro a obtener, actualizar o eliminar.", + "required": true, + "example": 513168138 + } + }, + "schemas": { + "pet": { + "type": "object", + "properties": { + "name": { + "type": "string", + "example": "Snow" + }, + "type": { + "type": "string", + "example": "dog" + } + } + }, + "pets": { + "type": "object", + "properties": { + "size": { + "type": "integer", + "example": 1 + }, + "pets": { + "type": "array", + "items": { + "$ref": "#/components/schemas/pet" + } + } + } + } + }, + "responses": { + "server_error_response": { + "description": "Default error response", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "example": "Server error" + } + } + }, + "example": { + "error": "Server error" + } + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/resources/OAR031/valid.yaml b/src/test/resources/checks/v32/resources/OAR031/valid.yaml new file mode 100644 index 00000000..d0100253 --- /dev/null +++ b/src/test/resources/checks/v32/resources/OAR031/valid.yaml @@ -0,0 +1,113 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: + post: + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/pet" + example: + name: Puppy + type: dog + responses: + 201: + description: Pet list + content: + application/json: + schema: + $ref: '#/components/schemas/pet' + example: + name: Puppy + type: dog + 204: + description: No content + default: + $ref: "#/components/responses/server_error_response" + get: + responses: + 204: + description: No content + 206: + description: Pet created + content: + application/json: + schema: + $ref: '#/components/schemas/pets' + example: + size: 2 + pets: + - name: Fluffy + type: cat + - name: Sparky + type: dog + default: + $ref: "#/components/responses/server_error_response" + /pets/{id}: + get: + parameters: + - $ref: "#/components/parameters/id" + responses: + 200: + description: One pet + content: + application/json: + schema: + $ref: "#/components/schemas/pet" + example: + name: Fluffy + type: cat + 204: + description: No content + default: + $ref: "#/components/responses/server_error_response" + +components: + parameters: + id: + in: path + name: id + schema: + type: integer + format: int64 + maxLength: 22 + example: 513168138 + description: Identificador del tipo de centro a obtener, actualizar o eliminar. + required: true + + schemas: + pet: + type: object + properties: + name: + type: string + example: "Snow" + type: + type: string + example: "dog" + pets: + type: object + properties: + size: + type: integer + example: 1 + pets: + type: array + items: + $ref: '#/components/schemas/pet' + responses: + server_error_response: + description: Default error response + content: + application/json: + schema: + type: object + properties: + error: + type: string + example: "Server error" + example: + error: "Server error" \ No newline at end of file diff --git a/src/test/resources/checks/v32/resources/OAR031/without-examples.json b/src/test/resources/checks/v32/resources/OAR031/without-examples.json new file mode 100644 index 00000000..40728d00 --- /dev/null +++ b/src/test/resources/checks/v32/resources/OAR031/without-examples.json @@ -0,0 +1,120 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/pets": { + "get": { + "responses": { + "206": { # Noncompliant {{OAR031: Responses must have one or more examples defined}} + "description": "Pet list", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/pets" + } + } + } + }, + "default": { + "$ref": "#/components/responses/server_error_response" + } + } + } + }, + "/pets/{id}": { + "parameters": [ + { # Noncompliant {{OAR031: Parameters must have one or more examples defined}} + "in": "query", + "name": "$start", + "schema": { + "type": "integer" + } + } + ], + "get": { + "parameters": [ + { + "$ref": "#/components/parameters/id" + } + ], + "responses": { + "200": { # Noncompliant {{OAR031: Responses must have one or more examples defined}} + "description": "One pet", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/pet" + } + } + } + }, + "default": { + "$ref": "#/components/responses/server_error_response" + } + } + } + } + }, + "components": { + "parameters": { + "id": { # Noncompliant {{OAR031: Parameters must have one or more examples defined}} + "in": "path", + "name": "id", + "schema": { + "type": "integer", + "format": "int64", + "maxLength": 22 + }, + "description": "Identificador del tipo de centro a obtener, actualizar o eliminar.", + "required": true + } + }, + "schemas": { + "pet": { + "type": "object", + "properties": { + "name": { # Noncompliant {{OAR031: Properties must have an example defined}} + "type": "string" + }, + "type": { # Noncompliant {{OAR031: Properties must have an example defined}} + "type": "string" + } + } + }, + "pets": { + "type": "object", + "properties": { + "size": { # Noncompliant {{OAR031: Properties must have an example defined}} + "type": "integer" + }, + "pets": { + "type": "array", + "items": { + "$ref": "#/components/schemas/pet" + } + } + } + } + }, + "responses": { + "server_error_response": { # Noncompliant {{OAR031: Responses must have one or more examples defined}} + "description": "Default error response", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "error": { # Noncompliant {{OAR031: Properties must have an example defined}} + "type": "string" + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/resources/OAR031/without-examples.yaml b/src/test/resources/checks/v32/resources/OAR031/without-examples.yaml new file mode 100644 index 00000000..ec8cd2a0 --- /dev/null +++ b/src/test/resources/checks/v32/resources/OAR031/without-examples.yaml @@ -0,0 +1,73 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: + get: + responses: + 206: # Noncompliant {{OAR031: Responses must have one or more examples defined}} + description: Pet list + content: + application/json: + schema: + $ref: '#/components/schemas/pets' + default: + $ref: "#/components/responses/server_error_response" + /pets/{id}: + parameters: + - in: query # Noncompliant {{OAR031: Parameters must have one or more examples defined}} + name: $start + schema: + type: integer + get: + parameters: + - $ref: "#/components/parameters/id" + responses: + 200: # Noncompliant {{OAR031: Responses must have one or more examples defined}} + description: One pet + content: + application/json: + schema: + $ref: "#/components/schemas/pet" + default: + $ref: "#/components/responses/server_error_response" + +components: + parameters: + id: + in: path # Noncompliant {{OAR031: Parameters must have one or more examples defined}} + name: id + schema: + type: integer + format: int64 + maxLength: 22 + description: Identificador del tipo de centro a obtener, actualizar o eliminar. + required: true + schemas: + pet: + type: object + properties: + name: # Noncompliant {{OAR031: Properties must have an example defined}} + type: string + type: # Noncompliant {{OAR031: Properties must have an example defined}} + type: string + pets: + type: object + properties: + size: # Noncompliant {{OAR031: Properties must have an example defined}} + type: integer + pets: + type: array + items: + $ref: '#/components/schemas/pet' + responses: + server_error_response: # Noncompliant {{OAR031: Responses must have one or more examples defined}} + description: Default error response + content: + application/json: + schema: + type: object + properties: + error: # Noncompliant {{OAR031: Properties must have an example defined}} + type: string \ No newline at end of file diff --git a/src/test/resources/checks/v32/resources/OAR032/forbidden-names.json b/src/test/resources/checks/v32/resources/OAR032/forbidden-names.json new file mode 100644 index 00000000..9c26b26f --- /dev/null +++ b/src/test/resources/checks/v32/resources/OAR032/forbidden-names.json @@ -0,0 +1,36 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/elements" : { # Noncompliant {{OAR032: Ambiguous path parts not encouraged: elements}} + "get" : { + "responses" : { + "200" : { + "description" : "Ok" + } + } + } + }, + "/a/nested/items" : { # Noncompliant {{OAR032: Ambiguous path parts not encouraged: items}} + "get" : { + "responses" : { + "200" : { + "description" : "Ok" + } + } + } + }, + "/another/{param}/with/valores" : { # Noncompliant {{OAR032: Ambiguous path parts not encouraged: valores}} + "get" : { + "responses" : { + "200" : { + "description" : "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/resources/OAR032/forbidden-names.yaml b/src/test/resources/checks/v32/resources/OAR032/forbidden-names.yaml new file mode 100644 index 00000000..2e3b2806 --- /dev/null +++ b/src/test/resources/checks/v32/resources/OAR032/forbidden-names.yaml @@ -0,0 +1,20 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /elements: # Noncompliant {{OAR032: Ambiguous path parts not encouraged: elements}} + get: + responses: + 200: + description: Ok + /a/nested/items: # Noncompliant {{OAR032: Ambiguous path parts not encouraged: items}} + get: + responses: + 200: + description: Ok + /another/{param}/with/valores: # Noncompliant {{OAR032: Ambiguous path parts not encouraged: valores}} + get: + responses: + 200: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v32/resources/OAR032/valid.json b/src/test/resources/checks/v32/resources/OAR032/valid.json new file mode 100644 index 00000000..bce9cd4c --- /dev/null +++ b/src/test/resources/checks/v32/resources/OAR032/valid.json @@ -0,0 +1,27 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/pets" : { + "get" : { + "responses" : { + "200" : { + "description" : "Ok" + } + } + } + }, + "/pets/{elements}" : { + "get" : { + "responses" : { + "200" : { + "description" : "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/resources/OAR032/valid.yaml b/src/test/resources/checks/v32/resources/OAR032/valid.yaml new file mode 100644 index 00000000..f26951f4 --- /dev/null +++ b/src/test/resources/checks/v32/resources/OAR032/valid.yaml @@ -0,0 +1,15 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: + get: + responses: + 200: + description: Ok + /pets/{elements}: + get: + responses: + 200: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v32/resources/OAR034/valid-all-of.json b/src/test/resources/checks/v32/resources/OAR034/valid-all-of.json new file mode 100644 index 00000000..0a433770 --- /dev/null +++ b/src/test/resources/checks/v32/resources/OAR034/valid-all-of.json @@ -0,0 +1,126 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/endpoint": { + "get": { + "responses": { + "206": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/response" + } + } + } + }, + "204": { + "description": "No content" + }, + "400": { + "description": "Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/response" + } + } + } + }, + "default": { + "description": "Unknown" + } + } + } + } + }, + "components": { + "schemas": { + "response": { + "type": "object", + "allOf": [ { + "$ref": "#/components/schemas/paged_response" + } ], + "properties": { + "data": { + "type": "object", + "properties": { + "values": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + }, + "paged_response": { + "type": "object", + "properties": { + "paging": { + "type": "object", + "properties": { + "start": { + "type": "integer" + }, + "limit": { + "type": "integer" + }, + "total": { + "type": "integer" + }, + "numPages": { + "type": "integer" + }, + "links": { + "type": "object", + "properties": { + "self": { + "allOf": [ { + "$ref": "#/components/schemas/link" + } ] + }, + "first": { + "allOf": [ { + "$ref": "#/components/schemas/link" + } ] + }, + "previous": { + "allOf": [ { + "$ref": "#/components/schemas/link" + } ] + }, + "next": { + "allOf": [ { + "$ref": "#/components/schemas/link" + } ] + }, + "last": { + "allOf": [ { + "$ref": "#/components/schemas/link" + } ] + } + }, + "required": [ "self", "previous", "next" ] + } + }, + "required": [ "start", "limit", "links" ] + } + } + }, + "link": { + "type": "object", + "properties": { + "href": { + "type": "string" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/resources/OAR034/valid-all-of.yaml b/src/test/resources/checks/v32/resources/OAR034/valid-all-of.yaml new file mode 100644 index 00000000..15669c82 --- /dev/null +++ b/src/test/resources/checks/v32/resources/OAR034/valid-all-of.yaml @@ -0,0 +1,84 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /endpoint: + get: + responses: + 206: + description: Ok + content: + application/json: + schema: + $ref: '#/components/schemas/response' + 204: + description: No content + 400: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/response' + default: + description: Unknown + +components: + schemas: + response: + type: object + allOf: + - $ref: '#/components/schemas/paged_response' + properties: + data: + type: object + properties: + values: + type: array + items: + type: string + paged_response: + type: object + properties: + paging: + type: object + properties: + start: + type: integer + limit: + type: integer + total: + type: integer + numPages: + type: integer + links: + type: object + properties: + self: + allOf: + - $ref: '#/components/schemas/link' + first: + allOf: + - $ref: '#/components/schemas/link' + previous: + allOf: + - $ref: '#/components/schemas/link' + next: + allOf: + - $ref: '#/components/schemas/link' + last: + allOf: + - $ref: '#/components/schemas/link' + required: + - self + - previous + - next + required: + - start + - limit + - links + link: + type: object + properties: + href: + type: string \ No newline at end of file diff --git a/src/test/resources/checks/v32/resources/OAR034/valid.json b/src/test/resources/checks/v32/resources/OAR034/valid.json new file mode 100644 index 00000000..242adbb8 --- /dev/null +++ b/src/test/resources/checks/v32/resources/OAR034/valid.json @@ -0,0 +1,116 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/endpoint": { + "get": { + "responses": { + "206": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/response" + } + } + } + }, + "204": { + "description": "No content" + }, + "400": { + "description": "Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/response" + } + } + } + }, + "default": { + "description": "Unknown" + } + } + } + } + }, + "components": { + "schemas": { + "response": { + "type": "object", + "allOf": [ { + "$ref": "#/components/schemas/paged_response" + } ], + "properties": { + "data": { + "type": "object", + "properties": { + "values": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + }, + "paged_response": { + "type": "object", + "properties": { + "paging": { + "type": "object", + "properties": { + "start": { + "type": "integer" + }, + "limit": { + "type": "integer" + }, + "total": { + "type": "integer" + }, + "numPages": { + "type": "integer" + }, + "links": { + "type": "object", + "properties": { + "self": { + "$ref": "#/components/schemas/link" + }, + "first": { + "$ref": "#/components/schemas/link" + }, + "previous": { + "$ref": "#/components/schemas/link" + }, + "next": { + "$ref": "#/components/schemas/link" + }, + "last": { + "$ref": "#/components/schemas/link" + } + }, + "required": [ "self", "previous", "next" ] + } + }, + "required": [ "start", "limit", "links" ] + } + } + }, + "link": { + "type": "object", + "properties": { + "href": { + "type": "string" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/resources/OAR034/valid.yaml b/src/test/resources/checks/v32/resources/OAR034/valid.yaml new file mode 100644 index 00000000..62da717a --- /dev/null +++ b/src/test/resources/checks/v32/resources/OAR034/valid.yaml @@ -0,0 +1,79 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /endpoint: + get: + responses: + 206: + description: Ok + content: + application/json: + schema: + $ref: '#/components/schemas/response' + 204: + description: No content + 400: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/response' + default: + description: Unknown + +components: + schemas: + response: + type: object + allOf: + - $ref: '#/components/schemas/paged_response' + properties: + data: + type: object + properties: + values: + type: array + items: + type: string + paged_response: + type: object + properties: + paging: + type: object + properties: + start: + type: integer + limit: + type: integer + total: + type: integer + numPages: + type: integer + links: + type: object + properties: + self: + $ref: '#/components/schemas/link' + first: + $ref: '#/components/schemas/link' + previous: + $ref: '#/components/schemas/link' + next: + $ref: '#/components/schemas/link' + last: + $ref: '#/components/schemas/link' + required: + - self + - previous + - next + required: + - start + - limit + - links + link: + type: object + properties: + href: + type: string \ No newline at end of file diff --git a/src/test/resources/checks/v32/resources/OAR034/with-links-without-properties.json b/src/test/resources/checks/v32/resources/OAR034/with-links-without-properties.json new file mode 100644 index 00000000..7f789dbc --- /dev/null +++ b/src/test/resources/checks/v32/resources/OAR034/with-links-without-properties.json @@ -0,0 +1,96 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/endpoint": { + "get": { + "responses": { + "206": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/response" + } + } + } + }, + "204": { + "description": "No content" + }, + "400": { + "description": "Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/response" + } + } + } + }, + "default": { + "description": "Unknown" + } + } + } + } + }, + "components": { + "schemas": { + "response": { + "type": "object", + "allOf": [ { + "$ref": "#/components/schemas/paged_response" + } ], + "properties": { + "data": { + "type": "object", + "properties": { + "values": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + }, + "paged_response": { + "type": "object", + "properties": { + "paging": { + "type": "object", + "properties": { + "start": { + "type": "integer" + }, + "limit": { + "type": "integer" + }, + "total": { + "type": "integer" + }, + "numPages": { + "type": "integer" + }, + "links": { # Noncompliant {{OAR034: 'first' property is missing}} {{OAR034: 'last' property is missing}} {{OAR034: 'next' property is missing}} {{OAR034: 'previous' property is missing}} {{OAR034: 'self' property is missing}} + "type": "object", + "properties": { + "name": { + "type": "string" + } + }, + "required": [ "self", "previous", "next" ] + } + }, + "required": [ "start", "limit", "links" ] + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/resources/OAR034/with-links-without-properties.yaml b/src/test/resources/checks/v32/resources/OAR034/with-links-without-properties.yaml new file mode 100644 index 00000000..3685c1f3 --- /dev/null +++ b/src/test/resources/checks/v32/resources/OAR034/with-links-without-properties.yaml @@ -0,0 +1,66 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /endpoint: + get: + responses: + 206: + description: Ok + content: + application/json: + schema: + $ref: '#/components/schemas/response' + 204: + description: No content + 400: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/response' + default: + description: Unknown + +components: + schemas: + response: + type: object + allOf: + - $ref: '#/components/schemas/paged_response' + properties: + data: + type: object + properties: + values: + type: array + items: + type: string + paged_response: + type: object + properties: + paging: + type: object + properties: + start: + type: integer + limit: + type: integer + total: + type: integer + numPages: + type: integer + links: # Noncompliant {{OAR034: 'first' property is missing}} {{OAR034: 'last' property is missing}} {{OAR034: 'next' property is missing}} {{OAR034: 'previous' property is missing}} {{OAR034: 'self' property is missing}} + type: object + properties: + name: + type: string + required: + - self + - previous + - next + required: + - start + - limit + - links \ No newline at end of file diff --git a/src/test/resources/checks/v32/resources/OAR034/with-paging-with-properties-wrong-types.json b/src/test/resources/checks/v32/resources/OAR034/with-paging-with-properties-wrong-types.json new file mode 100644 index 00000000..119921b1 --- /dev/null +++ b/src/test/resources/checks/v32/resources/OAR034/with-paging-with-properties-wrong-types.json @@ -0,0 +1,91 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/endpoint": { + "get": { + "responses": { + "206": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/response" + } + } + } + }, + "204": { + "description": "No content" + }, + "400": { + "description": "Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/response" + } + } + } + }, + "default": { + "description": "Unknown" + } + } + } + } + }, + "components": { + "schemas": { + "response": { + "type": "object", + "allOf": [ { + "$ref": "#/components/schemas/paged_response" + } ], + "properties": { + "data": { + "type": "object", + "properties": { + "values": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + }, + "paged_response": { + "type": "object", + "properties": { + "paging": { + "type": "object", + "properties": { + "start": { + "type": "string" # Noncompliant {{OAR034: 'start' must be of type integer}} + }, + "limit": { + "type": "string" # Noncompliant {{OAR034: 'limit' must be of type integer}} + }, + "total": { + "type": "string" # Noncompliant {{OAR034: 'total' must be of type integer}} + }, + "numPages": { + "type": "string" # Noncompliant {{OAR034: 'numPages' must be of type integer}} + }, + "links": { + "type": "string", # Noncompliant {{OAR034: 'links' must be of type object}} + "required": [ "self", "previous", "next" ] + } + }, + "required": [ "start", "limit", "links" ] + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/resources/OAR034/with-paging-with-properties-wrong-types.yaml b/src/test/resources/checks/v32/resources/OAR034/with-paging-with-properties-wrong-types.yaml new file mode 100644 index 00000000..4d725aca --- /dev/null +++ b/src/test/resources/checks/v32/resources/OAR034/with-paging-with-properties-wrong-types.yaml @@ -0,0 +1,63 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /endpoint: + get: + responses: + 206: + description: Ok + content: + application/json: + schema: + $ref: '#/components/schemas/response' + 204: + description: No content + 400: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/response' + default: + description: Unknown + +components: + schemas: + response: + type: object + allOf: + - $ref: '#/components/schemas/paged_response' + properties: + data: + type: object + properties: + values: + type: array + items: + type: string + paged_response: + type: object + properties: + paging: + type: object + properties: + start: + type: string # Noncompliant {{OAR034: 'start' must be of type integer}} + limit: + type: string # Noncompliant {{OAR034: 'limit' must be of type integer}} + total: + type: string # Noncompliant {{OAR034: 'total' must be of type integer}} + numPages: + type: string # Noncompliant {{OAR034: 'numPages' must be of type integer}} + links: + type: string # Noncompliant {{OAR034: 'links' must be of type object}} + required: + - self + - previous + - next + required: + - start + - limit + - links \ No newline at end of file diff --git a/src/test/resources/checks/v32/resources/OAR034/with-paging-without-properties.json b/src/test/resources/checks/v32/resources/OAR034/with-paging-without-properties.json new file mode 100644 index 00000000..ed4ab056 --- /dev/null +++ b/src/test/resources/checks/v32/resources/OAR034/with-paging-without-properties.json @@ -0,0 +1,78 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/endpoint": { + "get": { + "responses": { + "206": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/response" + } + } + } + }, + "204": { + "description": "No content" + }, + "400": { + "description": "Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/response" + } + } + } + }, + "default": { + "description": "Unknown" + } + } + } + } + }, + "components": { + "schemas": { + "response": { + "type": "object", + "allOf": [ { + "$ref": "#/components/schemas/paged_response" + } ], + "properties": { + "data": { + "type": "object", + "properties": { + "values": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + }, + "paged_response": { + "type": "object", + "properties": { + "paging": { # Noncompliant {{OAR034: 'limit' property is missing}} {{OAR034: 'links' property is missing}} {{OAR034: 'numPages' property is missing}} {{OAR034: 'start' property is missing}} {{OAR034: 'total' property is missing}} + "type": "object", + "properties": { + "name": { + "type": "string" + } + }, + "required": [ "start", "limit", "links" ] + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/resources/OAR034/with-paging-without-properties.yaml b/src/test/resources/checks/v32/resources/OAR034/with-paging-without-properties.yaml new file mode 100644 index 00000000..153ece2f --- /dev/null +++ b/src/test/resources/checks/v32/resources/OAR034/with-paging-without-properties.yaml @@ -0,0 +1,51 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /endpoint: + get: + responses: + 206: + description: Ok + content: + application/json: + schema: + $ref: '#/components/schemas/response' + 204: + description: No content + 400: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/response' + default: + description: Unknown + +components: + schemas: + response: + type: object + allOf: + - $ref: '#/components/schemas/paged_response' + properties: + data: + type: object + properties: + values: + type: array + items: + type: string + paged_response: + type: object + properties: + paging: # Noncompliant {{OAR034: 'limit' property is missing}} {{OAR034: 'links' property is missing}} {{OAR034: 'numPages' property is missing}} {{OAR034: 'start' property is missing}} {{OAR034: 'total' property is missing}} + type: object + properties: + name: + type: string + required: + - start + - limit + - links \ No newline at end of file diff --git a/src/test/resources/checks/v32/resources/OAR034/with-paging-wrong-type.json b/src/test/resources/checks/v32/resources/OAR034/with-paging-wrong-type.json new file mode 100644 index 00000000..d9966a0b --- /dev/null +++ b/src/test/resources/checks/v32/resources/OAR034/with-paging-wrong-type.json @@ -0,0 +1,73 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/endpoint": { + "get": { + "responses": { + "206": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/response" + } + } + } + }, + "204": { + "description": "No content" + }, + "400": { + "description": "Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/response" + } + } + } + }, + "default": { + "description": "Unknown" + } + } + } + } + }, + "components": { + "schemas": { + "response": { + "type": "object", + "allOf": [ { + "$ref": "#/components/schemas/paged_response" + } ], + "properties": { + "data": { + "type": "object", + "properties": { + "values": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + }, + "paged_response": { + "type": "object", + "properties": { + "paging": { + "type": "string", # Noncompliant {{OAR034: 'paging' must be of type object}} + "required": [ "start", "limit", "links" ] + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/resources/OAR034/with-paging-wrong-type.yaml b/src/test/resources/checks/v32/resources/OAR034/with-paging-wrong-type.yaml new file mode 100644 index 00000000..33d666d9 --- /dev/null +++ b/src/test/resources/checks/v32/resources/OAR034/with-paging-wrong-type.yaml @@ -0,0 +1,48 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /endpoint: + get: + responses: + 206: + description: Ok + content: + application/json: + schema: + $ref: '#/components/schemas/response' + 204: + description: No content + 400: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/response' + default: + description: Unknown + +components: + schemas: + response: + type: object + allOf: + - $ref: '#/components/schemas/paged_response' + properties: + data: + type: object + properties: + values: + type: array + items: + type: string + paged_response: + type: object + properties: + paging: + type: string # Noncompliant {{OAR034: 'paging' must be of type object}} + required: + - start + - limit + - links \ No newline at end of file diff --git a/src/test/resources/checks/v32/resources/OAR034/without-links-required-fields.json b/src/test/resources/checks/v32/resources/OAR034/without-links-required-fields.json new file mode 100644 index 00000000..5ecd5e4b --- /dev/null +++ b/src/test/resources/checks/v32/resources/OAR034/without-links-required-fields.json @@ -0,0 +1,116 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/endpoint": { + "get": { + "responses": { + "206": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/response" + } + } + } + }, + "204": { + "description": "No content" + }, + "400": { + "description": "Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/response" + } + } + } + }, + "default": { + "description": "Unknown" + } + } + } + } + }, + "components": { + "schemas": { + "response": { + "type": "object", + "allOf": [ { + "$ref": "#/components/schemas/paged_response" + } ], + "properties": { + "data": { + "type": "object", + "properties": { + "values": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + }, + "paged_response": { + "type": "object", + "properties": { + "paging": { + "type": "object", + "properties": { + "start": { + "type": "integer" + }, + "limit": { + "type": "integer" + }, + "total": { + "type": "integer" + }, + "numPages": { + "type": "integer" + }, + "links": { + "type": "object", + "properties": { + "self": { + "$ref": "#/components/schemas/link" + }, + "first": { + "$ref": "#/components/schemas/link" + }, + "previous": { + "$ref": "#/components/schemas/link" + }, + "next": { + "$ref": "#/components/schemas/link" + }, + "last": { + "$ref": "#/components/schemas/link" + } + }, + "required": [ "self" ] # Noncompliant {{OAR034: The following fields must be required: next, previous, self}} + } + }, + "required": [ "start", "limit", "links" ] + } + } + }, + "link": { + "type": "object", + "properties": { + "href": { + "type": "string" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/resources/OAR034/without-links-required-fields.yaml b/src/test/resources/checks/v32/resources/OAR034/without-links-required-fields.yaml new file mode 100644 index 00000000..3ca7987e --- /dev/null +++ b/src/test/resources/checks/v32/resources/OAR034/without-links-required-fields.yaml @@ -0,0 +1,77 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /endpoint: + get: + responses: + 206: + description: Ok + content: + application/json: + schema: + $ref: '#/components/schemas/response' + 204: + description: No content + 400: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/response' + default: + description: Unknown + +components: + schemas: + response: + type: object + allOf: + - $ref: '#/components/schemas/paged_response' + properties: + data: + type: object + properties: + values: + type: array + items: + type: string + paged_response: + type: object + properties: + paging: + type: object + properties: + start: + type: integer + limit: + type: integer + total: + type: integer + numPages: + type: integer + links: + type: object + properties: + self: + $ref: '#/components/schemas/link' + first: + $ref: '#/components/schemas/link' + previous: + $ref: '#/components/schemas/link' + next: + $ref: '#/components/schemas/link' + last: + $ref: '#/components/schemas/link' + required: # Noncompliant {{OAR034: The following fields must be required: next, previous, self}} + - self + required: + - start + - limit + - links + link: + type: object + properties: + href: + type: string \ No newline at end of file diff --git a/src/test/resources/checks/v32/resources/OAR034/without-pagination-required-fields.json b/src/test/resources/checks/v32/resources/OAR034/without-pagination-required-fields.json new file mode 100644 index 00000000..fd7e6e38 --- /dev/null +++ b/src/test/resources/checks/v32/resources/OAR034/without-pagination-required-fields.json @@ -0,0 +1,116 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/endpoint": { + "get": { + "responses": { + "206": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/response" + } + } + } + }, + "204": { + "description": "No content" + }, + "400": { + "description": "Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/response" + } + } + } + }, + "default": { + "description": "Unknown" + } + } + } + } + }, + "components": { + "schemas": { + "response": { + "type": "object", + "allOf": [ { + "$ref": "#/components/schemas/paged_response" + } ], + "properties": { + "data": { + "type": "object", + "properties": { + "values": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + }, + "paged_response": { + "type": "object", + "properties": { + "paging": { + "type": "object", + "properties": { + "start": { + "type": "integer" + }, + "limit": { + "type": "integer" + }, + "total": { + "type": "integer" + }, + "numPages": { + "type": "integer" + }, + "links": { + "type": "object", + "properties": { + "self": { + "$ref": "#/components/schemas/link" + }, + "first": { + "$ref": "#/components/schemas/link" + }, + "previous": { + "$ref": "#/components/schemas/link" + }, + "next": { + "$ref": "#/components/schemas/link" + }, + "last": { + "$ref": "#/components/schemas/link" + } + }, + "required": [ "self", "previous", "next" ] + } + }, + "required": [ "start" ] # Noncompliant {{OAR034: The following fields must be required: limit, links, start}} + } + } + }, + "link": { + "type": "object", + "properties": { + "href": { + "type": "string" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/resources/OAR034/without-pagination-required-fields.yaml b/src/test/resources/checks/v32/resources/OAR034/without-pagination-required-fields.yaml new file mode 100644 index 00000000..cc4c316a --- /dev/null +++ b/src/test/resources/checks/v32/resources/OAR034/without-pagination-required-fields.yaml @@ -0,0 +1,77 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /endpoint: + get: + responses: + 206: + description: Ok + content: + application/json: + schema: + $ref: '#/components/schemas/response' + 204: + description: No content + 400: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/response' + default: + description: Unknown + +components: + schemas: + response: + type: object + allOf: + - $ref: '#/components/schemas/paged_response' + properties: + data: + type: object + properties: + values: + type: array + items: + type: string + paged_response: + type: object + properties: + paging: + type: object + properties: + start: + type: integer + limit: + type: integer + total: + type: integer + numPages: + type: integer + links: + type: object + properties: + self: + $ref: '#/components/schemas/link' + first: + $ref: '#/components/schemas/link' + previous: + $ref: '#/components/schemas/link' + next: + $ref: '#/components/schemas/link' + last: + $ref: '#/components/schemas/link' + required: + - self + - previous + - next + required: # Noncompliant {{OAR034: The following fields must be required: limit, links, start}} + - start + link: + type: object + properties: + href: + type: string \ No newline at end of file diff --git a/src/test/resources/checks/v32/resources/OAR034/without-paging.json b/src/test/resources/checks/v32/resources/OAR034/without-paging.json new file mode 100644 index 00000000..4fb4a8e9 --- /dev/null +++ b/src/test/resources/checks/v32/resources/OAR034/without-paging.json @@ -0,0 +1,61 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/endpoint": { + "get": { + "responses": { + "206": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/response" + } + } + } + }, + "204": { + "description": "No content" + }, + "400": { + "description": "Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/response" + } + } + } + }, + "default": { + "description": "Unknown" + } + } + } + } + }, + "components": { + "schemas": { + "response": { # Noncompliant {{OAR034: 'paging' property is missing}} + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "values": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/resources/OAR034/without-paging.yaml b/src/test/resources/checks/v32/resources/OAR034/without-paging.yaml new file mode 100644 index 00000000..0bb219ab --- /dev/null +++ b/src/test/resources/checks/v32/resources/OAR034/without-paging.yaml @@ -0,0 +1,37 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /endpoint: + get: + responses: + 206: + description: Ok + content: + application/json: + schema: + $ref: '#/components/schemas/response' + 204: + description: No content + 400: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/response' + default: + description: Unknown + +components: + schemas: + response: # Noncompliant {{OAR034: 'paging' property is missing}} + type: object + properties: + data: + type: object + properties: + values: + type: array + items: + type: string \ No newline at end of file diff --git a/src/test/resources/checks/v32/resources/OAR038/valid-multiple-properties.json b/src/test/resources/checks/v32/resources/OAR038/valid-multiple-properties.json new file mode 100644 index 00000000..6c5aa7f8 --- /dev/null +++ b/src/test/resources/checks/v32/resources/OAR038/valid-multiple-properties.json @@ -0,0 +1,48 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/endpoint" : { + "post" : { + "responses" : { + "201" : { + "description" : "Ok", + "content": { + "application/json":{ + "schema" : { + "$ref" : "#/components/schemas/response" + } + } + } + }, + "204" : { + "description" : "No content" + } + } + } + } + }, + "components": { + "schemas": { + "response" : { + "type" : "object", + "properties" : { + "data" : { + "type" : "object", + "properties" : { + "id" : { + "type" : "string" + }, + "name" : { + "type" : "string" + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/resources/OAR038/valid-multiple-properties.yaml b/src/test/resources/checks/v32/resources/OAR038/valid-multiple-properties.yaml new file mode 100644 index 00000000..64c4f794 --- /dev/null +++ b/src/test/resources/checks/v32/resources/OAR038/valid-multiple-properties.yaml @@ -0,0 +1,29 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /endpoint: + post: + responses: + 201: + description: Ok + content: + application/json: + schema: + $ref: '#/components/schemas/response' + 204: + description: No content + +components: + schemas: + response: + type: object + properties: + data: + type: object + properties: + id: + type: string + name: + type: string diff --git a/src/test/resources/checks/v32/resources/OAR038/valid-one-property.json b/src/test/resources/checks/v32/resources/OAR038/valid-one-property.json new file mode 100644 index 00000000..76dae630 --- /dev/null +++ b/src/test/resources/checks/v32/resources/OAR038/valid-one-property.json @@ -0,0 +1,45 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/endpoint" : { + "post" : { + "responses" : { + "201" : { + "description" : "Ok", + "content": { + "application/json":{ + "schema" : { + "$ref" : "#/components/schemas/response" + } + } + } + }, + "204" : { + "description" : "No content" + } + } + } + } + }, + "components": { + "schemas": { + "response" : { + "type" : "object", + "properties" : { + "data" : { + "type" : "object", + "properties" : { + "id" : { + "type" : "string" + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/resources/OAR038/valid-one-property.yaml b/src/test/resources/checks/v32/resources/OAR038/valid-one-property.yaml new file mode 100644 index 00000000..6a93ee9d --- /dev/null +++ b/src/test/resources/checks/v32/resources/OAR038/valid-one-property.yaml @@ -0,0 +1,27 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /endpoint: + post: + responses: + 201: + description: Ok + content: + application/json: + schema: + $ref: '#/components/schemas/response' + 204: + description: No content + +components: + schemas: + response: + type: object + properties: + data: + type: object + properties: + id: + type: string diff --git a/src/test/resources/checks/v32/resources/OAR038/with-properties-empty.json b/src/test/resources/checks/v32/resources/OAR038/with-properties-empty.json new file mode 100644 index 00000000..8f2032d6 --- /dev/null +++ b/src/test/resources/checks/v32/resources/OAR038/with-properties-empty.json @@ -0,0 +1,41 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/endpoint" : { + "post" : { + "responses" : { + "201" : { + "description" : "Ok", + "content": { + "application/json":{ + "schema" : { + "$ref" : "#/components/schemas/response" + } + } + } + }, + "204" : { + "description" : "No content" + } + } + } + } + }, + "components": { + "schemas": { + "response" : { + "type" : "object", + "properties" : { + "data" : { # Noncompliant {{OAR038: At least you have to define the identifier property}} + "type" : "object", + "properties" : { } + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/resources/OAR038/with-properties-empty.yaml b/src/test/resources/checks/v32/resources/OAR038/with-properties-empty.yaml new file mode 100644 index 00000000..4680fd0a --- /dev/null +++ b/src/test/resources/checks/v32/resources/OAR038/with-properties-empty.yaml @@ -0,0 +1,25 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /endpoint: + post: + responses: + 201: + description: Ok + content: + application/json: + schema: + $ref: '#/components/schemas/response' + 204: + description: No content + +components: + schemas: + response: + type: object + properties: + data: # Noncompliant {{OAR038: At least you have to define the identifier property}} + type: object + properties: {} diff --git a/src/test/resources/checks/v32/resources/OAR038/without-data.json b/src/test/resources/checks/v32/resources/OAR038/without-data.json new file mode 100644 index 00000000..a6d5f9a6 --- /dev/null +++ b/src/test/resources/checks/v32/resources/OAR038/without-data.json @@ -0,0 +1,35 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/endpoint" : { + "post" : { + "responses" : { + "201" : { + "description" : "Ok", + "content": { + "application/json":{ + "schema" : { + "$ref" : "#/components/schemas/response" + } + } + } + }, + "204" : { + "description" : "No content" + } + } + } + } + }, + "components": { + "schemas" : { + "response" : { # Noncompliant {{OAR038: 'data' property is missing}} + "type" : "object" + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/resources/OAR038/without-data.yaml b/src/test/resources/checks/v32/resources/OAR038/without-data.yaml new file mode 100644 index 00000000..b64463dd --- /dev/null +++ b/src/test/resources/checks/v32/resources/OAR038/without-data.yaml @@ -0,0 +1,21 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /endpoint: + post: + responses: + 201: + description: Ok + content: + application/json: + schema: + $ref: '#/components/schemas/response' + 204: + description: No content + +components: + schemas: + response: # Noncompliant {{OAR038: 'data' property is missing}} + type: object \ No newline at end of file diff --git a/src/test/resources/checks/v32/resources/OAR038/without-properties.json b/src/test/resources/checks/v32/resources/OAR038/without-properties.json new file mode 100644 index 00000000..3573e876 --- /dev/null +++ b/src/test/resources/checks/v32/resources/OAR038/without-properties.json @@ -0,0 +1,53 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/endpoint": { + "post": { + "responses": { + "201": { + "$ref": "#/components/responses/createResponse" + }, + "204": { + "description": "No content" + } + } + } + } + }, + "components": { + "schemas": { + "response": { + "type": "object", + "allOf": [ + { + "$ref": "#/components/schemas/post_response" + } + ] + }, + "post_response": { + "type": "object", + "properties": { + "data": { # Noncompliant {{OAR038: At least you have to define the identifier property}} + "type": "object" + } + } + } + }, + "responses": { + "createResponse": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/response" + } + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/resources/OAR038/without-properties.yaml b/src/test/resources/checks/v32/resources/OAR038/without-properties.yaml new file mode 100644 index 00000000..b57f97f7 --- /dev/null +++ b/src/test/resources/checks/v32/resources/OAR038/without-properties.yaml @@ -0,0 +1,33 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /endpoint: + post: + responses: + 201: + $ref: '#/components/responses/createResponse' + 204: + description: No content + +components: + schemas: + response: + type: object + allOf: + - $ref: '#/components/schemas/post_response' + + post_response: + type: object + properties: + data: # Noncompliant {{OAR038: At least you have to define the identifier property}} + type: object + + responses: + createResponse: + description: Ok + content: + application/json: + schema: + $ref: '#/components/schemas/response' \ No newline at end of file diff --git a/src/test/resources/checks/v32/resources/OAR038/without-schema.json b/src/test/resources/checks/v32/resources/OAR038/without-schema.json new file mode 100644 index 00000000..8cdacdba --- /dev/null +++ b/src/test/resources/checks/v32/resources/OAR038/without-schema.json @@ -0,0 +1,21 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/endpoint" : { + "post" : { + "responses" : { + "201" : { # Noncompliant {{OAR038: Response schema is required}} + "description" : "Ok" + }, + "204" : { + "description" : "No content" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/resources/OAR038/without-schema.yaml b/src/test/resources/checks/v32/resources/OAR038/without-schema.yaml new file mode 100644 index 00000000..5ec0e410 --- /dev/null +++ b/src/test/resources/checks/v32/resources/OAR038/without-schema.yaml @@ -0,0 +1,12 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /endpoint: + post: + responses: + 201: # Noncompliant {{OAR038: Response schema is required}} + description: Ok + 204: + description: No content \ No newline at end of file diff --git a/src/test/resources/checks/v32/resources/OAR039/missing-codes.json b/src/test/resources/checks/v32/resources/OAR039/missing-codes.json new file mode 100644 index 00000000..1495f285 --- /dev/null +++ b/src/test/resources/checks/v32/resources/OAR039/missing-codes.json @@ -0,0 +1,109 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths": { + "/pets": { + "get": { + "responses": { # Noncompliant {{OAR039: Response code 200 or 206 must be defined}} {{OAR039: Response code 400 must be defined}} {{OAR039: Response code 500 must be defined}} {{OAR039: Response code 503 must be defined}} + "default": { + "description": "Unexpected error" + } + } + }, + "post": { + "responses": { # Noncompliant {{OAR039: Response code 200 or 201 or 202 must be defined}} {{OAR039: Response code 400 must be defined}} {{OAR039: Response code 415 must be defined}} {{OAR039: Response code 500 must be defined}} {{OAR039: Response code 503 must be defined}} + "default": { + "description": "Unexpected error" + } + } + } + }, + "/pets/get": { + "post": { + "responses": { # Noncompliant {{OAR039: Response code 200 must be defined}} {{OAR039: Response code 400 must be defined}} {{OAR039: Response code 404 must be defined}} {{OAR039: Response code 415 must be defined}} {{OAR039: Response code 500 must be defined}} {{OAR039: Response code 503 must be defined}} + "default": { + "description": "Unexpected error" + } + } + } + }, + "/pets/delete": { + "post": { + "responses": { # Noncompliant {{OAR039: Response code 200 must be defined}} {{OAR039: Response code 400 must be defined}} {{OAR039: Response code 404 must be defined}} {{OAR039: Response code 415 must be defined}} {{OAR039: Response code 500 must be defined}} {{OAR039: Response code 503 must be defined}} + "default": { + "description": "Unexpected error" + } + } + } + }, + "/pets/{id}": { + "get": { + "responses": { # Noncompliant {{OAR039: Response code 200 must be defined}} {{OAR039: Response code 400 must be defined}} {{OAR039: Response code 404 must be defined}} {{OAR039: Response code 500 must be defined}} {{OAR039: Response code 503 must be defined}} + "default": { + "description": "Unexpected error" + } + } + }, + "put": { + "responses": { # Noncompliant {{OAR039: Response code 200 must be defined}} {{OAR039: Response code 400 must be defined}} {{OAR039: Response code 404 must be defined}} {{OAR039: Response code 415 must be defined}} {{OAR039: Response code 500 must be defined}} {{OAR039: Response code 503 must be defined}} + "default": { + "description": "Unexpected error" + } + } + }, + "patch": { + "responses": { # Noncompliant {{OAR039: Response code 200 must be defined}} {{OAR039: Response code 400 must be defined}} {{OAR039: Response code 404 must be defined}} {{OAR039: Response code 415 must be defined}} {{OAR039: Response code 500 must be defined}} {{OAR039: Response code 503 must be defined}} + "default": { + "description": "Unexpected error" + } + } + }, + "delete": { + "responses": { # Noncompliant {{OAR039: Response code 200 must be defined}} {{OAR039: Response code 400 must be defined}} {{OAR039: Response code 404 must be defined}} {{OAR039: Response code 500 must be defined}} {{OAR039: Response code 503 must be defined}} + "default": { + "description": "Unexpected error" + } + } + } + }, + "/pets/{id}/owner": { + "post": { + "responses": { # Noncompliant {{OAR039: Response code 200 or 201 or 202 must be defined}} {{OAR039: Response code 400 must be defined}} {{OAR039: Response code 404 must be defined}} {{OAR039: Response code 415 must be defined}} {{OAR039: Response code 500 must be defined}} {{OAR039: Response code 503 must be defined}} + "default": { + "description": "Unexpected error" + } + } + } + }, + "/pets/{id}/owner/get": { + "post": { + "responses": { # Noncompliant {{OAR039: Response code 200 must be defined}} {{OAR039: Response code 400 must be defined}} {{OAR039: Response code 404 must be defined}} {{OAR039: Response code 415 must be defined}} {{OAR039: Response code 500 must be defined}} {{OAR039: Response code 503 must be defined}} + "default": { + "description": "Unexpected error" + } + } + } + }, + "/pets/{id}/owner/delete": { + "post": { + "responses": { # Noncompliant {{OAR039: Response code 200 must be defined}} {{OAR039: Response code 400 must be defined}} {{OAR039: Response code 404 must be defined}} {{OAR039: Response code 415 must be defined}} {{OAR039: Response code 500 must be defined}} {{OAR039: Response code 503 must be defined}} + "default": { + "description": "Unexpected error" + } + } + } + }, + "/status": { + "get": { + "responses": { + "default": { + "description": "Unexpected error" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/resources/OAR039/missing-codes.yaml b/src/test/resources/checks/v32/resources/OAR039/missing-codes.yaml new file mode 100644 index 00000000..b2be1e3d --- /dev/null +++ b/src/test/resources/checks/v32/resources/OAR039/missing-codes.yaml @@ -0,0 +1,68 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: + get: + responses: # Noncompliant {{OAR039: Response code 200 or 206 must be defined}} {{OAR039: Response code 400 must be defined}} {{OAR039: Response code 500 must be defined}} {{OAR039: Response code 503 must be defined}} + default: + description: Unexpected error + post: + responses: # Noncompliant {{OAR039: Response code 200 or 201 or 202 must be defined}} {{OAR039: Response code 400 must be defined}} {{OAR039: Response code 415 must be defined}} {{OAR039: Response code 500 must be defined}} {{OAR039: Response code 503 must be defined}} + default: + description: Unexpected error + + /pets/get: + post: + responses: # Noncompliant {{OAR039: Response code 200 must be defined}} {{OAR039: Response code 400 must be defined}} {{OAR039: Response code 404 must be defined}} {{OAR039: Response code 415 must be defined}} {{OAR039: Response code 500 must be defined}} {{OAR039: Response code 503 must be defined}} + default: + description: Unexpected error + + /pets/delete: + post: + responses: # Noncompliant {{OAR039: Response code 200 must be defined}} {{OAR039: Response code 400 must be defined}} {{OAR039: Response code 404 must be defined}} {{OAR039: Response code 415 must be defined}} {{OAR039: Response code 500 must be defined}} {{OAR039: Response code 503 must be defined}} + default: + description: Unexpected error + + /pets/{id}: + get: + responses: # Noncompliant {{OAR039: Response code 200 must be defined}} {{OAR039: Response code 400 must be defined}} {{OAR039: Response code 404 must be defined}} {{OAR039: Response code 500 must be defined}} {{OAR039: Response code 503 must be defined}} + default: + description: Unexpected error + put: + responses: # Noncompliant {{OAR039: Response code 200 must be defined}} {{OAR039: Response code 400 must be defined}} {{OAR039: Response code 404 must be defined}} {{OAR039: Response code 415 must be defined}} {{OAR039: Response code 500 must be defined}} {{OAR039: Response code 503 must be defined}} + default: + description: Unexpected error + patch: + responses: # Noncompliant {{OAR039: Response code 200 must be defined}} {{OAR039: Response code 400 must be defined}} {{OAR039: Response code 404 must be defined}} {{OAR039: Response code 415 must be defined}} {{OAR039: Response code 500 must be defined}} {{OAR039: Response code 503 must be defined}} + default: + description: Unexpected error + delete: + responses: # Noncompliant {{OAR039: Response code 200 must be defined}} {{OAR039: Response code 400 must be defined}} {{OAR039: Response code 404 must be defined}} {{OAR039: Response code 500 must be defined}} {{OAR039: Response code 503 must be defined}} + default: + description: Unexpected error + + /pets/{id}/owner: + post: + responses: # Noncompliant {{OAR039: Response code 200 or 201 or 202 must be defined}} {{OAR039: Response code 400 must be defined}} {{OAR039: Response code 404 must be defined}} {{OAR039: Response code 415 must be defined}} {{OAR039: Response code 500 must be defined}} {{OAR039: Response code 503 must be defined}} + default: + description: Unexpected error + + /pets/{id}/owner/get: + post: + responses: # Noncompliant {{OAR039: Response code 200 must be defined}} {{OAR039: Response code 400 must be defined}} {{OAR039: Response code 404 must be defined}} {{OAR039: Response code 415 must be defined}} {{OAR039: Response code 500 must be defined}} {{OAR039: Response code 503 must be defined}} + default: + description: Unexpected error + + /pets/{id}/owner/delete: + post: + responses: # Noncompliant {{OAR039: Response code 200 must be defined}} {{OAR039: Response code 400 must be defined}} {{OAR039: Response code 404 must be defined}} {{OAR039: Response code 415 must be defined}} {{OAR039: Response code 500 must be defined}} {{OAR039: Response code 503 must be defined}} + default: + description: Unexpected error + + /status: + get: + responses: + default: + description: Unexpected error \ No newline at end of file diff --git a/src/test/resources/checks/v32/resources/OAR039/valid.json b/src/test/resources/checks/v32/resources/OAR039/valid.json new file mode 100644 index 00000000..59eaf067 --- /dev/null +++ b/src/test/resources/checks/v32/resources/OAR039/valid.json @@ -0,0 +1,283 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths": { + "/pets": { + "get": { + "responses": { + "206": { + "description": "Partial collection" + }, + "400": { + "description": "Bad request" + }, + "500": { + "description": "Internal server error" + }, + "503": { + "description": "Service unavailable" + } + } + }, + "post": { + "responses": { + "201": { + "description": "Created" + }, + "400": { + "description": "Bad request" + }, + "413": { + "description": "Payload too large" + }, + "415": { + "description": "Unsupported media type" + }, + "500": { + "description": "Internal server error" + }, + "503": { + "description": "Service unavailable" + } + } + } + }, + "/pets/get": { + "post": { + "responses": { + "200": { + "description": "Ok" + }, + "400": { + "description": "Bad request" + }, + "404": { + "description": "Not found" + }, + "413": { + "description": "Payload too large" + }, + "415": { + "description": "Unsupported media type" + }, + "500": { + "description": "Internal server error" + }, + "503": { + "description": "Service unavailable" + } + } + } + }, + "/pets/delete": { + "post": { + "responses": { + "200": { + "description": "Ok" + }, + "400": { + "description": "Bad request" + }, + "404": { + "description": "Not found" + }, + "413": { + "description": "Payload too large" + }, + "415": { + "description": "Unsupported media type" + }, + "500": { + "description": "Internal server error" + }, + "503": { + "description": "Service unavailable" + } + } + } + }, + "/pets/{id}": { + "get": { + "responses": { + "200": { + "description": "Ok" + }, + "400": { + "description": "Bad request" + }, + "404": { + "description": "Not found" + }, + "500": { + "description": "Internal server error" + }, + "503": { + "description": "Service unavailable" + } + } + }, + "put": { + "responses": { + "200": { + "description": "Ok" + }, + "400": { + "description": "Bad request" + }, + "404": { + "description": "Not found" + }, + "413": { + "description": "Payload too large" + }, + "415": { + "description": "Unsupported media type" + }, + "500": { + "description": "Internal server error" + }, + "503": { + "description": "Service unavailable" + } + } + }, + "patch": { + "responses": { + "200": { + "description": "Ok" + }, + "400": { + "description": "Bad request" + }, + "404": { + "description": "Not found" + }, + "413": { + "description": "Payload too large" + }, + "415": { + "description": "Unsupported media type" + }, + "500": { + "description": "Internal server error" + }, + "503": { + "description": "Service unavailable" + } + } + }, + "delete": { + "responses": { + "200": { + "description": "Ok" + }, + "400": { + "description": "Bad request" + }, + "404": { + "description": "Not found" + }, + "500": { + "description": "Internal server error" + }, + "503": { + "description": "Service unavailable" + } + } + } + }, + "/pets/{id}/owner": { + "post": { + "responses": { + "201": { + "description": "Created" + }, + "400": { + "description": "Bad request" + }, + "404": { + "description": "Not found" + }, + "413": { + "description": "Payload too large" + }, + "415": { + "description": "Unsupported media type" + }, + "500": { + "description": "Internal server error" + }, + "503": { + "description": "Service unavailable" + } + } + } + }, + "/pets/{id}/owner/get": { + "post": { + "responses": { + "200": { + "description": "Ok" + }, + "400": { + "description": "Bad request" + }, + "404": { + "description": "Not found" + }, + "413": { + "description": "Payload too large" + }, + "415": { + "description": "Unsupported media type" + }, + "500": { + "description": "Internal server error" + }, + "503": { + "description": "Service unavailable" + } + } + } + }, + "/pets/{id}/owner/delete": { + "post": { + "responses": { + "200": { + "description": "Ok" + }, + "400": { + "description": "Bad request" + }, + "404": { + "description": "Not found" + }, + "413": { + "description": "Payload too large" + }, + "415": { + "description": "Unsupported media type" + }, + "500": { + "description": "Internal server error" + }, + "503": { + "description": "Service unavailable" + } + } + } + }, + "/status": { + "get": { + "responses": { + "default": { + "description": "Unexpected error" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/resources/OAR039/valid.yaml b/src/test/resources/checks/v32/resources/OAR039/valid.yaml new file mode 100644 index 00000000..1f23f21a --- /dev/null +++ b/src/test/resources/checks/v32/resources/OAR039/valid.yaml @@ -0,0 +1,184 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: + get: + responses: + 206: + description: Partial collection + 400: + description: Bad request + 500: + description: Internal server error + 503: + description: Service unavailable + post: + responses: + 201: + description: Created + 400: + description: Bad request + 413: + description: Payload too large + 415: + description: Unsupported media type + 500: + description: Internal server error + 503: + description: Service unavailable + + /pets/get: + post: + responses: + 200: + description: Ok + 400: + description: Bad request + 404: + description: Not found + 413: + description: Payload too large + 415: + description: Unsupported media type + 500: + description: Internal server error + 503: + description: Service unavailable + + /pets/delete: + post: + responses: + 200: + description: Ok + 400: + description: Bad request + 404: + description: Not found + 413: + description: Payload too large + 415: + description: Unsupported media type + 500: + description: Internal server error + 503: + description: Service unavailable + + /pets/{id}: + get: + responses: + 200: + description: Ok + 400: + description: Bad request + 404: + description: Not found + 500: + description: Internal server error + 503: + description: Service unavailable + put: + responses: + 200: + description: Ok + 400: + description: Bad request + 404: + description: Not found + 413: + description: Payload too large + 415: + description: Unsupported media type + 500: + description: Internal server error + 503: + description: Service unavailable + patch: + responses: + 200: + description: Ok + 400: + description: Bad request + 404: + description: Not found + 413: + description: Payload too large + 415: + description: Unsupported media type + 500: + description: Internal server error + 503: + description: Service unavailable + delete: + responses: + 200: + description: Ok + 400: + description: Bad request + 404: + description: Not found + 500: + description: Internal server error + 503: + description: Service unavailable + + /pets/{id}/owner: + post: + responses: + 201: + description: Created + 400: + description: Bad request + 404: + description: Not found + 413: + description: Payload too large + 415: + description: Unsupported media type + 500: + description: Internal server error + 503: + description: Service unavailable + + /pets/{id}/owner/get: + post: + responses: + 200: + description: Ok + 400: + description: Bad request + 404: + description: Not found + 413: + description: Payload too large + 415: + description: Unsupported media type + 500: + description: Internal server error + 503: + description: Service unavailable + + /pets/{id}/owner/delete: + post: + responses: + 200: + description: Ok + 400: + description: Bad request + 404: + description: Not found + 413: + description: Payload too large + 415: + description: Unsupported media type + 500: + description: Internal server error + 503: + description: Service unavailable + + /status: + get: + responses: + default: + description: Unexpected error \ No newline at end of file diff --git a/src/test/resources/checks/v32/schemas/OAR080/empty-global-security.json b/src/test/resources/checks/v32/schemas/OAR080/empty-global-security.json new file mode 100644 index 00000000..81763b5c --- /dev/null +++ b/src/test/resources/checks/v32/schemas/OAR080/empty-global-security.json @@ -0,0 +1,20 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Sample API" + }, + "security": [], + "paths": { + "/users": { + "get": { # Noncompliant {{OAR080: The security scheme must be among those allowed by the organization and must be complete.}} + "summary": "Get all users", + "responses": { + "200": { + "description": "OK" + } + } + } + } + } +} diff --git a/src/test/resources/checks/v32/schemas/OAR080/empty-global-security.yaml b/src/test/resources/checks/v32/schemas/OAR080/empty-global-security.yaml new file mode 100644 index 00000000..05fb3ba3 --- /dev/null +++ b/src/test/resources/checks/v32/schemas/OAR080/empty-global-security.yaml @@ -0,0 +1,12 @@ +openapi: 3.0.0 +info: + version: 1.0.0 + title: Sample API +security: [] +paths: + /users: + get: # Noncompliant {{OAR080: The security scheme must be among those allowed by the organization and must be complete.}} + summary: Get all users + responses: + '200': + description: OK diff --git a/src/test/resources/checks/v32/schemas/OAR080/empty-security.json b/src/test/resources/checks/v32/schemas/OAR080/empty-security.json new file mode 100644 index 00000000..b7f31ef0 --- /dev/null +++ b/src/test/resources/checks/v32/schemas/OAR080/empty-security.json @@ -0,0 +1,31 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Sample API" + }, + "paths": { + "/users": { + "get": { # Noncompliant {{OAR080: The security scheme must be among those allowed by the organization and must be complete.}} + "summary": "Get all users", + "security": [], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/products": { + "post": { # Noncompliant {{OAR080: The security scheme must be among those allowed by the organization and must be complete.}} + "summary": "Create a new product", + "security": [], + "responses": { + "200": { + "description": "OK" + } + } + } + } + } +} diff --git a/src/test/resources/checks/v32/schemas/OAR080/empty-security.yaml b/src/test/resources/checks/v32/schemas/OAR080/empty-security.yaml new file mode 100644 index 00000000..8821cacf --- /dev/null +++ b/src/test/resources/checks/v32/schemas/OAR080/empty-security.yaml @@ -0,0 +1,19 @@ +openapi: 3.0.0 +info: + version: 1.0.0 + title: Sample API +paths: + /users: + get: # Noncompliant {{OAR080: The security scheme must be among those allowed by the organization and must be complete.}} + summary: Get all users + security: [] + responses: + '200': + description: OK + /products: + post: # Noncompliant {{OAR080: The security scheme must be among those allowed by the organization and must be complete.}} + summary: Create a new product + security: [] + responses: + '200': + description: OK diff --git a/src/test/resources/checks/v32/schemas/OAR080/global-security.json b/src/test/resources/checks/v32/schemas/OAR080/global-security.json new file mode 100644 index 00000000..645a4a88 --- /dev/null +++ b/src/test/resources/checks/v32/schemas/OAR080/global-security.json @@ -0,0 +1,53 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Sample API" + }, + "security": [ + { "apiKey": [] }, + { "oauth2": [] } + ], + "components": { + "securitySchemes": { + "oauth2": { + "type": "oauth2", + "flows": { + "implicit": { + "authorizationUrl": "https://example.com/oauth/authorize", + "scopes": { + "read": "Read access" + } + } + } + }, + "apiKey": { + "type": "apiKey", + "name": "X-API-Key", + "in": "header" + } + } + }, + "paths": { + "/users": { + "get": { + "summary": "Get all users", + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/products": { + "post": { + "summary": "Create a new product", + "responses": { + "200": { + "description": "OK" + } + } + } + } + } +} diff --git a/src/test/resources/checks/v32/schemas/OAR080/global-security.yaml b/src/test/resources/checks/v32/schemas/OAR080/global-security.yaml new file mode 100644 index 00000000..3205ed2a --- /dev/null +++ b/src/test/resources/checks/v32/schemas/OAR080/global-security.yaml @@ -0,0 +1,51 @@ +openapi: 3.0.0 +info: + version: 1.0.0 + title: Sample API +security: + - apiKey: [] + - oauth2: [] +components: + securitySchemes: + oauth2: + type: oauth2 + flows: + implicit: + authorizationUrl: https://example.com/oauth/authorize + scopes: + read: Read access + apiKey: + type: apiKey + name: X-API-Key + in: header +paths: + /users: + get: + summary: Get all users + responses: + '200': + description: OK + /products: + post: + summary: Create a new product + responses: + '200': + description: OK + /orders: + put: + summary: Update an order + responses: + '200': + description: OK + /invoices: + delete: + summary: Delete an invoice + responses: + '200': + description: OK + /items: + patch: + summary: Patch an item + responses: + '200': + description: OK diff --git a/src/test/resources/checks/v32/schemas/OAR080/with-security.json b/src/test/resources/checks/v32/schemas/OAR080/with-security.json new file mode 100644 index 00000000..1157cab0 --- /dev/null +++ b/src/test/resources/checks/v32/schemas/OAR080/with-security.json @@ -0,0 +1,71 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Sample API" + }, + "paths": { + "/users": { + "get": { + "summary": "Get all users", + "security": [ + { + "apiKey": [], + "oauth2": [] + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/products": { + "post": { + "summary": "Create a new product", + "security": [ + { + "oauth2": [], + "apiKey": [] + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/orders": { + "put": { # Noncompliant {{OAR080: The security scheme must be among those allowed by the organization and must be complete.}} + "summary": "Update an order", + "security": [ + { + "unknownScheme": [] + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/invoices": { + "delete": { # Noncompliant {{OAR080: The security scheme must be among those allowed by the organization and must be complete.}} + "summary": "Delete an invoice", + "security": [ + { + "unknownScheme": [] + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/schemas/OAR080/with-security.yaml b/src/test/resources/checks/v32/schemas/OAR080/with-security.yaml new file mode 100644 index 00000000..de18bc04 --- /dev/null +++ b/src/test/resources/checks/v32/schemas/OAR080/with-security.yaml @@ -0,0 +1,39 @@ +openapi: 3.0.0 +info: + version: 1.0.0 + title: Sample API +paths: + /users: + get: + summary: Get all users + security: + - apiKey: [] + - oauth2: [] + responses: + '200': + description: OK + /products: + post: + summary: Create a new product + security: + - apiKey: [] + - oauth2: [] + responses: + '200': + description: OK + /orders: + put: # Noncompliant {{OAR080: The security scheme must be among those allowed by the organization and must be complete.}} + summary: Update an order + security: + - unknownScheme: [] + responses: + '200': + description: OK + /invoices: + delete: # Noncompliant {{OAR080: The security scheme must be among those allowed by the organization and must be complete.}} + summary: Delete an invoice + security: + - unknownScheme: [] + responses: + '200': + description: OK \ No newline at end of file diff --git a/src/test/resources/checks/v32/schemas/OAR080/without-security.json b/src/test/resources/checks/v32/schemas/OAR080/without-security.json new file mode 100644 index 00000000..82430d79 --- /dev/null +++ b/src/test/resources/checks/v32/schemas/OAR080/without-security.json @@ -0,0 +1,69 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Sample API" + }, + "paths": { + "/users": { + "get": { # Noncompliant {{OAR080: The security scheme must be among those allowed by the organization and must be complete.}} + "summary": "Get all users", + "security": [ + { + "apiKey": [] + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/products": { + "post": { # Noncompliant {{OAR080: The security scheme must be among those allowed by the organization and must be complete.}} + "summary": "Create a new product", + "security": [ + { + "oauth2": [] + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/orders": { + "put": { # Noncompliant {{OAR080: The security scheme must be among those allowed by the organization and must be complete.}} + "summary": "Update an order", + "security": [ + { + "unknownScheme": [] + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/invoices": { + "delete": { # Noncompliant {{OAR080: The security scheme must be among those allowed by the organization and must be complete.}} + "summary": "Delete an invoice", + "security": [ + { + "unknownScheme": [] + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/schemas/OAR080/without-security.yaml b/src/test/resources/checks/v32/schemas/OAR080/without-security.yaml new file mode 100644 index 00000000..675f89b2 --- /dev/null +++ b/src/test/resources/checks/v32/schemas/OAR080/without-security.yaml @@ -0,0 +1,37 @@ +openapi: 3.0.0 +info: + version: 1.0.0 + title: Sample API +paths: + /users: + get: # Noncompliant {{OAR080: The security scheme must be among those allowed by the organization and must be complete.}} + summary: Get all users + security: + - apiKey: [] + responses: + '200': + description: OK + /products: + post: # Noncompliant {{OAR080: The security scheme must be among those allowed by the organization and must be complete.}} + summary: Create a new product + security: + - oauth2: [] + responses: + '200': + description: OK + /orders: + put: # Noncompliant {{OAR080: The security scheme must be among those allowed by the organization and must be complete.}} + summary: Update an order + security: + - unknownScheme: [] + responses: + '200': + description: OK + /invoices: + delete: # Noncompliant {{OAR080: The security scheme must be among those allowed by the organization and must be complete.}} + summary: Delete an invoice + security: + - unknownScheme: [] + responses: + '200': + description: OK \ No newline at end of file diff --git a/src/test/resources/checks/v32/schemas/OAR080/wrong-scheme.json b/src/test/resources/checks/v32/schemas/OAR080/wrong-scheme.json new file mode 100644 index 00000000..b042b2b4 --- /dev/null +++ b/src/test/resources/checks/v32/schemas/OAR080/wrong-scheme.json @@ -0,0 +1,54 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Sample API" + }, + "paths": { + "/users": { + "get": { # Noncompliant {{OAR080: The security scheme must be among those allowed by the organization and must be complete.}} + "summary": "Get all users", + "security": [ + { + "unknownScheme": [] + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/products": { + "post": { # Noncompliant {{OAR080: The security scheme must be among those allowed by the organization and must be complete.}} + "summary": "Create a new product", + "security": [ + { + "apiKey": [] + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/orders": { + "patch": { # Noncompliant {{OAR080: The security scheme must be among those allowed by the organization and must be complete.}} + "summary": "Patch an order", + "security": [ + { + "unknownScheme": [] + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + } + } +} diff --git a/src/test/resources/checks/v32/schemas/OAR080/wrong-scheme.yaml b/src/test/resources/checks/v32/schemas/OAR080/wrong-scheme.yaml new file mode 100644 index 00000000..86220d9f --- /dev/null +++ b/src/test/resources/checks/v32/schemas/OAR080/wrong-scheme.yaml @@ -0,0 +1,35 @@ +openapi: 3.0.0 +info: + version: 1.0.0 + title: Sample API +paths: + /users: + get: # Noncompliant {{OAR080: The security scheme must be among those allowed by the organization and must be complete.}} + summary: Get all users + security: + - unknownScheme: [] + responses: + '200': + description: OK + /products: + post: # Noncompliant {{OAR080: The security scheme must be among those allowed by the organization and must be complete.}} + summary: Create a new product + security: + - apiKey: [] + responses: + '200': + description: OK + /orders: + patch: # Noncompliant {{OAR080: The security scheme must be among those allowed by the organization and must be complete.}} + summary: Patch an order + security: + - unknownScheme: [] + responses: + '200': + description: OK + /items: + head: + summary: Head – non-security verb, ignored + responses: + '200': + description: OK diff --git a/src/test/resources/checks/v32/schemas/OAR108/invalid.json b/src/test/resources/checks/v32/schemas/OAR108/invalid.json new file mode 100644 index 00000000..3ce871c6 --- /dev/null +++ b/src/test/resources/checks/v32/schemas/OAR108/invalid.json @@ -0,0 +1,38 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "Ejemplo de API", + "version": "1.0.0" + }, + "paths": { + "/item": { + "get": { + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "nombre": { + "type": "string" + } + }, + "required": ["id", "nombre"] + }, + "example": { # Noncompliant {{OAR108: Schema does not match the provided example}} + "id": "hola", + "nombre": "Ejemplo" + } + } + } + } + } + } + } + } + } diff --git a/src/test/resources/checks/v32/schemas/OAR108/invalid.yaml b/src/test/resources/checks/v32/schemas/OAR108/invalid.yaml new file mode 100644 index 00000000..67c4fb32 --- /dev/null +++ b/src/test/resources/checks/v32/schemas/OAR108/invalid.yaml @@ -0,0 +1,25 @@ + openapi: 3.0.0 + info: + title: Ejemplo de API + version: 1.0.0 + paths: + /item: + get: + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + id: + type: integer + nombre: + type: string + required: + - id + - nombre + example: # Noncompliant {{OAR108: Schema does not match the provided example}} + id: hola123 + nombre: Ejemplo diff --git a/src/test/resources/checks/v32/schemas/OAR108/valid.json b/src/test/resources/checks/v32/schemas/OAR108/valid.json new file mode 100644 index 00000000..6a922454 --- /dev/null +++ b/src/test/resources/checks/v32/schemas/OAR108/valid.json @@ -0,0 +1,38 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "Ejemplo de API", + "version": "1.0.0" + }, + "paths": { + "/item": { + "get": { + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "id": { + "type": "number" + }, + "nombre": { + "type": "string" + } + }, + "required": ["id", "nombre"] + }, + "example": { + "id": 12.3, + "nombre": "Ejemplo" + } + } + } + } + } + } + } + } + } diff --git a/src/test/resources/checks/v32/schemas/OAR108/valid.yaml b/src/test/resources/checks/v32/schemas/OAR108/valid.yaml new file mode 100644 index 00000000..6c14d980 --- /dev/null +++ b/src/test/resources/checks/v32/schemas/OAR108/valid.yaml @@ -0,0 +1,47 @@ +openapi: 3.0.0 +info: + title: Ejemplo de API Ampliada + version: 1.0.0 +paths: + /item: + get: + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + id: + type: number + nombre: + type: string + activo: + type: boolean + configuracion: + type: object + properties: + tema: + type: string + notificaciones: + type: boolean + tags: + type: array + items: + type: string + proyectoNull: + type: string + nullable: true + required: + - id + - nombre + example: + id: 123.0 + nombre: Ejemplo + activo: false + configuracion: + tema: Oscuro + notificaciones: true + tags: ["api", "openapi"] + proyectoNull: null \ No newline at end of file diff --git a/src/test/resources/checks/v32/security/OAR001/with-servers.json b/src/test/resources/checks/v32/security/OAR001/with-servers.json new file mode 100644 index 00000000..14fb615b --- /dev/null +++ b/src/test/resources/checks/v32/security/OAR001/with-servers.json @@ -0,0 +1,15 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "servers" : [ + { + "url": "http://petstore.swagger.io/v1" # Noncompliant {{OAR001: Protocol https in server url is mandatory}} + } + ], + "paths" : { + "/pets" : { } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/security/OAR001/with-servers.yaml b/src/test/resources/checks/v32/security/OAR001/with-servers.yaml new file mode 100644 index 00000000..0827de6e --- /dev/null +++ b/src/test/resources/checks/v32/security/OAR001/with-servers.yaml @@ -0,0 +1,8 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +servers: + - url: http://petstore.swagger.io/v1 # Noncompliant {{OAR001: Protocol https in server url is mandatory}} +paths: + /pets: {} diff --git a/src/test/resources/checks/v32/security/OAR001/without-servers.json b/src/test/resources/checks/v32/security/OAR001/without-servers.json new file mode 100644 index 00000000..0bb90cf7 --- /dev/null +++ b/src/test/resources/checks/v32/security/OAR001/without-servers.json @@ -0,0 +1,10 @@ +{ # Noncompliant {{OAR001: Define 'servers' is mandatory}} + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/pets" : { } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/security/OAR001/without-servers.yaml b/src/test/resources/checks/v32/security/OAR001/without-servers.yaml new file mode 100644 index 00000000..a4233292 --- /dev/null +++ b/src/test/resources/checks/v32/security/OAR001/without-servers.yaml @@ -0,0 +1,7 @@ +# Noncompliant {{OAR001: Define 'servers' is mandatory}} +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: {} diff --git a/src/test/resources/checks/v32/security/OAR033/valid.json b/src/test/resources/checks/v32/security/OAR033/valid.json new file mode 100644 index 00000000..8315cce5 --- /dev/null +++ b/src/test/resources/checks/v32/security/OAR033/valid.json @@ -0,0 +1,52 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/pets": { + "get": { + "parameters": [ + { + "in": "header", + "name": "x-api-key", + "schema": { + "type": "string" + }, + "required": true + }, + { + "in": "header", + "name": "traceId", + "schema": { + "type": "string" + }, + "required": true + }, + { + "in": "header", + "name": "dateTime", + "schema": { + "type": "string" + }, + "required": true + }, + { + "in": "query", + "name": "Authorization", + "schema": { + "type": "string" + }, + "required": true + } + ], + "responses": { + "200": { + "description": "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/security/OAR033/valid.yaml b/src/test/resources/checks/v32/security/OAR033/valid.yaml new file mode 100644 index 00000000..87f75ec1 --- /dev/null +++ b/src/test/resources/checks/v32/security/OAR033/valid.yaml @@ -0,0 +1,31 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /petts: + parameters: + - in: header + name: x-api-key + schema: + type: string + required: true + - in: header + name: traceId + schema: + type: string + required: true + - in: header + name: dateTime + schema: + type: string + required: true + - in: query + name: Authorization + schema: + type: string + required: true + get: + responses: + 200: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v32/security/OAR033/with-forbidden-params.json b/src/test/resources/checks/v32/security/OAR033/with-forbidden-params.json new file mode 100644 index 00000000..ea0db738 --- /dev/null +++ b/src/test/resources/checks/v32/security/OAR033/with-forbidden-params.json @@ -0,0 +1,54 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "components": { + "parameters": { + "x-api-key": { + "in": "header", + "name": "x-api-key", + "schema": { + "type": "string" + }, + "required": true + }, + "accept": { + "in": "header", + "name": "Accept", # Noncompliant {{OAR033: Header not allowed}} + "schema": { + "type": "string" + }, + "required": true + } + } + }, + "paths": { + "/pets": { + "get": { + "parameters": [ + { + "$ref": "#/components/parameters/x-api-key" + }, + { + "$ref": "#/components/parameters/accept" + }, + { + "in": "header", + "name": "Authorization", # Noncompliant {{OAR033: Header not allowed}} + "schema": { + "type": "string" + }, + "required": true + } + ], + "responses": { + "200": { + "description": "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/security/OAR033/with-forbidden-params.yaml b/src/test/resources/checks/v32/security/OAR033/with-forbidden-params.yaml new file mode 100644 index 00000000..187dab95 --- /dev/null +++ b/src/test/resources/checks/v32/security/OAR033/with-forbidden-params.yaml @@ -0,0 +1,32 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +components: + parameters: + x-api-key: + in: header + name: x-api-key + schema: + type: string + required: true + accept: + in: header + name: Accept # Noncompliant {{OAR033: Header not allowed}} + schema: + type: string + required: true +paths: + /pets: + get: + parameters: + - $ref: '#/components/parameters/x-api-key' + - $ref: '#/components/parameters/accept' + - in: header + name: Authorization # Noncompliant {{OAR033: Header not allowed}} + schema: + type: string + required: true + responses: + 200: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v32/security/OAR033/without-required-params.json b/src/test/resources/checks/v32/security/OAR033/without-required-params.json new file mode 100644 index 00000000..27231df1 --- /dev/null +++ b/src/test/resources/checks/v32/security/OAR033/without-required-params.json @@ -0,0 +1,53 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "components": { + "parameters": { + "x-api-key": { + "in": "header", + "name": "x-api-key", + "schema": { + "type": "string" + }, + "required": true + }, + "traceId": { + "in": "header", + "name": "traceId", + "schema": { + "type": "string" + }, + "required": true + } + } + }, + "paths": { + "/pets": { + "parameters": [ + { + "$ref": "#/components/parameters/traceId" + } + ], + "get": { # Noncompliant {{OAR033: Headers [x-api-key] are required}} + "parameters": [ + { + "in": "header", + "name": "dateTime", + "schema": { + "type": "string" + }, + "required": true + } + ], + "responses": { + "200": { + "description": "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/security/OAR033/without-required-params.yaml b/src/test/resources/checks/v32/security/OAR033/without-required-params.yaml new file mode 100644 index 00000000..ff8b0fc6 --- /dev/null +++ b/src/test/resources/checks/v32/security/OAR033/without-required-params.yaml @@ -0,0 +1,32 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +components: + parameters: + x-api-key: + in: header + name: x-api-key + schema: + type: string + required: true + traceId: + in: header + name: traceId + schema: + type: string + required: true +paths: + /pets: + parameters: + - $ref: '#/components/parameters/traceId' + get: # Noncompliant {{OAR033: Headers [x-api-key] are required}} + parameters: + - in: header + name: dateTime + schema: + type: string + required: true + responses: + 200: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v32/security/OAR035/valid.json b/src/test/resources/checks/v32/security/OAR035/valid.json new file mode 100644 index 00000000..c45fbe9a --- /dev/null +++ b/src/test/resources/checks/v32/security/OAR035/valid.json @@ -0,0 +1,117 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "components": { + "securitySchemes": { + "BasicAuth": { + "type": "http", + "scheme": "basic" + }, + "BearerAuth": { + "type": "http", + "scheme": "bearer" + }, + "ApiKeyAuth": { + "type": "apiKey", + "in": "header", + "name": "X-API-Key" + }, + "OpenID": { + "type": "openIdConnect", + "openIdConnectUrl": "https://example.com/.well-known/openid-configuration" + }, + "OAuth2": { + "type": "oauth2", + "flows": { + "authorizationCode": { + "authorizationUrl": "https://example.com/oauth/authorize", + "tokenUrl": "https://example.com/oauth/token", + "scopes": { + "read": "Grants read access", + "write": "Grants write access", + "admin": "Grants access to admin operations" + } + } + } + } + } + }, + "paths": { + "/with-auth-and-header": { + "get": { + "parameters": [ + { + "in": "header", + "name": "x-api-key", + "schema": { + "type": "string" + } + } + ], + "security": [ + { + "ApiKeyAuth": [ + + ] + }, + { + "OAuth2": [ + "read", + "write" + ] + } + ], + "responses": { + "200": { + "description": "Ok" + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + }, + "429": { + "description": "Forbidden" + } + } + } + }, + "/with-header": { + "parameters": [ + { + "in": "header", + "name": "x-api-key", + "schema": { + "type": "string" + } + } + ], + "get": { + "responses": { + "200": { + "description": "Ok" + }, + "401": { + "description": "Unauthorized" + }, + "429": { + "description": "Unauthorized" + } + } + } + }, + "/without": { + "get": { + "responses": { + "200": { + "description": "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/security/OAR035/valid.yaml b/src/test/resources/checks/v32/security/OAR035/valid.yaml new file mode 100644 index 00000000..4ada663f --- /dev/null +++ b/src/test/resources/checks/v32/security/OAR035/valid.yaml @@ -0,0 +1,70 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +components: + securitySchemes: + BasicAuth: + type: http + scheme: basic + BearerAuth: + type: http + scheme: bearer + ApiKeyAuth: + type: apiKey + in: header + name: X-API-Key + OpenID: + type: openIdConnect + openIdConnectUrl: https://example.com/.well-known/openid-configuration + OAuth2: + type: oauth2 + flows: + authorizationCode: + authorizationUrl: https://example.com/oauth/authorize + tokenUrl: https://example.com/oauth/token + scopes: + read: Grants read access + write: Grants write access + admin: Grants access to admin operations +paths: + /with-auth-and-header: + get: + parameters: + - in: header + name: x-api-key + schema: + type: string + security: + - ApiKeyAuth: [] + - OAuth2: + - read + - write + responses: + 200: + description: Ok + 401: + description: Unauthorized + 403: + description: Forbidden + 429: + description: Forbidden + /with-header: + parameters: + - in: header + name: x-api-key + schema: + type: string + get: + responses: + 200: + description: Ok + 401: + description: Unauthorized + 429: + description: Unauthorized + /without: + get: + responses: + 200: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v32/security/OAR035/without-authorization-responses.json b/src/test/resources/checks/v32/security/OAR035/without-authorization-responses.json new file mode 100644 index 00000000..cf9d9e5c --- /dev/null +++ b/src/test/resources/checks/v32/security/OAR035/without-authorization-responses.json @@ -0,0 +1,100 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "components": { + "securitySchemes": { + "BasicAuth": { + "type": "http", + "scheme": "basic" + }, + "BearerAuth": { + "type": "http", + "scheme": "bearer" + }, + "ApiKeyAuth": { + "type": "apiKey", + "in": "header", + "name": "X-API-Key" + }, + "OpenID": { + "type": "openIdConnect", + "openIdConnectUrl": "https://example.com/.well-known/openid-configuration" + }, + "OAuth2": { + "type": "oauth2", + "flows": { + "authorizationCode": { + "authorizationUrl": "https://example.com/oauth/authorize", + "tokenUrl": "https://example.com/oauth/token", + "scopes": { + "read": "Grants read access", + "write": "Grants write access", + "admin": "Grants access to admin operations" + } + } + } + } + } + }, + "paths": { + "/with-auth-and-header": { + "get": { + "parameters": [ + { + "in": "header", + "name": "x-api-key", + "schema": { + "type": "string" + } + } + ], + "security": [ + { + "ApiKeyAuth": [] + }, + { + "OAuth2": [ + "read", + "write" + ] + } + ], + "responses": { # Noncompliant {{OAR035: Response code 401 must be defined for operations with security schemes defined}} + "200": { + "description": "Ok" + } + } + } + }, + "/with-header": { + "parameters": [ + { + "in": "header", + "name": "x-api-key", + "schema": { + "type": "string" + } + } + ], + "get": { + "responses": { + "200": { + "description": "Ok" + } + } + } + }, + "/without": { + "get": { + "responses": { + "200": { + "description": "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/security/OAR035/without-authorization-responses.yaml b/src/test/resources/checks/v32/security/OAR035/without-authorization-responses.yaml new file mode 100644 index 00000000..b03ad2df --- /dev/null +++ b/src/test/resources/checks/v32/security/OAR035/without-authorization-responses.yaml @@ -0,0 +1,62 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +components: + securitySchemes: + BasicAuth: + type: http + scheme: basic + BearerAuth: + type: http + scheme: bearer + ApiKeyAuth: + type: apiKey + in: header + name: X-API-Key + OpenID: + type: openIdConnect + openIdConnectUrl: https://example.com/.well-known/openid-configuration + OAuth2: + type: oauth2 + flows: + authorizationCode: + authorizationUrl: https://example.com/oauth/authorize + tokenUrl: https://example.com/oauth/token + scopes: + read: Grants read access + write: Grants write access + admin: Grants access to admin operations +security: + - ApiKeyAuth: [] + - OAuth2: + - read + - write +paths: + /with-auth-and-header: + get: + parameters: + - in: header + name: x-api-key + schema: + type: string + responses: # Noncompliant {{OAR035: Response code 401 must be defined for operations with security schemes defined}} + 200: + description: Ok + + /with-header: + parameters: + - in: header + name: x-api-key + schema: + type: string + get: + responses: # Noncompliant {{OAR035: Response code 401 must be defined for operations with security schemes defined}} + 200: + description: Ok + + /without: + get: + responses: # Noncompliant {{OAR035: Response code 401 must be defined for operations with security schemes defined}} + 200: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v32/security/OAR036/valid.json b/src/test/resources/checks/v32/security/OAR036/valid.json new file mode 100644 index 00000000..bead835f --- /dev/null +++ b/src/test/resources/checks/v32/security/OAR036/valid.json @@ -0,0 +1,26 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/pets": { + "get": { + "parameters": [ { + "in": "header", + "name": "X-Authorization", + "schema": { + "type": "string" + }, + "required": true + } ], + "responses": { + "200": { + "description": "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/security/OAR036/valid.yaml b/src/test/resources/checks/v32/security/OAR036/valid.yaml new file mode 100644 index 00000000..23afab6a --- /dev/null +++ b/src/test/resources/checks/v32/security/OAR036/valid.yaml @@ -0,0 +1,16 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: + get: + parameters: + - in: header + name: X-Authorization + schema: + type: string + required: true + responses: + 200: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v32/security/OAR036/with-cookie.json b/src/test/resources/checks/v32/security/OAR036/with-cookie.json new file mode 100644 index 00000000..9d79650a --- /dev/null +++ b/src/test/resources/checks/v32/security/OAR036/with-cookie.json @@ -0,0 +1,42 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/pets": { + "parameters": [ { + "in": "header", + "name": "Cookie", # Noncompliant {{OAR036: Cookie use is forbidden as a session mechanism}} + "schema": { + "type": "string" + }, + "required": true + } ], + "get": { + "parameters": [ { + "in": "header", + "name": "Cookie", # Noncompliant {{OAR036: Cookie use is forbidden as a session mechanism}} + "schema": { + "type": "string" + }, + "required": true + } ], + "responses": { + "200": { + "description": "Ok", + "headers": { + "Set-Cookie": { # Noncompliant {{OAR036: Cookie use is forbidden as a session mechanism}} + "schema": { + "type": "string" + }, + "description": "session" + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/security/OAR036/with-cookie.yaml b/src/test/resources/checks/v32/security/OAR036/with-cookie.yaml new file mode 100644 index 00000000..e6b279f4 --- /dev/null +++ b/src/test/resources/checks/v32/security/OAR036/with-cookie.yaml @@ -0,0 +1,27 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: + parameters: + - in: header + name: Cookie # Noncompliant {{OAR036: Cookie use is forbidden as a session mechanism}} + schema: + type: string + required: true + get: + parameters: + - in: header + name: Cookie # Noncompliant {{OAR036: Cookie use is forbidden as a session mechanism}} + schema: + type: string + required: true + responses: + 200: + description: Ok + headers: + Set-Cookie: # Noncompliant {{OAR036: Cookie use is forbidden as a session mechanism}} + schema: + type: string + description: session \ No newline at end of file diff --git a/src/test/resources/checks/v32/security/OAR045/defined-response.json b/src/test/resources/checks/v32/security/OAR045/defined-response.json new file mode 100644 index 00000000..f86d6ac4 --- /dev/null +++ b/src/test/resources/checks/v32/security/OAR045/defined-response.json @@ -0,0 +1,78 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/pets": { + "get": { + "responses": { + "200": { + "description": "some response" // Noncompliant {{OAR045: Define the model of your response}} + }, + "202": { + "description": "some response", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + }, + "401": { // Noncompliant {{OAR045: Define the model of your response}} + "description": "error response", + "$ref": "#/components/responses/MyErroneousResponse" + } + } + }, + "post": { + "responses": {} // Noncompliant {{OAR045: Define the responses of your operations}} + }, + "put": { + "responses": { + "default": { + "description": "default response", + "content": { + "application/json": { + "schema": { + "type": "object" + } + } + } + }, + "200": { // Noncompliant {{OAR045: Define the model of your response}} + "description": "success response" + } + } + } + }, + "/other": { + "delete": { + "responses": { + "204": { + "description": "No content" + } + } + } + } + }, + "components": { + "responses": { + "MyErroneousResponse": { + "description": "an example response missing a model" + }, + "MyOtherResponse": { + "description": "some response", + "content": { + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } +} diff --git a/src/test/resources/checks/v32/security/OAR045/defined-response.yaml b/src/test/resources/checks/v32/security/OAR045/defined-response.yaml new file mode 100644 index 00000000..4370ac6c --- /dev/null +++ b/src/test/resources/checks/v32/security/OAR045/defined-response.yaml @@ -0,0 +1,48 @@ +openapi: 3.0.0 +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: + get: + responses: + # Noncompliant@+1 {{OAR045: Define the model of your response}} + '200': + description: some response + '202': + description: some response + content: + application/json: + schema: + type: string + '401': # Noncompliant {{OAR045: Define the model of your response}} + description: error response + $ref: '#/components/responses/MyErroneousResponse' + post: + # Noncompliant@+1 {{OAR045: Define the responses of your operations}} + responses: {} + put: + responses: + default: + description: default response + content: + application/json: + schema: + type: object + '200': # Noncompliant {{OAR045: Define the model of your response}} + description: success response + /other: + delete: + responses: + '204': + description: No content +components: + responses: + MyErroneousResponse: + description: an example response missing a model + MyOtherResponse: + description: some response + content: + application/json: + schema: + type: object diff --git a/src/test/resources/checks/v32/security/OAR053/valid.json b/src/test/resources/checks/v32/security/OAR053/valid.json new file mode 100644 index 00000000..774ea388 --- /dev/null +++ b/src/test/resources/checks/v32/security/OAR053/valid.json @@ -0,0 +1,42 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "components": { + "responses": { + "PetsResponse": { + "description": "OK", + "headers": { + "x-trace-id": { + "schema": { + "type": "string" + } + } + } + } + } + }, + "paths": { + "/pets": { + "get": { + "responses": { + "200": { + "$ref": "#/components/responses/PetsResponse" + }, + "400": { + "description": "Bad Request", + "headers": { + "x-trace-id": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/security/OAR053/valid.yaml b/src/test/resources/checks/v32/security/OAR053/valid.yaml new file mode 100644 index 00000000..bfda5f93 --- /dev/null +++ b/src/test/resources/checks/v32/security/OAR053/valid.yaml @@ -0,0 +1,26 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore + +components: + responses: + PetsResponse: + description: OK + headers: + x-trace-id: + schema: + type: string + +paths: + /pets: + get: + responses: + '200': + $ref: '#/components/responses/PetsResponse' + '400': + description: Bad Request + headers: + x-trace-id: + schema: + type: string \ No newline at end of file diff --git a/src/test/resources/checks/v32/security/OAR054/valid.json b/src/test/resources/checks/v32/security/OAR054/valid.json new file mode 100644 index 00000000..2f45e288 --- /dev/null +++ b/src/test/resources/checks/v32/security/OAR054/valid.json @@ -0,0 +1,19 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "servers": [ + { + "url": "https://api-dev.apiaddicts.org/api-vehicular/v1/" + }, + { + "url": "https://api-test.apiaddicts.org/api-vehicular/v1/" + }, + { + "url": "https://api.apiaddicts.org/api-vehicular/v1/" + } + ], + "paths": { } +} diff --git a/src/test/resources/checks/v32/security/OAR054/valid.yaml b/src/test/resources/checks/v32/security/OAR054/valid.yaml new file mode 100644 index 00000000..a87e4212 --- /dev/null +++ b/src/test/resources/checks/v32/security/OAR054/valid.yaml @@ -0,0 +1,9 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +servers: + - url: https://api-dev.apiaddicts.org/api-vehicular/v1/ + - url: https://api-test.apiaddicts.org/api-vehicular/v1/ + - url: https://api.apiaddicts.org/api-vehicular/v1/ +paths: {} diff --git a/src/test/resources/checks/v32/security/OAR072/no-stack-trace.json b/src/test/resources/checks/v32/security/OAR072/no-stack-trace.json new file mode 100644 index 00000000..929b4279 --- /dev/null +++ b/src/test/resources/checks/v32/security/OAR072/no-stack-trace.json @@ -0,0 +1,47 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "Compliant API", + "version": "1.0.0" + }, + "paths": { + "/example": { + "get": { + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "maxLength": 100 + } + } + } + } + } + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "maxLength": 100 + } + } + } + } + } + } + } + } + } + } + } \ No newline at end of file diff --git a/src/test/resources/checks/v32/security/OAR072/no-stack-trace.yaml b/src/test/resources/checks/v32/security/OAR072/no-stack-trace.yaml new file mode 100644 index 00000000..9c5c83f1 --- /dev/null +++ b/src/test/resources/checks/v32/security/OAR072/no-stack-trace.yaml @@ -0,0 +1,36 @@ +openapi: 3.0.0 +info: + title: Sample API + version: 1.0.0 +paths: + /sample: + get: + responses: + '200': + description: Successful operation + content: + application/json: + schema: + type: object + properties: + id: + type: integer + format: int64 + name: + type: string + status: + type: string + '400': + description: Bad request + content: + application/json: + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: string \ No newline at end of file diff --git a/src/test/resources/checks/v32/security/OAR072/with-stack-trace.json b/src/test/resources/checks/v32/security/OAR072/with-stack-trace.json new file mode 100644 index 00000000..35468a59 --- /dev/null +++ b/src/test/resources/checks/v32/security/OAR072/with-stack-trace.json @@ -0,0 +1,62 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "Sample API", + "version": "1.0.0" + }, + "paths": { + "/sample": { + "get": { + "responses": { + "200": { + "description": "Successful operation", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "name": { + "type": "string" + }, + "status": { + "type": "string" + } + } + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + }, + "details": { + "type": "string" + }, + "stackTrace": { # Noncompliant {{OAR072: Non OK responses shouldnt have stackTraces}} + "type": "string" + } + } + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/security/OAR072/with-stack-trace.yaml b/src/test/resources/checks/v32/security/OAR072/with-stack-trace.yaml new file mode 100644 index 00000000..8d1fcadf --- /dev/null +++ b/src/test/resources/checks/v32/security/OAR072/with-stack-trace.yaml @@ -0,0 +1,40 @@ +openapi: 3.0.0 +info: + title: Sample API + version: 1.0.0 +paths: + /sample: + get: + responses: + '201': + description: Successful operation + content: + application/json: + schema: + type: object + properties: + id: + type: integer + format: int64 + name: + type: string + status: + type: string + stackTrace: + type: string + '400': + description: Bad request + content: + application/json: + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: string + stackTrace: # Noncompliant {{OAR072: Non OK responses shouldnt have stackTraces}} + type: string \ No newline at end of file diff --git a/src/test/resources/checks/v32/security/OAR074/no-restrictions.json b/src/test/resources/checks/v32/security/OAR074/no-restrictions.json new file mode 100644 index 00000000..4d6b726c --- /dev/null +++ b/src/test/resources/checks/v32/security/OAR074/no-restrictions.json @@ -0,0 +1,35 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "My API" + }, + "paths": { + "/items": { + "get": { + "summary": "Get a list of items", + "parameters": [ + { + "name": "param1", + "in": "query", + "schema": { + "type": "integer" # Noncompliant {{OAR074: Numeric parameters should have minimum, maximum, or format restriction}} + } + }, + { + "name": "param2", + "in": "query", + "schema": { + "type": "number" # Noncompliant {{OAR074: Numeric parameters should have minimum, maximum, or format restriction}} + } + } + ], + "responses": { + "200": { + "description": "A list of items" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/security/OAR074/no-restrictions.yaml b/src/test/resources/checks/v32/security/OAR074/no-restrictions.yaml new file mode 100644 index 00000000..91fea43c --- /dev/null +++ b/src/test/resources/checks/v32/security/OAR074/no-restrictions.yaml @@ -0,0 +1,20 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: My API +paths: + /items: + get: + summary: Get a list of items + parameters: + - name: param1 + in: query + schema: + type: integer # Noncompliant {{OAR074: Numeric parameters should have minimum, maximum, or format restriction}} + - name: param2 + in: query + schema: + type: number # Noncompliant {{OAR074: Numeric parameters should have minimum, maximum, or format restriction}} + responses: + 200: + description: A list of items \ No newline at end of file diff --git a/src/test/resources/checks/v32/security/OAR074/with-restrictions.json b/src/test/resources/checks/v32/security/OAR074/with-restrictions.json new file mode 100644 index 00000000..02a94a5f --- /dev/null +++ b/src/test/resources/checks/v32/security/OAR074/with-restrictions.json @@ -0,0 +1,40 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "My API" + }, + "paths": { + "/items": { + "get": { + "summary": "Get a list of items", + "parameters": [ + { + "name": "param1", + "in": "query", + "schema": { + "type": "integer", + "minimum": 1, + "maximum": 100, + "format": "double" + } + }, + { + "name": "param2", + "in": "query", + "schema": { + "type": "number", + "minimum": 1, + "maximum": 100 + } + } + ], + "responses": { + "200": { + "description": "A list of items" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/security/OAR074/with-restrictions.yaml b/src/test/resources/checks/v32/security/OAR074/with-restrictions.yaml new file mode 100644 index 00000000..65e43fea --- /dev/null +++ b/src/test/resources/checks/v32/security/OAR074/with-restrictions.yaml @@ -0,0 +1,26 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: My API +paths: + /items: + get: + summary: Get a list of items + parameters: + - name: param1 + in: query + schema: + type: integer + minimum: 1 + maximum: 100 + format: double + - name: param2 + in: query + schema: + type: number + minimum: 1 + maximum: 100 + format: double + responses: + 200: + description: A list of items \ No newline at end of file diff --git a/src/test/resources/checks/v32/security/OAR075/no-restrictions.json b/src/test/resources/checks/v32/security/OAR075/no-restrictions.json new file mode 100644 index 00000000..1c260f41 --- /dev/null +++ b/src/test/resources/checks/v32/security/OAR075/no-restrictions.json @@ -0,0 +1,28 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "API sin restricciones", + "version": "1.0.0" + }, + "paths": { + "/users/{id}": { + "get": { + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" # Noncompliant {{OAR075: String parameters should have minLength, maxLength, pattern (regular expression), or enum restriction that are defined in the properties}} + } + } + ], + "responses": { + "200": { + "description": "Un usuario" + } + } + } + } + } + } \ No newline at end of file diff --git a/src/test/resources/checks/v32/security/OAR075/no-restrictions.yaml b/src/test/resources/checks/v32/security/OAR075/no-restrictions.yaml new file mode 100644 index 00000000..067bbe64 --- /dev/null +++ b/src/test/resources/checks/v32/security/OAR075/no-restrictions.yaml @@ -0,0 +1,16 @@ +openapi: 3.0.0 +info: + title: API sin restricciones + version: 1.0.0 +paths: + /users/{id}: + get: + parameters: + - name: id + in: path + required: true + schema: + type: string # Noncompliant {{OAR075: String parameters should have minLength, maxLength, pattern (regular expression), or enum restriction that are defined in the properties}} + responses: + '200': + description: Un usuario \ No newline at end of file diff --git a/src/test/resources/checks/v32/security/OAR075/with-restrictions.json b/src/test/resources/checks/v32/security/OAR075/with-restrictions.json new file mode 100644 index 00000000..b27eda32 --- /dev/null +++ b/src/test/resources/checks/v32/security/OAR075/with-restrictions.json @@ -0,0 +1,32 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "API con restricciones", + "version": "1.0.0" + }, + "paths": { + "/users/{id}": { + "get": { + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "minLength": 5, + "maxLength": 120, + "format": "date", + "enum": ["admin", "user", "guest"] + } + } + ], + "responses": { + "200": { + "description": "Un usuario" + } + } + } + } + } + } \ No newline at end of file diff --git a/src/test/resources/checks/v32/security/OAR075/with-restrictions.yaml b/src/test/resources/checks/v32/security/OAR075/with-restrictions.yaml new file mode 100644 index 00000000..69aadfff --- /dev/null +++ b/src/test/resources/checks/v32/security/OAR075/with-restrictions.yaml @@ -0,0 +1,20 @@ +openapi: 3.0.0 +info: + title: API con restricciones + version: 1.0.0 +paths: + /users/{id}: + get: + parameters: + - name: id + in: path + required: true + schema: + type: string + minLength: 5 + maxLength: 120 + format: date + enum: ['admin', 'user', 'guest'] + responses: + '200': + description: Un usuario \ No newline at end of file diff --git a/src/test/resources/checks/v32/security/OAR076/nested.json b/src/test/resources/checks/v32/security/OAR076/nested.json new file mode 100644 index 00000000..b02da78c --- /dev/null +++ b/src/test/resources/checks/v32/security/OAR076/nested.json @@ -0,0 +1,40 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/invoices": { + "get": { + "responses": { + "200": { + "description": "A invoice.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "price": { + "type": "number", + "format": "double" + }, + "nested": { + "type": "object", + "properties": { + "value": { + "type": "number", # Noncompliant {{OAR076: Numeric types requires a valid format}} + "format": "int64" + } + } + } + } + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/security/OAR076/nested.yaml b/src/test/resources/checks/v32/security/OAR076/nested.yaml new file mode 100644 index 00000000..f0607065 --- /dev/null +++ b/src/test/resources/checks/v32/security/OAR076/nested.yaml @@ -0,0 +1,25 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /invoices: + get: + responses: + 200: + description: A invoice. + content: + application/json: + schema: + type: object + properties: + price: + type: number + format: double + nested: + type: object + properties: + value: + type: number # Noncompliant {{OAR076: Numeric types requires a valid format}} + format: int64 + diff --git a/src/test/resources/checks/v32/security/OAR076/plain.json b/src/test/resources/checks/v32/security/OAR076/plain.json new file mode 100644 index 00000000..b41cd0e8 --- /dev/null +++ b/src/test/resources/checks/v32/security/OAR076/plain.json @@ -0,0 +1,42 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/invoices": { + "get": { + "responses": { + "200": { + "description": "A invoice.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "id": { + "type": "integer" # Noncompliant {{OAR076: Numeric types requires a valid format}} + }, + "product_id": { + "type": "integer", # Noncompliant {{OAR076: Numeric types requires a valid format}} + "format": "int128" + }, + "line": { + "type": "number", # Noncompliant {{OAR076: Numeric types requires a valid format}} + "format": "int32" + }, + "price": { + "type": "number", + "format": "double" + } + } + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/security/OAR076/plain.yaml b/src/test/resources/checks/v32/security/OAR076/plain.yaml new file mode 100644 index 00000000..8128fb01 --- /dev/null +++ b/src/test/resources/checks/v32/security/OAR076/plain.yaml @@ -0,0 +1,27 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /invoices: + get: + responses: + 200: + description: A invoice. + content: + application/json: + schema: + type: object + properties: + id: + type: integer # Noncompliant {{OAR076: Numeric types requires a valid format}} + product_id: + type: integer # Noncompliant {{OAR076: Numeric types requires a valid format}} + format: int128 + line: + type: number # Noncompliant {{OAR076: Numeric types requires a valid format}} + format: int32 + price: + type: number + format: double + diff --git a/src/test/resources/checks/v32/security/OAR076/with-$ref.json b/src/test/resources/checks/v32/security/OAR076/with-$ref.json new file mode 100644 index 00000000..f2c2d7c8 --- /dev/null +++ b/src/test/resources/checks/v32/security/OAR076/with-$ref.json @@ -0,0 +1,47 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/invoices": { + "get": { + "responses": { + "200": { + "description": "A invoice.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "price": { + "type": "number", + "format": "double" + }, + "nested": { + "$ref": "#/components/schemas/nested" + } + } + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "nested": { + "type": "object", + "properties": { + "value": { + "type": "number", # Noncompliant {{OAR076: Numeric types requires a valid format}} + "format": "int64" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/security/OAR076/with-$ref.yaml b/src/test/resources/checks/v32/security/OAR076/with-$ref.yaml new file mode 100644 index 00000000..3f3e2db7 --- /dev/null +++ b/src/test/resources/checks/v32/security/OAR076/with-$ref.yaml @@ -0,0 +1,29 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /invoices: + get: + responses: + 200: + description: A invoice. + content: + application/json: + schema: + type: object + properties: + price: + type: number + format: double + nested: + $ref: '#/components/schemas/nested' + +components: + schemas: + nested: + type: object + properties: + value: + type: number # Noncompliant {{OAR076: Numeric types requires a valid format}} + format: int64 diff --git a/src/test/resources/checks/v32/security/OAR078/no-security.json b/src/test/resources/checks/v32/security/OAR078/no-security.json new file mode 100644 index 00000000..74770f90 --- /dev/null +++ b/src/test/resources/checks/v32/security/OAR078/no-security.json @@ -0,0 +1,54 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Sample API" + }, + "components": { + "securitySchemes": { + "apiKey": { + "type": "apiKey", + "name": "X-API-Key", + "in": "header" + } + } + }, + "paths": { + "/users": { + "get": { # Noncompliant {{OAR078: All API methods must have security}} + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/products": { + "post": { # Noncompliant {{OAR078: All API methods must have security}} + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/orders": { + "put": { # Noncompliant {{OAR078: All API methods must have security}} + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/invoices": { + "delete": { # Noncompliant {{OAR078: All API methods must have security}} + "responses": { + "200": { + "description": "OK" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/security/OAR078/no-security.yaml b/src/test/resources/checks/v32/security/OAR078/no-security.yaml new file mode 100644 index 00000000..005c2fbc --- /dev/null +++ b/src/test/resources/checks/v32/security/OAR078/no-security.yaml @@ -0,0 +1,33 @@ +openapi: 3.0.0 +info: + version: 1.0.0 + title: Sample API +components: + securitySchemes: + apiKey: + type: apiKey + name: X-API-Key + in: header +paths: + /users: + get: # Noncompliant {{OAR078: All API methods must have security}} + responses: + '200': + description: OK + /products: + post: # Noncompliant {{OAR078: All API methods must have security}} + responses: + '200': + description: OK + + /orders: + put: # Noncompliant {{OAR078: All API methods must have security}} + responses: + '200': + description: OK + + /invoices: + delete: # Noncompliant {{OAR078: All API methods must have security}} + responses: + '200': + description: OK diff --git a/src/test/resources/checks/v32/security/OAR078/with-security.json b/src/test/resources/checks/v32/security/OAR078/with-security.json new file mode 100644 index 00000000..dd025133 --- /dev/null +++ b/src/test/resources/checks/v32/security/OAR078/with-security.json @@ -0,0 +1,74 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Sample API" + }, + "paths": { + "/users": { + "get": { + "security": [ + { + "apiKey": [] + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/products": { + "post": { + "security": [ + { + "apiKey": [] + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/orders": { + "put": { + "security": [ + { + "apiKey": [] + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/invoices": { + "delete": { + "security": [ + { + "apiKey": [] + } + ], + "responses": { + "200": { + "description": "OK esto a json" + } + } + } + } + }, + "components": { + "securitySchemes": { + "apiKey": { + "type": "apiKey", + "name": "X-API-Key", + "in": "header" + } + } + } + } \ No newline at end of file diff --git a/src/test/resources/checks/v32/security/OAR078/with-security.yaml b/src/test/resources/checks/v32/security/OAR078/with-security.yaml new file mode 100644 index 00000000..c591c997 --- /dev/null +++ b/src/test/resources/checks/v32/security/OAR078/with-security.yaml @@ -0,0 +1,49 @@ +openapi: 3.0.0 +info: + title: Sample API + version: 1.0.0 +servers: + - url: https://api.example.com/v1 + +# Definición de seguridad global +security: + - apiKeyHeader: [] + +paths: + /items: + get: # Verb 'get' sin definición de seguridad local + summary: Get all items + responses: + '200': + description: Successful response + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Item' + post: # Verb 'post' sin definición de seguridad local + summary: Create an item + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Item' + responses: + '201': + description: Item created + +components: + schemas: + Item: + type: object + properties: + id: + type: string + name: + type: string + securitySchemes: + apiKeyHeader: + type: apiKey + in: header + name: X-API-Key \ No newline at end of file diff --git a/src/test/resources/checks/v32/security/OAR079/bad-request404.json b/src/test/resources/checks/v32/security/OAR079/bad-request404.json new file mode 100644 index 00000000..751268d5 --- /dev/null +++ b/src/test/resources/checks/v32/security/OAR079/bad-request404.json @@ -0,0 +1,42 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths": { + "/items": { + "get": { + "summary": "Get a list of items", + "parameters": [ + { + "name": "param1", + "in": "path", + "required": false, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "A list of items", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + }, + "404": { + "description": "Bad Request" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/security/OAR079/bad-request404.yaml b/src/test/resources/checks/v32/security/OAR079/bad-request404.yaml new file mode 100644 index 00000000..53082801 --- /dev/null +++ b/src/test/resources/checks/v32/security/OAR079/bad-request404.yaml @@ -0,0 +1,25 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /items: + get: + summary: Get a list of items + parameters: + - name: param1 + in: path + required: false + schema: + type: string + responses: + 200: + description: A list of items + content: + application/json: + schema: + type: array + items: + type: string + 404: + description: Bad Request \ No newline at end of file diff --git a/src/test/resources/checks/v32/security/OAR079/no-bad-request404.json b/src/test/resources/checks/v32/security/OAR079/no-bad-request404.json new file mode 100644 index 00000000..be422fe0 --- /dev/null +++ b/src/test/resources/checks/v32/security/OAR079/no-bad-request404.json @@ -0,0 +1,38 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths": { + "/example1": { + "get": { + "parameters": [ + { + "name": "param1", + "in": "path", + "required": false, + "schema": { + "type": "string" + } + } + ], + "responses": { # Noncompliant {{OAR079: Paths parameters, should have not found (404) response}} + "200": { + "description": "A list of items", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + } + } + } + } + } \ No newline at end of file diff --git a/src/test/resources/checks/v32/security/OAR079/no-bad-request404.yaml b/src/test/resources/checks/v32/security/OAR079/no-bad-request404.yaml new file mode 100644 index 00000000..0cbefaf9 --- /dev/null +++ b/src/test/resources/checks/v32/security/OAR079/no-bad-request404.yaml @@ -0,0 +1,22 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /status: + get: + parameters: + - name: param1 + in: path + required: false + schema: + type: string + responses: + 200: + description: A list of items + content: + application/json: + schema: + type: array + items: + type: string diff --git a/src/test/resources/checks/v32/security/OAR079/no-parameters.json b/src/test/resources/checks/v32/security/OAR079/no-parameters.json new file mode 100644 index 00000000..9d39ba8a --- /dev/null +++ b/src/test/resources/checks/v32/security/OAR079/no-parameters.json @@ -0,0 +1,19 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/items": { + "get": { + "summary": "Get a list of items", + "responses": { + "200": { + "description": "A list of items" + } + } + } + } + } +} diff --git a/src/test/resources/checks/v32/security/OAR079/no-parameters.yaml b/src/test/resources/checks/v32/security/OAR079/no-parameters.yaml new file mode 100644 index 00000000..f220c16c --- /dev/null +++ b/src/test/resources/checks/v32/security/OAR079/no-parameters.yaml @@ -0,0 +1,11 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /items: + get: + summary: Get a list of items + responses: + 200: + description: A list of items diff --git a/src/test/resources/checks/v32/security/OAR079/query-param-only.json b/src/test/resources/checks/v32/security/OAR079/query-param-only.json new file mode 100644 index 00000000..ad428c6b --- /dev/null +++ b/src/test/resources/checks/v32/security/OAR079/query-param-only.json @@ -0,0 +1,26 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/items": { + "get": { + "summary": "Get a list of items", + "parameters": [ + { + "name": "param1", + "in": "query", + "schema": { "type": "string" } + } + ], + "responses": { + "200": { + "description": "A list of items" + } + } + } + } + } +} diff --git a/src/test/resources/checks/v32/security/OAR079/query-param-only.yaml b/src/test/resources/checks/v32/security/OAR079/query-param-only.yaml new file mode 100644 index 00000000..d85cf1b8 --- /dev/null +++ b/src/test/resources/checks/v32/security/OAR079/query-param-only.yaml @@ -0,0 +1,16 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /items: + get: + summary: Get a list of items + parameters: + - name: param1 + in: query + schema: + type: string + responses: + 200: + description: A list of items diff --git a/src/test/resources/checks/v32/security/OAR081/.gitkeep b/src/test/resources/checks/v32/security/OAR081/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/src/test/resources/checks/v32/security/OAR081/not-valid-password.json b/src/test/resources/checks/v32/security/OAR081/not-valid-password.json new file mode 100644 index 00000000..eb626afe --- /dev/null +++ b/src/test/resources/checks/v32/security/OAR081/not-valid-password.json @@ -0,0 +1,52 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/users": { + "post": { + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "username": { + "type": "string" + }, + "password": { + "type": "string", + "format": "password" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "A user was successfully created.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "username": { + "type": "string" + }, + "password": { # Noncompliant {{OAR081: Fields of type password should be string with format password}} + "type": "string", + "format": "number" + } + } + } + } + } + } + } + } + } + } + } \ No newline at end of file diff --git a/src/test/resources/checks/v32/security/OAR081/not-valid-password.yaml b/src/test/resources/checks/v32/security/OAR081/not-valid-password.yaml new file mode 100644 index 00000000..4d7804fb --- /dev/null +++ b/src/test/resources/checks/v32/security/OAR081/not-valid-password.yaml @@ -0,0 +1,31 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /users: + post: + requestBody: + content: + application/json: + schema: + type: object + properties: + username: + type: string + password: # Noncompliant {{OAR081: Fields of type password should be string with format password}} + type: string + format: number + responses: + 200: + description: A user was successfully created. + content: + application/json: + schema: + type: object + properties: + username: + type: string + password: # Noncompliant {{OAR081: Fields of type password should be string with format password}} + type: string + format: number \ No newline at end of file diff --git a/src/test/resources/checks/v32/security/OAR081/valid-password.json b/src/test/resources/checks/v32/security/OAR081/valid-password.json new file mode 100644 index 00000000..1bc3a18d --- /dev/null +++ b/src/test/resources/checks/v32/security/OAR081/valid-password.json @@ -0,0 +1,52 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/users": { + "post": { + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "username": { + "type": "string" + }, + "password": { + "type": "string", + "format": "password" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "A user was successfully created.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "username": { + "type": "string" + }, + "password": { + "type": "string", + "format": "password" + } + } + } + } + } + } + } + } + } + } + } \ No newline at end of file diff --git a/src/test/resources/checks/v32/security/OAR081/valid-password.yaml b/src/test/resources/checks/v32/security/OAR081/valid-password.yaml new file mode 100644 index 00000000..2545f739 --- /dev/null +++ b/src/test/resources/checks/v32/security/OAR081/valid-password.yaml @@ -0,0 +1,31 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /users: + post: + requestBody: + content: + application/json: + schema: + type: object + properties: + username: + type: string + password: + type: string + format: password + responses: + 200: + description: A user was successfully created. + content: + application/json: + schema: + type: object + properties: + username: + type: string + password: + type: string + format: password \ No newline at end of file diff --git a/src/test/resources/checks/v32/security/OAR081/valid-with-components.json b/src/test/resources/checks/v32/security/OAR081/valid-with-components.json new file mode 100644 index 00000000..0ce1cdd6 --- /dev/null +++ b/src/test/resources/checks/v32/security/OAR081/valid-with-components.json @@ -0,0 +1,50 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/users": { + "post": { + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/User" + } + } + } + }, + "responses": { + "200": { + "description": "A user was successfully created.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/User" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "User": { + "type": "object", + "properties": { + "username": { + "type": "string" + }, + "password": { # Noncompliant {{OAR081: Fields of type password should be string with format password}} + "type": "string", + "format": "number" + } + } + } + } + } + } \ No newline at end of file diff --git a/src/test/resources/checks/v32/security/OAR081/valid-with-components.yaml b/src/test/resources/checks/v32/security/OAR081/valid-with-components.yaml new file mode 100644 index 00000000..61c4d53c --- /dev/null +++ b/src/test/resources/checks/v32/security/OAR081/valid-with-components.yaml @@ -0,0 +1,29 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /users: + post: + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/User' + responses: + 200: + description: A user was successfully created. + content: + application/json: + schema: + $ref: '#/components/schemas/User' +components: + schemas: + User: + type: object + properties: + username: + type: string + password: # Noncompliant {{OAR081: Fields of type password should be string with format password}} + type: string + format: number \ No newline at end of file diff --git a/src/test/resources/checks/v32/security/OAR082/.gitkeep b/src/test/resources/checks/v32/security/OAR082/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/src/test/resources/checks/v32/security/OAR082/valid-format.json b/src/test/resources/checks/v32/security/OAR082/valid-format.json new file mode 100644 index 00000000..7423cb98 --- /dev/null +++ b/src/test/resources/checks/v32/security/OAR082/valid-format.json @@ -0,0 +1,45 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/invoices": { + "get": { + "responses": { + "200": { + "description": "A invoice.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "product": { + "type": "string", # Noncompliant {{OAR082: The string properties of the specified parameters must define a byte or binary format.}} + "format": "int128" + }, + "line": { + "type": "string" # Noncompliant {{OAR082: The string properties of the specified parameters must define a byte or binary format.}} + }, + "price": { + "type": "string", + "format": "byte" + } + } + } + } + } + } + } + } + } + } + } + + + + + + + \ No newline at end of file diff --git a/src/test/resources/checks/v32/security/OAR082/valid-format.yaml b/src/test/resources/checks/v32/security/OAR082/valid-format.yaml new file mode 100644 index 00000000..626624e9 --- /dev/null +++ b/src/test/resources/checks/v32/security/OAR082/valid-format.yaml @@ -0,0 +1,23 @@ +openapi: "3.0.0" +info: + version: "1.0.0" + title: "Swagger Petstore" +paths: + /invoices: + get: + responses: + '200': + description: A invoice. + content: + application/json: + schema: + type: object + properties: + product: + type: string # Noncompliant {{OAR082: The string properties of the specified parameters must define a byte or binary format.}} + format: int128 + line: + type: string # Noncompliant {{OAR082: The string properties of the specified parameters must define a byte or binary format.}} + price: + type: string + format: byte \ No newline at end of file diff --git a/src/test/resources/checks/v32/security/OAR083/forbidden-query-params.json b/src/test/resources/checks/v32/security/OAR083/forbidden-query-params.json new file mode 100644 index 00000000..b0519a8d --- /dev/null +++ b/src/test/resources/checks/v32/security/OAR083/forbidden-query-params.json @@ -0,0 +1,45 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "My API" + }, + "paths": { + "/examples": { + "get": { + "summary": "Get a list of items", + "parameters": [ # Noncompliant {{OAR083: The parameter email should not pass through this querystring}} + { + "name": "email", + "in": "query", + "schema": { + "type": "string" + } + }, + { + "name": "patata", + "in": "query", + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "description": "A list of items", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + } + } + } + } + } \ No newline at end of file diff --git a/src/test/resources/checks/v32/security/OAR083/forbidden-query-params.yaml b/src/test/resources/checks/v32/security/OAR083/forbidden-query-params.yaml new file mode 100644 index 00000000..1a6d9121 --- /dev/null +++ b/src/test/resources/checks/v32/security/OAR083/forbidden-query-params.yaml @@ -0,0 +1,26 @@ + openapi: "3.0.0" + info: + version: 1.0.0 + title: My API + paths: + /examples: + post: + summary: Get a list of items + parameters: # Noncompliant {{OAR083: The parameter email should not pass through this querystring}} + - name: email + in: query + schema: + type: string + - name: param2 + in: query + schema: + type: integer + responses: + 200: + description: A list of items + content: + application/json: + schema: + type: array + items: + type: string \ No newline at end of file diff --git a/src/test/resources/checks/v32/security/OAR083/no-parameters.json b/src/test/resources/checks/v32/security/OAR083/no-parameters.json new file mode 100644 index 00000000..c4aee44f --- /dev/null +++ b/src/test/resources/checks/v32/security/OAR083/no-parameters.json @@ -0,0 +1,19 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "My API" + }, + "paths": { + "/examples": { + "get": { + "summary": "Get a list of items", + "responses": { + "200": { + "description": "A list of items" + } + } + } + } + } +} diff --git a/src/test/resources/checks/v32/security/OAR083/no-parameters.yaml b/src/test/resources/checks/v32/security/OAR083/no-parameters.yaml new file mode 100644 index 00000000..cc4eaac0 --- /dev/null +++ b/src/test/resources/checks/v32/security/OAR083/no-parameters.yaml @@ -0,0 +1,11 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: My API +paths: + /examples: + get: + summary: Get a list of items + responses: + 200: + description: A list of items diff --git a/src/test/resources/checks/v32/security/OAR083/null-name-param.json b/src/test/resources/checks/v32/security/OAR083/null-name-param.json new file mode 100644 index 00000000..467fc8c9 --- /dev/null +++ b/src/test/resources/checks/v32/security/OAR083/null-name-param.json @@ -0,0 +1,30 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "My API" + }, + "paths": { + "/examples/{id}": { + "get": { + "summary": "Get an item", + "parameters": [ + { + "name": null, + "in": "query", + "schema": { "type": "string" } + }, + { + "name": "id", + "in": "path", + "required": true, + "schema": { "type": "string" } + } + ], + "responses": { + "200": { "description": "An item" } + } + } + } + } +} diff --git a/src/test/resources/checks/v32/security/OAR083/null-name-param.yaml b/src/test/resources/checks/v32/security/OAR083/null-name-param.yaml new file mode 100644 index 00000000..67ccaf06 --- /dev/null +++ b/src/test/resources/checks/v32/security/OAR083/null-name-param.yaml @@ -0,0 +1,21 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: My API +paths: + /examples/{id}: + get: + summary: Get an item + parameters: + - name: ~ + in: query + schema: + type: string + - name: id + in: path + required: true + schema: + type: string + responses: + 200: + description: An item diff --git a/src/test/resources/checks/v32/security/OAR083/options-operation.json b/src/test/resources/checks/v32/security/OAR083/options-operation.json new file mode 100644 index 00000000..f2471041 --- /dev/null +++ b/src/test/resources/checks/v32/security/OAR083/options-operation.json @@ -0,0 +1,24 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "My API" + }, + "paths": { + "/examples": { + "options": { + "summary": "Options for the resource", + "parameters": [ + { + "name": "email", + "in": "query", + "schema": { "type": "string" } + } + ], + "responses": { + "200": { "description": "OK" } + } + } + } + } +} diff --git a/src/test/resources/checks/v32/security/OAR083/options-operation.yaml b/src/test/resources/checks/v32/security/OAR083/options-operation.yaml new file mode 100644 index 00000000..02b2fada --- /dev/null +++ b/src/test/resources/checks/v32/security/OAR083/options-operation.yaml @@ -0,0 +1,16 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: My API +paths: + /examples: + options: + summary: Options for the resource + parameters: + - name: email + in: query + schema: + type: string + responses: + 200: + description: OK diff --git a/src/test/resources/checks/v32/security/OAR083/valid-query-params.json b/src/test/resources/checks/v32/security/OAR083/valid-query-params.json new file mode 100644 index 00000000..9251c180 --- /dev/null +++ b/src/test/resources/checks/v32/security/OAR083/valid-query-params.json @@ -0,0 +1,45 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "My API" + }, + "paths": { + "/items": { + "get": { + "summary": "Get a list of items", + "parameters": [ + { + "name": "param1", + "in": "query", + "schema": { + "type": "string" + } + }, + { + "name": "param2", + "in": "query", + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "description": "A list of items", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + } + } + } + } + } \ No newline at end of file diff --git a/src/test/resources/checks/v32/security/OAR083/valid-query-params.yaml b/src/test/resources/checks/v32/security/OAR083/valid-query-params.yaml new file mode 100644 index 00000000..4347bb96 --- /dev/null +++ b/src/test/resources/checks/v32/security/OAR083/valid-query-params.yaml @@ -0,0 +1,26 @@ + openapi: "3.0.0" + info: + version: 1.0.0 + title: My API + paths: + /items: + get: + summary: Get a list of items + parameters: + - name: param1 + in: query + schema: + type: string + - name: param2 + in: query + schema: + type: integer + responses: + 200: + description: A list of items + content: + application/json: + schema: + type: array + items: + type: string \ No newline at end of file diff --git a/src/test/resources/checks/v32/security/OAR084/forbidden-query-formats.json b/src/test/resources/checks/v32/security/OAR084/forbidden-query-formats.json new file mode 100644 index 00000000..9b2e7f7b --- /dev/null +++ b/src/test/resources/checks/v32/security/OAR084/forbidden-query-formats.json @@ -0,0 +1,46 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "My API" + }, + "paths": { + "/examples": { + "get": { + "summary": "Get a list of items", + "parameters": [ + { + "name": "exampleParam1", + "in": "query", + "schema": { + "type": "string", + "format": "password" # Noncompliant {{OAR084: The format password should not pass through this querystring}} + } + }, + { + "name": "param3", + "in": "query", + "schema": { + "type": "boolean" + } + } + ], + "responses": { + "200": { + "description": "A list of items", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/security/OAR084/forbidden-query-formats.yaml b/src/test/resources/checks/v32/security/OAR084/forbidden-query-formats.yaml new file mode 100644 index 00000000..892eaa69 --- /dev/null +++ b/src/test/resources/checks/v32/security/OAR084/forbidden-query-formats.yaml @@ -0,0 +1,27 @@ +openapi: 3.0.0 +info: + version: 1.0.0 + title: My API +paths: + /examples: + get: + summary: Get a list of items + parameters: + - name: exampleParam1 + in: query + schema: + type: string + format: password # Noncompliant {{OAR084: The format password should not pass through this querystring}} + - name: param3 + in: query + schema: + type: boolean + responses: + 200: + description: A list of items + content: + application/json: + schema: + type: array + items: + type: string \ No newline at end of file diff --git a/src/test/resources/checks/v32/security/OAR084/no-parameters.json b/src/test/resources/checks/v32/security/OAR084/no-parameters.json new file mode 100644 index 00000000..dcdc8dd6 --- /dev/null +++ b/src/test/resources/checks/v32/security/OAR084/no-parameters.json @@ -0,0 +1,17 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "My API" + }, + "paths": { + "/examples": { + "get": { + "summary": "Get a list of items", + "responses": { + "200": { "description": "A list of items" } + } + } + } + } +} diff --git a/src/test/resources/checks/v32/security/OAR084/no-parameters.yaml b/src/test/resources/checks/v32/security/OAR084/no-parameters.yaml new file mode 100644 index 00000000..cc4eaac0 --- /dev/null +++ b/src/test/resources/checks/v32/security/OAR084/no-parameters.yaml @@ -0,0 +1,11 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: My API +paths: + /examples: + get: + summary: Get a list of items + responses: + 200: + description: A list of items diff --git a/src/test/resources/checks/v32/security/OAR084/non-query-param.json b/src/test/resources/checks/v32/security/OAR084/non-query-param.json new file mode 100644 index 00000000..2b52b6d3 --- /dev/null +++ b/src/test/resources/checks/v32/security/OAR084/non-query-param.json @@ -0,0 +1,28 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "My API" + }, + "paths": { + "/examples/{id}": { + "get": { + "summary": "Get an item", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "password" + } + } + ], + "responses": { + "200": { "description": "An item" } + } + } + } + } +} diff --git a/src/test/resources/checks/v32/security/OAR084/non-query-param.yaml b/src/test/resources/checks/v32/security/OAR084/non-query-param.yaml new file mode 100644 index 00000000..b9ec5900 --- /dev/null +++ b/src/test/resources/checks/v32/security/OAR084/non-query-param.yaml @@ -0,0 +1,18 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: My API +paths: + /examples/{id}: + get: + summary: Get an item + parameters: + - name: id + in: path + required: true + schema: + type: string + format: password + responses: + 200: + description: An item diff --git a/src/test/resources/checks/v32/security/OAR084/null-format-param.json b/src/test/resources/checks/v32/security/OAR084/null-format-param.json new file mode 100644 index 00000000..8f760ba8 --- /dev/null +++ b/src/test/resources/checks/v32/security/OAR084/null-format-param.json @@ -0,0 +1,27 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "My API" + }, + "paths": { + "/examples": { + "get": { + "summary": "Get a list of items", + "parameters": [ + { + "name": "exampleParam1", + "in": "query", + "schema": { + "type": "string", + "format": null + } + } + ], + "responses": { + "200": { "description": "A list of items" } + } + } + } + } +} diff --git a/src/test/resources/checks/v32/security/OAR084/null-format-param.yaml b/src/test/resources/checks/v32/security/OAR084/null-format-param.yaml new file mode 100644 index 00000000..dbdd4a21 --- /dev/null +++ b/src/test/resources/checks/v32/security/OAR084/null-format-param.yaml @@ -0,0 +1,17 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: My API +paths: + /examples: + get: + summary: Get a list of items + parameters: + - name: exampleParam1 + in: query + schema: + type: string + format: ~ + responses: + 200: + description: A list of items diff --git a/src/test/resources/checks/v32/security/OAR084/valid-query-formats.json b/src/test/resources/checks/v32/security/OAR084/valid-query-formats.json new file mode 100644 index 00000000..9251c180 --- /dev/null +++ b/src/test/resources/checks/v32/security/OAR084/valid-query-formats.json @@ -0,0 +1,45 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "My API" + }, + "paths": { + "/items": { + "get": { + "summary": "Get a list of items", + "parameters": [ + { + "name": "param1", + "in": "query", + "schema": { + "type": "string" + } + }, + { + "name": "param2", + "in": "query", + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "description": "A list of items", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + } + } + } + } + } \ No newline at end of file diff --git a/src/test/resources/checks/v32/security/OAR084/valid-query-formats.yaml b/src/test/resources/checks/v32/security/OAR084/valid-query-formats.yaml new file mode 100644 index 00000000..5a53854c --- /dev/null +++ b/src/test/resources/checks/v32/security/OAR084/valid-query-formats.yaml @@ -0,0 +1,27 @@ +openapi: 3.0.0 +info: + version: 1.0.0 + title: My API +paths: + /examples: + get: + summary: Get a list of items + parameters: + - name: exampleParam1 + in: query + schema: + type: string + format: date + - name: param3 + in: query + schema: + type: boolean + responses: + 200: + description: A list of items + content: + application/json: + schema: + type: array + items: + type: string \ No newline at end of file diff --git a/src/test/resources/checks/v32/security/OAR085/invalid-openapi-version.json b/src/test/resources/checks/v32/security/OAR085/invalid-openapi-version.json new file mode 100644 index 00000000..88a6bbca --- /dev/null +++ b/src/test/resources/checks/v32/security/OAR085/invalid-openapi-version.json @@ -0,0 +1,9 @@ +{ + "openapi": "3.0.3", + "info": { + "title": "Sample API", + "description": "This is a sample API.", + "version": "1.0.0" + }, + "paths": {} +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/security/OAR085/invalid-openapi-version.yaml b/src/test/resources/checks/v32/security/OAR085/invalid-openapi-version.yaml new file mode 100644 index 00000000..9cfcd02d --- /dev/null +++ b/src/test/resources/checks/v32/security/OAR085/invalid-openapi-version.yaml @@ -0,0 +1,6 @@ +openapi: 3.0.3 +info: + title: Sample API + description: This is a sample API. + version: 1.0.0 +paths: {} \ No newline at end of file diff --git a/src/test/resources/checks/v32/security/OAR085/valid-openapi-version.json b/src/test/resources/checks/v32/security/OAR085/valid-openapi-version.json new file mode 100644 index 00000000..0997875d --- /dev/null +++ b/src/test/resources/checks/v32/security/OAR085/valid-openapi-version.json @@ -0,0 +1,9 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "Sample API", + "description": "This is a sample API.", + "version": "1.0.0" + }, + "paths": {} + } \ No newline at end of file diff --git a/src/test/resources/checks/v32/security/OAR085/valid-openapi-version.yaml b/src/test/resources/checks/v32/security/OAR085/valid-openapi-version.yaml new file mode 100644 index 00000000..ee95c7c0 --- /dev/null +++ b/src/test/resources/checks/v32/security/OAR085/valid-openapi-version.yaml @@ -0,0 +1,6 @@ +openapi: 3.0.0 +info: + title: Sample API + description: This is a sample API. + version: 1.0.0 +paths: {} \ No newline at end of file diff --git a/src/test/resources/checks/v32/security/OAR096/valid.json b/src/test/resources/checks/v32/security/OAR096/valid.json new file mode 100644 index 00000000..c45fbe9a --- /dev/null +++ b/src/test/resources/checks/v32/security/OAR096/valid.json @@ -0,0 +1,117 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "components": { + "securitySchemes": { + "BasicAuth": { + "type": "http", + "scheme": "basic" + }, + "BearerAuth": { + "type": "http", + "scheme": "bearer" + }, + "ApiKeyAuth": { + "type": "apiKey", + "in": "header", + "name": "X-API-Key" + }, + "OpenID": { + "type": "openIdConnect", + "openIdConnectUrl": "https://example.com/.well-known/openid-configuration" + }, + "OAuth2": { + "type": "oauth2", + "flows": { + "authorizationCode": { + "authorizationUrl": "https://example.com/oauth/authorize", + "tokenUrl": "https://example.com/oauth/token", + "scopes": { + "read": "Grants read access", + "write": "Grants write access", + "admin": "Grants access to admin operations" + } + } + } + } + } + }, + "paths": { + "/with-auth-and-header": { + "get": { + "parameters": [ + { + "in": "header", + "name": "x-api-key", + "schema": { + "type": "string" + } + } + ], + "security": [ + { + "ApiKeyAuth": [ + + ] + }, + { + "OAuth2": [ + "read", + "write" + ] + } + ], + "responses": { + "200": { + "description": "Ok" + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + }, + "429": { + "description": "Forbidden" + } + } + } + }, + "/with-header": { + "parameters": [ + { + "in": "header", + "name": "x-api-key", + "schema": { + "type": "string" + } + } + ], + "get": { + "responses": { + "200": { + "description": "Ok" + }, + "401": { + "description": "Unauthorized" + }, + "429": { + "description": "Unauthorized" + } + } + } + }, + "/without": { + "get": { + "responses": { + "200": { + "description": "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/security/OAR096/valid.yaml b/src/test/resources/checks/v32/security/OAR096/valid.yaml new file mode 100644 index 00000000..4ada663f --- /dev/null +++ b/src/test/resources/checks/v32/security/OAR096/valid.yaml @@ -0,0 +1,70 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +components: + securitySchemes: + BasicAuth: + type: http + scheme: basic + BearerAuth: + type: http + scheme: bearer + ApiKeyAuth: + type: apiKey + in: header + name: X-API-Key + OpenID: + type: openIdConnect + openIdConnectUrl: https://example.com/.well-known/openid-configuration + OAuth2: + type: oauth2 + flows: + authorizationCode: + authorizationUrl: https://example.com/oauth/authorize + tokenUrl: https://example.com/oauth/token + scopes: + read: Grants read access + write: Grants write access + admin: Grants access to admin operations +paths: + /with-auth-and-header: + get: + parameters: + - in: header + name: x-api-key + schema: + type: string + security: + - ApiKeyAuth: [] + - OAuth2: + - read + - write + responses: + 200: + description: Ok + 401: + description: Unauthorized + 403: + description: Forbidden + 429: + description: Forbidden + /with-header: + parameters: + - in: header + name: x-api-key + schema: + type: string + get: + responses: + 200: + description: Ok + 401: + description: Unauthorized + 429: + description: Unauthorized + /without: + get: + responses: + 200: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v32/security/OAR096/without-authorization-responses.json b/src/test/resources/checks/v32/security/OAR096/without-authorization-responses.json new file mode 100644 index 00000000..4fa2d839 --- /dev/null +++ b/src/test/resources/checks/v32/security/OAR096/without-authorization-responses.json @@ -0,0 +1,100 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "components": { + "securitySchemes": { + "BasicAuth": { + "type": "http", + "scheme": "basic" + }, + "BearerAuth": { + "type": "http", + "scheme": "bearer" + }, + "ApiKeyAuth": { + "type": "apiKey", + "in": "header", + "name": "X-API-Key" + }, + "OpenID": { + "type": "openIdConnect", + "openIdConnectUrl": "https://example.com/.well-known/openid-configuration" + }, + "OAuth2": { + "type": "oauth2", + "flows": { + "authorizationCode": { + "authorizationUrl": "https://example.com/oauth/authorize", + "tokenUrl": "https://example.com/oauth/token", + "scopes": { + "read": "Grants read access", + "write": "Grants write access", + "admin": "Grants access to admin operations" + } + } + } + } + } + }, + "paths": { + "/with-auth-and-header": { + "get": { + "parameters": [ + { + "in": "header", + "name": "x-api-key", + "schema": { + "type": "string" + } + } + ], + "security": [ + { + "ApiKeyAuth": [] + }, + { + "OAuth2": [ + "read", + "write" + ] + } + ], + "responses": { # Noncompliant {{OAR096: Response code 403 must be defined for operations with security schemes defined}} + "200": { + "description": "Ok" + } + } + } + }, + "/with-header": { + "parameters": [ + { + "in": "header", + "name": "x-api-key", + "schema": { + "type": "string" + } + } + ], + "get": { + "responses": { + "200": { + "description": "Ok" + } + } + } + }, + "/without": { + "get": { + "responses": { + "200": { + "description": "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/security/OAR096/without-authorization-responses.yaml b/src/test/resources/checks/v32/security/OAR096/without-authorization-responses.yaml new file mode 100644 index 00000000..45b6d2e7 --- /dev/null +++ b/src/test/resources/checks/v32/security/OAR096/without-authorization-responses.yaml @@ -0,0 +1,62 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +components: + securitySchemes: + BasicAuth: + type: http + scheme: basic + BearerAuth: + type: http + scheme: bearer + ApiKeyAuth: + type: apiKey + in: header + name: X-API-Key + OpenID: + type: openIdConnect + openIdConnectUrl: https://example.com/.well-known/openid-configuration + OAuth2: + type: oauth2 + flows: + authorizationCode: + authorizationUrl: https://example.com/oauth/authorize + tokenUrl: https://example.com/oauth/token + scopes: + read: Grants read access + write: Grants write access + admin: Grants access to admin operations +security: + - ApiKeyAuth: [] + - OAuth2: + - read + - write +paths: + /with-auth-and-header: + get: + parameters: + - in: header + name: x-api-key + schema: + type: string + responses: # Noncompliant {{OAR096: Response code 403 must be defined for operations with security schemes defined}} + 200: + description: Ok + + /with-header: + parameters: + - in: header + name: x-api-key + schema: + type: string + get: + responses: # Noncompliant {{OAR096: Response code 403 must be defined for operations with security schemes defined}} + 200: + description: Ok + + /without: + get: + responses: # Noncompliant {{OAR096: Response code 403 must be defined for operations with security schemes defined}} + 200: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v32/security/OAR114/valid.json b/src/test/resources/checks/v32/security/OAR114/valid.json new file mode 100644 index 00000000..79d9c816 --- /dev/null +++ b/src/test/resources/checks/v32/security/OAR114/valid.json @@ -0,0 +1,32 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "Valid Response Headers Test", + "version": "1.0" + }, + "paths": { + "/example": { + "get": { + "responses": { + "200": { + "description": "OK", + "headers": { + "x-api-key": { + "description": "Mandatory header", + "schema": { + "type": "string" + } + }, + "traceId": { + "description": "Optional but allowed", + "schema": { + "type": "string" + } + } + } + } + } + } + } + } +} diff --git a/src/test/resources/checks/v32/security/OAR114/valid.yaml b/src/test/resources/checks/v32/security/OAR114/valid.yaml new file mode 100644 index 00000000..8c936a19 --- /dev/null +++ b/src/test/resources/checks/v32/security/OAR114/valid.yaml @@ -0,0 +1,19 @@ +openapi: 3.0.0 +info: + title: Valid Response Headers Test + version: "1.0" +paths: + /example: + get: + responses: + "200": + description: OK + headers: + x-api-key: + description: Mandatory header + schema: + type: string + traceId: + description: Optional but allowed + schema: + type: string diff --git a/src/test/resources/checks/v32/security/OAR114/with-forbidden-params.json b/src/test/resources/checks/v32/security/OAR114/with-forbidden-params.json new file mode 100644 index 00000000..975318bc --- /dev/null +++ b/src/test/resources/checks/v32/security/OAR114/with-forbidden-params.json @@ -0,0 +1,26 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "Forbidden Header Test", + "version": "1.0" + }, + "paths": { + "/example": { + "get": { + "responses": { + "200": { # Noncompliant {{OAR114: Headers [x-api-key] are required}} + "description": "OK", + "headers": { + "Authorization": { # Noncompliant {{OAR114: Header not allowed}} + "description": "Forbidden header", + "schema": { + "type": "string" + } + } + } + } + } + } + } + } +} diff --git a/src/test/resources/checks/v32/security/OAR114/with-forbidden-params.yaml b/src/test/resources/checks/v32/security/OAR114/with-forbidden-params.yaml new file mode 100644 index 00000000..4f2c2bc7 --- /dev/null +++ b/src/test/resources/checks/v32/security/OAR114/with-forbidden-params.yaml @@ -0,0 +1,15 @@ +openapi: 3.0.0 +info: + title: Forbidden Header Test + version: "1.0" +paths: + /example: + get: + responses: + "200": # Noncompliant {{OAR114: Headers [x-api-key] are required}} + description: OK + headers: + Authorization: # Noncompliant {{OAR114: Header not allowed}} + description: Forbidden header + schema: + type: string diff --git a/src/test/resources/checks/v32/security/OAR114/without-required-params.json b/src/test/resources/checks/v32/security/OAR114/without-required-params.json new file mode 100644 index 00000000..876746f3 --- /dev/null +++ b/src/test/resources/checks/v32/security/OAR114/without-required-params.json @@ -0,0 +1,26 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "Missing Mandatory Header Test", + "version": "1.0" + }, + "paths": { + "/example": { + "get": { + "responses": { + "200": { # Noncompliant {{OAR114: Headers [x-api-key] are required}} + "description": "OK", + "headers": { + "traceId": { + "description": "Allowed header", + "schema": { + "type": "string" + } + } + } + } + } + } + } + } +} diff --git a/src/test/resources/checks/v32/security/OAR114/without-required-params.yaml b/src/test/resources/checks/v32/security/OAR114/without-required-params.yaml new file mode 100644 index 00000000..5603c561 --- /dev/null +++ b/src/test/resources/checks/v32/security/OAR114/without-required-params.yaml @@ -0,0 +1,15 @@ +openapi: 3.0.0 +info: + title: Missing Mandatory Header Test + version: "1.0" +paths: + /example: + get: + responses: + "200": # Noncompliant {{OAR114: Headers [x-api-key] are required}} + description: OK + headers: + traceId: + description: Allowed header + schema: + type: string diff --git a/src/test/resources/validation-test-all-violations.yaml b/src/test/resources/validation-test-all-violations.yaml new file mode 100644 index 00000000..a4ec2f75 --- /dev/null +++ b/src/test/resources/validation-test-all-violations.yaml @@ -0,0 +1,110 @@ +openapi: 3.0.0 +info: + title: Test API with Violations + version: 1.0.0 + # Missing license and contact (OAR110, OAR111) +servers: + - url: http://example.com # OAR001: Should be HTTPS + description: Non-HTTPS server +paths: + /users: + get: + summary: Get Users + # Missing description (OAR086, OAR087) + operationId: getUsers + tags: + - undeclaredTag # OAR046: Tag not in global tags list + parameters: + - name: limit + in: query + schema: + type: integer + # Missing required field info (OAR025) + - name: offset_value # OAR077: Should use snake_case in query params + in: query + schema: + type: integer + required: true + responses: + '200': + description: Success + content: + application/json: + schema: + type: object + properties: + data: + type: array + '401': + # Missing content for non-204 response (OAR045) + description: Unauthorized + '204': + description: No Content + # OAR049: Should not have content for 204 + content: + application/json: + schema: + type: object + post: + summary: Create User + description: This creates a user # OAR051: Summary and description are too similar + requestBody: + # Missing content (OAR006) + required: true + responses: + '201': + # Missing location header (OAR027) + description: Created + /products/{id}: + parameters: + - name: id + in: path + required: true + schema: + type: string + get: + summary: Get Product + parameters: + - name: id + in: query # OAR069: Path param should not also be in query + required: true + schema: + type: string + responses: + default: + description: Default + # Missing content (OAR007) + put: + summary: Update Product + responses: + '200': + description: Updated + # Missing content (OAR007) + /internal/admin: # OAR030: Status endpoint not found + get: + summary: Admin Panel + tags: + - admin + responses: + '200': + description: OK + content: + application/json: + schema: + type: object +tags: + - name: users + description: User operations + - name: products + # OAR047: Tag should have description (if declared, should be used properly) +components: + schemas: + Error: + type: object + properties: + code: + type: integer + format: int32 # OAR016, OAR037: Format validation + message: + type: string + # Missing required fields (OAR115) From 0e126d3af27ea58e386c0cae35bbb26c30f8ad11 Mon Sep 17 00:00:00 2001 From: Melsy Huamani Date: Tue, 5 May 2026 20:43:05 -0500 Subject: [PATCH 02/28] feat: update existing rules to support openapi 3.2 specifications and tests --- .../checks/examples/OAR031ExamplesCheck.java | 24 ++++---- .../examples/OAR094UseExamplesCheck.java | 9 +-- .../checks/format/AbstractBasePathCheck.java | 3 +- .../format/AbstractDefaultMediaTypeCheck.java | 3 +- .../checks/format/AbstractFormatCheck.java | 3 +- .../AbstractInfoObjectMappingCheck.java | 4 +- .../AbstractSchemaNamingConventionCheck.java | 11 ++-- .../AbstractUndefinedMediaTypeCheck.java | 3 +- .../OAR011UrlNamingConventionCheck.java | 3 +- .../OAR012ParameterNamingConventionCheck.java | 18 ++++-- .../checks/format/OAR044MediaTypeCheck.java | 9 +-- .../format/OAR050ProvideOpSummaryCheck.java | 3 +- .../OAR051DescriptionDiffersSummaryCheck.java | 3 +- ...OAR077ParametersInQuerySnakeCaseCheck.java | 5 +- .../format/OAR086DescriptionFormatCheck.java | 1 + .../format/OAR087SummaryFormatCheck.java | 7 ++- .../checks/format/OAR088RefParamCheck.java | 5 +- .../format/OAR089RefRequestBodyCheck.java | 5 +- .../checks/format/OAR090RefResponseCheck.java | 3 +- .../checks/format/OAR113CustomFieldCheck.java | 35 +++++++---- .../format/OAR115VerifyRequiredFields.java | 5 +- .../operations/AbstractHttpMethodCheck.java | 9 +-- .../AbstractResourceLevelCheck.java | 3 +- .../AbstractResourcesByVerbCheck.java | 6 +- .../operations/AbstractVerbPathCheck.java | 3 +- .../OAR008AllowedHttpVerbCheck.java | 4 +- .../OAR013DefaultResponseCheck.java | 3 +- .../operations/OAR017ResourcePathCheck.java | 3 +- ...OAR027PostResponseLocationHeaderCheck.java | 3 +- .../operations/OAR030StatusEndpointCheck.java | 3 +- .../OAR032AmbiguousElementsPathCheck.java | 3 +- .../operations/OAR046DeclaredTagCheck.java | 3 +- .../operations/OAR047DocumentedTagCheck.java | 5 +- .../OAR071GetQueryParamsDefinedCheck.java | 7 ++- .../operations/OAR091ParamOnlyRefCheck.java | 5 +- .../OAR092RequestBodyOnlyRefCheck.java | 5 +- .../OAR093ResponseOnlyRefCheck.java | 5 +- ...R109ForbiddenInternalServerErrorCheck.java | 3 +- .../parameters/AbstractParameterCheck.java | 4 +- .../AbstractQueryParameterCheck.java | 7 ++- ...OAR026TotalParameterDefaultValueCheck.java | 5 +- .../OAR028FilterParameterCheck.java | 7 ++- .../OAR069PathParamAndQueryCheck.java | 7 ++- .../checks/regex/OAR112RegexCheck.java | 43 ++++++++++--- .../AbstractExplicitResponseCheck.java | 5 +- .../OAR029StandardResponseSchemaCheck.java | 5 +- .../schemas/OAR080SecuritySchemasCheck.java | 5 +- .../schemas/OAR108SchemaValidatorCheck.java | 4 +- .../AbstractPathAwareOperationCheck.java | 8 ++- .../AbstractSecurityResponseCheck.java | 3 +- .../AbstractTypedParameterIntegrityCheck.java | 4 +- .../OAR001MandatoryHttpsProtocolCheck.java | 3 +- .../security/OAR033HttpHeadersCheck.java | 5 +- .../OAR036SessionMechanismsCheck.java | 7 ++- .../security/OAR049NoContentIn204Check.java | 5 +- .../checks/security/OAR054HostCheck.java | 3 +- .../OAR072NonOKModelResponseCheck.java | 5 +- .../security/OAR078VerbsSecurityCheck.java | 7 ++- .../security/OAR081PasswordFormatCheck.java | 10 +++- .../OAR082BinaryOrByteFormatCheck.java | 3 +- .../security/OAR085OpenAPIVersionCheck.java | 5 +- .../OAR114HttpResponseHeadersChecks.java | 3 +- .../sonar/openapi/utils/JsonNodeUtils.java | 3 +- .../openapi/ExtendedOpenApiCheckVerifier.java | 4 +- .../checks/v31/operations/OAR008/plain.json | 60 +++++++++++++++++++ .../checks/v31/operations/OAR008/plain.yaml | 34 +++++++++++ .../checks/v32/operations/OAR008/plain.json | 60 +++++++++++++++++++ .../checks/v32/operations/OAR008/plain.yaml | 34 +++++++++++ 68 files changed, 452 insertions(+), 141 deletions(-) create mode 100644 src/test/resources/checks/v31/operations/OAR008/plain.json create mode 100644 src/test/resources/checks/v31/operations/OAR008/plain.yaml create mode 100644 src/test/resources/checks/v32/operations/OAR008/plain.json create mode 100644 src/test/resources/checks/v32/operations/OAR008/plain.yaml diff --git a/src/main/java/apiaddicts/sonar/openapi/checks/examples/OAR031ExamplesCheck.java b/src/main/java/apiaddicts/sonar/openapi/checks/examples/OAR031ExamplesCheck.java index b1d0582a..2c4fb058 100644 --- a/src/main/java/apiaddicts/sonar/openapi/checks/examples/OAR031ExamplesCheck.java +++ b/src/main/java/apiaddicts/sonar/openapi/checks/examples/OAR031ExamplesCheck.java @@ -12,6 +12,7 @@ import org.apiaddicts.apitools.dosonarapi.api.v2.OpenApi2Grammar; import org.apiaddicts.apitools.dosonarapi.api.v3.OpenApi3Grammar; import org.apiaddicts.apitools.dosonarapi.api.v31.OpenApi31Grammar; +import org.apiaddicts.apitools.dosonarapi.api.v32.OpenApi32Grammar; import org.apiaddicts.apitools.dosonarapi.sslr.yaml.grammar.JsonNode; import org.sonar.check.Rule; @@ -35,17 +36,18 @@ public Set subscribedKinds() { OpenApi2Grammar.SCHEMA, OpenApi2Grammar.RESPONSES, OpenApi2Grammar.PARAMETER, OpenApi3Grammar.SCHEMA, OpenApi3Grammar.RESPONSES, OpenApi3Grammar.PARAMETER, OpenApi31Grammar.SCHEMA, OpenApi31Grammar.RESPONSES, OpenApi31Grammar.PARAMETER, - OpenApi3Grammar.REQUEST_BODY, OpenApi31Grammar.REQUEST_BODY, - OpenApi2Grammar.PATH, OpenApi3Grammar.PATH, OpenApi31Grammar.PATH + OpenApi32Grammar.SCHEMA, OpenApi32Grammar.RESPONSES, OpenApi32Grammar.PARAMETER, + OpenApi3Grammar.REQUEST_BODY, OpenApi31Grammar.REQUEST_BODY, OpenApi32Grammar.REQUEST_BODY, + OpenApi2Grammar.PATH, OpenApi3Grammar.PATH, OpenApi31Grammar.PATH, OpenApi32Grammar.PATH ); } @Override public void visitNode(JsonNode node) { AstNodeType type = node.getType(); - if (OpenApi2Grammar.PATH.equals(type) || OpenApi3Grammar.PATH.equals(type) || OpenApi31Grammar.PATH.equals(type)) { + if (OpenApi2Grammar.PATH.equals(type) || OpenApi3Grammar.PATH.equals(type) || OpenApi31Grammar.PATH.equals(type) || OpenApi32Grammar.PATH.equals(type)) { visitPathNode(node); - } else if (OpenApi2Grammar.PARAMETER.equals(type) || OpenApi3Grammar.PARAMETER.equals(type) || OpenApi31Grammar.PARAMETER.equals(type)) { + } else if (OpenApi2Grammar.PARAMETER.equals(type) || OpenApi3Grammar.PARAMETER.equals(type) || OpenApi31Grammar.PARAMETER.equals(type) || OpenApi32Grammar.PARAMETER.equals(type)) { visitParameterNode(node); } else if (type.equals(OpenApi2Grammar.RESPONSES) || type.equals(OpenApi2Grammar.SCHEMA)) { visitV2Node(node); @@ -98,11 +100,11 @@ private void visitResponseV2Node(JsonNode node) { private void visitV3Node(JsonNode node) { AstNodeType type = node.getType(); - if (OpenApi3Grammar.RESPONSES.equals(type)) { + if (OpenApi3Grammar.RESPONSES.equals(type) || OpenApi31Grammar.RESPONSES.equals(type) || OpenApi32Grammar.RESPONSES.equals(type)) { processResponses(node, this::visitRequestBodyOrResponseV3Node); - } else if (OpenApi3Grammar.SCHEMA.equals(type)) { + } else if (OpenApi3Grammar.SCHEMA.equals(type) || OpenApi31Grammar.SCHEMA.equals(type) || OpenApi32Grammar.SCHEMA.equals(type)) { visitSchemaNode(node); - } else if (OpenApi3Grammar.REQUEST_BODY.equals(type)) { + } else if (OpenApi3Grammar.REQUEST_BODY.equals(type) || OpenApi31Grammar.REQUEST_BODY.equals(type) || OpenApi32Grammar.REQUEST_BODY.equals(type)) { visitRequestBodyOrResponseV3Node(node); } } @@ -118,7 +120,7 @@ private void visitRequestBodyOrResponseV3Node(JsonNode node) { JsonNode content = node.at("/content"); if (content.isMissing()) { - String errorKey = node.getType().equals(OpenApi3Grammar.REQUEST_BODY) ? "OAR031.error-request" : ERROR_RESPONSE; + String errorKey = (node.getType().equals(OpenApi3Grammar.REQUEST_BODY) || node.getType().equals(OpenApi31Grammar.REQUEST_BODY) || node.getType().equals(OpenApi32Grammar.REQUEST_BODY)) ? "OAR031.error-request" : ERROR_RESPONSE; addIssue(KEY, translate(errorKey), handleExternalRef.getTrueNode(node.key())); return; } @@ -129,7 +131,7 @@ private void visitRequestBodyOrResponseV3Node(JsonNode node) { || !mediaTypeNode.get(EXAMPLE).isMissing(); if (!hasExplicitExample && !isSchemaCovered(schemaNode)) { - String errorKey = node.getType().equals(OpenApi3Grammar.REQUEST_BODY) ? "OAR031.error-request" : ERROR_RESPONSE; + String errorKey = (node.getType().equals(OpenApi3Grammar.REQUEST_BODY) || node.getType().equals(OpenApi31Grammar.REQUEST_BODY) || node.getType().equals(OpenApi32Grammar.REQUEST_BODY)) ? "OAR031.error-request" : ERROR_RESPONSE; addIssue(KEY, translate(errorKey), handleExternalRef.getTrueNode(node.key())); } } @@ -160,7 +162,7 @@ private boolean isSchemaCovered(JsonNode schemaNode) { private void visitSchemaNode(JsonNode node) { JsonNode parentNode = (JsonNode) node.getParent().getParent(); - if (parentNode.getType().equals(OpenApi3Grammar.PARAMETER)) { + if (parentNode.getType().equals(OpenApi3Grammar.PARAMETER) || parentNode.getType().equals(OpenApi31Grammar.PARAMETER) || parentNode.getType().equals(OpenApi32Grammar.PARAMETER)) { return; } @@ -190,7 +192,7 @@ private void visitPathNode(JsonNode node) { .forEach(response -> handleExternalRef.resolve(response, resolved -> { if (resolved.getType().equals(OpenApi2Grammar.RESPONSE)) { visitSchemaNode2(resolved); - } else if (resolved.getType().equals(OpenApi3Grammar.RESPONSE)) { + } else if (resolved.getType().equals(OpenApi3Grammar.RESPONSE) || resolved.getType().equals(OpenApi31Grammar.RESPONSE) || resolved.getType().equals(OpenApi32Grammar.RESPONSE)) { JsonNode content = resolved.at("/content"); if (!content.isMissing()) { content.propertyMap().forEach((mediaType, mediaTypeNode) -> { diff --git a/src/main/java/apiaddicts/sonar/openapi/checks/examples/OAR094UseExamplesCheck.java b/src/main/java/apiaddicts/sonar/openapi/checks/examples/OAR094UseExamplesCheck.java index ca1c4eb0..4c34f582 100644 --- a/src/main/java/apiaddicts/sonar/openapi/checks/examples/OAR094UseExamplesCheck.java +++ b/src/main/java/apiaddicts/sonar/openapi/checks/examples/OAR094UseExamplesCheck.java @@ -6,6 +6,7 @@ import org.apiaddicts.apitools.dosonarapi.api.v2.OpenApi2Grammar; import org.apiaddicts.apitools.dosonarapi.api.v3.OpenApi3Grammar; import org.apiaddicts.apitools.dosonarapi.api.v31.OpenApi31Grammar; +import org.apiaddicts.apitools.dosonarapi.api.v32.OpenApi32Grammar; import org.apiaddicts.apitools.dosonarapi.sslr.yaml.grammar.JsonNode; import apiaddicts.sonar.openapi.checks.BaseCheck; import apiaddicts.sonar.openapi.utils.ExternalRefHandler; @@ -26,15 +27,15 @@ public class OAR094UseExamplesCheck extends BaseCheck { @Override public Set subscribedKinds() { - return ImmutableSet.of(OpenApi2Grammar.ROOT, OpenApi3Grammar.ROOT, OpenApi31Grammar.ROOT, OpenApi2Grammar.PATH, OpenApi3Grammar.PATH, OpenApi31Grammar.PATH); + return ImmutableSet.of(OpenApi2Grammar.ROOT, OpenApi3Grammar.ROOT, OpenApi31Grammar.ROOT, OpenApi32Grammar.ROOT, OpenApi2Grammar.PATH, OpenApi3Grammar.PATH, OpenApi31Grammar.PATH, OpenApi32Grammar.PATH); } @Override public void visitNode(JsonNode node) { - if (OpenApi2Grammar.ROOT.equals(node.getType()) || OpenApi3Grammar.ROOT.equals(node.getType()) || OpenApi31Grammar.ROOT.equals(node.getType())) { + if (OpenApi2Grammar.ROOT.equals(node.getType()) || OpenApi3Grammar.ROOT.equals(node.getType()) || OpenApi31Grammar.ROOT.equals(node.getType()) || OpenApi32Grammar.ROOT.equals(node.getType())) { deepSearchForExample(node); } - if (OpenApi2Grammar.PATH.equals(node.getType()) || OpenApi3Grammar.PATH.equals(node.getType()) || OpenApi31Grammar.PATH.equals(node.getType())) { + if (OpenApi2Grammar.PATH.equals(node.getType()) || OpenApi3Grammar.PATH.equals(node.getType()) || OpenApi31Grammar.PATH.equals(node.getType()) || OpenApi32Grammar.PATH.equals(node.getType())) { visitPathNode(node); } } @@ -60,7 +61,7 @@ private void visitPathNode(JsonNode node) { .forEach(response -> handleExternalRef.resolve(response, resolved -> { if (resolved.getType().equals(OpenApi2Grammar.RESPONSE)) { visitSchemaNode(resolved); - } else if (resolved.getType().equals(OpenApi3Grammar.RESPONSE)) { + } else if (resolved.getType().equals(OpenApi3Grammar.RESPONSE) || resolved.getType().equals(OpenApi31Grammar.RESPONSE) || resolved.getType().equals(OpenApi32Grammar.RESPONSE)) { JsonNode content = resolved.at("/content"); if (!content.isMissing()) { content.propertyMap().forEach((mediaType, mediaTypeNode) -> { diff --git a/src/main/java/apiaddicts/sonar/openapi/checks/format/AbstractBasePathCheck.java b/src/main/java/apiaddicts/sonar/openapi/checks/format/AbstractBasePathCheck.java index ef1358fe..35bc151d 100644 --- a/src/main/java/apiaddicts/sonar/openapi/checks/format/AbstractBasePathCheck.java +++ b/src/main/java/apiaddicts/sonar/openapi/checks/format/AbstractBasePathCheck.java @@ -12,6 +12,7 @@ import org.apiaddicts.apitools.dosonarapi.api.v2.OpenApi2Grammar; import org.apiaddicts.apitools.dosonarapi.api.v3.OpenApi3Grammar; import org.apiaddicts.apitools.dosonarapi.api.v31.OpenApi31Grammar; +import org.apiaddicts.apitools.dosonarapi.api.v32.OpenApi32Grammar; import org.apiaddicts.apitools.dosonarapi.sslr.yaml.grammar.JsonNode; public abstract class AbstractBasePathCheck extends BaseCheck { @@ -24,7 +25,7 @@ protected AbstractBasePathCheck(String ruleKey) { @Override public Set subscribedKinds() { - return ImmutableSet.of(OpenApi2Grammar.ROOT, OpenApi3Grammar.SERVER, OpenApi31Grammar.SERVER); + return ImmutableSet.of(OpenApi2Grammar.ROOT, OpenApi3Grammar.SERVER, OpenApi31Grammar.SERVER, OpenApi32Grammar.SERVER); } @Override diff --git a/src/main/java/apiaddicts/sonar/openapi/checks/format/AbstractDefaultMediaTypeCheck.java b/src/main/java/apiaddicts/sonar/openapi/checks/format/AbstractDefaultMediaTypeCheck.java index 3a621ca6..21a8e2ee 100644 --- a/src/main/java/apiaddicts/sonar/openapi/checks/format/AbstractDefaultMediaTypeCheck.java +++ b/src/main/java/apiaddicts/sonar/openapi/checks/format/AbstractDefaultMediaTypeCheck.java @@ -13,6 +13,7 @@ import org.apiaddicts.apitools.dosonarapi.api.v2.OpenApi2Grammar; import org.apiaddicts.apitools.dosonarapi.api.v3.OpenApi3Grammar; import org.apiaddicts.apitools.dosonarapi.api.v31.OpenApi31Grammar; +import org.apiaddicts.apitools.dosonarapi.api.v32.OpenApi32Grammar; import org.apiaddicts.apitools.dosonarapi.sslr.yaml.grammar.JsonNode; import org.sonar.check.RuleProperty; @@ -50,7 +51,7 @@ protected AbstractDefaultMediaTypeCheck(String key, String section, String messa @Override public Set subscribedKinds() { - return ImmutableSet.of(OpenApi2Grammar.OPERATION, OpenApi3Grammar.OPERATION, OpenApi31Grammar.OPERATION, OpenApi3Grammar.RESPONSES, OpenApi31Grammar.RESPONSES); + return ImmutableSet.of(OpenApi2Grammar.OPERATION, OpenApi3Grammar.OPERATION, OpenApi31Grammar.OPERATION, OpenApi32Grammar.OPERATION, OpenApi3Grammar.RESPONSES, OpenApi31Grammar.RESPONSES, OpenApi32Grammar.RESPONSES); } @Override diff --git a/src/main/java/apiaddicts/sonar/openapi/checks/format/AbstractFormatCheck.java b/src/main/java/apiaddicts/sonar/openapi/checks/format/AbstractFormatCheck.java index b163c2fd..af276003 100644 --- a/src/main/java/apiaddicts/sonar/openapi/checks/format/AbstractFormatCheck.java +++ b/src/main/java/apiaddicts/sonar/openapi/checks/format/AbstractFormatCheck.java @@ -5,6 +5,7 @@ import org.apiaddicts.apitools.dosonarapi.api.v2.OpenApi2Grammar; import org.apiaddicts.apitools.dosonarapi.api.v3.OpenApi3Grammar; import org.apiaddicts.apitools.dosonarapi.api.v31.OpenApi31Grammar; +import org.apiaddicts.apitools.dosonarapi.api.v32.OpenApi32Grammar; import apiaddicts.sonar.openapi.checks.BaseCheck; import org.apiaddicts.apitools.dosonarapi.sslr.yaml.grammar.JsonNode; @@ -14,7 +15,7 @@ public abstract class AbstractFormatCheck extends BaseCheck { @Override public Set subscribedKinds() { - return ImmutableSet.of(OpenApi2Grammar.SCHEMA, OpenApi2Grammar.PARAMETER, OpenApi3Grammar.SCHEMA, OpenApi31Grammar.SCHEMA); + return ImmutableSet.of(OpenApi2Grammar.SCHEMA, OpenApi2Grammar.PARAMETER, OpenApi3Grammar.SCHEMA, OpenApi31Grammar.SCHEMA, OpenApi32Grammar.SCHEMA); } @Override diff --git a/src/main/java/apiaddicts/sonar/openapi/checks/format/AbstractInfoObjectMappingCheck.java b/src/main/java/apiaddicts/sonar/openapi/checks/format/AbstractInfoObjectMappingCheck.java index 82b50705..b8fa9d64 100644 --- a/src/main/java/apiaddicts/sonar/openapi/checks/format/AbstractInfoObjectMappingCheck.java +++ b/src/main/java/apiaddicts/sonar/openapi/checks/format/AbstractInfoObjectMappingCheck.java @@ -6,6 +6,7 @@ import org.apiaddicts.apitools.dosonarapi.api.v2.OpenApi2Grammar; import org.apiaddicts.apitools.dosonarapi.api.v3.OpenApi3Grammar; import org.apiaddicts.apitools.dosonarapi.api.v31.OpenApi31Grammar; +import org.apiaddicts.apitools.dosonarapi.api.v32.OpenApi32Grammar; import org.apiaddicts.apitools.dosonarapi.sslr.yaml.grammar.JsonNode; import java.util.List; @@ -32,7 +33,8 @@ public Set subscribedKinds() { return ImmutableSet.of( OpenApi2Grammar.INFO, OpenApi3Grammar.INFO, - OpenApi31Grammar.INFO + OpenApi31Grammar.INFO, + OpenApi32Grammar.INFO ); } diff --git a/src/main/java/apiaddicts/sonar/openapi/checks/format/AbstractSchemaNamingConventionCheck.java b/src/main/java/apiaddicts/sonar/openapi/checks/format/AbstractSchemaNamingConventionCheck.java index 11e89f24..dbc25a3c 100644 --- a/src/main/java/apiaddicts/sonar/openapi/checks/format/AbstractSchemaNamingConventionCheck.java +++ b/src/main/java/apiaddicts/sonar/openapi/checks/format/AbstractSchemaNamingConventionCheck.java @@ -9,6 +9,7 @@ import org.apiaddicts.apitools.dosonarapi.api.v2.OpenApi2Grammar; import org.apiaddicts.apitools.dosonarapi.api.v3.OpenApi3Grammar; import org.apiaddicts.apitools.dosonarapi.api.v31.OpenApi31Grammar; +import org.apiaddicts.apitools.dosonarapi.api.v32.OpenApi32Grammar; import org.apiaddicts.apitools.dosonarapi.sslr.yaml.grammar.JsonNode; import static apiaddicts.sonar.openapi.utils.JsonNodeUtils.isOperation; @@ -25,16 +26,16 @@ protected AbstractSchemaNamingConventionCheck(String key, String message, String @Override public Set subscribedKinds() { - return ImmutableSet.of(OpenApi2Grammar.PATHS, OpenApi3Grammar.PATHS, OpenApi31Grammar.PATHS, OpenApi2Grammar.PATH, - OpenApi3Grammar.PATH, OpenApi31Grammar.PATH); + return ImmutableSet.of(OpenApi2Grammar.PATHS, OpenApi3Grammar.PATHS, OpenApi31Grammar.PATHS, OpenApi32Grammar.PATHS, OpenApi2Grammar.PATH, + OpenApi3Grammar.PATH, OpenApi31Grammar.PATH, OpenApi32Grammar.PATH); } @Override public void visitNode(JsonNode node) { - if (OpenApi2Grammar.PATHS.equals(node.getType()) || OpenApi3Grammar.PATHS.equals(node.getType())) { + if (OpenApi2Grammar.PATHS.equals(node.getType()) || OpenApi3Grammar.PATHS.equals(node.getType()) || OpenApi31Grammar.PATHS.equals(node.getType()) || OpenApi32Grammar.PATHS.equals(node.getType())) { visitPathsNode(node); } - if (OpenApi2Grammar.PATH.equals(node.getType()) || OpenApi3Grammar.PATH.equals(node.getType())) { + if (OpenApi2Grammar.PATH.equals(node.getType()) || OpenApi3Grammar.PATH.equals(node.getType()) || OpenApi31Grammar.PATH.equals(node.getType()) || OpenApi32Grammar.PATH.equals(node.getType())) { visitPathNode(node); } } @@ -121,7 +122,7 @@ private void visitPathNode(JsonNode node) { .forEach(response -> handleExternalRef.resolve(response, resolved -> { if (resolved.getType().equals(OpenApi2Grammar.RESPONSE)) { visitSchemaNode2(resolved); - } else if (resolved.getType().equals(OpenApi3Grammar.RESPONSE)) { + } else if (resolved.getType().equals(OpenApi3Grammar.RESPONSE) || resolved.getType().equals(OpenApi31Grammar.RESPONSE) || resolved.getType().equals(OpenApi32Grammar.RESPONSE)) { JsonNode content = resolved.at("/content"); if (!content.isMissing()) { content.propertyMap().forEach((mediaType, mediaTypeNode) -> { diff --git a/src/main/java/apiaddicts/sonar/openapi/checks/format/AbstractUndefinedMediaTypeCheck.java b/src/main/java/apiaddicts/sonar/openapi/checks/format/AbstractUndefinedMediaTypeCheck.java index 04ce8a73..07fd3cf0 100644 --- a/src/main/java/apiaddicts/sonar/openapi/checks/format/AbstractUndefinedMediaTypeCheck.java +++ b/src/main/java/apiaddicts/sonar/openapi/checks/format/AbstractUndefinedMediaTypeCheck.java @@ -10,6 +10,7 @@ import org.apiaddicts.apitools.dosonarapi.api.v2.OpenApi2Grammar; import org.apiaddicts.apitools.dosonarapi.api.v3.OpenApi3Grammar; import org.apiaddicts.apitools.dosonarapi.api.v31.OpenApi31Grammar; +import org.apiaddicts.apitools.dosonarapi.api.v32.OpenApi32Grammar; import org.apiaddicts.apitools.dosonarapi.sslr.yaml.grammar.JsonNode; public abstract class AbstractUndefinedMediaTypeCheck extends BaseCheck { @@ -28,7 +29,7 @@ protected AbstractUndefinedMediaTypeCheck(String key, String section) { @Override public Set subscribedKinds() { - return ImmutableSet.of(OpenApi2Grammar.OPERATION, OpenApi3Grammar.OPERATION, OpenApi31Grammar.OPERATION, OpenApi3Grammar.RESPONSES, OpenApi31Grammar.RESPONSES); + return ImmutableSet.of(OpenApi2Grammar.OPERATION, OpenApi3Grammar.OPERATION, OpenApi31Grammar.OPERATION, OpenApi32Grammar.OPERATION, OpenApi3Grammar.RESPONSES, OpenApi31Grammar.RESPONSES, OpenApi32Grammar.RESPONSES); } @Override diff --git a/src/main/java/apiaddicts/sonar/openapi/checks/format/OAR011UrlNamingConventionCheck.java b/src/main/java/apiaddicts/sonar/openapi/checks/format/OAR011UrlNamingConventionCheck.java index da4525c1..4409e791 100644 --- a/src/main/java/apiaddicts/sonar/openapi/checks/format/OAR011UrlNamingConventionCheck.java +++ b/src/main/java/apiaddicts/sonar/openapi/checks/format/OAR011UrlNamingConventionCheck.java @@ -8,6 +8,7 @@ import org.apiaddicts.apitools.dosonarapi.api.v2.OpenApi2Grammar; import org.apiaddicts.apitools.dosonarapi.api.v3.OpenApi3Grammar; import org.apiaddicts.apitools.dosonarapi.api.v31.OpenApi31Grammar; +import org.apiaddicts.apitools.dosonarapi.api.v32.OpenApi32Grammar; import org.apiaddicts.apitools.dosonarapi.sslr.yaml.grammar.JsonNode; import java.net.MalformedURLException; @@ -35,7 +36,7 @@ public OAR011UrlNamingConventionCheck() { @Override public Set subscribedKinds() { - return ImmutableSet.of(OpenApi2Grammar.ROOT, OpenApi2Grammar.PATH, OpenApi3Grammar.SERVER, OpenApi3Grammar.PATH, OpenApi31Grammar.SERVER, OpenApi31Grammar.PATH); + return ImmutableSet.of(OpenApi2Grammar.ROOT, OpenApi2Grammar.PATH, OpenApi3Grammar.SERVER, OpenApi3Grammar.PATH, OpenApi31Grammar.SERVER, OpenApi31Grammar.PATH, OpenApi32Grammar.SERVER, OpenApi32Grammar.PATH); } @Override diff --git a/src/main/java/apiaddicts/sonar/openapi/checks/format/OAR012ParameterNamingConventionCheck.java b/src/main/java/apiaddicts/sonar/openapi/checks/format/OAR012ParameterNamingConventionCheck.java index 07492204..8f4d7c9f 100644 --- a/src/main/java/apiaddicts/sonar/openapi/checks/format/OAR012ParameterNamingConventionCheck.java +++ b/src/main/java/apiaddicts/sonar/openapi/checks/format/OAR012ParameterNamingConventionCheck.java @@ -7,6 +7,8 @@ import org.apiaddicts.apitools.dosonarapi.api.v2.OpenApi2Grammar; import org.apiaddicts.apitools.dosonarapi.api.v3.OpenApi3Grammar; +import org.apiaddicts.apitools.dosonarapi.api.v31.OpenApi31Grammar; +import org.apiaddicts.apitools.dosonarapi.api.v32.OpenApi32Grammar; import org.apiaddicts.apitools.dosonarapi.sslr.yaml.grammar.JsonNode; import org.sonar.check.Rule; import org.sonar.check.RuleProperty; @@ -36,13 +38,18 @@ public OAR012ParameterNamingConventionCheck() { @Override public Set subscribedKinds() { - return ImmutableSet.of(OpenApi2Grammar.PARAMETER, OpenApi2Grammar.SCHEMA, OpenApi3Grammar.PARAMETER, - OpenApi3Grammar.SCHEMA); + return ImmutableSet.of( + OpenApi2Grammar.PARAMETER, OpenApi2Grammar.SCHEMA, + OpenApi3Grammar.PARAMETER, OpenApi3Grammar.SCHEMA, + OpenApi31Grammar.PARAMETER, OpenApi31Grammar.SCHEMA, + OpenApi32Grammar.PARAMETER, OpenApi32Grammar.SCHEMA); } @Override public void visitNode(JsonNode node) { - if (OpenApi2Grammar.PARAMETER.equals(node.getType()) || OpenApi3Grammar.PARAMETER.equals(node.getType())) { + AstNodeType type = node.getType(); + if (OpenApi2Grammar.PARAMETER.equals(type) || OpenApi3Grammar.PARAMETER.equals(type) + || OpenApi31Grammar.PARAMETER.equals(type) || OpenApi32Grammar.PARAMETER.equals(type)) { visitParameterNode(node); } else { visitSchemaNode(node); @@ -50,7 +57,8 @@ public void visitNode(JsonNode node) { } private void visitSchemaNode(JsonNode schemaNode) { - if (schemaNode.getType().equals(OpenApi3Grammar.REF)) + AstNodeType type = schemaNode.getType(); + if (OpenApi3Grammar.REF.equals(type) || OpenApi31Grammar.REF.equals(type) || OpenApi32Grammar.REF.equals(type)) schemaNode = resolve(schemaNode); Map properties = schemaNode.propertyMap(); @@ -74,4 +82,4 @@ private void visitParameterNode(JsonNode node) { validateNamingConvention(name, nameNode); } -} \ No newline at end of file +} diff --git a/src/main/java/apiaddicts/sonar/openapi/checks/format/OAR044MediaTypeCheck.java b/src/main/java/apiaddicts/sonar/openapi/checks/format/OAR044MediaTypeCheck.java index c747e49e..50ce1ec7 100644 --- a/src/main/java/apiaddicts/sonar/openapi/checks/format/OAR044MediaTypeCheck.java +++ b/src/main/java/apiaddicts/sonar/openapi/checks/format/OAR044MediaTypeCheck.java @@ -26,6 +26,7 @@ import org.apiaddicts.apitools.dosonarapi.api.v2.OpenApi2Grammar; import org.apiaddicts.apitools.dosonarapi.api.v3.OpenApi3Grammar; import org.apiaddicts.apitools.dosonarapi.api.v31.OpenApi31Grammar; +import org.apiaddicts.apitools.dosonarapi.api.v32.OpenApi32Grammar; import apiaddicts.sonar.openapi.checks.BaseCheck; import org.apiaddicts.apitools.dosonarapi.sslr.yaml.grammar.JsonNode; import apiaddicts.sonar.openapi.utils.ExternalRefHandler; @@ -60,7 +61,7 @@ public class OAR044MediaTypeCheck extends BaseCheck { @Override public Set subscribedKinds() { - return Sets.newHashSet(OpenApi2Grammar.ROOT, OpenApi2Grammar.OPERATION, OpenApi3Grammar.OPERATION, OpenApi3Grammar.RESPONSE, OpenApi3Grammar.RESPONSES, OpenApi3Grammar.REQUEST_BODY, OpenApi3Grammar.PARAMETER, OpenApi31Grammar.PARAMETER, OpenApi31Grammar.REQUEST_BODY, OpenApi31Grammar.RESPONSE); + return Sets.newHashSet(OpenApi2Grammar.ROOT, OpenApi2Grammar.OPERATION, OpenApi3Grammar.OPERATION, OpenApi3Grammar.RESPONSE, OpenApi3Grammar.RESPONSES, OpenApi3Grammar.REQUEST_BODY, OpenApi3Grammar.PARAMETER, OpenApi31Grammar.PARAMETER, OpenApi31Grammar.REQUEST_BODY, OpenApi31Grammar.RESPONSE, OpenApi32Grammar.PARAMETER, OpenApi32Grammar.REQUEST_BODY, OpenApi32Grammar.RESPONSE); } @Override @@ -88,17 +89,17 @@ private void verifyMimeTypeArray(JsonNode node) { private void visitOpenApi3(JsonNode node) { AstNodeType type = node.getType(); - if (type == OpenApi3Grammar.PARAMETER) { + if (type == OpenApi3Grammar.PARAMETER || type == OpenApi31Grammar.PARAMETER || type == OpenApi32Grammar.PARAMETER) { verifyParameterContent(node); - } else if (type == OpenApi3Grammar.RESPONSES) { + } else if (type == OpenApi3Grammar.RESPONSES || type == OpenApi31Grammar.RESPONSES || type == OpenApi32Grammar.RESPONSES) { node.properties().forEach(responseNode -> { if (!"204".equals(responseNode.key().getTokenValue())) { handleExternalRef.resolve(responseNode, this::verifyContent); } }); - } else if (type == OpenApi3Grammar.OPERATION) { + } else if (type == OpenApi3Grammar.OPERATION || type == OpenApi31Grammar.OPERATION || type == OpenApi32Grammar.OPERATION) { String op = node.key().getTokenValue().toLowerCase(); if (new HashSet<>(Arrays.asList("post", "put", "patch")).contains(op)) { diff --git a/src/main/java/apiaddicts/sonar/openapi/checks/format/OAR050ProvideOpSummaryCheck.java b/src/main/java/apiaddicts/sonar/openapi/checks/format/OAR050ProvideOpSummaryCheck.java index 56ac487f..ae80959e 100644 --- a/src/main/java/apiaddicts/sonar/openapi/checks/format/OAR050ProvideOpSummaryCheck.java +++ b/src/main/java/apiaddicts/sonar/openapi/checks/format/OAR050ProvideOpSummaryCheck.java @@ -25,6 +25,7 @@ import org.apiaddicts.apitools.dosonarapi.api.v2.OpenApi2Grammar; import org.apiaddicts.apitools.dosonarapi.api.v3.OpenApi3Grammar; import org.apiaddicts.apitools.dosonarapi.api.v31.OpenApi31Grammar; +import org.apiaddicts.apitools.dosonarapi.api.v32.OpenApi32Grammar; import apiaddicts.sonar.openapi.checks.BaseCheck; import org.apiaddicts.apitools.dosonarapi.sslr.yaml.grammar.JsonNode; @@ -36,7 +37,7 @@ public class OAR050ProvideOpSummaryCheck extends BaseCheck { @Override public Set subscribedKinds() { - return Sets.newHashSet(OpenApi2Grammar.OPERATION, OpenApi3Grammar.OPERATION, OpenApi31Grammar.OPERATION); + return Sets.newHashSet(OpenApi2Grammar.OPERATION, OpenApi3Grammar.OPERATION, OpenApi31Grammar.OPERATION, OpenApi32Grammar.OPERATION); } @Override diff --git a/src/main/java/apiaddicts/sonar/openapi/checks/format/OAR051DescriptionDiffersSummaryCheck.java b/src/main/java/apiaddicts/sonar/openapi/checks/format/OAR051DescriptionDiffersSummaryCheck.java index da2aaee9..e86d24d0 100644 --- a/src/main/java/apiaddicts/sonar/openapi/checks/format/OAR051DescriptionDiffersSummaryCheck.java +++ b/src/main/java/apiaddicts/sonar/openapi/checks/format/OAR051DescriptionDiffersSummaryCheck.java @@ -25,6 +25,7 @@ import org.apiaddicts.apitools.dosonarapi.api.v2.OpenApi2Grammar; import org.apiaddicts.apitools.dosonarapi.api.v3.OpenApi3Grammar; import org.apiaddicts.apitools.dosonarapi.api.v31.OpenApi31Grammar; +import org.apiaddicts.apitools.dosonarapi.api.v32.OpenApi32Grammar; import apiaddicts.sonar.openapi.checks.BaseCheck; import org.apiaddicts.apitools.dosonarapi.sslr.yaml.grammar.JsonNode; @@ -36,7 +37,7 @@ public class OAR051DescriptionDiffersSummaryCheck extends BaseCheck { @Override public Set subscribedKinds() { - return Sets.newHashSet(OpenApi2Grammar.OPERATION, OpenApi3Grammar.OPERATION, OpenApi31Grammar.OPERATION); + return Sets.newHashSet(OpenApi2Grammar.OPERATION, OpenApi3Grammar.OPERATION, OpenApi31Grammar.OPERATION, OpenApi32Grammar.OPERATION); } @Override diff --git a/src/main/java/apiaddicts/sonar/openapi/checks/format/OAR077ParametersInQuerySnakeCaseCheck.java b/src/main/java/apiaddicts/sonar/openapi/checks/format/OAR077ParametersInQuerySnakeCaseCheck.java index fbfae9b1..c2647a9c 100644 --- a/src/main/java/apiaddicts/sonar/openapi/checks/format/OAR077ParametersInQuerySnakeCaseCheck.java +++ b/src/main/java/apiaddicts/sonar/openapi/checks/format/OAR077ParametersInQuerySnakeCaseCheck.java @@ -6,6 +6,7 @@ import org.apiaddicts.apitools.dosonarapi.api.v2.OpenApi2Grammar; import org.apiaddicts.apitools.dosonarapi.api.v3.OpenApi3Grammar; import org.apiaddicts.apitools.dosonarapi.api.v31.OpenApi31Grammar; +import org.apiaddicts.apitools.dosonarapi.api.v32.OpenApi32Grammar; import org.apiaddicts.apitools.dosonarapi.sslr.yaml.grammar.JsonNode; import java.util.Set; @@ -23,12 +24,12 @@ public OAR077ParametersInQuerySnakeCaseCheck() { @Override public Set subscribedKinds() { - return ImmutableSet.of(OpenApi2Grammar.PATHS, OpenApi3Grammar.PATHS, OpenApi31Grammar.PATHS); + return ImmutableSet.of(OpenApi2Grammar.PATHS, OpenApi3Grammar.PATHS, OpenApi31Grammar.PATHS, OpenApi32Grammar.PATHS); } @Override public void visitNode(JsonNode node) { - if (OpenApi2Grammar.PATHS.equals(node.getType()) || OpenApi3Grammar.PATHS.equals(node.getType()) || OpenApi3Grammar.PATHS.equals(node.getType())) { + if (OpenApi2Grammar.PATHS.equals(node.getType()) || OpenApi3Grammar.PATHS.equals(node.getType()) || OpenApi31Grammar.PATHS.equals(node.getType()) || OpenApi32Grammar.PATHS.equals(node.getType())) { visitPathsNode(node); } } diff --git a/src/main/java/apiaddicts/sonar/openapi/checks/format/OAR086DescriptionFormatCheck.java b/src/main/java/apiaddicts/sonar/openapi/checks/format/OAR086DescriptionFormatCheck.java index 117dd457..44c1ebb4 100644 --- a/src/main/java/apiaddicts/sonar/openapi/checks/format/OAR086DescriptionFormatCheck.java +++ b/src/main/java/apiaddicts/sonar/openapi/checks/format/OAR086DescriptionFormatCheck.java @@ -5,6 +5,7 @@ import org.apiaddicts.apitools.dosonarapi.api.v2.OpenApi2Grammar; import org.apiaddicts.apitools.dosonarapi.api.v3.OpenApi3Grammar; import org.apiaddicts.apitools.dosonarapi.api.v31.OpenApi31Grammar; +import org.apiaddicts.apitools.dosonarapi.api.v32.OpenApi32Grammar; import apiaddicts.sonar.openapi.checks.BaseCheck; import static apiaddicts.sonar.openapi.utils.JsonNodeUtils.*; diff --git a/src/main/java/apiaddicts/sonar/openapi/checks/format/OAR087SummaryFormatCheck.java b/src/main/java/apiaddicts/sonar/openapi/checks/format/OAR087SummaryFormatCheck.java index 6c1f81a7..697ffb63 100644 --- a/src/main/java/apiaddicts/sonar/openapi/checks/format/OAR087SummaryFormatCheck.java +++ b/src/main/java/apiaddicts/sonar/openapi/checks/format/OAR087SummaryFormatCheck.java @@ -5,6 +5,7 @@ import org.apiaddicts.apitools.dosonarapi.api.v2.OpenApi2Grammar; import org.apiaddicts.apitools.dosonarapi.api.v3.OpenApi3Grammar; import org.apiaddicts.apitools.dosonarapi.api.v31.OpenApi31Grammar; +import org.apiaddicts.apitools.dosonarapi.api.v32.OpenApi32Grammar; import apiaddicts.sonar.openapi.checks.BaseCheck; import org.apiaddicts.apitools.dosonarapi.sslr.yaml.grammar.JsonNode; @@ -20,16 +21,16 @@ public class OAR087SummaryFormatCheck extends BaseCheck { @Override public Set subscribedKinds() { - return ImmutableSet.of(OpenApi2Grammar.ROOT, OpenApi3Grammar.ROOT, OpenApi31Grammar.ROOT, OpenApi2Grammar.PATHS, OpenApi3Grammar.PATHS, OpenApi31Grammar.PATHS, OpenApi2Grammar.OPERATION, OpenApi3Grammar.OPERATION, OpenApi31Grammar.OPERATION); + return ImmutableSet.of(OpenApi2Grammar.ROOT, OpenApi3Grammar.ROOT, OpenApi31Grammar.ROOT, OpenApi32Grammar.ROOT, OpenApi2Grammar.PATHS, OpenApi3Grammar.PATHS, OpenApi31Grammar.PATHS, OpenApi32Grammar.PATHS, OpenApi2Grammar.OPERATION, OpenApi3Grammar.OPERATION, OpenApi31Grammar.OPERATION, OpenApi32Grammar.OPERATION); } @Override public void visitNode(JsonNode node) { - if (OpenApi2Grammar.ROOT.equals(node.getType()) || OpenApi3Grammar.ROOT.equals(node.getType()) || OpenApi31Grammar.ROOT.equals(node.getType())) { + if (OpenApi2Grammar.ROOT.equals(node.getType()) || OpenApi3Grammar.ROOT.equals(node.getType()) || OpenApi31Grammar.ROOT.equals(node.getType()) || OpenApi32Grammar.ROOT.equals(node.getType())) { checkInfoSummary(node); checkDefinitionsSummary(node); } - if (OpenApi2Grammar.PATHS.equals(node.getType()) || OpenApi3Grammar.PATHS.equals(node.getType()) || OpenApi31Grammar.PATHS.equals(node.getType())) { + if (OpenApi2Grammar.PATHS.equals(node.getType()) || OpenApi3Grammar.PATHS.equals(node.getType()) || OpenApi31Grammar.PATHS.equals(node.getType()) || OpenApi32Grammar.PATHS.equals(node.getType())) { visitPathsNode(node); } } diff --git a/src/main/java/apiaddicts/sonar/openapi/checks/format/OAR088RefParamCheck.java b/src/main/java/apiaddicts/sonar/openapi/checks/format/OAR088RefParamCheck.java index 2b3da78b..e94c9636 100644 --- a/src/main/java/apiaddicts/sonar/openapi/checks/format/OAR088RefParamCheck.java +++ b/src/main/java/apiaddicts/sonar/openapi/checks/format/OAR088RefParamCheck.java @@ -7,6 +7,7 @@ import org.apiaddicts.apitools.dosonarapi.api.v2.OpenApi2Grammar; import org.apiaddicts.apitools.dosonarapi.api.v3.OpenApi3Grammar; import org.apiaddicts.apitools.dosonarapi.api.v31.OpenApi31Grammar; +import org.apiaddicts.apitools.dosonarapi.api.v32.OpenApi32Grammar; import org.apiaddicts.apitools.dosonarapi.sslr.yaml.grammar.JsonNode; import apiaddicts.sonar.openapi.checks.BaseCheck; @@ -28,12 +29,12 @@ public class OAR088RefParamCheck extends BaseCheck { @Override public Set subscribedKinds() { - return ImmutableSet.of(OpenApi2Grammar.PATHS, OpenApi3Grammar.PATHS, OpenApi31Grammar.PATHS); + return ImmutableSet.of(OpenApi2Grammar.PATHS, OpenApi3Grammar.PATHS, OpenApi31Grammar.PATHS, OpenApi32Grammar.PATHS); } @Override public void visitNode(JsonNode node) { - if (OpenApi2Grammar.PATHS.equals(node.getType()) || OpenApi3Grammar.PATHS.equals(node.getType()) || OpenApi31Grammar.PATHS.equals(node.getType())) { + if (OpenApi2Grammar.PATHS.equals(node.getType()) || OpenApi3Grammar.PATHS.equals(node.getType()) || OpenApi31Grammar.PATHS.equals(node.getType()) || OpenApi32Grammar.PATHS.equals(node.getType())) { visitPathsNode(node); } } diff --git a/src/main/java/apiaddicts/sonar/openapi/checks/format/OAR089RefRequestBodyCheck.java b/src/main/java/apiaddicts/sonar/openapi/checks/format/OAR089RefRequestBodyCheck.java index 772c6bea..6fd8acea 100644 --- a/src/main/java/apiaddicts/sonar/openapi/checks/format/OAR089RefRequestBodyCheck.java +++ b/src/main/java/apiaddicts/sonar/openapi/checks/format/OAR089RefRequestBodyCheck.java @@ -6,6 +6,7 @@ import org.sonar.check.RuleProperty; import org.apiaddicts.apitools.dosonarapi.api.v3.OpenApi3Grammar; import org.apiaddicts.apitools.dosonarapi.api.v31.OpenApi31Grammar; +import org.apiaddicts.apitools.dosonarapi.api.v32.OpenApi32Grammar; import org.apiaddicts.apitools.dosonarapi.sslr.yaml.grammar.JsonNode; import apiaddicts.sonar.openapi.checks.BaseCheck; @@ -27,12 +28,12 @@ public class OAR089RefRequestBodyCheck extends BaseCheck { @Override public Set subscribedKinds() { - return ImmutableSet.of(OpenApi3Grammar.PATHS, OpenApi31Grammar.PATHS); + return ImmutableSet.of(OpenApi3Grammar.PATHS, OpenApi31Grammar.PATHS, OpenApi32Grammar.PATHS); } @Override public void visitNode(JsonNode node) { - if (OpenApi3Grammar.PATHS.equals(node.getType()) || OpenApi31Grammar.PATHS.equals(node.getType())) { + if (OpenApi3Grammar.PATHS.equals(node.getType()) || OpenApi31Grammar.PATHS.equals(node.getType()) || OpenApi32Grammar.PATHS.equals(node.getType())) { visitPathsNode(node); } } diff --git a/src/main/java/apiaddicts/sonar/openapi/checks/format/OAR090RefResponseCheck.java b/src/main/java/apiaddicts/sonar/openapi/checks/format/OAR090RefResponseCheck.java index 88bb914d..9c1f815a 100644 --- a/src/main/java/apiaddicts/sonar/openapi/checks/format/OAR090RefResponseCheck.java +++ b/src/main/java/apiaddicts/sonar/openapi/checks/format/OAR090RefResponseCheck.java @@ -7,6 +7,7 @@ import org.apiaddicts.apitools.dosonarapi.api.v2.OpenApi2Grammar; import org.apiaddicts.apitools.dosonarapi.api.v3.OpenApi3Grammar; import org.apiaddicts.apitools.dosonarapi.api.v31.OpenApi31Grammar; +import org.apiaddicts.apitools.dosonarapi.api.v32.OpenApi32Grammar; import org.apiaddicts.apitools.dosonarapi.sslr.yaml.grammar.JsonNode; import apiaddicts.sonar.openapi.checks.BaseCheck; @@ -28,7 +29,7 @@ public class OAR090RefResponseCheck extends BaseCheck { @Override public Set subscribedKinds() { - return ImmutableSet.of(OpenApi2Grammar.OPERATION, OpenApi3Grammar.OPERATION, OpenApi31Grammar.OPERATION); + return ImmutableSet.of(OpenApi2Grammar.OPERATION, OpenApi3Grammar.OPERATION, OpenApi31Grammar.OPERATION, OpenApi32Grammar.OPERATION); } @Override diff --git a/src/main/java/apiaddicts/sonar/openapi/checks/format/OAR113CustomFieldCheck.java b/src/main/java/apiaddicts/sonar/openapi/checks/format/OAR113CustomFieldCheck.java index a8eed149..2dd78a64 100644 --- a/src/main/java/apiaddicts/sonar/openapi/checks/format/OAR113CustomFieldCheck.java +++ b/src/main/java/apiaddicts/sonar/openapi/checks/format/OAR113CustomFieldCheck.java @@ -9,6 +9,7 @@ import org.apiaddicts.apitools.dosonarapi.api.v2.OpenApi2Grammar; import org.apiaddicts.apitools.dosonarapi.api.v3.OpenApi3Grammar; import org.apiaddicts.apitools.dosonarapi.api.v31.OpenApi31Grammar; +import org.apiaddicts.apitools.dosonarapi.api.v32.OpenApi32Grammar; import org.apiaddicts.apitools.dosonarapi.sslr.yaml.grammar.JsonNode; import org.sonar.check.Rule; import org.sonar.check.RuleProperty; @@ -62,7 +63,15 @@ public Set subscribedKinds() { OpenApi31Grammar.PARAMETER, OpenApi31Grammar.RESPONSE, OpenApi31Grammar.SCHEMA, - OpenApi31Grammar.HEADER + OpenApi31Grammar.HEADER, + OpenApi32Grammar.OPERATION, + OpenApi32Grammar.PATHS, + OpenApi32Grammar.PATH, + OpenApi32Grammar.COMPONENTS, + OpenApi32Grammar.PARAMETER, + OpenApi32Grammar.RESPONSE, + OpenApi32Grammar.SCHEMA, + OpenApi32Grammar.HEADER ); } @@ -76,29 +85,32 @@ private void manageOperationAndResponse(JsonNode node, Set locations) { AstNodeType type = node.getType(); String nodeKey = node.key().getTokenValue(); - if (isType(type, OpenApi2Grammar.OPERATION, OpenApi3Grammar.OPERATION, OpenApi31Grammar.OPERATION)) { + if (isType(type, OpenApi2Grammar.OPERATION, OpenApi3Grammar.OPERATION, OpenApi31Grammar.OPERATION, OpenApi32Grammar.OPERATION)) { String op = nodeKey.toLowerCase(); if (locations.contains("operation") || locations.contains("operation_" + op)) { checkRequiredFieldInNode(node); } - } else if (isType(type, OpenApi2Grammar.RESPONSE, OpenApi3Grammar.RESPONSE, OpenApi31Grammar.RESPONSE)) { + } else if (isType(type, OpenApi2Grammar.RESPONSE, OpenApi3Grammar.RESPONSE, OpenApi31Grammar.RESPONSE, OpenApi32Grammar.RESPONSE)) { if (locations.contains("response") || locations.contains("response_" + nodeKey)) { checkRequiredFieldInNode(node); } + } else if (isType(type, OpenApi2Grammar.PATH, OpenApi3Grammar.PATH, OpenApi31Grammar.PATH, OpenApi32Grammar.PATH)) { + verifyParameter(node, locations, "path"); + } else if (isType(type, OpenApi2Grammar.SCHEMA, OpenApi3Grammar.SCHEMA, OpenApi31Grammar.SCHEMA, OpenApi32Grammar.SCHEMA)) { + verifyParameter(node, locations, "schema"); + } else if (isType(type, OpenApi2Grammar.HEADER, OpenApi3Grammar.HEADER, OpenApi31Grammar.HEADER, OpenApi32Grammar.HEADER)) { + verifyParameter(node, locations, "header"); + } else if (isType(type, OpenApi2Grammar.PARAMETER, OpenApi3Grammar.PARAMETER, OpenApi31Grammar.PARAMETER, OpenApi32Grammar.PARAMETER)) { + verifyParameter(node, locations, "parameter"); } - else if (isType(type, OpenApi2Grammar.PATH, OpenApi3Grammar.PATH, OpenApi31Grammar.PATH)) verifyParameter(node, locations, "path"); - else if (isType(type, OpenApi2Grammar.SCHEMA, OpenApi3Grammar.SCHEMA, OpenApi31Grammar.SCHEMA)) verifyParameter(node, locations, "schema"); - else if (isType(type, OpenApi2Grammar.HEADER, OpenApi3Grammar.HEADER, OpenApi31Grammar.HEADER)) verifyParameter(node, locations, "header"); - else if (isType(type, OpenApi2Grammar.PARAMETER, OpenApi3Grammar.PARAMETER, OpenApi31Grammar.PARAMETER)) verifyParameter(node, locations, "parameter"); - if (locations.contains(nodeKey)) { checkRequiredFieldInNode(node); } } - private void verifyParameter(JsonNode node,Set locations ,String target){ - if(locations.contains(target)) + private void verifyParameter(JsonNode node, Set locations, String target) { + if (locations.contains(target)) checkRequiredFieldInNode(node); } @@ -110,7 +122,6 @@ private void checkRequiredFieldInNode(JsonNode rootNode) { } } - private boolean isExtension(String field) { return field != null && field.startsWith("x-"); } @@ -121,7 +132,6 @@ private boolean isType(AstNodeType nodeType, AstNodeType... types) { private void checkExtension(JsonNode node, String extension) { boolean extensionExists = node.propertyMap().containsKey(extension); - if (!extensionExists) { addIssue(KEY, translate("OAR113.error", extension), node.key()); } @@ -133,5 +143,4 @@ private void checkStandardField(JsonNode node, String field) { addIssue(KEY, translate("OAR113.error", field), node.key()); } } - } diff --git a/src/main/java/apiaddicts/sonar/openapi/checks/format/OAR115VerifyRequiredFields.java b/src/main/java/apiaddicts/sonar/openapi/checks/format/OAR115VerifyRequiredFields.java index fd39de30..235065ec 100644 --- a/src/main/java/apiaddicts/sonar/openapi/checks/format/OAR115VerifyRequiredFields.java +++ b/src/main/java/apiaddicts/sonar/openapi/checks/format/OAR115VerifyRequiredFields.java @@ -10,6 +10,7 @@ import org.apiaddicts.apitools.dosonarapi.api.v2.OpenApi2Grammar; import org.apiaddicts.apitools.dosonarapi.api.v3.OpenApi3Grammar; import org.apiaddicts.apitools.dosonarapi.api.v31.OpenApi31Grammar; +import org.apiaddicts.apitools.dosonarapi.api.v32.OpenApi32Grammar; import org.apiaddicts.apitools.dosonarapi.sslr.yaml.grammar.JsonNode; import org.sonar.check.Rule; @@ -22,12 +23,12 @@ public class OAR115VerifyRequiredFields extends BaseCheck { @Override public Set subscribedKinds() { - return ImmutableSet.of(OpenApi2Grammar.SCHEMA,OpenApi2Grammar.RESPONSE, OpenApi3Grammar.SCHEMA,OpenApi31Grammar.SCHEMA,OpenApi3Grammar.RESPONSE, OpenApi31Grammar.RESPONSE); + return ImmutableSet.of(OpenApi2Grammar.SCHEMA, OpenApi2Grammar.RESPONSE, OpenApi3Grammar.SCHEMA, OpenApi3Grammar.RESPONSE, OpenApi31Grammar.SCHEMA, OpenApi31Grammar.RESPONSE, OpenApi32Grammar.SCHEMA, OpenApi32Grammar.RESPONSE); } @Override public void visitNode(JsonNode node) { - if(node.getType() == OpenApi3Grammar.RESPONSE || node.getType() == OpenApi31Grammar.RESPONSE ){ + if(node.getType() == OpenApi3Grammar.RESPONSE || node.getType() == OpenApi31Grammar.RESPONSE || node.getType() == OpenApi32Grammar.RESPONSE){ JsonNode content = node.get("content"); JsonNode json = content.get("application/json"); JsonNode schema = json.get("schema"); diff --git a/src/main/java/apiaddicts/sonar/openapi/checks/operations/AbstractHttpMethodCheck.java b/src/main/java/apiaddicts/sonar/openapi/checks/operations/AbstractHttpMethodCheck.java index 9713db8a..e7f77304 100644 --- a/src/main/java/apiaddicts/sonar/openapi/checks/operations/AbstractHttpMethodCheck.java +++ b/src/main/java/apiaddicts/sonar/openapi/checks/operations/AbstractHttpMethodCheck.java @@ -6,6 +6,7 @@ import org.apiaddicts.apitools.dosonarapi.api.v2.OpenApi2Grammar; import org.apiaddicts.apitools.dosonarapi.api.v3.OpenApi3Grammar; import org.apiaddicts.apitools.dosonarapi.api.v31.OpenApi31Grammar; +import org.apiaddicts.apitools.dosonarapi.api.v32.OpenApi32Grammar; import org.apiaddicts.apitools.dosonarapi.sslr.yaml.grammar.JsonNode; import org.sonar.check.RuleProperty; @@ -84,16 +85,16 @@ protected void visitFile(JsonNode root) { @Override public Set subscribedKinds() { return ImmutableSet.of( - OpenApi2Grammar.PATH, OpenApi3Grammar.PATH, OpenApi31Grammar.PATH, - OpenApi2Grammar.OPERATION, OpenApi3Grammar.OPERATION, OpenApi31Grammar.OPERATION + OpenApi2Grammar.PATH, OpenApi3Grammar.PATH, OpenApi31Grammar.PATH, OpenApi32Grammar.PATH, + OpenApi2Grammar.OPERATION, OpenApi3Grammar.OPERATION, OpenApi31Grammar.OPERATION, OpenApi32Grammar.OPERATION ); } @Override public void visitNode(JsonNode node) { - if (node.getType() == OpenApi2Grammar.PATH || node.getType() == OpenApi3Grammar.PATH || node.getType() == OpenApi31Grammar.PATH) { + if (node.getType() == OpenApi2Grammar.PATH || node.getType() == OpenApi3Grammar.PATH || node.getType() == OpenApi31Grammar.PATH || node.getType() == OpenApi32Grammar.PATH) { currentPath = node.key().getTokenValue(); - } else if (node.getType() == OpenApi2Grammar.OPERATION || node.getType() == OpenApi3Grammar.OPERATION || node.getType() == OpenApi31Grammar.OPERATION) { + } else if (node.getType() == OpenApi2Grammar.OPERATION || node.getType() == OpenApi3Grammar.OPERATION || node.getType() == OpenApi31Grammar.OPERATION || node.getType() == OpenApi32Grammar.OPERATION) { if (shouldExcludePath()) { return; } diff --git a/src/main/java/apiaddicts/sonar/openapi/checks/operations/AbstractResourceLevelCheck.java b/src/main/java/apiaddicts/sonar/openapi/checks/operations/AbstractResourceLevelCheck.java index b85c8ada..76d65b10 100644 --- a/src/main/java/apiaddicts/sonar/openapi/checks/operations/AbstractResourceLevelCheck.java +++ b/src/main/java/apiaddicts/sonar/openapi/checks/operations/AbstractResourceLevelCheck.java @@ -7,6 +7,7 @@ import org.apiaddicts.apitools.dosonarapi.api.v2.OpenApi2Grammar; import org.apiaddicts.apitools.dosonarapi.api.v3.OpenApi3Grammar; import org.apiaddicts.apitools.dosonarapi.api.v31.OpenApi31Grammar; +import org.apiaddicts.apitools.dosonarapi.api.v32.OpenApi32Grammar; import apiaddicts.sonar.openapi.checks.BaseCheck; import org.apiaddicts.apitools.dosonarapi.sslr.yaml.grammar.JsonNode; @@ -26,7 +27,7 @@ protected AbstractResourceLevelCheck(String key) { @Override public Set subscribedKinds() { - return ImmutableSet.of(OpenApi2Grammar.PATH, OpenApi3Grammar.PATH, OpenApi31Grammar.PATH); + return ImmutableSet.of(OpenApi2Grammar.PATH, OpenApi3Grammar.PATH, OpenApi31Grammar.PATH, OpenApi32Grammar.PATH); } @Override diff --git a/src/main/java/apiaddicts/sonar/openapi/checks/operations/AbstractResourcesByVerbCheck.java b/src/main/java/apiaddicts/sonar/openapi/checks/operations/AbstractResourcesByVerbCheck.java index 8f421eb5..09e5eef7 100644 --- a/src/main/java/apiaddicts/sonar/openapi/checks/operations/AbstractResourcesByVerbCheck.java +++ b/src/main/java/apiaddicts/sonar/openapi/checks/operations/AbstractResourcesByVerbCheck.java @@ -7,6 +7,7 @@ import org.apiaddicts.apitools.dosonarapi.api.v2.OpenApi2Grammar; import org.apiaddicts.apitools.dosonarapi.api.v3.OpenApi3Grammar; import org.apiaddicts.apitools.dosonarapi.api.v31.OpenApi31Grammar; +import org.apiaddicts.apitools.dosonarapi.api.v32.OpenApi32Grammar; import org.apiaddicts.apitools.dosonarapi.sslr.yaml.grammar.JsonNode; import java.util.Set; @@ -47,7 +48,7 @@ private void init() { @Override public Set subscribedKinds() { - return ImmutableSet.of(OpenApi2Grammar.OPERATION, OpenApi3Grammar.OPERATION, OpenApi31Grammar.OPERATION); + return ImmutableSet.of(OpenApi2Grammar.OPERATION, OpenApi3Grammar.OPERATION, OpenApi31Grammar.OPERATION, OpenApi32Grammar.OPERATION); } @Override @@ -67,7 +68,8 @@ private JsonNode findParentPathNode(JsonNode node) { JsonNode parent = (JsonNode) node.getParent(); while (parent != null && !(parent.getType() == OpenApi2Grammar.PATH || parent.getType() == OpenApi3Grammar.PATH - || parent.getType() == OpenApi31Grammar.PATH)) { + || parent.getType() == OpenApi31Grammar.PATH + || parent.getType() == OpenApi32Grammar.PATH)) { parent = (JsonNode) parent.getParent(); } return parent; diff --git a/src/main/java/apiaddicts/sonar/openapi/checks/operations/AbstractVerbPathCheck.java b/src/main/java/apiaddicts/sonar/openapi/checks/operations/AbstractVerbPathCheck.java index bd2a6bb5..6532921c 100644 --- a/src/main/java/apiaddicts/sonar/openapi/checks/operations/AbstractVerbPathCheck.java +++ b/src/main/java/apiaddicts/sonar/openapi/checks/operations/AbstractVerbPathCheck.java @@ -5,6 +5,7 @@ import org.apiaddicts.apitools.dosonarapi.api.v2.OpenApi2Grammar; import org.apiaddicts.apitools.dosonarapi.api.v3.OpenApi3Grammar; import org.apiaddicts.apitools.dosonarapi.api.v31.OpenApi31Grammar; +import org.apiaddicts.apitools.dosonarapi.api.v32.OpenApi32Grammar; import apiaddicts.sonar.openapi.checks.schemas.AbstractSchemaCheck; import apiaddicts.sonar.openapi.utils.JsonNodeUtils; @@ -26,7 +27,7 @@ protected AbstractVerbPathCheck(String key) { @Override public Set subscribedKinds() { - return ImmutableSet.of(OpenApi2Grammar.PATH, OpenApi3Grammar.PATH, OpenApi31Grammar.PATH); + return ImmutableSet.of(OpenApi2Grammar.PATH, OpenApi3Grammar.PATH, OpenApi31Grammar.PATH, OpenApi32Grammar.PATH); } @Override diff --git a/src/main/java/apiaddicts/sonar/openapi/checks/operations/OAR008AllowedHttpVerbCheck.java b/src/main/java/apiaddicts/sonar/openapi/checks/operations/OAR008AllowedHttpVerbCheck.java index c75e15ff..7b16f390 100644 --- a/src/main/java/apiaddicts/sonar/openapi/checks/operations/OAR008AllowedHttpVerbCheck.java +++ b/src/main/java/apiaddicts/sonar/openapi/checks/operations/OAR008AllowedHttpVerbCheck.java @@ -6,6 +6,8 @@ import org.sonar.check.RuleProperty; import org.apiaddicts.apitools.dosonarapi.api.v2.OpenApi2Grammar; import org.apiaddicts.apitools.dosonarapi.api.v3.OpenApi3Grammar; +import org.apiaddicts.apitools.dosonarapi.api.v31.OpenApi31Grammar; +import org.apiaddicts.apitools.dosonarapi.api.v32.OpenApi32Grammar; import apiaddicts.sonar.openapi.checks.BaseCheck; import org.apiaddicts.apitools.dosonarapi.sslr.yaml.grammar.JsonNode; @@ -39,7 +41,7 @@ protected void visitFile(JsonNode root) { @Override public Set subscribedKinds() { - return ImmutableSet.of(OpenApi2Grammar.OPERATION, OpenApi3Grammar.OPERATION); + return ImmutableSet.of(OpenApi2Grammar.OPERATION, OpenApi3Grammar.OPERATION, OpenApi31Grammar.OPERATION, OpenApi32Grammar.OPERATION); } @Override diff --git a/src/main/java/apiaddicts/sonar/openapi/checks/operations/OAR013DefaultResponseCheck.java b/src/main/java/apiaddicts/sonar/openapi/checks/operations/OAR013DefaultResponseCheck.java index 5e583606..ccf4eb3e 100644 --- a/src/main/java/apiaddicts/sonar/openapi/checks/operations/OAR013DefaultResponseCheck.java +++ b/src/main/java/apiaddicts/sonar/openapi/checks/operations/OAR013DefaultResponseCheck.java @@ -6,6 +6,7 @@ import org.apiaddicts.apitools.dosonarapi.api.v2.OpenApi2Grammar; import org.apiaddicts.apitools.dosonarapi.api.v3.OpenApi3Grammar; import org.apiaddicts.apitools.dosonarapi.api.v31.OpenApi31Grammar; +import org.apiaddicts.apitools.dosonarapi.api.v32.OpenApi32Grammar; import apiaddicts.sonar.openapi.checks.BaseCheck; import org.apiaddicts.apitools.dosonarapi.sslr.yaml.grammar.JsonNode; @@ -19,7 +20,7 @@ public class OAR013DefaultResponseCheck extends BaseCheck { @Override public Set subscribedKinds() { - return ImmutableSet.of(OpenApi2Grammar.RESPONSES, OpenApi3Grammar.RESPONSES, OpenApi31Grammar.RESPONSES); + return ImmutableSet.of(OpenApi2Grammar.RESPONSES, OpenApi3Grammar.RESPONSES, OpenApi31Grammar.RESPONSES, OpenApi32Grammar.RESPONSES); } @Override diff --git a/src/main/java/apiaddicts/sonar/openapi/checks/operations/OAR017ResourcePathCheck.java b/src/main/java/apiaddicts/sonar/openapi/checks/operations/OAR017ResourcePathCheck.java index 83db0b98..1e667e3b 100644 --- a/src/main/java/apiaddicts/sonar/openapi/checks/operations/OAR017ResourcePathCheck.java +++ b/src/main/java/apiaddicts/sonar/openapi/checks/operations/OAR017ResourcePathCheck.java @@ -9,6 +9,7 @@ import org.apiaddicts.apitools.dosonarapi.api.v2.OpenApi2Grammar; import org.apiaddicts.apitools.dosonarapi.api.v3.OpenApi3Grammar; import org.apiaddicts.apitools.dosonarapi.api.v31.OpenApi31Grammar; +import org.apiaddicts.apitools.dosonarapi.api.v32.OpenApi32Grammar; import org.apiaddicts.apitools.dosonarapi.sslr.yaml.grammar.JsonNode; import org.sonar.check.Rule; import org.sonar.check.RuleProperty; @@ -29,7 +30,7 @@ public class OAR017ResourcePathCheck extends BaseCheck { @Override public Set subscribedKinds() { - return ImmutableSet.of(OpenApi2Grammar.PATH, OpenApi3Grammar.PATH, OpenApi31Grammar.PATH); + return ImmutableSet.of(OpenApi2Grammar.PATH, OpenApi3Grammar.PATH, OpenApi31Grammar.PATH, OpenApi32Grammar.PATH); } @Override diff --git a/src/main/java/apiaddicts/sonar/openapi/checks/operations/OAR027PostResponseLocationHeaderCheck.java b/src/main/java/apiaddicts/sonar/openapi/checks/operations/OAR027PostResponseLocationHeaderCheck.java index 7181057c..88c8d9dd 100644 --- a/src/main/java/apiaddicts/sonar/openapi/checks/operations/OAR027PostResponseLocationHeaderCheck.java +++ b/src/main/java/apiaddicts/sonar/openapi/checks/operations/OAR027PostResponseLocationHeaderCheck.java @@ -6,6 +6,7 @@ import org.apiaddicts.apitools.dosonarapi.api.v2.OpenApi2Grammar; import org.apiaddicts.apitools.dosonarapi.api.v3.OpenApi3Grammar; import org.apiaddicts.apitools.dosonarapi.api.v31.OpenApi31Grammar; +import org.apiaddicts.apitools.dosonarapi.api.v32.OpenApi32Grammar; import apiaddicts.sonar.openapi.checks.BaseCheck; import org.apiaddicts.apitools.dosonarapi.sslr.yaml.grammar.JsonNode; @@ -19,7 +20,7 @@ public class OAR027PostResponseLocationHeaderCheck extends BaseCheck { @Override public Set subscribedKinds() { - return ImmutableSet.of(OpenApi2Grammar.OPERATION, OpenApi3Grammar.OPERATION, OpenApi31Grammar.OPERATION); + return ImmutableSet.of(OpenApi2Grammar.OPERATION, OpenApi3Grammar.OPERATION, OpenApi31Grammar.OPERATION, OpenApi32Grammar.OPERATION); } @Override diff --git a/src/main/java/apiaddicts/sonar/openapi/checks/operations/OAR030StatusEndpointCheck.java b/src/main/java/apiaddicts/sonar/openapi/checks/operations/OAR030StatusEndpointCheck.java index 932c06eb..964dd45d 100644 --- a/src/main/java/apiaddicts/sonar/openapi/checks/operations/OAR030StatusEndpointCheck.java +++ b/src/main/java/apiaddicts/sonar/openapi/checks/operations/OAR030StatusEndpointCheck.java @@ -7,6 +7,7 @@ import org.apiaddicts.apitools.dosonarapi.api.v2.OpenApi2Grammar; import org.apiaddicts.apitools.dosonarapi.api.v3.OpenApi3Grammar; import org.apiaddicts.apitools.dosonarapi.api.v31.OpenApi31Grammar; +import org.apiaddicts.apitools.dosonarapi.api.v32.OpenApi32Grammar; import apiaddicts.sonar.openapi.checks.BaseCheck; import org.apiaddicts.apitools.dosonarapi.sslr.yaml.grammar.JsonNode; @@ -35,7 +36,7 @@ public class OAR030StatusEndpointCheck extends BaseCheck { @Override public Set subscribedKinds() { - return ImmutableSet.of(OpenApi2Grammar.PATH, OpenApi3Grammar.PATH, OpenApi31Grammar.PATH); + return ImmutableSet.of(OpenApi2Grammar.PATH, OpenApi3Grammar.PATH, OpenApi31Grammar.PATH, OpenApi32Grammar.PATH); } @Override diff --git a/src/main/java/apiaddicts/sonar/openapi/checks/operations/OAR032AmbiguousElementsPathCheck.java b/src/main/java/apiaddicts/sonar/openapi/checks/operations/OAR032AmbiguousElementsPathCheck.java index a0ddd3d9..0a2af0d5 100644 --- a/src/main/java/apiaddicts/sonar/openapi/checks/operations/OAR032AmbiguousElementsPathCheck.java +++ b/src/main/java/apiaddicts/sonar/openapi/checks/operations/OAR032AmbiguousElementsPathCheck.java @@ -7,6 +7,7 @@ import org.apiaddicts.apitools.dosonarapi.api.v2.OpenApi2Grammar; import org.apiaddicts.apitools.dosonarapi.api.v3.OpenApi3Grammar; import org.apiaddicts.apitools.dosonarapi.api.v31.OpenApi31Grammar; +import org.apiaddicts.apitools.dosonarapi.api.v32.OpenApi32Grammar; import apiaddicts.sonar.openapi.checks.BaseCheck; import org.apiaddicts.apitools.dosonarapi.sslr.yaml.grammar.JsonNode; @@ -41,7 +42,7 @@ protected void visitFile(JsonNode root) { @Override public Set subscribedKinds() { - return ImmutableSet.of(OpenApi2Grammar.PATH, OpenApi3Grammar.PATH, OpenApi31Grammar.PATH); + return ImmutableSet.of(OpenApi2Grammar.PATH, OpenApi3Grammar.PATH, OpenApi31Grammar.PATH, OpenApi32Grammar.PATH); } @Override diff --git a/src/main/java/apiaddicts/sonar/openapi/checks/operations/OAR046DeclaredTagCheck.java b/src/main/java/apiaddicts/sonar/openapi/checks/operations/OAR046DeclaredTagCheck.java index e0e947d0..5c862ad7 100644 --- a/src/main/java/apiaddicts/sonar/openapi/checks/operations/OAR046DeclaredTagCheck.java +++ b/src/main/java/apiaddicts/sonar/openapi/checks/operations/OAR046DeclaredTagCheck.java @@ -25,6 +25,7 @@ import org.apiaddicts.apitools.dosonarapi.api.v2.OpenApi2Grammar; import org.apiaddicts.apitools.dosonarapi.api.v3.OpenApi3Grammar; import org.apiaddicts.apitools.dosonarapi.api.v31.OpenApi31Grammar; +import org.apiaddicts.apitools.dosonarapi.api.v32.OpenApi32Grammar; import apiaddicts.sonar.openapi.checks.BaseCheck; import org.apiaddicts.apitools.dosonarapi.sslr.yaml.grammar.JsonNode; @@ -36,7 +37,7 @@ public class OAR046DeclaredTagCheck extends BaseCheck { @Override public Set subscribedKinds() { - return Sets.newHashSet(OpenApi2Grammar.OPERATION, OpenApi3Grammar.OPERATION, OpenApi31Grammar.OPERATION); + return Sets.newHashSet(OpenApi2Grammar.OPERATION, OpenApi3Grammar.OPERATION, OpenApi31Grammar.OPERATION, OpenApi32Grammar.OPERATION); } @Override diff --git a/src/main/java/apiaddicts/sonar/openapi/checks/operations/OAR047DocumentedTagCheck.java b/src/main/java/apiaddicts/sonar/openapi/checks/operations/OAR047DocumentedTagCheck.java index 618a327e..afd3f604 100644 --- a/src/main/java/apiaddicts/sonar/openapi/checks/operations/OAR047DocumentedTagCheck.java +++ b/src/main/java/apiaddicts/sonar/openapi/checks/operations/OAR047DocumentedTagCheck.java @@ -26,6 +26,7 @@ import org.apiaddicts.apitools.dosonarapi.api.v2.OpenApi2Grammar; import org.apiaddicts.apitools.dosonarapi.api.v3.OpenApi3Grammar; import org.apiaddicts.apitools.dosonarapi.api.v31.OpenApi31Grammar; +import org.apiaddicts.apitools.dosonarapi.api.v32.OpenApi32Grammar; import apiaddicts.sonar.openapi.checks.BaseCheck; import org.apiaddicts.apitools.dosonarapi.sslr.yaml.grammar.JsonNode; import org.apiaddicts.apitools.dosonarapi.sslr.yaml.grammar.impl.MissingNode; @@ -41,7 +42,7 @@ public class OAR047DocumentedTagCheck extends BaseCheck { @Override public Set subscribedKinds() { - return Sets.newHashSet(OpenApi2Grammar.TAG, OpenApi2Grammar.OPERATION, OpenApi3Grammar.TAG, OpenApi31Grammar.TAG, OpenApi3Grammar.OPERATION, OpenApi31Grammar.OPERATION); + return Sets.newHashSet(OpenApi2Grammar.TAG, OpenApi2Grammar.OPERATION, OpenApi3Grammar.TAG, OpenApi31Grammar.TAG, OpenApi32Grammar.TAG, OpenApi3Grammar.OPERATION, OpenApi31Grammar.OPERATION, OpenApi32Grammar.OPERATION); } @Override @@ -63,7 +64,7 @@ public void visitFile(JsonNode root) { @Override protected void visitNode(JsonNode node) { AstNodeType nodeType = node.getType(); - if (nodeType == OpenApi2Grammar.TAG || nodeType == OpenApi3Grammar.TAG) { + if (nodeType == OpenApi2Grammar.TAG || nodeType == OpenApi3Grammar.TAG || nodeType == OpenApi31Grammar.TAG || nodeType == OpenApi32Grammar.TAG) { visitTag(node); } else { visitOperation(node); diff --git a/src/main/java/apiaddicts/sonar/openapi/checks/operations/OAR071GetQueryParamsDefinedCheck.java b/src/main/java/apiaddicts/sonar/openapi/checks/operations/OAR071GetQueryParamsDefinedCheck.java index 6ccb1cc1..9105e4f5 100644 --- a/src/main/java/apiaddicts/sonar/openapi/checks/operations/OAR071GetQueryParamsDefinedCheck.java +++ b/src/main/java/apiaddicts/sonar/openapi/checks/operations/OAR071GetQueryParamsDefinedCheck.java @@ -7,6 +7,7 @@ import org.apiaddicts.apitools.dosonarapi.api.v2.OpenApi2Grammar; import org.apiaddicts.apitools.dosonarapi.api.v3.OpenApi3Grammar; import org.apiaddicts.apitools.dosonarapi.api.v31.OpenApi31Grammar; +import org.apiaddicts.apitools.dosonarapi.api.v32.OpenApi32Grammar; import apiaddicts.sonar.openapi.checks.BaseCheck; import org.apiaddicts.apitools.dosonarapi.sslr.yaml.grammar.JsonNode; @@ -68,19 +69,19 @@ protected void visitFile(JsonNode root) { @Override public Set subscribedKinds() { - return ImmutableSet.of(OpenApi2Grammar.PATH, OpenApi3Grammar.PATH, OpenApi31Grammar.PATH, OpenApi2Grammar.OPERATION, OpenApi3Grammar.OPERATION, OpenApi31Grammar.OPERATION); + return ImmutableSet.of(OpenApi2Grammar.PATH, OpenApi3Grammar.PATH, OpenApi31Grammar.PATH, OpenApi32Grammar.PATH, OpenApi2Grammar.OPERATION, OpenApi3Grammar.OPERATION, OpenApi31Grammar.OPERATION, OpenApi32Grammar.OPERATION); } @Override public void visitNode(JsonNode node) { AstNodeType type = node.getType(); - if (isType(type, OpenApi2Grammar.PATH, OpenApi3Grammar.PATH, OpenApi31Grammar.PATH)) { + if (isType(type, OpenApi2Grammar.PATH, OpenApi3Grammar.PATH, OpenApi31Grammar.PATH, OpenApi32Grammar.PATH)) { currentPath = node.key().getTokenValue(); return; } - if (isType(type, OpenApi2Grammar.OPERATION, OpenApi3Grammar.OPERATION, OpenApi31Grammar.OPERATION)) { + if (isType(type, OpenApi2Grammar.OPERATION, OpenApi3Grammar.OPERATION, OpenApi31Grammar.OPERATION, OpenApi32Grammar.OPERATION)) { if (shouldExcludePath() || !"get".equalsIgnoreCase(node.key().getTokenValue())) { return; } diff --git a/src/main/java/apiaddicts/sonar/openapi/checks/operations/OAR091ParamOnlyRefCheck.java b/src/main/java/apiaddicts/sonar/openapi/checks/operations/OAR091ParamOnlyRefCheck.java index 90a5a1f3..b0f570ce 100644 --- a/src/main/java/apiaddicts/sonar/openapi/checks/operations/OAR091ParamOnlyRefCheck.java +++ b/src/main/java/apiaddicts/sonar/openapi/checks/operations/OAR091ParamOnlyRefCheck.java @@ -6,6 +6,7 @@ import org.apiaddicts.apitools.dosonarapi.api.v2.OpenApi2Grammar; import org.apiaddicts.apitools.dosonarapi.api.v3.OpenApi3Grammar; import org.apiaddicts.apitools.dosonarapi.api.v31.OpenApi31Grammar; +import org.apiaddicts.apitools.dosonarapi.api.v32.OpenApi32Grammar; import org.apiaddicts.apitools.dosonarapi.sslr.yaml.grammar.JsonNode; import apiaddicts.sonar.openapi.checks.BaseCheck; @@ -20,12 +21,12 @@ public class OAR091ParamOnlyRefCheck extends BaseCheck { @Override public Set subscribedKinds() { - return ImmutableSet.of(OpenApi2Grammar.PATHS, OpenApi3Grammar.PATHS, OpenApi31Grammar.PATHS); + return ImmutableSet.of(OpenApi2Grammar.PATHS, OpenApi3Grammar.PATHS, OpenApi31Grammar.PATHS, OpenApi32Grammar.PATHS); } @Override public void visitNode(JsonNode node) { - if (OpenApi2Grammar.PATHS.equals(node.getType()) || OpenApi3Grammar.PATHS.equals(node.getType()) || OpenApi31Grammar.PATHS.equals(node.getType())) { + if (OpenApi2Grammar.PATHS.equals(node.getType()) || OpenApi3Grammar.PATHS.equals(node.getType()) || OpenApi31Grammar.PATHS.equals(node.getType()) || OpenApi32Grammar.PATHS.equals(node.getType())) { visitParametersNode(node); } } diff --git a/src/main/java/apiaddicts/sonar/openapi/checks/operations/OAR092RequestBodyOnlyRefCheck.java b/src/main/java/apiaddicts/sonar/openapi/checks/operations/OAR092RequestBodyOnlyRefCheck.java index 53cd2a59..1df9f83f 100644 --- a/src/main/java/apiaddicts/sonar/openapi/checks/operations/OAR092RequestBodyOnlyRefCheck.java +++ b/src/main/java/apiaddicts/sonar/openapi/checks/operations/OAR092RequestBodyOnlyRefCheck.java @@ -5,6 +5,7 @@ import org.sonar.check.Rule; import org.apiaddicts.apitools.dosonarapi.api.v3.OpenApi3Grammar; import org.apiaddicts.apitools.dosonarapi.api.v31.OpenApi31Grammar; +import org.apiaddicts.apitools.dosonarapi.api.v32.OpenApi32Grammar; import org.apiaddicts.apitools.dosonarapi.sslr.yaml.grammar.JsonNode; import apiaddicts.sonar.openapi.checks.BaseCheck; @@ -19,12 +20,12 @@ public class OAR092RequestBodyOnlyRefCheck extends BaseCheck { @Override public Set subscribedKinds() { - return ImmutableSet.of(OpenApi3Grammar.PATHS); + return ImmutableSet.of(OpenApi3Grammar.PATHS, OpenApi31Grammar.PATHS, OpenApi32Grammar.PATHS); } @Override public void visitNode(JsonNode node) { - if (OpenApi3Grammar.PATHS.equals(node.getType()) || OpenApi31Grammar.PATHS.equals(node.getType())) { + if (OpenApi3Grammar.PATHS.equals(node.getType()) || OpenApi31Grammar.PATHS.equals(node.getType()) || OpenApi32Grammar.PATHS.equals(node.getType())) { visitPathsNode(node); } } diff --git a/src/main/java/apiaddicts/sonar/openapi/checks/operations/OAR093ResponseOnlyRefCheck.java b/src/main/java/apiaddicts/sonar/openapi/checks/operations/OAR093ResponseOnlyRefCheck.java index 29ba8f3c..a277dcc7 100644 --- a/src/main/java/apiaddicts/sonar/openapi/checks/operations/OAR093ResponseOnlyRefCheck.java +++ b/src/main/java/apiaddicts/sonar/openapi/checks/operations/OAR093ResponseOnlyRefCheck.java @@ -6,6 +6,7 @@ import org.apiaddicts.apitools.dosonarapi.api.v2.OpenApi2Grammar; import org.apiaddicts.apitools.dosonarapi.api.v3.OpenApi3Grammar; import org.apiaddicts.apitools.dosonarapi.api.v31.OpenApi31Grammar; +import org.apiaddicts.apitools.dosonarapi.api.v32.OpenApi32Grammar; import org.apiaddicts.apitools.dosonarapi.sslr.yaml.grammar.JsonNode; import apiaddicts.sonar.openapi.checks.BaseCheck; @@ -20,12 +21,12 @@ public class OAR093ResponseOnlyRefCheck extends BaseCheck { @Override public Set subscribedKinds() { - return ImmutableSet.of(OpenApi2Grammar.PATHS, OpenApi3Grammar.PATHS, OpenApi31Grammar.PATHS); + return ImmutableSet.of(OpenApi2Grammar.PATHS, OpenApi3Grammar.PATHS, OpenApi31Grammar.PATHS, OpenApi32Grammar.PATHS); } @Override public void visitNode(JsonNode node) { - if (OpenApi2Grammar.PATHS.equals(node.getType()) || OpenApi3Grammar.PATHS.equals(node.getType()) || OpenApi31Grammar.PATHS.equals(node.getType())) { + if (OpenApi2Grammar.PATHS.equals(node.getType()) || OpenApi3Grammar.PATHS.equals(node.getType()) || OpenApi31Grammar.PATHS.equals(node.getType()) || OpenApi32Grammar.PATHS.equals(node.getType())) { visitResponseNode(node); } } diff --git a/src/main/java/apiaddicts/sonar/openapi/checks/operations/OAR109ForbiddenInternalServerErrorCheck.java b/src/main/java/apiaddicts/sonar/openapi/checks/operations/OAR109ForbiddenInternalServerErrorCheck.java index 82f04b2c..c11cdfd2 100644 --- a/src/main/java/apiaddicts/sonar/openapi/checks/operations/OAR109ForbiddenInternalServerErrorCheck.java +++ b/src/main/java/apiaddicts/sonar/openapi/checks/operations/OAR109ForbiddenInternalServerErrorCheck.java @@ -12,6 +12,7 @@ import org.apiaddicts.apitools.dosonarapi.api.v2.OpenApi2Grammar; import org.apiaddicts.apitools.dosonarapi.api.v3.OpenApi3Grammar; import org.apiaddicts.apitools.dosonarapi.api.v31.OpenApi31Grammar; +import org.apiaddicts.apitools.dosonarapi.api.v32.OpenApi32Grammar; @Rule(key = OAR109ForbiddenInternalServerErrorCheck.KEY) public class OAR109ForbiddenInternalServerErrorCheck extends BaseCheck { @@ -21,7 +22,7 @@ public class OAR109ForbiddenInternalServerErrorCheck extends BaseCheck { @Override public Set subscribedKinds() { - return ImmutableSet.of(OpenApi2Grammar.OPERATION, OpenApi3Grammar.OPERATION, OpenApi31Grammar.OPERATION); + return ImmutableSet.of(OpenApi2Grammar.OPERATION, OpenApi3Grammar.OPERATION, OpenApi31Grammar.OPERATION, OpenApi32Grammar.OPERATION); } @Override diff --git a/src/main/java/apiaddicts/sonar/openapi/checks/parameters/AbstractParameterCheck.java b/src/main/java/apiaddicts/sonar/openapi/checks/parameters/AbstractParameterCheck.java index c4676a78..355c7fa8 100644 --- a/src/main/java/apiaddicts/sonar/openapi/checks/parameters/AbstractParameterCheck.java +++ b/src/main/java/apiaddicts/sonar/openapi/checks/parameters/AbstractParameterCheck.java @@ -6,6 +6,7 @@ import org.apiaddicts.apitools.dosonarapi.api.v2.OpenApi2Grammar; import org.apiaddicts.apitools.dosonarapi.api.v3.OpenApi3Grammar; import org.apiaddicts.apitools.dosonarapi.api.v31.OpenApi31Grammar; +import org.apiaddicts.apitools.dosonarapi.api.v32.OpenApi32Grammar; import org.apiaddicts.apitools.dosonarapi.sslr.yaml.grammar.JsonNode; import java.util.Set; @@ -17,7 +18,8 @@ public Set subscribedKinds() { return ImmutableSet.of( OpenApi2Grammar.PARAMETER, OpenApi3Grammar.PARAMETER, - OpenApi31Grammar.PARAMETER + OpenApi31Grammar.PARAMETER, + OpenApi32Grammar.PARAMETER ); } diff --git a/src/main/java/apiaddicts/sonar/openapi/checks/parameters/AbstractQueryParameterCheck.java b/src/main/java/apiaddicts/sonar/openapi/checks/parameters/AbstractQueryParameterCheck.java index 06d6889e..7d808a63 100644 --- a/src/main/java/apiaddicts/sonar/openapi/checks/parameters/AbstractQueryParameterCheck.java +++ b/src/main/java/apiaddicts/sonar/openapi/checks/parameters/AbstractQueryParameterCheck.java @@ -11,6 +11,7 @@ import org.apiaddicts.apitools.dosonarapi.api.v2.OpenApi2Grammar; import org.apiaddicts.apitools.dosonarapi.api.v3.OpenApi3Grammar; import org.apiaddicts.apitools.dosonarapi.api.v31.OpenApi31Grammar; +import org.apiaddicts.apitools.dosonarapi.api.v32.OpenApi32Grammar; import org.apiaddicts.apitools.dosonarapi.sslr.yaml.grammar.JsonNode; import org.sonar.check.RuleProperty; @@ -58,7 +59,7 @@ protected AbstractQueryParameterCheck( @Override public Set subscribedKinds() { - return ImmutableSet.of(OpenApi2Grammar.OPERATION, OpenApi3Grammar.OPERATION, OpenApi31Grammar.OPERATION); + return ImmutableSet.of(OpenApi2Grammar.OPERATION, OpenApi3Grammar.OPERATION, OpenApi31Grammar.OPERATION, OpenApi32Grammar.OPERATION); } @Override @@ -130,9 +131,9 @@ protected boolean hasDirectParameter(JsonNode parameterNode) { protected String getPath(JsonNode node) { StringBuilder pathBuilder = new StringBuilder(); - AstNode pathNode = node.getFirstAncestor(OpenApi2Grammar.PATH, OpenApi3Grammar.PATH, OpenApi31Grammar.PATH); + AstNode pathNode = node.getFirstAncestor(OpenApi2Grammar.PATH, OpenApi3Grammar.PATH, OpenApi31Grammar.PATH, OpenApi32Grammar.PATH); if (pathNode != null) { - while (pathNode.getType() != OpenApi2Grammar.PATH && pathNode.getType() != OpenApi3Grammar.PATH && pathNode.getType() != OpenApi31Grammar.PATH) { + while (pathNode.getType() != OpenApi2Grammar.PATH && pathNode.getType() != OpenApi3Grammar.PATH && pathNode.getType() != OpenApi31Grammar.PATH && pathNode.getType() != OpenApi32Grammar.PATH) { pathNode = pathNode.getParent(); } pathBuilder.append(((JsonNode) pathNode).key().getTokenValue()); diff --git a/src/main/java/apiaddicts/sonar/openapi/checks/parameters/OAR026TotalParameterDefaultValueCheck.java b/src/main/java/apiaddicts/sonar/openapi/checks/parameters/OAR026TotalParameterDefaultValueCheck.java index 5052ead5..57f41e5e 100644 --- a/src/main/java/apiaddicts/sonar/openapi/checks/parameters/OAR026TotalParameterDefaultValueCheck.java +++ b/src/main/java/apiaddicts/sonar/openapi/checks/parameters/OAR026TotalParameterDefaultValueCheck.java @@ -6,6 +6,7 @@ import org.apiaddicts.apitools.dosonarapi.api.v2.OpenApi2Grammar; import org.apiaddicts.apitools.dosonarapi.api.v3.OpenApi3Grammar; import org.apiaddicts.apitools.dosonarapi.api.v31.OpenApi31Grammar; +import org.apiaddicts.apitools.dosonarapi.api.v32.OpenApi32Grammar; import apiaddicts.sonar.openapi.checks.BaseCheck; import org.apiaddicts.apitools.dosonarapi.sslr.yaml.grammar.JsonNode; @@ -19,7 +20,7 @@ public class OAR026TotalParameterDefaultValueCheck extends BaseCheck { @Override public Set subscribedKinds() { - return ImmutableSet.of(OpenApi2Grammar.PARAMETER, OpenApi3Grammar.PARAMETER, OpenApi31Grammar.PARAMETER); + return ImmutableSet.of(OpenApi2Grammar.PARAMETER, OpenApi3Grammar.PARAMETER, OpenApi31Grammar.PARAMETER, OpenApi32Grammar.PARAMETER); } @Override @@ -29,7 +30,7 @@ public void visitNode(JsonNode node) { private void visitV2Node(JsonNode node) { if (!"$total".equals(node.get("name").getTokenValue())) return; - JsonNode defaultNode = ( node.getType() == OpenApi2Grammar.PARAMETER ) ? node.get("default") : node.at("/schema/default"); + JsonNode defaultNode = (node.getType() == OpenApi2Grammar.PARAMETER) ? node.get("default") : node.at("/schema/default"); if (defaultNode.isMissing()) { if (node.key().isMissing()) { addIssue(KEY, translate(MESSAGE), node); diff --git a/src/main/java/apiaddicts/sonar/openapi/checks/parameters/OAR028FilterParameterCheck.java b/src/main/java/apiaddicts/sonar/openapi/checks/parameters/OAR028FilterParameterCheck.java index 93f271f8..d839d3e2 100644 --- a/src/main/java/apiaddicts/sonar/openapi/checks/parameters/OAR028FilterParameterCheck.java +++ b/src/main/java/apiaddicts/sonar/openapi/checks/parameters/OAR028FilterParameterCheck.java @@ -6,6 +6,7 @@ import org.apiaddicts.apitools.dosonarapi.api.v2.OpenApi2Grammar; import org.apiaddicts.apitools.dosonarapi.api.v3.OpenApi3Grammar; import org.apiaddicts.apitools.dosonarapi.api.v31.OpenApi31Grammar; +import org.apiaddicts.apitools.dosonarapi.api.v32.OpenApi32Grammar; import org.apiaddicts.apitools.dosonarapi.sslr.yaml.grammar.JsonNode; import org.sonar.check.Rule; import org.sonar.check.RuleProperty; @@ -55,7 +56,7 @@ public class OAR028FilterParameterCheck extends BaseCheck { @Override public Set subscribedKinds() { - return ImmutableSet.of(OpenApi2Grammar.PARAMETER, OpenApi3Grammar.PARAMETER, OpenApi31Grammar.PARAMETER); + return ImmutableSet.of(OpenApi2Grammar.PARAMETER, OpenApi3Grammar.PARAMETER, OpenApi31Grammar.PARAMETER, OpenApi32Grammar.PARAMETER); } @Override @@ -83,9 +84,9 @@ public void visitParameterNode(JsonNode node) { private String getPath(JsonNode node) { StringBuilder pathBuilder = new StringBuilder(); - AstNode pathNode = node.getFirstAncestor(OpenApi2Grammar.PATH, OpenApi3Grammar.PATH, OpenApi31Grammar.PATH); + AstNode pathNode = node.getFirstAncestor(OpenApi2Grammar.PATH, OpenApi3Grammar.PATH, OpenApi31Grammar.PATH, OpenApi32Grammar.PATH); if (pathNode != null) { - while (pathNode.getType() != OpenApi2Grammar.PATH && pathNode.getType() != OpenApi3Grammar.PATH && pathNode.getType() != OpenApi31Grammar.PATH) { + while (pathNode.getType() != OpenApi2Grammar.PATH && pathNode.getType() != OpenApi3Grammar.PATH && pathNode.getType() != OpenApi31Grammar.PATH && pathNode.getType() != OpenApi32Grammar.PATH) { pathNode = pathNode.getParent(); } pathBuilder.append(((JsonNode) pathNode).key().getTokenValue()); diff --git a/src/main/java/apiaddicts/sonar/openapi/checks/parameters/OAR069PathParamAndQueryCheck.java b/src/main/java/apiaddicts/sonar/openapi/checks/parameters/OAR069PathParamAndQueryCheck.java index 212e38af..7f8f269a 100644 --- a/src/main/java/apiaddicts/sonar/openapi/checks/parameters/OAR069PathParamAndQueryCheck.java +++ b/src/main/java/apiaddicts/sonar/openapi/checks/parameters/OAR069PathParamAndQueryCheck.java @@ -4,6 +4,7 @@ import org.apiaddicts.apitools.dosonarapi.api.v2.OpenApi2Grammar; import org.apiaddicts.apitools.dosonarapi.api.v3.OpenApi3Grammar; import org.apiaddicts.apitools.dosonarapi.api.v31.OpenApi31Grammar; +import org.apiaddicts.apitools.dosonarapi.api.v32.OpenApi32Grammar; import org.sonar.check.Rule; import apiaddicts.sonar.openapi.checks.BaseCheck; import com.google.common.collect.ImmutableSet; @@ -21,18 +22,18 @@ public class OAR069PathParamAndQueryCheck extends BaseCheck { @Override public Set subscribedKinds() { - return ImmutableSet.of(OpenApi2Grammar.OPERATION, OpenApi3Grammar.OPERATION, OpenApi31Grammar.OPERATION); + return ImmutableSet.of(OpenApi2Grammar.OPERATION, OpenApi3Grammar.OPERATION, OpenApi31Grammar.OPERATION, OpenApi32Grammar.OPERATION); } @Override public void visitNode(JsonNode node) { - if (node.getType() == OpenApi2Grammar.OPERATION || node.getType() == OpenApi3Grammar.OPERATION || node.getType() == OpenApi31Grammar.OPERATION) { + if (node.getType() == OpenApi2Grammar.OPERATION || node.getType() == OpenApi3Grammar.OPERATION || node.getType() == OpenApi31Grammar.OPERATION || node.getType() == OpenApi32Grammar.OPERATION) { visitOperationNode(node); } } private void visitOperationNode(JsonNode node) { - List parameters = node.getDescendants(OpenApi2Grammar.PARAMETER, OpenApi3Grammar.PARAMETER, OpenApi31Grammar.PARAMETER) + List parameters = node.getDescendants(OpenApi2Grammar.PARAMETER, OpenApi3Grammar.PARAMETER, OpenApi31Grammar.PARAMETER, OpenApi32Grammar.PARAMETER) .stream() .map(JsonNode.class::cast) .collect(Collectors.toList()); diff --git a/src/main/java/apiaddicts/sonar/openapi/checks/regex/OAR112RegexCheck.java b/src/main/java/apiaddicts/sonar/openapi/checks/regex/OAR112RegexCheck.java index 5a775b02..d113b2cf 100644 --- a/src/main/java/apiaddicts/sonar/openapi/checks/regex/OAR112RegexCheck.java +++ b/src/main/java/apiaddicts/sonar/openapi/checks/regex/OAR112RegexCheck.java @@ -8,6 +8,8 @@ import org.apiaddicts.apitools.dosonarapi.api.v2.OpenApi2Grammar; import org.apiaddicts.apitools.dosonarapi.api.v3.OpenApi3Grammar; +import org.apiaddicts.apitools.dosonarapi.api.v31.OpenApi31Grammar; +import org.apiaddicts.apitools.dosonarapi.api.v32.OpenApi32Grammar; import org.apiaddicts.apitools.dosonarapi.sslr.yaml.grammar.JsonNode; import org.apiaddicts.apitools.dosonarapi.sslr.yaml.grammar.impl.MissingNode; @@ -70,6 +72,32 @@ public Set subscribedKinds() { OpenApi3Grammar.TAG, OpenApi3Grammar.SERVER, OpenApi3Grammar.EXTERNAL_DOC, + OpenApi31Grammar.ROOT, + OpenApi31Grammar.PATHS, + OpenApi31Grammar.OPERATION, + OpenApi31Grammar.INFO, + OpenApi31Grammar.RESPONSES, + OpenApi31Grammar.PARAMETER, + OpenApi31Grammar.COMPONENTS, + OpenApi31Grammar.REQUEST_BODY, + OpenApi31Grammar.SCHEMA, + OpenApi31Grammar.SECURITY_SCHEME, + OpenApi31Grammar.TAG, + OpenApi31Grammar.SERVER, + OpenApi31Grammar.EXTERNAL_DOC, + OpenApi32Grammar.ROOT, + OpenApi32Grammar.PATHS, + OpenApi32Grammar.OPERATION, + OpenApi32Grammar.INFO, + OpenApi32Grammar.RESPONSES, + OpenApi32Grammar.PARAMETER, + OpenApi32Grammar.COMPONENTS, + OpenApi32Grammar.REQUEST_BODY, + OpenApi32Grammar.SCHEMA, + OpenApi32Grammar.SECURITY_SCHEME, + OpenApi32Grammar.TAG, + OpenApi32Grammar.SERVER, + OpenApi32Grammar.EXTERNAL_DOC, OpenApi2Grammar.ROOT, OpenApi2Grammar.PATHS, OpenApi2Grammar.OPERATION, @@ -81,7 +109,6 @@ public Set subscribedKinds() { OpenApi2Grammar.SECURITY_SCHEME, OpenApi2Grammar.TAG, OpenApi2Grammar.EXTERNAL_DOC - ); } @@ -95,18 +122,18 @@ public void visitNode(JsonNode node) { boolean isMethod = isPathRoot && Arrays.asList("get", "post", "put", "patch", "delete") .contains(nodeSegments[1].toLowerCase()); - if (pathSegments.contains("info") && isType(type, OpenApi3Grammar.ROOT, OpenApi2Grammar.ROOT)) { + if (pathSegments.contains("info") && isType(type, OpenApi3Grammar.ROOT, OpenApi31Grammar.ROOT, OpenApi32Grammar.ROOT, OpenApi2Grammar.ROOT)) { handleInfoSection(node, pathSegments); - } else if (pathSegments.contains("servers") && type.equals(OpenApi3Grammar.SERVER)) { + } else if (pathSegments.contains("servers") && isType(type, OpenApi3Grammar.SERVER, OpenApi31Grammar.SERVER, OpenApi32Grammar.SERVER)) { handleServerNode(node, pathSegments); - } else if (isMethod && isType(type, OpenApi3Grammar.OPERATION, OpenApi2Grammar.OPERATION)) { + } else if (isMethod && isType(type, OpenApi3Grammar.OPERATION, OpenApi31Grammar.OPERATION, OpenApi32Grammar.OPERATION, OpenApi2Grammar.OPERATION)) { handleOperationsNode(node, pathSegments); - } else if (pathSegments.contains("tags") && isType(type, OpenApi3Grammar.TAG, OpenApi2Grammar.TAG)) { + } else if (pathSegments.contains("tags") && isType(type, OpenApi3Grammar.TAG, OpenApi31Grammar.TAG, OpenApi32Grammar.TAG, OpenApi2Grammar.TAG)) { handleTagsNode(node, pathSegments); - } else if (pathSegments.contains("externalDocs") && isType(type, OpenApi3Grammar.EXTERNAL_DOC, OpenApi2Grammar.EXTERNAL_DOC)) { + } else if (pathSegments.contains("externalDocs") && isType(type, OpenApi3Grammar.EXTERNAL_DOC, OpenApi31Grammar.EXTERNAL_DOC, OpenApi32Grammar.EXTERNAL_DOC, OpenApi2Grammar.EXTERNAL_DOC)) { handleExternalDocsNode(node, pathSegments); } else if (isMethod && nodeSegments.length > 2 && "parameters".equals(nodeSegments[2]) - && isType(type, OpenApi3Grammar.PARAMETER, OpenApi2Grammar.PARAMETERS)) { + && isType(type, OpenApi3Grammar.PARAMETER, OpenApi31Grammar.PARAMETER, OpenApi32Grammar.PARAMETER, OpenApi2Grammar.PARAMETERS)) { handleParametersNode(node, pathSegments); } } @@ -182,4 +209,4 @@ private void validateNodeWithRegex(JsonNode parentNode, String childKey, String } } } -} \ No newline at end of file +} diff --git a/src/main/java/apiaddicts/sonar/openapi/checks/schemas/AbstractExplicitResponseCheck.java b/src/main/java/apiaddicts/sonar/openapi/checks/schemas/AbstractExplicitResponseCheck.java index d7dc092b..106dca05 100644 --- a/src/main/java/apiaddicts/sonar/openapi/checks/schemas/AbstractExplicitResponseCheck.java +++ b/src/main/java/apiaddicts/sonar/openapi/checks/schemas/AbstractExplicitResponseCheck.java @@ -6,6 +6,7 @@ import org.apiaddicts.apitools.dosonarapi.api.v2.OpenApi2Grammar; import org.apiaddicts.apitools.dosonarapi.api.v3.OpenApi3Grammar; import org.apiaddicts.apitools.dosonarapi.api.v31.OpenApi31Grammar; +import org.apiaddicts.apitools.dosonarapi.api.v32.OpenApi32Grammar; import org.apiaddicts.apitools.dosonarapi.sslr.yaml.grammar.JsonNode; import java.util.Set; @@ -25,7 +26,7 @@ protected AbstractExplicitResponseCheck(String key, String responseCode) { @Override public Set subscribedKinds() { - return ImmutableSet.of(OpenApi2Grammar.RESPONSES, OpenApi3Grammar.RESPONSES, OpenApi31Grammar.RESPONSES); + return ImmutableSet.of(OpenApi2Grammar.RESPONSES, OpenApi3Grammar.RESPONSES, OpenApi31Grammar.RESPONSES, OpenApi32Grammar.RESPONSES); } @Override @@ -46,7 +47,7 @@ protected void visitResponsesNode(JsonNode node) { visitV2ExplicitNode(resolved); } - else if (OpenApi3Grammar.RESPONSE.equals(type) || OpenApi31Grammar.RESPONSE.equals(type)) { + else if (OpenApi3Grammar.RESPONSE.equals(type) || OpenApi31Grammar.RESPONSE.equals(type) || OpenApi32Grammar.RESPONSE.equals(type)) { handleV3Response(resolved); } } diff --git a/src/main/java/apiaddicts/sonar/openapi/checks/schemas/OAR029StandardResponseSchemaCheck.java b/src/main/java/apiaddicts/sonar/openapi/checks/schemas/OAR029StandardResponseSchemaCheck.java index c78ee24f..e61aee17 100644 --- a/src/main/java/apiaddicts/sonar/openapi/checks/schemas/OAR029StandardResponseSchemaCheck.java +++ b/src/main/java/apiaddicts/sonar/openapi/checks/schemas/OAR029StandardResponseSchemaCheck.java @@ -11,6 +11,7 @@ import org.apiaddicts.apitools.dosonarapi.api.v2.OpenApi2Grammar; import org.apiaddicts.apitools.dosonarapi.api.v3.OpenApi3Grammar; import org.apiaddicts.apitools.dosonarapi.api.v31.OpenApi31Grammar; +import org.apiaddicts.apitools.dosonarapi.api.v32.OpenApi32Grammar; import org.apiaddicts.apitools.dosonarapi.sslr.yaml.grammar.JsonNode; import java.util.Arrays; @@ -77,7 +78,7 @@ protected void visitFile(JsonNode root) { @Override public Set subscribedKinds() { - return ImmutableSet.of(OpenApi2Grammar.PATH, OpenApi3Grammar.PATH, OpenApi31Grammar.PATH); + return ImmutableSet.of(OpenApi2Grammar.PATH, OpenApi3Grammar.PATH, OpenApi31Grammar.PATH, OpenApi32Grammar.PATH); } @Override @@ -99,7 +100,7 @@ private void visitPathNode(JsonNode node) { handleExternalRef.resolve(propResponse.value(), resolved -> { if (resolved.getType().equals(OpenApi2Grammar.RESPONSE)) { visitSchemaNode(resolved, statusCode); - } else if (resolved.getType().equals(OpenApi3Grammar.RESPONSE)) { + } else if (resolved.getType().equals(OpenApi3Grammar.RESPONSE) || resolved.getType().equals(OpenApi31Grammar.RESPONSE) || resolved.getType().equals(OpenApi32Grammar.RESPONSE)) { resolved.at("/content").propertyMap().forEach((mediaType, mediaTypeNode) -> { if (mediaType.toLowerCase().contains("json")) { visitSchemaNode(mediaTypeNode, statusCode); diff --git a/src/main/java/apiaddicts/sonar/openapi/checks/schemas/OAR080SecuritySchemasCheck.java b/src/main/java/apiaddicts/sonar/openapi/checks/schemas/OAR080SecuritySchemasCheck.java index 6b22172d..147c805b 100644 --- a/src/main/java/apiaddicts/sonar/openapi/checks/schemas/OAR080SecuritySchemasCheck.java +++ b/src/main/java/apiaddicts/sonar/openapi/checks/schemas/OAR080SecuritySchemasCheck.java @@ -9,6 +9,7 @@ import org.apiaddicts.apitools.dosonarapi.api.v2.OpenApi2Grammar; import org.apiaddicts.apitools.dosonarapi.api.v3.OpenApi3Grammar; import org.apiaddicts.apitools.dosonarapi.api.v31.OpenApi31Grammar; +import org.apiaddicts.apitools.dosonarapi.api.v32.OpenApi32Grammar; import org.apiaddicts.apitools.dosonarapi.sslr.yaml.grammar.JsonNode; import org.sonar.check.Rule; import org.sonar.check.RuleProperty; @@ -40,9 +41,11 @@ public Set subscribedKinds() { OpenApi2Grammar.PATH, OpenApi3Grammar.PATH, OpenApi31Grammar.PATH, + OpenApi32Grammar.PATH, OpenApi2Grammar.OPERATION, OpenApi3Grammar.OPERATION, - OpenApi31Grammar.OPERATION + OpenApi31Grammar.OPERATION, + OpenApi32Grammar.OPERATION ); } diff --git a/src/main/java/apiaddicts/sonar/openapi/checks/schemas/OAR108SchemaValidatorCheck.java b/src/main/java/apiaddicts/sonar/openapi/checks/schemas/OAR108SchemaValidatorCheck.java index 9b599379..8153a58c 100644 --- a/src/main/java/apiaddicts/sonar/openapi/checks/schemas/OAR108SchemaValidatorCheck.java +++ b/src/main/java/apiaddicts/sonar/openapi/checks/schemas/OAR108SchemaValidatorCheck.java @@ -7,6 +7,8 @@ import org.apiaddicts.apitools.dosonarapi.sslr.yaml.grammar.JsonNode; import org.apiaddicts.apitools.dosonarapi.api.v2.OpenApi2Grammar; import org.apiaddicts.apitools.dosonarapi.api.v3.OpenApi3Grammar; +import org.apiaddicts.apitools.dosonarapi.api.v31.OpenApi31Grammar; +import org.apiaddicts.apitools.dosonarapi.api.v32.OpenApi32Grammar; import java.util.HashMap; import java.util.Map; @@ -20,7 +22,7 @@ public class OAR108SchemaValidatorCheck extends BaseCheck { @Override public Set subscribedKinds() { - return ImmutableSet.of(OpenApi2Grammar.PATHS, OpenApi3Grammar.PATHS); + return ImmutableSet.of(OpenApi2Grammar.PATHS, OpenApi3Grammar.PATHS, OpenApi31Grammar.PATHS, OpenApi32Grammar.PATHS); } @Override diff --git a/src/main/java/apiaddicts/sonar/openapi/checks/security/AbstractPathAwareOperationCheck.java b/src/main/java/apiaddicts/sonar/openapi/checks/security/AbstractPathAwareOperationCheck.java index 64f34a30..d27877f6 100644 --- a/src/main/java/apiaddicts/sonar/openapi/checks/security/AbstractPathAwareOperationCheck.java +++ b/src/main/java/apiaddicts/sonar/openapi/checks/security/AbstractPathAwareOperationCheck.java @@ -6,6 +6,7 @@ import org.apiaddicts.apitools.dosonarapi.api.v2.OpenApi2Grammar; import org.apiaddicts.apitools.dosonarapi.api.v3.OpenApi3Grammar; import org.apiaddicts.apitools.dosonarapi.api.v31.OpenApi31Grammar; +import org.apiaddicts.apitools.dosonarapi.api.v32.OpenApi32Grammar; import org.apiaddicts.apitools.dosonarapi.sslr.yaml.grammar.JsonNode; import java.util.Set; @@ -20,9 +21,11 @@ public Set subscribedKinds() { OpenApi2Grammar.PATH, OpenApi3Grammar.PATH, OpenApi31Grammar.PATH, + OpenApi32Grammar.PATH, OpenApi2Grammar.OPERATION, OpenApi3Grammar.OPERATION, - OpenApi31Grammar.OPERATION + OpenApi31Grammar.OPERATION, + OpenApi32Grammar.OPERATION ); } @@ -32,7 +35,8 @@ public void visitNode(JsonNode node) { if (type == OpenApi2Grammar.PATH || type == OpenApi3Grammar.PATH - || type == OpenApi31Grammar.PATH) { + || type == OpenApi31Grammar.PATH + || type == OpenApi32Grammar.PATH) { currentPath = node.key().getTokenValue(); return; } diff --git a/src/main/java/apiaddicts/sonar/openapi/checks/security/AbstractSecurityResponseCheck.java b/src/main/java/apiaddicts/sonar/openapi/checks/security/AbstractSecurityResponseCheck.java index 7a7de47e..af301d44 100644 --- a/src/main/java/apiaddicts/sonar/openapi/checks/security/AbstractSecurityResponseCheck.java +++ b/src/main/java/apiaddicts/sonar/openapi/checks/security/AbstractSecurityResponseCheck.java @@ -7,6 +7,7 @@ import org.apiaddicts.apitools.dosonarapi.api.v2.OpenApi2Grammar; import org.apiaddicts.apitools.dosonarapi.api.v3.OpenApi3Grammar; import org.apiaddicts.apitools.dosonarapi.api.v31.OpenApi31Grammar; +import org.apiaddicts.apitools.dosonarapi.api.v32.OpenApi32Grammar; import org.apiaddicts.apitools.dosonarapi.sslr.yaml.grammar.JsonNode; import java.util.Arrays; @@ -38,7 +39,7 @@ protected AbstractSecurityResponseCheck(String ruleKey, String messageKey, Strin @Override public Set subscribedKinds() { - return ImmutableSet.of(OpenApi2Grammar.OPERATION, OpenApi3Grammar.OPERATION, OpenApi31Grammar.OPERATION); + return ImmutableSet.of(OpenApi2Grammar.OPERATION, OpenApi3Grammar.OPERATION, OpenApi31Grammar.OPERATION, OpenApi32Grammar.OPERATION); } @Override diff --git a/src/main/java/apiaddicts/sonar/openapi/checks/security/AbstractTypedParameterIntegrityCheck.java b/src/main/java/apiaddicts/sonar/openapi/checks/security/AbstractTypedParameterIntegrityCheck.java index c3dfde43..03488ae8 100644 --- a/src/main/java/apiaddicts/sonar/openapi/checks/security/AbstractTypedParameterIntegrityCheck.java +++ b/src/main/java/apiaddicts/sonar/openapi/checks/security/AbstractTypedParameterIntegrityCheck.java @@ -6,6 +6,7 @@ import org.apiaddicts.apitools.dosonarapi.api.v2.OpenApi2Grammar; import org.apiaddicts.apitools.dosonarapi.api.v3.OpenApi3Grammar; import org.apiaddicts.apitools.dosonarapi.api.v31.OpenApi31Grammar; +import org.apiaddicts.apitools.dosonarapi.api.v32.OpenApi32Grammar; import org.apiaddicts.apitools.dosonarapi.sslr.yaml.grammar.JsonNode; import java.util.Set; @@ -24,7 +25,8 @@ public Set subscribedKinds() { return ImmutableSet.of( OpenApi2Grammar.PARAMETER, OpenApi3Grammar.PARAMETER, - OpenApi31Grammar.PARAMETER + OpenApi31Grammar.PARAMETER, + OpenApi32Grammar.PARAMETER ); } diff --git a/src/main/java/apiaddicts/sonar/openapi/checks/security/OAR001MandatoryHttpsProtocolCheck.java b/src/main/java/apiaddicts/sonar/openapi/checks/security/OAR001MandatoryHttpsProtocolCheck.java index 2cef1c2a..64e400be 100644 --- a/src/main/java/apiaddicts/sonar/openapi/checks/security/OAR001MandatoryHttpsProtocolCheck.java +++ b/src/main/java/apiaddicts/sonar/openapi/checks/security/OAR001MandatoryHttpsProtocolCheck.java @@ -7,6 +7,7 @@ import org.apiaddicts.apitools.dosonarapi.api.v2.OpenApi2Grammar; import org.apiaddicts.apitools.dosonarapi.api.v3.OpenApi3Grammar; import org.apiaddicts.apitools.dosonarapi.api.v31.OpenApi31Grammar; +import org.apiaddicts.apitools.dosonarapi.api.v32.OpenApi32Grammar; import apiaddicts.sonar.openapi.checks.BaseCheck; import org.apiaddicts.apitools.dosonarapi.sslr.yaml.grammar.JsonNode; @@ -20,7 +21,7 @@ public class OAR001MandatoryHttpsProtocolCheck extends BaseCheck { @Override public Set subscribedKinds() { - return ImmutableSet.of(OpenApi2Grammar.ROOT, OpenApi3Grammar.ROOT, OpenApi31Grammar.ROOT); + return ImmutableSet.of(OpenApi2Grammar.ROOT, OpenApi3Grammar.ROOT, OpenApi31Grammar.ROOT, OpenApi32Grammar.ROOT); } @Override diff --git a/src/main/java/apiaddicts/sonar/openapi/checks/security/OAR033HttpHeadersCheck.java b/src/main/java/apiaddicts/sonar/openapi/checks/security/OAR033HttpHeadersCheck.java index 0439b45a..ccb199bc 100644 --- a/src/main/java/apiaddicts/sonar/openapi/checks/security/OAR033HttpHeadersCheck.java +++ b/src/main/java/apiaddicts/sonar/openapi/checks/security/OAR033HttpHeadersCheck.java @@ -7,6 +7,7 @@ import org.apiaddicts.apitools.dosonarapi.api.v2.OpenApi2Grammar; import org.apiaddicts.apitools.dosonarapi.api.v3.OpenApi3Grammar; import org.apiaddicts.apitools.dosonarapi.api.v31.OpenApi31Grammar; +import org.apiaddicts.apitools.dosonarapi.api.v32.OpenApi32Grammar; import apiaddicts.sonar.openapi.checks.BaseCheck; import apiaddicts.sonar.openapi.utils.JsonNodeUtils; @@ -75,14 +76,14 @@ protected void visitFile(JsonNode root) { @Override public Set subscribedKinds() { - return ImmutableSet.of(OpenApi2Grammar.PATH, OpenApi3Grammar.PATH, OpenApi31Grammar.PATH); + return ImmutableSet.of(OpenApi2Grammar.PATH, OpenApi3Grammar.PATH, OpenApi31Grammar.PATH, OpenApi32Grammar.PATH); } @Override public void visitNode(JsonNode node) { if (node.getType() == OpenApi2Grammar.PATH) { visitPathV2Node(node); - } else if (node.getType() == OpenApi3Grammar.PATH || node.getType() == OpenApi31Grammar.PATH){ + } else if (node.getType() == OpenApi3Grammar.PATH || node.getType() == OpenApi31Grammar.PATH || node.getType() == OpenApi32Grammar.PATH){ visitPathV3Node(node); } } diff --git a/src/main/java/apiaddicts/sonar/openapi/checks/security/OAR036SessionMechanismsCheck.java b/src/main/java/apiaddicts/sonar/openapi/checks/security/OAR036SessionMechanismsCheck.java index d158e3ff..c4c880ea 100644 --- a/src/main/java/apiaddicts/sonar/openapi/checks/security/OAR036SessionMechanismsCheck.java +++ b/src/main/java/apiaddicts/sonar/openapi/checks/security/OAR036SessionMechanismsCheck.java @@ -6,6 +6,7 @@ import org.apiaddicts.apitools.dosonarapi.api.v2.OpenApi2Grammar; import org.apiaddicts.apitools.dosonarapi.api.v3.OpenApi3Grammar; import org.apiaddicts.apitools.dosonarapi.api.v31.OpenApi31Grammar; +import org.apiaddicts.apitools.dosonarapi.api.v32.OpenApi32Grammar; import apiaddicts.sonar.openapi.checks.BaseCheck; import org.apiaddicts.apitools.dosonarapi.sslr.yaml.grammar.JsonNode; @@ -19,16 +20,16 @@ public class OAR036SessionMechanismsCheck extends BaseCheck { @Override public Set subscribedKinds() { - return ImmutableSet.of(OpenApi2Grammar.PARAMETER, OpenApi2Grammar.HEADER, OpenApi3Grammar.PARAMETER, OpenApi3Grammar.HEADER, OpenApi31Grammar.PARAMETER, OpenApi31Grammar.HEADER); + return ImmutableSet.of(OpenApi2Grammar.PARAMETER, OpenApi2Grammar.HEADER, OpenApi3Grammar.PARAMETER, OpenApi3Grammar.HEADER, OpenApi31Grammar.PARAMETER, OpenApi31Grammar.HEADER, OpenApi32Grammar.PARAMETER, OpenApi32Grammar.HEADER); } @Override public void visitNode(JsonNode node) { - if ( ( OpenApi2Grammar.PARAMETER.equals(node.getType()) || OpenApi3Grammar.PARAMETER.equals(node.getType()) || OpenApi31Grammar.PARAMETER.equals(node.getType())) + if ( ( OpenApi2Grammar.PARAMETER.equals(node.getType()) || OpenApi3Grammar.PARAMETER.equals(node.getType()) || OpenApi31Grammar.PARAMETER.equals(node.getType()) || OpenApi32Grammar.PARAMETER.equals(node.getType())) && "header".equals(node.get("in").getTokenValue()) && "Cookie".equals(node.get("name").getTokenValue())) { addIssue(KEY, translate(MESSAGE), node.get("name").value()); } - if ( ( OpenApi2Grammar.HEADER.equals(node.getType()) || OpenApi3Grammar.HEADER.equals(node.getType()) || OpenApi31Grammar.HEADER.equals(node.getType()) ) + if ( ( OpenApi2Grammar.HEADER.equals(node.getType()) || OpenApi3Grammar.HEADER.equals(node.getType()) || OpenApi31Grammar.HEADER.equals(node.getType()) || OpenApi32Grammar.HEADER.equals(node.getType()) ) && "Set-Cookie".equals(node.key().getTokenValue())) { addIssue(KEY, translate(MESSAGE), node.key()); } diff --git a/src/main/java/apiaddicts/sonar/openapi/checks/security/OAR049NoContentIn204Check.java b/src/main/java/apiaddicts/sonar/openapi/checks/security/OAR049NoContentIn204Check.java index 9fe1d4df..0cf74277 100644 --- a/src/main/java/apiaddicts/sonar/openapi/checks/security/OAR049NoContentIn204Check.java +++ b/src/main/java/apiaddicts/sonar/openapi/checks/security/OAR049NoContentIn204Check.java @@ -25,6 +25,7 @@ import org.apiaddicts.apitools.dosonarapi.api.v2.OpenApi2Grammar; import org.apiaddicts.apitools.dosonarapi.api.v3.OpenApi3Grammar; import org.apiaddicts.apitools.dosonarapi.api.v31.OpenApi31Grammar; +import org.apiaddicts.apitools.dosonarapi.api.v32.OpenApi32Grammar; import apiaddicts.sonar.openapi.checks.BaseCheck; import org.apiaddicts.apitools.dosonarapi.sslr.yaml.grammar.JsonNode; @@ -37,7 +38,7 @@ public class OAR049NoContentIn204Check extends BaseCheck { @Override public Set subscribedKinds() { - return Sets.newHashSet(OpenApi2Grammar.OPERATION, OpenApi3Grammar.OPERATION, OpenApi31Grammar.OPERATION); + return Sets.newHashSet(OpenApi2Grammar.OPERATION, OpenApi3Grammar.OPERATION, OpenApi31Grammar.OPERATION, OpenApi32Grammar.OPERATION); } @Override @@ -60,6 +61,6 @@ private void checkNoContent(JsonNode response) { private static boolean hasContent(JsonNode effective) { return effective.getType() instanceof OpenApi2Grammar && !effective.get("schema").isMissing() - || effective.getType() instanceof OpenApi3Grammar && ! effective.get("content").isMissing() || effective.getType() instanceof OpenApi31Grammar && ! effective.get("content").isMissing(); + || effective.getType() instanceof OpenApi3Grammar && ! effective.get("content").isMissing() || effective.getType() instanceof OpenApi31Grammar && ! effective.get("content").isMissing() || effective.getType() instanceof OpenApi32Grammar && ! effective.get("content").isMissing(); } } diff --git a/src/main/java/apiaddicts/sonar/openapi/checks/security/OAR054HostCheck.java b/src/main/java/apiaddicts/sonar/openapi/checks/security/OAR054HostCheck.java index c986b66b..035c0fe1 100644 --- a/src/main/java/apiaddicts/sonar/openapi/checks/security/OAR054HostCheck.java +++ b/src/main/java/apiaddicts/sonar/openapi/checks/security/OAR054HostCheck.java @@ -7,6 +7,7 @@ import org.apiaddicts.apitools.dosonarapi.api.v2.OpenApi2Grammar; import org.apiaddicts.apitools.dosonarapi.api.v3.OpenApi3Grammar; import org.apiaddicts.apitools.dosonarapi.api.v31.OpenApi31Grammar; +import org.apiaddicts.apitools.dosonarapi.api.v32.OpenApi32Grammar; import apiaddicts.sonar.openapi.checks.BaseCheck; import org.apiaddicts.apitools.dosonarapi.sslr.yaml.grammar.JsonNode; @@ -30,7 +31,7 @@ public class OAR054HostCheck extends BaseCheck { @Override public Set subscribedKinds() { - return ImmutableSet.of(OpenApi2Grammar.ROOT, OpenApi3Grammar.SERVER, OpenApi31Grammar.SERVER); + return ImmutableSet.of(OpenApi2Grammar.ROOT, OpenApi3Grammar.SERVER, OpenApi31Grammar.SERVER, OpenApi32Grammar.SERVER); } @Override diff --git a/src/main/java/apiaddicts/sonar/openapi/checks/security/OAR072NonOKModelResponseCheck.java b/src/main/java/apiaddicts/sonar/openapi/checks/security/OAR072NonOKModelResponseCheck.java index 1ce11226..5c77e50c 100644 --- a/src/main/java/apiaddicts/sonar/openapi/checks/security/OAR072NonOKModelResponseCheck.java +++ b/src/main/java/apiaddicts/sonar/openapi/checks/security/OAR072NonOKModelResponseCheck.java @@ -6,6 +6,7 @@ import org.apiaddicts.apitools.dosonarapi.api.v2.OpenApi2Grammar; import org.apiaddicts.apitools.dosonarapi.api.v3.OpenApi3Grammar; import org.apiaddicts.apitools.dosonarapi.api.v31.OpenApi31Grammar; +import org.apiaddicts.apitools.dosonarapi.api.v32.OpenApi32Grammar; import apiaddicts.sonar.openapi.checks.BaseCheck; import org.apiaddicts.apitools.dosonarapi.sslr.yaml.grammar.JsonNode; @@ -23,7 +24,7 @@ public class OAR072NonOKModelResponseCheck extends BaseCheck { @Override public Set subscribedKinds() { - return ImmutableSet.of(OpenApi2Grammar.OPERATION, OpenApi3Grammar.OPERATION, OpenApi31Grammar.OPERATION); + return ImmutableSet.of(OpenApi2Grammar.OPERATION, OpenApi3Grammar.OPERATION, OpenApi31Grammar.OPERATION, OpenApi32Grammar.OPERATION); } @Override @@ -43,6 +44,8 @@ private void visitOperationNode(JsonNode node) { checkOpenApiResponse(responseNode); } else if (node.is(OpenApi31Grammar.OPERATION)) { checkOpenApiResponse(responseNode); + } else if (node.is(OpenApi32Grammar.OPERATION)) { + checkOpenApiResponse(responseNode); } } } diff --git a/src/main/java/apiaddicts/sonar/openapi/checks/security/OAR078VerbsSecurityCheck.java b/src/main/java/apiaddicts/sonar/openapi/checks/security/OAR078VerbsSecurityCheck.java index 07f3c303..eb2b5528 100644 --- a/src/main/java/apiaddicts/sonar/openapi/checks/security/OAR078VerbsSecurityCheck.java +++ b/src/main/java/apiaddicts/sonar/openapi/checks/security/OAR078VerbsSecurityCheck.java @@ -5,6 +5,7 @@ import org.apiaddicts.apitools.dosonarapi.api.v2.OpenApi2Grammar; import org.apiaddicts.apitools.dosonarapi.api.v3.OpenApi3Grammar; import org.apiaddicts.apitools.dosonarapi.api.v31.OpenApi31Grammar; +import org.apiaddicts.apitools.dosonarapi.api.v32.OpenApi32Grammar; import org.apiaddicts.apitools.dosonarapi.sslr.yaml.grammar.JsonNode; import org.sonar.check.Rule; import apiaddicts.sonar.openapi.checks.BaseCheck; @@ -23,7 +24,7 @@ public class OAR078VerbsSecurityCheck extends BaseCheck { @Override public Set subscribedKinds() { - return ImmutableSet.of(OpenApi2Grammar.PATH, OpenApi3Grammar.PATH, OpenApi31Grammar.PATH, OpenApi2Grammar.OPERATION, OpenApi3Grammar.OPERATION, OpenApi31Grammar.OPERATION); + return ImmutableSet.of(OpenApi2Grammar.PATH, OpenApi3Grammar.PATH, OpenApi31Grammar.PATH, OpenApi32Grammar.PATH, OpenApi2Grammar.OPERATION, OpenApi3Grammar.OPERATION, OpenApi31Grammar.OPERATION, OpenApi32Grammar.OPERATION); } @Override @@ -41,8 +42,8 @@ public void visitNode(JsonNode node) { Object type = node.getType(); - if (type == OpenApi2Grammar.PATH || type == OpenApi3Grammar.PATH || type == OpenApi31Grammar.PATH || - type == OpenApi2Grammar.OPERATION || type == OpenApi3Grammar.OPERATION || type == OpenApi31Grammar.OPERATION) { + if (type == OpenApi2Grammar.PATH || type == OpenApi3Grammar.PATH || type == OpenApi31Grammar.PATH || type == OpenApi32Grammar.PATH || + type == OpenApi2Grammar.OPERATION || type == OpenApi3Grammar.OPERATION || type == OpenApi31Grammar.OPERATION || type == OpenApi32Grammar.OPERATION) { visitOperationNode(node); } } diff --git a/src/main/java/apiaddicts/sonar/openapi/checks/security/OAR081PasswordFormatCheck.java b/src/main/java/apiaddicts/sonar/openapi/checks/security/OAR081PasswordFormatCheck.java index 1a0be7c9..37d8d909 100644 --- a/src/main/java/apiaddicts/sonar/openapi/checks/security/OAR081PasswordFormatCheck.java +++ b/src/main/java/apiaddicts/sonar/openapi/checks/security/OAR081PasswordFormatCheck.java @@ -7,6 +7,7 @@ import org.apiaddicts.apitools.dosonarapi.api.v2.OpenApi2Grammar; import org.apiaddicts.apitools.dosonarapi.api.v3.OpenApi3Grammar; import org.apiaddicts.apitools.dosonarapi.api.v31.OpenApi31Grammar; +import org.apiaddicts.apitools.dosonarapi.api.v32.OpenApi32Grammar; import org.apiaddicts.apitools.dosonarapi.sslr.yaml.grammar.JsonNode; import java.util.Set; @@ -21,12 +22,12 @@ public class OAR081PasswordFormatCheck extends BaseCheck { @Override public Set subscribedKinds() { - return ImmutableSet.of(OpenApi2Grammar.PATHS, OpenApi2Grammar.DEFINITIONS, OpenApi3Grammar.PATHS, OpenApi3Grammar.COMPONENTS, OpenApi31Grammar.PATHS, OpenApi31Grammar.COMPONENTS); + return ImmutableSet.of(OpenApi2Grammar.PATHS, OpenApi2Grammar.DEFINITIONS, OpenApi3Grammar.PATHS, OpenApi3Grammar.COMPONENTS, OpenApi31Grammar.PATHS, OpenApi31Grammar.COMPONENTS, OpenApi32Grammar.PATHS, OpenApi32Grammar.COMPONENTS); } @Override public void visitNode(JsonNode node) { - if (OpenApi2Grammar.PATHS.equals(node.getType()) || OpenApi3Grammar.PATHS.equals(node.getType()) || OpenApi31Grammar.PATHS.equals(node.getType())) { + if (OpenApi2Grammar.PATHS.equals(node.getType()) || OpenApi3Grammar.PATHS.equals(node.getType()) || OpenApi31Grammar.PATHS.equals(node.getType()) || OpenApi32Grammar.PATHS.equals(node.getType())) { visitPathsNode(node); } else if (OpenApi2Grammar.DEFINITIONS.equals(node.getType())) { visitDefinitionsNode(node); @@ -40,6 +41,11 @@ public void visitNode(JsonNode node) { if (!schemasNode.isMissing()) { visitDefinitionsNode(schemasNode); } + } else if (OpenApi32Grammar.COMPONENTS.equals(node.getType())) { + JsonNode schemasNode = node.get("schemas"); + if (!schemasNode.isMissing()) { + visitDefinitionsNode(schemasNode); + } } } diff --git a/src/main/java/apiaddicts/sonar/openapi/checks/security/OAR082BinaryOrByteFormatCheck.java b/src/main/java/apiaddicts/sonar/openapi/checks/security/OAR082BinaryOrByteFormatCheck.java index dd585c23..0c831f4a 100644 --- a/src/main/java/apiaddicts/sonar/openapi/checks/security/OAR082BinaryOrByteFormatCheck.java +++ b/src/main/java/apiaddicts/sonar/openapi/checks/security/OAR082BinaryOrByteFormatCheck.java @@ -10,6 +10,7 @@ import org.apiaddicts.apitools.dosonarapi.api.v2.OpenApi2Grammar; import org.apiaddicts.apitools.dosonarapi.api.v3.OpenApi3Grammar; import org.apiaddicts.apitools.dosonarapi.api.v31.OpenApi31Grammar; +import org.apiaddicts.apitools.dosonarapi.api.v32.OpenApi32Grammar; import org.apiaddicts.apitools.dosonarapi.sslr.yaml.grammar.JsonNode; import java.util.Arrays; @@ -34,7 +35,7 @@ public class OAR082BinaryOrByteFormatCheck extends BaseCheck { @Override public Set subscribedKinds() { - return ImmutableSet.of(OpenApi2Grammar.SCHEMA, OpenApi2Grammar.PARAMETER, OpenApi3Grammar.SCHEMA, OpenApi31Grammar.SCHEMA); + return ImmutableSet.of(OpenApi2Grammar.SCHEMA, OpenApi2Grammar.PARAMETER, OpenApi3Grammar.SCHEMA, OpenApi31Grammar.SCHEMA, OpenApi32Grammar.SCHEMA); } @Override diff --git a/src/main/java/apiaddicts/sonar/openapi/checks/security/OAR085OpenAPIVersionCheck.java b/src/main/java/apiaddicts/sonar/openapi/checks/security/OAR085OpenAPIVersionCheck.java index c102417b..2cc3ba66 100644 --- a/src/main/java/apiaddicts/sonar/openapi/checks/security/OAR085OpenAPIVersionCheck.java +++ b/src/main/java/apiaddicts/sonar/openapi/checks/security/OAR085OpenAPIVersionCheck.java @@ -6,6 +6,7 @@ import org.apiaddicts.apitools.dosonarapi.api.v2.OpenApi2Grammar; import org.apiaddicts.apitools.dosonarapi.api.v3.OpenApi3Grammar; import org.apiaddicts.apitools.dosonarapi.api.v31.OpenApi31Grammar; +import org.apiaddicts.apitools.dosonarapi.api.v32.OpenApi32Grammar; import apiaddicts.sonar.openapi.checks.BaseCheck; import org.apiaddicts.apitools.dosonarapi.sslr.yaml.grammar.JsonNode; @@ -19,7 +20,7 @@ public class OAR085OpenAPIVersionCheck extends BaseCheck { public static final String KEY = "OAR085"; private static final String MESSAGE = "OAR085.error"; - private static final String DEFAULT_VALID_VERSIONS = "2.0,3.0.0,3.0.1,3.0.2,3.0.3,3.1.0"; + private static final String DEFAULT_VALID_VERSIONS = "2.0,3.0.0,3.0.1,3.0.2,3.0.3,3.1.0,3.2.0"; @RuleProperty( key = "valid-versions", @@ -56,6 +57,6 @@ private String getVersion(JsonNode swagger, JsonNode openapi) { @Override public Set subscribedKinds() { - return ImmutableSet.of(OpenApi2Grammar.ROOT, OpenApi3Grammar.ROOT, OpenApi31Grammar.ROOT); + return ImmutableSet.of(OpenApi2Grammar.ROOT, OpenApi3Grammar.ROOT, OpenApi31Grammar.ROOT, OpenApi32Grammar.ROOT); } } \ No newline at end of file diff --git a/src/main/java/apiaddicts/sonar/openapi/checks/security/OAR114HttpResponseHeadersChecks.java b/src/main/java/apiaddicts/sonar/openapi/checks/security/OAR114HttpResponseHeadersChecks.java index ad4df8b0..52845a24 100644 --- a/src/main/java/apiaddicts/sonar/openapi/checks/security/OAR114HttpResponseHeadersChecks.java +++ b/src/main/java/apiaddicts/sonar/openapi/checks/security/OAR114HttpResponseHeadersChecks.java @@ -12,6 +12,7 @@ import org.apiaddicts.apitools.dosonarapi.api.v2.OpenApi2Grammar; import org.apiaddicts.apitools.dosonarapi.api.v3.OpenApi3Grammar; import org.apiaddicts.apitools.dosonarapi.api.v31.OpenApi31Grammar; +import org.apiaddicts.apitools.dosonarapi.api.v32.OpenApi32Grammar; import org.apiaddicts.apitools.dosonarapi.sslr.yaml.grammar.JsonNode; import org.sonar.check.Rule; import org.sonar.check.RuleProperty; @@ -49,7 +50,7 @@ protected void visitFile(JsonNode root) { @Override public Set subscribedKinds() { - return ImmutableSet.of(OpenApi2Grammar.RESPONSE, OpenApi3Grammar.RESPONSE, OpenApi31Grammar.RESPONSE); + return ImmutableSet.of(OpenApi2Grammar.RESPONSE, OpenApi3Grammar.RESPONSE, OpenApi31Grammar.RESPONSE, OpenApi32Grammar.RESPONSE); } @Override diff --git a/src/main/java/apiaddicts/sonar/openapi/utils/JsonNodeUtils.java b/src/main/java/apiaddicts/sonar/openapi/utils/JsonNodeUtils.java index 8dd2c5bc..a2aa4130 100644 --- a/src/main/java/apiaddicts/sonar/openapi/utils/JsonNodeUtils.java +++ b/src/main/java/apiaddicts/sonar/openapi/utils/JsonNodeUtils.java @@ -3,6 +3,7 @@ import org.apiaddicts.apitools.dosonarapi.api.v2.OpenApi2Grammar; import org.apiaddicts.apitools.dosonarapi.api.v3.OpenApi3Grammar; import org.apiaddicts.apitools.dosonarapi.api.v31.OpenApi31Grammar; +import org.apiaddicts.apitools.dosonarapi.api.v32.OpenApi32Grammar; import org.apiaddicts.apitools.dosonarapi.openapi.OpenApiConfiguration; import org.apiaddicts.apitools.dosonarapi.openapi.parser.OpenApiParser; import org.apiaddicts.apitools.dosonarapi.sslr.yaml.grammar.JsonNode; @@ -182,6 +183,6 @@ public static boolean isType(JsonNode type, String name) { public static boolean isOperation(JsonNode node) { AstNodeType type = node.getType(); - return type.equals(OpenApi2Grammar.OPERATION) || type.equals(OpenApi3Grammar.OPERATION) || type.equals(OpenApi31Grammar.OPERATION); + return type.equals(OpenApi2Grammar.OPERATION) || type.equals(OpenApi3Grammar.OPERATION) || type.equals(OpenApi31Grammar.OPERATION) || type.equals(OpenApi32Grammar.OPERATION); } } diff --git a/src/test/java/apiaddicts/sonar/openapi/ExtendedOpenApiCheckVerifier.java b/src/test/java/apiaddicts/sonar/openapi/ExtendedOpenApiCheckVerifier.java index 65205590..a60e1696 100644 --- a/src/test/java/apiaddicts/sonar/openapi/ExtendedOpenApiCheckVerifier.java +++ b/src/test/java/apiaddicts/sonar/openapi/ExtendedOpenApiCheckVerifier.java @@ -31,14 +31,14 @@ public ExtendedOpenApiCheckVerifier() { } public static List scanFileForIssues(File file, OpenApiCheck check, boolean isV2, boolean isV3, boolean isV31, boolean isV32) { - return check.scanFileForIssues(TestOpenApiVisitorRunner.createContext(file, isV2, isV3, isV31)); + return check.scanFileForIssues(TestOpenApiVisitorRunner.createContext(file, isV2, isV3, isV31, isV32)); } public static void verify(String path, OpenApiCheck check, boolean isV2, boolean isV3, boolean isV31, boolean isV32) { ExtendedOpenApiCheckVerifier verifier = new ExtendedOpenApiCheckVerifier(); OpenApiVisitor collector = new ExtendedOpenApiCheckVerifier.ExpectedIssueCollector(verifier); File file = new File(path); - TestOpenApiVisitorRunner.scanFileForComments(file, isV2, isV3, isV31, new OpenApiVisitor[]{collector}); + TestOpenApiVisitorRunner.scanFileForComments(file, isV2, isV3, isV31, isV32, new OpenApiVisitor[]{collector}); Iterator actualIssues = getActualIssues(file, check, isV2, isV3, isV31, isV32); verifier.checkIssues(actualIssues); if (actualIssues.hasNext()) { diff --git a/src/test/resources/checks/v31/operations/OAR008/plain.json b/src/test/resources/checks/v31/operations/OAR008/plain.json new file mode 100644 index 00000000..872d387f --- /dev/null +++ b/src/test/resources/checks/v31/operations/OAR008/plain.json @@ -0,0 +1,60 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/pets" : { + "patch" : { + "responses" : { + "200" : { + "description" : "Ok" + } + } + }, + "get" : { + "responses" : { + "200" : { + "description" : "Ok" + } + } + }, + "post" : { + "responses" : { + "200" : { + "description" : "Ok" + } + } + }, + "put" : { + "responses" : { + "200" : { + "description" : "Ok" + } + } + }, + "delete" : { + "responses" : { + "200" : { + "description" : "Ok" + } + } + }, + "head" : { # Noncompliant {{OAR008: Http verb (head) not encouraged}} + "responses" : { + "200" : { + "description" : "Ok" + } + } + }, + "options" : { # Noncompliant {{OAR008: Http verb (options) not encouraged}} + "responses" : { + "200" : { + "description" : "Ok" + } + } + } + } + } +} diff --git a/src/test/resources/checks/v31/operations/OAR008/plain.yaml b/src/test/resources/checks/v31/operations/OAR008/plain.yaml new file mode 100644 index 00000000..97f9dab8 --- /dev/null +++ b/src/test/resources/checks/v31/operations/OAR008/plain.yaml @@ -0,0 +1,34 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: + patch: + responses: + 200: + description: Ok + get: + responses: + 200: + description: Ok + post: + responses: + 200: + description: Ok + put: + responses: + 200: + description: Ok + delete: + responses: + 200: + description: Ok + head: # Noncompliant {{OAR008: Http verb (head) not encouraged}} + responses: + 200: + description: Ok + options: # Noncompliant {{OAR008: Http verb (options) not encouraged}} + responses: + 200: + description: Ok diff --git a/src/test/resources/checks/v32/operations/OAR008/plain.json b/src/test/resources/checks/v32/operations/OAR008/plain.json new file mode 100644 index 00000000..872d387f --- /dev/null +++ b/src/test/resources/checks/v32/operations/OAR008/plain.json @@ -0,0 +1,60 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/pets" : { + "patch" : { + "responses" : { + "200" : { + "description" : "Ok" + } + } + }, + "get" : { + "responses" : { + "200" : { + "description" : "Ok" + } + } + }, + "post" : { + "responses" : { + "200" : { + "description" : "Ok" + } + } + }, + "put" : { + "responses" : { + "200" : { + "description" : "Ok" + } + } + }, + "delete" : { + "responses" : { + "200" : { + "description" : "Ok" + } + } + }, + "head" : { # Noncompliant {{OAR008: Http verb (head) not encouraged}} + "responses" : { + "200" : { + "description" : "Ok" + } + } + }, + "options" : { # Noncompliant {{OAR008: Http verb (options) not encouraged}} + "responses" : { + "200" : { + "description" : "Ok" + } + } + } + } + } +} diff --git a/src/test/resources/checks/v32/operations/OAR008/plain.yaml b/src/test/resources/checks/v32/operations/OAR008/plain.yaml new file mode 100644 index 00000000..97f9dab8 --- /dev/null +++ b/src/test/resources/checks/v32/operations/OAR008/plain.yaml @@ -0,0 +1,34 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: + patch: + responses: + 200: + description: Ok + get: + responses: + 200: + description: Ok + post: + responses: + 200: + description: Ok + put: + responses: + 200: + description: Ok + delete: + responses: + 200: + description: Ok + head: # Noncompliant {{OAR008: Http verb (head) not encouraged}} + responses: + 200: + description: Ok + options: # Noncompliant {{OAR008: Http verb (options) not encouraged}} + responses: + 200: + description: Ok From 312127443b6df808416fcf218712347792e644f1 Mon Sep 17 00:00:00 2001 From: Melsy Huamani Date: Wed, 6 May 2026 15:50:08 -0500 Subject: [PATCH 03/28] feat: test cases for all rules with openapi 3.2 and update tests for 3.1 --- CHANGELOG.md | 10 + pom.xml | 8 +- .../apim/wso2/AbstractWso2OperationCheck.java | 6 +- .../apim/wso2/AbstractWso2ScopesCheck.java | 4 +- .../checks/examples/OAR031ExamplesCheck.java | 4 +- .../format/AbstractDefaultMediaTypeCheck.java | 6 +- .../AbstractUndefinedMediaTypeCheck.java | 5 +- .../OAR011UrlNamingConventionCheck.java | 2 +- .../checks/format/OAR044MediaTypeCheck.java | 2 +- .../format/OAR086DescriptionFormatCheck.java | 13 +- .../OAR028FilterParameterCheckTest.java | 4 + .../checks/regex/OAR112RegexCheckTest.java | 10 + .../OAR085OpenAPIVersionCheckTest.java | 2 +- .../v31/apim/OAR002/with-empty-scopes.json | 15 + .../v31/apim/OAR002/with-empty-scopes.yaml | 10 + .../v31/apim/OAR002/with-null-scopes.json | 15 + .../v31/apim/OAR002/with-null-scopes.yaml | 10 + .../checks/v31/apim/OAR002/with-scopes.json | 36 +++ .../checks/v31/apim/OAR002/with-scopes.yaml | 25 ++ .../v31/apim/OAR002/without-scopes.json | 13 + .../v31/apim/OAR002/without-scopes.yaml | 9 + .../v31/apim/OAR002/without-security.json | 10 + .../v31/apim/OAR002/without-security.yaml | 6 + .../v31/apim/OAR003/with-description.json | 20 ++ .../v31/apim/OAR003/with-description.yaml | 14 + .../apim/OAR003/with-null-description.json | 20 ++ .../apim/OAR003/with-null-description.yaml | 14 + .../v31/apim/OAR003/without-description.json | 19 ++ .../v31/apim/OAR003/without-description.yaml | 13 + .../v31/apim/OAR004/with-invalid-roles.json | 20 ++ .../v31/apim/OAR004/with-invalid-roles.yaml | 14 + .../v31/apim/OAR004/with-valid-roles.json | 20 ++ .../v31/apim/OAR004/with-valid-roles.yaml | 14 + .../OAR005/with-correct-operation-scope.json | 34 +++ .../OAR005/with-correct-operation-scope.yaml | 23 ++ .../OAR005/with-null-operation-scope.json | 34 +++ .../OAR005/with-null-operation-scope.yaml | 23 ++ .../OAR005/with-wrong-operation-scope.json | 34 +++ .../OAR005/with-wrong-operation-scope.yaml | 23 ++ .../checks/v31/apim/OAR040/invalid.json | 23 ++ .../checks/v31/apim/OAR040/invalid.yaml | 14 + .../checks/v31/apim/OAR040/valid.json | 19 ++ .../checks/v31/apim/OAR040/valid.yaml | 12 + .../v31/apim/OAR041/with-scope-and-auth.json | 35 +++ .../v31/apim/OAR041/with-scope-and-auth.yaml | 24 ++ .../apim/OAR041/with-scope-without-auth.json | 34 +++ .../apim/OAR041/with-scope-without-auth.yaml | 23 ++ .../apim/OAR041/without-scope-and-auth.json | 33 ++ .../apim/OAR041/without-scope-and-auth.yaml | 22 ++ .../checks/v31/core/OAR044/media-type.json | 2 +- .../checks/v31/core/OAR044/media-type.yaml | 2 +- .../v31/core/OAR045/defined-response.json | 2 +- .../v31/core/OAR045/defined-response.yaml | 2 +- .../checks/v31/core/OAR046/declared-tag.json | 2 +- .../checks/v31/core/OAR046/declared-tag.yaml | 2 +- .../v31/core/OAR047/documented-tag.json | 2 +- .../v31/core/OAR047/documented-tag.yaml | 2 +- .../v31/core/OAR049/no-content-in-204.json | 2 +- .../v31/core/OAR049/no-content-in-204.yaml | 2 +- .../v31/core/OAR050/provide-summary.json | 2 +- .../v31/core/OAR050/provide-summary.yaml | 2 +- .../core/OAR051/different-description.json | 2 +- .../core/OAR051/different-description.yaml | 2 +- .../v31/examples/OAR031/externalref.yaml | 68 +++++ .../OAR031/nested-properties-examples.yaml | 39 +++ .../checks/v31/examples/OAR031/valid.json | 170 +++++++++++ .../checks/v31/examples/OAR031/valid.yaml | 113 +++++++ .../v31/examples/OAR031/without-examples.json | 120 ++++++++ .../v31/examples/OAR031/without-examples.yaml | 73 +++++ .../v31/examples/OAR094/externalref.yaml | 2 +- .../v31/examples/OAR094/invalid-example.json | 2 +- .../v31/examples/OAR094/invalid-example.yaml | 2 +- .../v31/examples/OAR094/valid-example.json | 2 +- .../v31/examples/OAR094/valid-example.yaml | 2 +- .../v31/format/OAR006/without-anything.json | 2 +- .../v31/format/OAR006/without-anything.yaml | 2 +- .../v31/format/OAR007/without-anything.json | 2 +- .../v31/format/OAR007/without-anything.yaml | 2 +- .../operation-not-allows-request-body.json | 2 +- .../operation-not-allows-request-body.yaml | 2 +- .../format/OAR009/with-default-and-$ref.json | 2 +- .../format/OAR009/with-default-and-$ref.yaml | 2 +- .../OAR009/with-default-and-specific.json | 2 +- .../OAR009/with-default-and-specific.yaml | 2 +- .../v31/format/OAR009/with-specific.json | 2 +- .../v31/format/OAR009/with-specific.yaml | 2 +- .../with-wrong-default-and-specific.json | 2 +- .../with-wrong-default-and-specific.yaml | 2 +- .../v31/format/OAR009/with-wrong-default.json | 2 +- .../v31/format/OAR009/with-wrong-default.yaml | 2 +- .../v31/format/OAR009/without-anything.json | 2 +- .../v31/format/OAR009/without-anything.yaml | 2 +- .../format/OAR010/with-default-and-$ref.json | 2 +- .../format/OAR010/with-default-and-$ref.yaml | 2 +- .../OAR010/with-default-and-specific.json | 2 +- .../OAR010/with-default-and-specific.yaml | 2 +- .../v31/format/OAR010/with-specific.json | 2 +- .../v31/format/OAR010/with-specific.yaml | 2 +- .../with-wrong-default-and-specific.json | 2 +- .../with-wrong-default-and-specific.yaml | 2 +- .../v31/format/OAR010/with-wrong-default.json | 2 +- .../v31/format/OAR010/with-wrong-default.yaml | 2 +- .../v31/format/OAR010/without-anything.json | 2 +- .../v31/format/OAR010/without-anything.yaml | 2 +- .../v31/format/OAR011/base-path-ok.json | 2 +- .../v31/format/OAR011/base-path-ok.yaml | 2 +- .../v31/format/OAR011/base-path-wrong.json | 2 +- .../v31/format/OAR011/base-path-wrong.yaml | 2 +- .../checks/v31/format/OAR011/plain.json | 2 +- .../checks/v31/format/OAR011/plain.yaml | 2 +- .../v31/format/OAR012/camel-case-plain.json | 2 +- .../v31/format/OAR012/camel-case-plain.yaml | 2 +- .../format/OAR012/camel-case-with-$ref.json | 2 +- .../format/OAR012/camel-case-with-$ref.yaml | 2 +- .../v31/format/OAR012/kebab-case-plain.json | 2 +- .../v31/format/OAR012/kebab-case-plain.yaml | 2 +- .../format/OAR012/kebab-case-with-$ref.json | 2 +- .../format/OAR012/kebab-case-with-$ref.yaml | 2 +- .../v31/format/OAR012/snake-case-plain.json | 2 +- .../v31/format/OAR012/snake-case-plain.yaml | 2 +- .../format/OAR012/snake-case-with-$ref.json | 2 +- .../format/OAR012/snake-case-with-$ref.yaml | 2 +- .../checks/v31/format/OAR016/nested.json | 2 +- .../checks/v31/format/OAR016/nested.yaml | 2 +- .../checks/v31/format/OAR016/plain.json | 2 +- .../checks/v31/format/OAR016/plain.yaml | 2 +- .../checks/v31/format/OAR016/with-$ref.json | 2 +- .../checks/v31/format/OAR016/with-$ref.yaml | 2 +- .../checks/v31/format/OAR037/complete.json | 2 +- .../checks/v31/format/OAR037/complete.yaml | 2 +- .../checks/v31/format/OAR037/nested.json | 2 +- .../checks/v31/format/OAR037/nested.yaml | 2 +- .../checks/v31/format/OAR037/with-$ref.json | 2 +- .../checks/v31/format/OAR037/with-$ref.yaml | 2 +- .../v31/format/OAR042/incorrect-version.json | 2 +- .../v31/format/OAR042/incorrect-version.yaml | 2 +- .../checks/v31/format/OAR042/too-long.json | 2 +- .../checks/v31/format/OAR042/too-long.yaml | 2 +- .../checks/v31/format/OAR042/too-short.json | 2 +- .../checks/v31/format/OAR042/too-short.yaml | 2 +- .../checks/v31/format/OAR042/valid.json | 2 +- .../checks/v31/format/OAR042/valid.yaml | 2 +- .../v31/format/OAR042/without-api-prefix.json | 2 +- .../v31/format/OAR042/without-api-prefix.yaml | 2 +- .../checks/v31/format/OAR044/media-type.json | 46 +++ .../checks/v31/format/OAR044/media-type.yaml | 28 ++ .../v31/format/OAR050/provide-summary.json | 26 ++ .../v31/format/OAR050/provide-summary.yaml | 15 + .../format/OAR051/different-description.json | 30 ++ .../format/OAR051/different-description.yaml | 21 ++ .../checks/v31/format/OAR052/nested.json | 2 +- .../checks/v31/format/OAR052/nested.yaml | 2 +- .../checks/v31/format/OAR052/plain.json | 2 +- .../checks/v31/format/OAR052/plain.yaml | 2 +- .../checks/v31/format/OAR052/with-$ref.json | 2 +- .../checks/v31/format/OAR052/with-$ref.yaml | 2 +- .../v31/format/OAR066/snake-case-error.json | 2 +- .../v31/format/OAR066/snake-case-error.yaml | 2 +- .../checks/v31/format/OAR066/valid.json | 2 +- .../checks/v31/format/OAR066/valid.yaml | 2 +- .../v31/format/OAR067/camel-case-error.json | 2 +- .../v31/format/OAR067/camel-case-error.yaml | 2 +- .../checks/v31/format/OAR067/valid.json | 2 +- .../checks/v31/format/OAR067/valid.yaml | 2 +- .../checks/v31/format/OAR068/externalref.yaml | 2 +- .../v31/format/OAR068/pascal-case-error.json | 2 +- .../v31/format/OAR068/pascal-case-error.yaml | 2 +- .../checks/v31/format/OAR068/valid.json | 2 +- .../checks/v31/format/OAR068/valid.yaml | 2 +- .../v31/format/OAR077/not-valid-in-query.json | 2 +- .../v31/format/OAR077/not-valid-in-query.yaml | 2 +- .../v31/format/OAR077/valid-in-query.json | 2 +- .../v31/format/OAR077/valid-in-query.yaml | 2 +- .../format/OAR086/external-refexample.yaml | 2 +- .../format/OAR086/internal-refexample.yaml | 2 +- .../v31/format/OAR086/invalid-example.json | 2 +- .../v31/format/OAR086/invalid-example.yaml | 2 +- .../v31/format/OAR086/valid-example.json | 2 +- .../v31/format/OAR086/valid-example.yaml | 2 +- .../v31/format/OAR087/invalid-example.json | 2 +- .../v31/format/OAR087/invalid-example.yaml | 2 +- .../v31/format/OAR087/valid-example.json | 2 +- .../v31/format/OAR087/valid-example.yaml | 2 +- .../checks/v31/format/OAR088/invalid-ref.json | 2 +- .../checks/v31/format/OAR088/invalid-ref.yaml | 2 +- .../checks/v31/format/OAR088/valid-ref.json | 2 +- .../checks/v31/format/OAR088/valid-ref.yaml | 2 +- .../checks/v31/format/OAR089/invalid-ref.json | 2 +- .../checks/v31/format/OAR089/invalid-ref.yaml | 2 +- .../checks/v31/format/OAR089/valid-ref.json | 2 +- .../checks/v31/format/OAR089/valid-ref.yaml | 2 +- .../checks/v31/format/OAR090/invalid-ref.json | 2 +- .../checks/v31/format/OAR090/invalid-ref.yaml | 2 +- .../checks/v31/format/OAR090/valid-ref.json | 2 +- .../checks/v31/format/OAR090/valid-ref.yaml | 2 +- .../checks/v31/format/OAR097/too-short.json | 2 +- .../checks/v31/format/OAR097/too-short.yaml | 2 +- .../checks/v31/format/OAR097/valid.json | 2 +- .../checks/v31/format/OAR097/valid.yaml | 2 +- .../checks/v31/format/OAR098/too-long.json | 2 +- .../checks/v31/format/OAR098/too-long.yaml | 2 +- .../checks/v31/format/OAR098/valid.json | 2 +- .../checks/v31/format/OAR098/valid.yaml | 2 +- .../checks/v31/format/OAR099/valid.json | 2 +- .../checks/v31/format/OAR099/valid.yaml | 2 +- .../v31/format/OAR099/without-api-prefix.json | 2 +- .../v31/format/OAR099/without-api-prefix.yaml | 2 +- .../v31/format/OAR100/incorrect-version.json | 2 +- .../v31/format/OAR100/incorrect-version.yaml | 2 +- .../checks/v31/format/OAR100/valid.json | 2 +- .../checks/v31/format/OAR100/valid.yaml | 2 +- .../checks/v31/format/OAR101/empty-path.json | 2 +- .../checks/v31/format/OAR101/empty-path.yaml | 2 +- .../checks/v31/format/OAR101/invalid.json | 2 +- .../checks/v31/format/OAR101/invalid.yaml | 2 +- .../v31/format/OAR101/valid-with-values.json | 2 +- .../v31/format/OAR101/valid-with-values.yaml | 2 +- .../checks/v31/format/OAR101/valid.json | 2 +- .../checks/v31/format/OAR101/valid.yaml | 2 +- .../checks/v31/format/OAR102/invalid.json | 2 +- .../checks/v31/format/OAR102/invalid.yaml | 2 +- .../v31/format/OAR102/one-part-path.json | 2 +- .../v31/format/OAR102/one-part-path.yaml | 2 +- .../v31/format/OAR102/valid-with-values.json | 2 +- .../v31/format/OAR102/valid-with-values.yaml | 2 +- .../checks/v31/format/OAR102/valid.json | 2 +- .../checks/v31/format/OAR102/valid.yaml | 2 +- .../checks/v31/format/OAR110/valid.json | 2 +- .../checks/v31/format/OAR110/valid.yaml | 2 +- .../checks/v31/format/OAR111/valid.json | 2 +- .../checks/v31/format/OAR111/valid.yaml | 2 +- .../checks/v31/format/OAR113/invalid.json | 2 +- .../checks/v31/format/OAR113/invalid.yaml | 2 +- .../checks/v31/format/OAR113/valid.json | 2 +- .../checks/v31/format/OAR113/valid.yaml | 2 +- .../checks/v31/format/OAR115/invalid.json | 2 +- .../checks/v31/format/OAR115/invalid.yaml | 2 +- .../checks/v31/format/OAR115/valid.json | 2 +- .../checks/v31/format/OAR115/valid.yaml | 2 +- .../checks/v31/operations/OAR008/plain.json | 2 +- .../checks/v31/operations/OAR008/plain.yaml | 2 +- .../checks/v31/operations/OAR013/plain.json | 25 ++ .../checks/v31/operations/OAR013/plain.yaml | 14 + .../checks/v31/operations/OAR014/plain.json | 54 ++++ .../checks/v31/operations/OAR014/plain.yaml | 30 ++ .../checks/v31/operations/OAR015/plain.json | 72 +++++ .../checks/v31/operations/OAR015/plain.yaml | 40 +++ .../checks/v31/operations/OAR017/plain.json | 54 ++++ .../checks/v31/operations/OAR017/plain.yaml | 30 ++ .../checks/v31/operations/OAR018/plain.json | 194 ++++++++++++ .../checks/v31/operations/OAR018/plain.yaml | 114 +++++++ .../checks/v31/operations/OAR027/no-post.json | 18 ++ .../checks/v31/operations/OAR027/no-post.yaml | 10 + .../OAR027/post-201-with-location.json | 25 ++ .../OAR027/post-201-with-location.yaml | 14 + .../OAR027/post-201-with-other-headers.json | 25 ++ .../OAR027/post-201-with-other-headers.yaml | 14 + .../OAR027/post-201-without-location.json | 18 ++ .../OAR027/post-201-without-location.yaml | 10 + .../v31/operations/OAR027/post-no-201.json | 18 ++ .../v31/operations/OAR027/post-no-201.yaml | 10 + .../checks/v31/operations/OAR030/valid.json | 27 ++ .../checks/v31/operations/OAR030/valid.yaml | 15 + .../OAR030/with-status-without-get.json | 27 ++ .../OAR030/with-status-without-get.yaml | 15 + .../v31/operations/OAR030/without-status.json | 18 ++ .../v31/operations/OAR030/without-status.yaml | 10 + .../operations/OAR032/forbidden-names.json | 36 +++ .../operations/OAR032/forbidden-names.yaml | 20 ++ .../checks/v31/operations/OAR032/valid.json | 27 ++ .../checks/v31/operations/OAR032/valid.yaml | 15 + .../OAR038/valid-multiple-properties.json | 48 +++ .../OAR038/valid-multiple-properties.yaml | 29 ++ .../operations/OAR038/valid-one-property.json | 45 +++ .../operations/OAR038/valid-one-property.yaml | 27 ++ .../OAR038/with-properties-empty.json | 41 +++ .../OAR038/with-properties-empty.yaml | 25 ++ .../v31/operations/OAR038/without-data.json | 35 +++ .../v31/operations/OAR038/without-data.yaml | 21 ++ .../operations/OAR038/without-properties.json | 53 ++++ .../operations/OAR038/without-properties.yaml | 33 ++ .../v31/operations/OAR038/without-schema.json | 21 ++ .../v31/operations/OAR038/without-schema.yaml | 12 + .../v31/operations/OAR039/missing-codes.json | 109 +++++++ .../v31/operations/OAR039/missing-codes.yaml | 68 +++++ .../checks/v31/operations/OAR039/valid.json | 283 ++++++++++++++++++ .../checks/v31/operations/OAR039/valid.yaml | 184 ++++++++++++ .../operations/OAR045/defined-response.json | 2 +- .../operations/OAR045/defined-response.yaml | 2 +- .../v31/operations/OAR046/declared-tag.json | 26 ++ .../v31/operations/OAR046/declared-tag.yaml | 17 ++ .../operations/OAR048/many-body-params.json | 2 +- .../operations/OAR048/many-body-params.yaml | 2 +- .../OAR061/insuficent-response-codes.json | 2 +- .../OAR061/insuficent-response-codes.yaml | 2 +- .../checks/v31/operations/OAR061/valid.json | 2 +- .../checks/v31/operations/OAR061/valid.yaml | 2 +- .../OAR062/insuficent-response-codes.json | 2 +- .../OAR062/insuficent-response-codes.yaml | 2 +- .../checks/v31/operations/OAR062/valid.json | 2 +- .../checks/v31/operations/OAR062/valid.yaml | 2 +- .../OAR063/insuficent-response-codes.json | 2 +- .../OAR063/insuficent-response-codes.yaml | 2 +- .../checks/v31/operations/OAR063/valid.json | 2 +- .../checks/v31/operations/OAR063/valid.yaml | 2 +- .../OAR064/insuficent-response-codes.json | 2 +- .../OAR064/insuficent-response-codes.yaml | 2 +- .../checks/v31/operations/OAR064/valid.json | 2 +- .../checks/v31/operations/OAR064/valid.yaml | 2 +- .../OAR065/insuficent-response-codes.json | 2 +- .../OAR065/insuficent-response-codes.yaml | 2 +- .../checks/v31/operations/OAR065/valid.json | 2 +- .../checks/v31/operations/OAR065/valid.yaml | 2 +- .../OAR071/missing-query-params.json | 2 +- .../OAR071/missing-query-params.yaml | 2 +- .../operations/OAR071/valid-query-params.json | 2 +- .../operations/OAR071/valid-query-params.yaml | 2 +- .../checks/v31/operations/OAR091/no-ref.json | 2 +- .../checks/v31/operations/OAR091/no-ref.yaml | 2 +- .../v31/operations/OAR091/with-ref.json | 2 +- .../v31/operations/OAR091/with-ref.yaml | 2 +- .../checks/v31/operations/OAR092/no-ref.json | 2 +- .../checks/v31/operations/OAR092/no-ref.yaml | 2 +- .../v31/operations/OAR092/with-ref.json | 2 +- .../v31/operations/OAR092/with-ref.yaml | 2 +- .../checks/v31/operations/OAR093/no-ref.json | 2 +- .../checks/v31/operations/OAR093/no-ref.yaml | 2 +- .../v31/operations/OAR093/with-ref.json | 2 +- .../v31/operations/OAR093/with-ref.yaml | 2 +- .../checks/v31/operations/OAR103/plain.json | 2 +- .../checks/v31/operations/OAR103/plain.yaml | 2 +- .../checks/v31/operations/OAR104/plain.yaml | 2 +- .../checks/v31/operations/OAR105/plain.json | 2 +- .../checks/v31/operations/OAR105/plain.yaml | 2 +- .../checks/v31/operations/OAR106/plain.json | 2 +- .../checks/v31/operations/OAR106/plain.yaml | 2 +- .../checks/v31/operations/OAR107/plain.json | 2 +- .../checks/v31/operations/OAR107/plain.yaml | 2 +- .../checks/v31/operations/OAR109/plain.json | 2 +- .../checks/v31/operations/OAR109/plain.yaml | 2 +- .../checks/v31/owasp/OAR070/no-numeric.json | 2 +- .../checks/v31/owasp/OAR070/no-numeric.yaml | 2 +- .../checks/v31/owasp/OAR070/numeric.json | 2 +- .../checks/v31/owasp/OAR070/numeric.yaml | 2 +- .../v31/owasp/OAR073/no-rate-limit.json | 2 +- .../v31/owasp/OAR073/no-rate-limit.yaml | 2 +- .../checks/v31/owasp/OAR073/no-responses.json | 2 +- .../checks/v31/owasp/OAR073/no-responses.yaml | 2 +- .../checks/v31/owasp/OAR073/rate-limit.json | 2 +- .../checks/v31/owasp/OAR073/rate-limit.yaml | 2 +- .../v31/parameters/OAR019/excluded.json | 2 +- .../v31/parameters/OAR019/excluded.yaml | 2 +- .../v31/parameters/OAR019/plain-without.json | 2 +- .../v31/parameters/OAR019/plain-without.yaml | 2 +- .../checks/v31/parameters/OAR019/plain.json | 2 +- .../checks/v31/parameters/OAR019/plain.yaml | 2 +- .../parameters/OAR019/with-$ref-without.json | 2 +- .../parameters/OAR019/with-$ref-without.yaml | 2 +- .../v31/parameters/OAR019/with-$ref.json | 2 +- .../v31/parameters/OAR019/with-$ref.yaml | 2 +- .../v31/parameters/OAR019/with-param.json | 2 +- .../v31/parameters/OAR019/with-param.yaml | 2 +- .../v31/parameters/OAR019/with-ref.json | 2 +- .../v31/parameters/OAR019/with-ref.yaml | 2 +- .../parameters/OAR019/without-parameters.json | 2 +- .../parameters/OAR019/without-parameters.yaml | 2 +- .../v31/parameters/OAR020/excluded.json | 2 +- .../v31/parameters/OAR020/excluded.yaml | 2 +- .../v31/parameters/OAR020/excluded2.json | 2 +- .../v31/parameters/OAR020/excluded2.yaml | 2 +- .../v31/parameters/OAR020/plain-without.json | 2 +- .../v31/parameters/OAR020/plain-without.yaml | 2 +- .../v31/parameters/OAR020/plain-without2.json | 2 +- .../v31/parameters/OAR020/plain-without2.yaml | 2 +- .../checks/v31/parameters/OAR020/plain.json | 2 +- .../checks/v31/parameters/OAR020/plain.yaml | 2 +- .../checks/v31/parameters/OAR020/plain2.json | 2 +- .../checks/v31/parameters/OAR020/plain2.yaml | 2 +- .../parameters/OAR020/with-$ref-without.json | 2 +- .../parameters/OAR020/with-$ref-without.yaml | 2 +- .../v31/parameters/OAR020/with-$ref.json | 2 +- .../v31/parameters/OAR020/with-$ref.yaml | 2 +- .../v31/parameters/OAR020/with-param.json | 2 +- .../v31/parameters/OAR020/with-param.yaml | 2 +- .../v31/parameters/OAR020/with-ref.json | 2 +- .../v31/parameters/OAR020/with-ref.yaml | 2 +- .../parameters/OAR020/without-parameters.json | 2 +- .../parameters/OAR020/without-parameters.yaml | 2 +- .../v31/parameters/OAR021/excluded.json | 2 +- .../v31/parameters/OAR021/excluded.yaml | 2 +- .../v31/parameters/OAR021/plain-without.json | 2 +- .../v31/parameters/OAR021/plain-without.yaml | 2 +- .../checks/v31/parameters/OAR021/plain.json | 2 +- .../checks/v31/parameters/OAR021/plain.yaml | 2 +- .../parameters/OAR021/with-$ref-without.json | 2 +- .../parameters/OAR021/with-$ref-without.yaml | 2 +- .../v31/parameters/OAR021/with-$ref.json | 2 +- .../v31/parameters/OAR021/with-$ref.yaml | 2 +- .../v31/parameters/OAR021/with-param.json | 2 +- .../v31/parameters/OAR021/with-param.yaml | 2 +- .../v31/parameters/OAR021/with-ref.json | 2 +- .../v31/parameters/OAR021/with-ref.yaml | 2 +- .../parameters/OAR021/without-parameters.json | 2 +- .../parameters/OAR021/without-parameters.yaml | 2 +- .../v31/parameters/OAR022/excluded.json | 2 +- .../v31/parameters/OAR022/excluded.yaml | 2 +- .../v31/parameters/OAR022/plain-without.json | 2 +- .../v31/parameters/OAR022/plain-without.yaml | 2 +- .../checks/v31/parameters/OAR022/plain.json | 2 +- .../checks/v31/parameters/OAR022/plain.yaml | 2 +- .../parameters/OAR022/with-$ref-without.json | 2 +- .../parameters/OAR022/with-$ref-without.yaml | 2 +- .../v31/parameters/OAR022/with-$ref.json | 2 +- .../v31/parameters/OAR022/with-$ref.yaml | 2 +- .../parameters/OAR022/without-parameters.json | 2 +- .../parameters/OAR022/without-parameters.yaml | 2 +- .../v31/parameters/OAR023/excluded.json | 2 +- .../v31/parameters/OAR023/excluded.yaml | 2 +- .../v31/parameters/OAR023/plain-without.json | 2 +- .../v31/parameters/OAR023/plain-without.yaml | 2 +- .../checks/v31/parameters/OAR023/plain.json | 2 +- .../checks/v31/parameters/OAR023/plain.yaml | 2 +- .../parameters/OAR023/with-$ref-without.json | 2 +- .../parameters/OAR023/with-$ref-without.yaml | 2 +- .../v31/parameters/OAR023/with-$ref.json | 2 +- .../v31/parameters/OAR023/with-$ref.yaml | 2 +- .../parameters/OAR023/without-parameters.json | 2 +- .../parameters/OAR023/without-parameters.yaml | 2 +- .../v31/parameters/OAR024/excluded.json | 2 +- .../v31/parameters/OAR024/excluded.yaml | 2 +- .../v31/parameters/OAR024/plain-without.json | 2 +- .../v31/parameters/OAR024/plain-without.yaml | 2 +- .../checks/v31/parameters/OAR024/plain.json | 2 +- .../checks/v31/parameters/OAR024/plain.yaml | 2 +- .../parameters/OAR024/with-$ref-without.json | 2 +- .../parameters/OAR024/with-$ref-without.yaml | 2 +- .../v31/parameters/OAR024/with-$ref.json | 2 +- .../v31/parameters/OAR024/with-$ref.yaml | 2 +- .../parameters/OAR024/without-parameters.json | 2 +- .../parameters/OAR024/without-parameters.yaml | 2 +- .../v31/parameters/OAR025/excluded.json | 2 +- .../v31/parameters/OAR025/excluded.yaml | 2 +- .../v31/parameters/OAR025/plain-without.json | 2 +- .../v31/parameters/OAR025/plain-without.yaml | 2 +- .../checks/v31/parameters/OAR025/plain.json | 2 +- .../checks/v31/parameters/OAR025/plain.yaml | 2 +- .../parameters/OAR025/with-$ref-without.json | 2 +- .../parameters/OAR025/with-$ref-without.yaml | 2 +- .../v31/parameters/OAR025/with-$ref.json | 2 +- .../v31/parameters/OAR025/with-$ref.yaml | 2 +- .../parameters/OAR025/without-parameters.json | 2 +- .../parameters/OAR025/without-parameters.yaml | 2 +- .../plain-with-$total-with-defval-false.json | 2 +- .../plain-with-$total-with-defval-false.yaml | 2 +- .../plain-with-$total-with-defval-true.json | 2 +- .../plain-with-$total-with-defval-true.yaml | 2 +- .../plain-with-$total-without-defval.json | 2 +- .../plain-with-$total-without-defval.yaml | 2 +- .../OAR026/plain-without-$total.json | 2 +- .../OAR026/plain-without-$total.yaml | 2 +- ...th-$ref-with-$total-with-defval-false.json | 2 +- ...th-$ref-with-$total-with-defval-false.yaml | 2 +- ...ith-$ref-with-$total-with-defval-true.json | 2 +- ...ith-$ref-with-$total-with-defval-true.yaml | 2 +- .../with-$ref-with-$total-without-defval.json | 2 +- .../with-$ref-with-$total-without-defval.yaml | 2 +- .../OAR026/with-$ref-without-$total.json | 2 +- .../OAR026/with-$ref-without-$total.yaml | 2 +- .../parameters/OAR026/without-parameters.json | 2 +- .../parameters/OAR026/without-parameters.yaml | 2 +- .../parameters/OAR028/components-param.json | 2 +- .../parameters/OAR028/components-param.yaml | 2 +- .../OAR028/exclude-noncompliant.json | 2 +- .../OAR028/exclude-noncompliant.yaml | 2 +- .../v31/parameters/OAR028/excluded.json | 2 +- .../v31/parameters/OAR028/excluded.yaml | 2 +- .../v31/parameters/OAR028/plain-without.json | 2 +- .../v31/parameters/OAR028/plain-without.yaml | 2 +- .../checks/v31/parameters/OAR028/plain.json | 2 +- .../checks/v31/parameters/OAR028/plain.yaml | 2 +- .../parameters/OAR028/with-$ref-without.json | 2 +- .../parameters/OAR028/with-$ref-without.yaml | 2 +- .../v31/parameters/OAR028/with-$ref.json | 2 +- .../v31/parameters/OAR028/with-$ref.yaml | 2 +- .../parameters/OAR028/without-parameters.json | 2 +- .../parameters/OAR028/without-parameters.yaml | 2 +- .../v31/parameters/OAR060/required-false.json | 2 +- .../v31/parameters/OAR060/required-false.yaml | 2 +- .../v31/parameters/OAR060/required-true.json | 2 +- .../v31/parameters/OAR060/required-true.yaml | 2 +- .../v31/parameters/OAR069/bad-request400.json | 2 +- .../v31/parameters/OAR069/bad-request400.yaml | 2 +- .../parameters/OAR069/no-bad-request400.json | 2 +- .../parameters/OAR069/no-bad-request400.yaml | 2 +- .../regex/OAR112/external-docs-invalid.json | 2 +- .../regex/OAR112/external-docs-invalid.yaml | 2 +- .../v31/regex/OAR112/external-docs-valid.json | 2 +- .../v31/regex/OAR112/external-docs-valid.yaml | 2 +- .../checks/v31/regex/OAR112/info-invalid.json | 2 +- .../checks/v31/regex/OAR112/info-invalid.yaml | 2 +- .../checks/v31/regex/OAR112/minimal.json | 2 +- .../checks/v31/regex/OAR112/minimal.yaml | 2 +- .../v31/regex/OAR112/missing-description.json | 2 +- .../v31/regex/OAR112/missing-description.yaml | 2 +- .../v31/regex/OAR112/operation-invalid.json | 2 +- .../v31/regex/OAR112/operation-invalid.yaml | 2 +- .../v31/regex/OAR112/operation-valid.json | 2 +- .../v31/regex/OAR112/operation-valid.yaml | 2 +- .../v31/regex/OAR112/parameters-invalid.json | 2 +- .../v31/regex/OAR112/parameters-invalid.yaml | 2 +- .../v31/regex/OAR112/parameters-valid.json | 2 +- .../v31/regex/OAR112/parameters-valid.yaml | 2 +- .../checks/v31/regex/OAR112/plain.json | 2 +- .../checks/v31/regex/OAR112/plain.yaml | 2 +- .../v31/regex/OAR112/servers-invalid.json | 2 +- .../v31/regex/OAR112/servers-invalid.yaml | 2 +- .../v31/regex/OAR112/servers-valid.json | 2 +- .../v31/regex/OAR112/servers-valid.yaml | 2 +- .../checks/v31/regex/OAR112/tags-invalid.json | 2 +- .../checks/v31/regex/OAR112/tags-invalid.yaml | 2 +- .../checks/v31/regex/OAR112/tags-valid.json | 2 +- .../checks/v31/regex/OAR112/tags-valid.yaml | 2 +- .../checks/v31/resources/OAR008/plain.json | 2 +- .../checks/v31/resources/OAR008/plain.yaml | 2 +- .../checks/v31/resources/OAR013/plain.json | 2 +- .../checks/v31/resources/OAR013/plain.yaml | 2 +- .../checks/v31/resources/OAR014/plain.json | 2 +- .../checks/v31/resources/OAR014/plain.yaml | 2 +- .../checks/v31/resources/OAR015/plain.json | 2 +- .../checks/v31/resources/OAR015/plain.yaml | 2 +- .../checks/v31/resources/OAR017/plain.json | 2 +- .../checks/v31/resources/OAR017/plain.yaml | 2 +- .../checks/v31/resources/OAR018/plain.json | 2 +- .../checks/v31/resources/OAR018/plain.yaml | 2 +- .../checks/v31/resources/OAR027/no-post.json | 2 +- .../checks/v31/resources/OAR027/no-post.yaml | 2 +- .../OAR027/post-201-with-location.json | 2 +- .../OAR027/post-201-with-location.yaml | 2 +- .../OAR027/post-201-with-other-headers.json | 2 +- .../OAR027/post-201-with-other-headers.yaml | 2 +- .../OAR027/post-201-without-location.json | 2 +- .../OAR027/post-201-without-location.yaml | 2 +- .../v31/resources/OAR027/post-no-201.json | 2 +- .../v31/resources/OAR027/post-no-201.yaml | 2 +- .../v31/resources/OAR029/valid-all-of-md.json | 2 +- .../v31/resources/OAR029/valid-all-of-md.yaml | 2 +- .../v31/resources/OAR029/valid-all-of.json | 2 +- .../v31/resources/OAR029/valid-all-of.yaml | 2 +- .../checks/v31/resources/OAR029/valid-md.json | 2 +- .../checks/v31/resources/OAR029/valid-md.yaml | 2 +- .../checks/v31/resources/OAR029/valid-r.json | 2 +- .../checks/v31/resources/OAR029/valid-r.yaml | 2 +- .../checks/v31/resources/OAR029/valid.json | 2 +- .../checks/v31/resources/OAR029/valid.yaml | 2 +- ...th-error-with-properties-wrong-type-r.json | 2 +- ...th-error-with-properties-wrong-type-r.yaml | 2 +- .../with-error-without-properties-r.json | 2 +- .../with-error-without-properties-r.yaml | 2 +- .../OAR029/with-error-wrong-type-r.json | 2 +- .../OAR029/with-error-wrong-type-r.yaml | 2 +- ...-result-with-properties-wrong-type-md.json | 2 +- ...-result-with-properties-wrong-type-md.yaml | 2 +- .../with-result-without-properties-md.json | 2 +- .../with-result-without-properties-md.yaml | 2 +- .../OAR029/with-result-wrong-type-md.json | 2 +- .../OAR029/with-result-wrong-type-md.yaml | 2 +- ...ith-status-with-properties-wrong-type.json | 2 +- ...ith-status-with-properties-wrong-type.yaml | 2 +- .../with-status-without-properties.json | 2 +- .../with-status-without-properties.yaml | 2 +- .../OAR029/with-status-wrong-type.json | 2 +- .../OAR029/with-status-wrong-type.yaml | 2 +- .../v31/resources/OAR029/without-data-md.json | 2 +- .../v31/resources/OAR029/without-data-md.yaml | 2 +- .../v31/resources/OAR029/without-data.json | 2 +- .../v31/resources/OAR029/without-data.yaml | 2 +- .../v31/resources/OAR029/without-error-r.json | 2 +- .../v31/resources/OAR029/without-error-r.yaml | 2 +- .../resources/OAR029/without-payload-r.json | 2 +- .../resources/OAR029/without-payload-r.yaml | 2 +- .../OAR029/without-required-fields-md.json | 2 +- .../OAR029/without-required-fields-md.yaml | 2 +- .../OAR029/without-required-fields-r.json | 2 +- .../OAR029/without-required-fields-r.yaml | 2 +- .../OAR029/without-required-fields.json | 2 +- .../OAR029/without-required-fields.yaml | 2 +- .../resources/OAR029/without-result-md.json | 2 +- .../resources/OAR029/without-result-md.yaml | 2 +- .../v31/resources/OAR029/without-status.json | 2 +- .../v31/resources/OAR029/without-status.yaml | 2 +- .../checks/v31/resources/OAR030/valid.json | 2 +- .../checks/v31/resources/OAR030/valid.yaml | 2 +- .../OAR030/with-status-without-get.json | 2 +- .../OAR030/with-status-without-get.yaml | 2 +- .../v31/resources/OAR030/without-status.json | 2 +- .../v31/resources/OAR030/without-status.yaml | 2 +- .../checks/v31/resources/OAR031/valid.json | 2 +- .../checks/v31/resources/OAR031/valid.yaml | 2 +- .../resources/OAR031/without-examples.json | 2 +- .../resources/OAR031/without-examples.yaml | 2 +- .../v31/resources/OAR032/forbidden-names.json | 2 +- .../v31/resources/OAR032/forbidden-names.yaml | 2 +- .../checks/v31/resources/OAR032/valid.json | 2 +- .../checks/v31/resources/OAR032/valid.yaml | 2 +- .../v31/resources/OAR034/valid-all-of.json | 2 +- .../v31/resources/OAR034/valid-all-of.yaml | 2 +- .../checks/v31/resources/OAR034/valid.json | 2 +- .../checks/v31/resources/OAR034/valid.yaml | 2 +- .../OAR034/with-links-without-properties.json | 2 +- .../OAR034/with-links-without-properties.yaml | 2 +- ...th-paging-with-properties-wrong-types.json | 2 +- ...th-paging-with-properties-wrong-types.yaml | 2 +- .../with-paging-without-properties.json | 2 +- .../with-paging-without-properties.yaml | 2 +- .../OAR034/with-paging-wrong-type.json | 2 +- .../OAR034/with-paging-wrong-type.yaml | 2 +- .../OAR034/without-links-required-fields.json | 2 +- .../OAR034/without-links-required-fields.yaml | 2 +- .../without-pagination-required-fields.json | 2 +- .../without-pagination-required-fields.yaml | 2 +- .../v31/resources/OAR034/without-paging.json | 2 +- .../v31/resources/OAR034/without-paging.yaml | 2 +- .../OAR038/valid-multiple-properties.json | 2 +- .../OAR038/valid-multiple-properties.yaml | 2 +- .../resources/OAR038/valid-one-property.json | 2 +- .../resources/OAR038/valid-one-property.yaml | 2 +- .../OAR038/with-properties-empty.json | 2 +- .../OAR038/with-properties-empty.yaml | 2 +- .../v31/resources/OAR038/without-data.json | 2 +- .../v31/resources/OAR038/without-data.yaml | 2 +- .../resources/OAR038/without-properties.json | 2 +- .../resources/OAR038/without-properties.yaml | 2 +- .../v31/resources/OAR038/without-schema.json | 2 +- .../v31/resources/OAR038/without-schema.yaml | 2 +- .../v31/resources/OAR039/missing-codes.json | 2 +- .../v31/resources/OAR039/missing-codes.yaml | 2 +- .../checks/v31/resources/OAR039/valid.json | 2 +- .../checks/v31/resources/OAR039/valid.yaml | 2 +- .../v31/schemas/OAR029/valid-all-of-md.json | 134 +++++++++ .../v31/schemas/OAR029/valid-all-of-md.yaml | 78 +++++ .../v31/schemas/OAR029/valid-all-of.json | 116 +++++++ .../v31/schemas/OAR029/valid-all-of.yaml | 76 +++++ .../checks/v31/schemas/OAR029/valid-md.json | 116 +++++++ .../checks/v31/schemas/OAR029/valid-md.yaml | 69 +++++ .../checks/v31/schemas/OAR029/valid-r.json | 96 ++++++ .../checks/v31/schemas/OAR029/valid-r.yaml | 59 ++++ .../checks/v31/schemas/OAR029/valid.json | 105 +++++++ .../checks/v31/schemas/OAR029/valid.yaml | 138 ++++++++- .../v31/schemas/OAR034/valid-all-of.json | 126 ++++++++ .../v31/schemas/OAR034/valid-all-of.yaml | 84 ++++++ .../checks/v31/schemas/OAR034/valid.json | 116 +++++++ .../checks/v31/schemas/OAR034/valid.yaml | 79 +++++ .../OAR034/with-links-without-properties.json | 96 ++++++ .../OAR034/with-links-without-properties.yaml | 66 ++++ ...th-paging-with-properties-wrong-types.json | 91 ++++++ ...th-paging-with-properties-wrong-types.yaml | 63 ++++ .../with-paging-without-properties.json | 78 +++++ .../with-paging-without-properties.yaml | 51 ++++ .../OAR034/with-paging-wrong-type.json | 73 +++++ .../OAR034/with-paging-wrong-type.yaml | 48 +++ .../OAR034/without-links-required-fields.json | 116 +++++++ .../OAR034/without-links-required-fields.yaml | 77 +++++ .../without-pagination-required-fields.json | 116 +++++++ .../without-pagination-required-fields.yaml | 77 +++++ .../v31/schemas/OAR034/without-paging.json | 61 ++++ .../v31/schemas/OAR034/without-paging.yaml | 37 +++ .../schemas/OAR080/empty-global-security.json | 2 +- .../schemas/OAR080/empty-global-security.yaml | 2 +- .../v31/schemas/OAR080/empty-security.json | 2 +- .../v31/schemas/OAR080/empty-security.yaml | 2 +- .../v31/schemas/OAR080/global-security.json | 2 +- .../v31/schemas/OAR080/global-security.yaml | 2 +- .../v31/schemas/OAR080/with-security.json | 2 +- .../v31/schemas/OAR080/with-security.yaml | 2 +- .../v31/schemas/OAR080/without-security.json | 2 +- .../v31/schemas/OAR080/without-security.yaml | 2 +- .../v31/schemas/OAR080/wrong-scheme.json | 2 +- .../v31/schemas/OAR080/wrong-scheme.yaml | 2 +- .../checks/v31/schemas/OAR108/invalid.json | 2 +- .../checks/v31/schemas/OAR108/invalid.yaml | 2 +- .../checks/v31/schemas/OAR108/valid.json | 2 +- .../checks/v31/schemas/OAR108/valid.yaml | 2 +- .../v31/security/OAR001/with-servers.json | 2 +- .../v31/security/OAR001/with-servers.yaml | 2 +- .../v31/security/OAR001/without-servers.json | 2 +- .../v31/security/OAR001/without-servers.yaml | 2 +- .../checks/v31/security/OAR033/valid.json | 2 +- .../checks/v31/security/OAR033/valid.yaml | 2 +- .../OAR033/with-forbidden-params.json | 2 +- .../OAR033/with-forbidden-params.yaml | 2 +- .../OAR033/without-required-params.json | 2 +- .../OAR033/without-required-params.yaml | 2 +- .../checks/v31/security/OAR035/valid.json | 2 +- .../checks/v31/security/OAR035/valid.yaml | 2 +- .../without-authorization-responses.json | 2 +- .../without-authorization-responses.yaml | 2 +- .../checks/v31/security/OAR036/valid.json | 2 +- .../checks/v31/security/OAR036/valid.yaml | 2 +- .../v31/security/OAR036/with-cookie.json | 2 +- .../v31/security/OAR036/with-cookie.yaml | 2 +- .../v31/security/OAR045/defined-response.json | 2 +- .../v31/security/OAR045/defined-response.yaml | 2 +- .../security/OAR049/no-content-in-204.json | 25 ++ .../security/OAR049/no-content-in-204.yaml | 14 + .../checks/v31/security/OAR053/valid.json | 2 +- .../checks/v31/security/OAR053/valid.yaml | 2 +- .../checks/v31/security/OAR054/valid.json | 2 +- .../checks/v31/security/OAR054/valid.yaml | 2 +- .../v31/security/OAR072/no-stack-trace.json | 2 +- .../v31/security/OAR072/no-stack-trace.yaml | 2 +- .../v31/security/OAR072/with-stack-trace.json | 2 +- .../v31/security/OAR072/with-stack-trace.yaml | 2 +- .../v31/security/OAR074/no-restrictions.json | 2 +- .../v31/security/OAR074/no-restrictions.yaml | 2 +- .../security/OAR074/with-restrictions.json | 2 +- .../security/OAR074/with-restrictions.yaml | 2 +- .../v31/security/OAR075/no-restrictions.json | 2 +- .../v31/security/OAR075/no-restrictions.yaml | 2 +- .../security/OAR075/with-restrictions.json | 2 +- .../security/OAR075/with-restrictions.yaml | 2 +- .../checks/v31/security/OAR076/nested.json | 2 +- .../checks/v31/security/OAR076/nested.yaml | 2 +- .../checks/v31/security/OAR076/plain.json | 2 +- .../checks/v31/security/OAR076/plain.yaml | 2 +- .../checks/v31/security/OAR076/with-$ref.json | 2 +- .../checks/v31/security/OAR076/with-$ref.yaml | 2 +- .../v31/security/OAR078/no-security.json | 2 +- .../v31/security/OAR078/no-security.yaml | 2 +- .../v31/security/OAR078/with-security.json | 2 +- .../v31/security/OAR078/with-security.yaml | 2 +- .../v31/security/OAR079/bad-request404.json | 2 +- .../v31/security/OAR079/bad-request404.yaml | 2 +- .../security/OAR079/no-bad-request404.json | 2 +- .../security/OAR079/no-bad-request404.yaml | 2 +- .../v31/security/OAR079/no-parameters.json | 2 +- .../v31/security/OAR079/no-parameters.yaml | 2 +- .../v31/security/OAR079/query-param-only.json | 2 +- .../v31/security/OAR079/query-param-only.yaml | 2 +- .../security/OAR081/not-valid-password.json | 2 +- .../security/OAR081/not-valid-password.yaml | 2 +- .../v31/security/OAR081/valid-password.json | 2 +- .../v31/security/OAR081/valid-password.yaml | 2 +- .../OAR081/valid-with-components.json | 2 +- .../OAR081/valid-with-components.yaml | 2 +- .../v31/security/OAR082/valid-format.json | 2 +- .../v31/security/OAR082/valid-format.yaml | 2 +- .../OAR083/forbidden-query-params.json | 2 +- .../OAR083/forbidden-query-params.yaml | 2 +- .../v31/security/OAR083/no-parameters.json | 2 +- .../v31/security/OAR083/no-parameters.yaml | 2 +- .../v31/security/OAR083/null-name-param.json | 2 +- .../v31/security/OAR083/null-name-param.yaml | 2 +- .../security/OAR083/options-operation.json | 2 +- .../security/OAR083/options-operation.yaml | 2 +- .../security/OAR083/valid-query-params.json | 2 +- .../security/OAR083/valid-query-params.yaml | 2 +- .../OAR084/forbidden-query-formats.json | 2 +- .../OAR084/forbidden-query-formats.yaml | 2 +- .../v31/security/OAR084/no-parameters.json | 2 +- .../v31/security/OAR084/no-parameters.yaml | 2 +- .../v31/security/OAR084/non-query-param.json | 2 +- .../v31/security/OAR084/non-query-param.yaml | 2 +- .../security/OAR084/null-format-param.json | 2 +- .../security/OAR084/null-format-param.yaml | 2 +- .../security/OAR084/valid-query-formats.json | 2 +- .../security/OAR084/valid-query-formats.yaml | 2 +- .../OAR085/invalid-openapi-version.json | 2 +- .../OAR085/invalid-openapi-version.yaml | 2 +- .../OAR085/valid-openapi-version.json | 2 +- .../OAR085/valid-openapi-version.yaml | 2 +- .../checks/v31/security/OAR096/valid.json | 2 +- .../checks/v31/security/OAR096/valid.yaml | 2 +- .../without-authorization-responses.json | 2 +- .../without-authorization-responses.yaml | 2 +- .../checks/v31/security/OAR114/valid.json | 2 +- .../checks/v31/security/OAR114/valid.yaml | 2 +- .../OAR114/with-forbidden-params.json | 2 +- .../OAR114/with-forbidden-params.yaml | 2 +- .../OAR114/without-required-params.json | 2 +- .../OAR114/without-required-params.yaml | 2 +- .../v32/apim/OAR002/with-empty-scopes.json | 15 + .../v32/apim/OAR002/with-empty-scopes.yaml | 10 + .../v32/apim/OAR002/with-null-scopes.json | 15 + .../v32/apim/OAR002/with-null-scopes.yaml | 10 + .../checks/v32/apim/OAR002/with-scopes.json | 36 +++ .../checks/v32/apim/OAR002/with-scopes.yaml | 25 ++ .../v32/apim/OAR002/without-scopes.json | 13 + .../v32/apim/OAR002/without-scopes.yaml | 9 + .../v32/apim/OAR002/without-security.json | 10 + .../v32/apim/OAR002/without-security.yaml | 6 + .../v32/apim/OAR003/with-description.json | 20 ++ .../v32/apim/OAR003/with-description.yaml | 14 + .../apim/OAR003/with-null-description.json | 20 ++ .../apim/OAR003/with-null-description.yaml | 14 + .../v32/apim/OAR003/without-description.json | 19 ++ .../v32/apim/OAR003/without-description.yaml | 13 + .../v32/apim/OAR004/with-invalid-roles.json | 20 ++ .../v32/apim/OAR004/with-invalid-roles.yaml | 14 + .../v32/apim/OAR004/with-valid-roles.json | 20 ++ .../v32/apim/OAR004/with-valid-roles.yaml | 14 + .../OAR005/with-correct-operation-scope.json | 34 +++ .../OAR005/with-correct-operation-scope.yaml | 23 ++ .../OAR005/with-null-operation-scope.json | 34 +++ .../OAR005/with-null-operation-scope.yaml | 23 ++ .../OAR005/with-wrong-operation-scope.json | 34 +++ .../OAR005/with-wrong-operation-scope.yaml | 23 ++ .../checks/v32/apim/OAR040/invalid.json | 23 ++ .../checks/v32/apim/OAR040/invalid.yaml | 14 + .../checks/v32/apim/OAR040/valid.json | 19 ++ .../checks/v32/apim/OAR040/valid.yaml | 12 + .../v32/apim/OAR041/with-scope-and-auth.json | 35 +++ .../v32/apim/OAR041/with-scope-and-auth.yaml | 24 ++ .../apim/OAR041/with-scope-without-auth.json | 34 +++ .../apim/OAR041/with-scope-without-auth.yaml | 23 ++ .../apim/OAR041/without-scope-and-auth.json | 33 ++ .../apim/OAR041/without-scope-and-auth.yaml | 22 ++ .../checks/v32/core/OAR044/media-type.json | 2 +- .../checks/v32/core/OAR044/media-type.yaml | 2 +- .../v32/core/OAR045/defined-response.json | 2 +- .../v32/core/OAR045/defined-response.yaml | 2 +- .../checks/v32/core/OAR046/declared-tag.json | 2 +- .../checks/v32/core/OAR046/declared-tag.yaml | 2 +- .../v32/core/OAR047/documented-tag.json | 2 +- .../v32/core/OAR047/documented-tag.yaml | 2 +- .../v32/core/OAR049/no-content-in-204.json | 2 +- .../v32/core/OAR049/no-content-in-204.yaml | 2 +- .../v32/core/OAR050/provide-summary.json | 2 +- .../v32/core/OAR050/provide-summary.yaml | 2 +- .../core/OAR051/different-description.json | 2 +- .../core/OAR051/different-description.yaml | 2 +- .../v32/examples/OAR031/externalref.yaml | 68 +++++ .../OAR031/nested-properties-examples.yaml | 39 +++ .../checks/v32/examples/OAR031/valid.json | 170 +++++++++++ .../checks/v32/examples/OAR031/valid.yaml | 113 +++++++ .../v32/examples/OAR031/without-examples.json | 120 ++++++++ .../v32/examples/OAR031/without-examples.yaml | 73 +++++ .../v32/examples/OAR094/externalref.yaml | 2 +- .../v32/examples/OAR094/invalid-example.json | 2 +- .../v32/examples/OAR094/invalid-example.yaml | 2 +- .../v32/examples/OAR094/valid-example.json | 2 +- .../v32/examples/OAR094/valid-example.yaml | 2 +- .../v32/format/OAR006/without-anything.json | 2 +- .../v32/format/OAR006/without-anything.yaml | 2 +- .../v32/format/OAR007/without-anything.json | 2 +- .../v32/format/OAR007/without-anything.yaml | 2 +- .../operation-not-allows-request-body.json | 2 +- .../operation-not-allows-request-body.yaml | 2 +- .../format/OAR009/with-default-and-$ref.json | 2 +- .../format/OAR009/with-default-and-$ref.yaml | 2 +- .../OAR009/with-default-and-specific.json | 2 +- .../OAR009/with-default-and-specific.yaml | 2 +- .../v32/format/OAR009/with-specific.json | 2 +- .../v32/format/OAR009/with-specific.yaml | 2 +- .../with-wrong-default-and-specific.json | 2 +- .../with-wrong-default-and-specific.yaml | 2 +- .../v32/format/OAR009/with-wrong-default.json | 2 +- .../v32/format/OAR009/with-wrong-default.yaml | 2 +- .../v32/format/OAR009/without-anything.json | 2 +- .../v32/format/OAR009/without-anything.yaml | 2 +- .../format/OAR010/with-default-and-$ref.json | 2 +- .../format/OAR010/with-default-and-$ref.yaml | 2 +- .../OAR010/with-default-and-specific.json | 2 +- .../OAR010/with-default-and-specific.yaml | 2 +- .../v32/format/OAR010/with-specific.json | 2 +- .../v32/format/OAR010/with-specific.yaml | 2 +- .../with-wrong-default-and-specific.json | 2 +- .../with-wrong-default-and-specific.yaml | 2 +- .../v32/format/OAR010/with-wrong-default.json | 2 +- .../v32/format/OAR010/with-wrong-default.yaml | 2 +- .../v32/format/OAR010/without-anything.json | 2 +- .../v32/format/OAR010/without-anything.yaml | 2 +- .../v32/format/OAR011/base-path-ok.json | 2 +- .../v32/format/OAR011/base-path-ok.yaml | 2 +- .../v32/format/OAR011/base-path-wrong.json | 2 +- .../v32/format/OAR011/base-path-wrong.yaml | 2 +- .../checks/v32/format/OAR011/plain.json | 2 +- .../checks/v32/format/OAR011/plain.yaml | 2 +- .../v32/format/OAR012/camel-case-plain.json | 2 +- .../v32/format/OAR012/camel-case-plain.yaml | 2 +- .../format/OAR012/camel-case-with-$ref.json | 2 +- .../format/OAR012/camel-case-with-$ref.yaml | 2 +- .../v32/format/OAR012/kebab-case-plain.json | 2 +- .../v32/format/OAR012/kebab-case-plain.yaml | 2 +- .../format/OAR012/kebab-case-with-$ref.json | 2 +- .../format/OAR012/kebab-case-with-$ref.yaml | 2 +- .../v32/format/OAR012/snake-case-plain.json | 2 +- .../v32/format/OAR012/snake-case-plain.yaml | 2 +- .../format/OAR012/snake-case-with-$ref.json | 2 +- .../format/OAR012/snake-case-with-$ref.yaml | 2 +- .../checks/v32/format/OAR016/nested.json | 2 +- .../checks/v32/format/OAR016/nested.yaml | 2 +- .../checks/v32/format/OAR016/plain.json | 2 +- .../checks/v32/format/OAR016/plain.yaml | 2 +- .../checks/v32/format/OAR016/with-$ref.json | 2 +- .../checks/v32/format/OAR016/with-$ref.yaml | 2 +- .../checks/v32/format/OAR037/complete.json | 2 +- .../checks/v32/format/OAR037/complete.yaml | 2 +- .../checks/v32/format/OAR037/nested.json | 2 +- .../checks/v32/format/OAR037/nested.yaml | 2 +- .../checks/v32/format/OAR037/with-$ref.json | 2 +- .../checks/v32/format/OAR037/with-$ref.yaml | 2 +- .../v32/format/OAR042/incorrect-version.json | 2 +- .../v32/format/OAR042/incorrect-version.yaml | 2 +- .../checks/v32/format/OAR042/too-long.json | 2 +- .../checks/v32/format/OAR042/too-long.yaml | 2 +- .../checks/v32/format/OAR042/too-short.json | 2 +- .../checks/v32/format/OAR042/too-short.yaml | 2 +- .../checks/v32/format/OAR042/valid.json | 2 +- .../checks/v32/format/OAR042/valid.yaml | 2 +- .../v32/format/OAR042/without-api-prefix.json | 2 +- .../v32/format/OAR042/without-api-prefix.yaml | 2 +- .../checks/v32/format/OAR044/media-type.json | 46 +++ .../checks/v32/format/OAR044/media-type.yaml | 28 ++ .../v32/format/OAR050/provide-summary.json | 26 ++ .../v32/format/OAR050/provide-summary.yaml | 15 + .../format/OAR051/different-description.json | 30 ++ .../format/OAR051/different-description.yaml | 21 ++ .../checks/v32/format/OAR052/nested.json | 2 +- .../checks/v32/format/OAR052/nested.yaml | 2 +- .../checks/v32/format/OAR052/plain.json | 2 +- .../checks/v32/format/OAR052/plain.yaml | 2 +- .../checks/v32/format/OAR052/with-$ref.json | 2 +- .../checks/v32/format/OAR052/with-$ref.yaml | 2 +- .../v32/format/OAR066/snake-case-error.json | 2 +- .../v32/format/OAR066/snake-case-error.yaml | 2 +- .../checks/v32/format/OAR066/valid.json | 2 +- .../checks/v32/format/OAR066/valid.yaml | 2 +- .../v32/format/OAR067/camel-case-error.json | 2 +- .../v32/format/OAR067/camel-case-error.yaml | 2 +- .../checks/v32/format/OAR067/valid.json | 2 +- .../checks/v32/format/OAR067/valid.yaml | 2 +- .../checks/v32/format/OAR068/externalref.yaml | 2 +- .../v32/format/OAR068/pascal-case-error.json | 2 +- .../v32/format/OAR068/pascal-case-error.yaml | 2 +- .../checks/v32/format/OAR068/valid.json | 2 +- .../checks/v32/format/OAR068/valid.yaml | 2 +- .../v32/format/OAR077/not-valid-in-query.json | 2 +- .../v32/format/OAR077/not-valid-in-query.yaml | 2 +- .../v32/format/OAR077/valid-in-query.json | 2 +- .../v32/format/OAR077/valid-in-query.yaml | 2 +- .../format/OAR086/external-refexample.yaml | 2 +- .../format/OAR086/internal-refexample.yaml | 2 +- .../v32/format/OAR086/invalid-example.json | 2 +- .../v32/format/OAR086/invalid-example.yaml | 2 +- .../v32/format/OAR086/valid-example.json | 2 +- .../v32/format/OAR086/valid-example.yaml | 2 +- .../v32/format/OAR087/invalid-example.json | 2 +- .../v32/format/OAR087/invalid-example.yaml | 2 +- .../v32/format/OAR087/valid-example.json | 2 +- .../v32/format/OAR087/valid-example.yaml | 2 +- .../checks/v32/format/OAR088/invalid-ref.json | 2 +- .../checks/v32/format/OAR088/invalid-ref.yaml | 2 +- .../checks/v32/format/OAR088/valid-ref.json | 2 +- .../checks/v32/format/OAR088/valid-ref.yaml | 2 +- .../checks/v32/format/OAR089/invalid-ref.json | 2 +- .../checks/v32/format/OAR089/invalid-ref.yaml | 2 +- .../checks/v32/format/OAR089/valid-ref.json | 2 +- .../checks/v32/format/OAR089/valid-ref.yaml | 2 +- .../checks/v32/format/OAR090/invalid-ref.json | 2 +- .../checks/v32/format/OAR090/invalid-ref.yaml | 2 +- .../checks/v32/format/OAR090/valid-ref.json | 2 +- .../checks/v32/format/OAR090/valid-ref.yaml | 2 +- .../checks/v32/format/OAR097/too-short.json | 2 +- .../checks/v32/format/OAR097/too-short.yaml | 2 +- .../checks/v32/format/OAR097/valid.json | 2 +- .../checks/v32/format/OAR097/valid.yaml | 2 +- .../checks/v32/format/OAR098/too-long.json | 2 +- .../checks/v32/format/OAR098/too-long.yaml | 2 +- .../checks/v32/format/OAR098/valid.json | 2 +- .../checks/v32/format/OAR098/valid.yaml | 2 +- .../checks/v32/format/OAR099/valid.json | 2 +- .../checks/v32/format/OAR099/valid.yaml | 2 +- .../v32/format/OAR099/without-api-prefix.json | 2 +- .../v32/format/OAR099/without-api-prefix.yaml | 2 +- .../v32/format/OAR100/incorrect-version.json | 2 +- .../v32/format/OAR100/incorrect-version.yaml | 2 +- .../checks/v32/format/OAR100/valid.json | 2 +- .../checks/v32/format/OAR100/valid.yaml | 2 +- .../checks/v32/format/OAR101/empty-path.json | 2 +- .../checks/v32/format/OAR101/empty-path.yaml | 2 +- .../checks/v32/format/OAR101/invalid.json | 2 +- .../checks/v32/format/OAR101/invalid.yaml | 2 +- .../v32/format/OAR101/valid-with-values.json | 2 +- .../v32/format/OAR101/valid-with-values.yaml | 2 +- .../checks/v32/format/OAR101/valid.json | 2 +- .../checks/v32/format/OAR101/valid.yaml | 2 +- .../checks/v32/format/OAR102/invalid.json | 2 +- .../checks/v32/format/OAR102/invalid.yaml | 2 +- .../v32/format/OAR102/one-part-path.json | 2 +- .../v32/format/OAR102/one-part-path.yaml | 2 +- .../v32/format/OAR102/valid-with-values.json | 2 +- .../v32/format/OAR102/valid-with-values.yaml | 2 +- .../checks/v32/format/OAR102/valid.json | 2 +- .../checks/v32/format/OAR102/valid.yaml | 2 +- .../checks/v32/format/OAR110/valid.json | 2 +- .../checks/v32/format/OAR110/valid.yaml | 2 +- .../checks/v32/format/OAR111/valid.json | 2 +- .../checks/v32/format/OAR111/valid.yaml | 2 +- .../checks/v32/format/OAR113/invalid.json | 2 +- .../checks/v32/format/OAR113/invalid.yaml | 2 +- .../checks/v32/format/OAR113/valid.json | 2 +- .../checks/v32/format/OAR113/valid.yaml | 2 +- .../checks/v32/format/OAR115/invalid.json | 2 +- .../checks/v32/format/OAR115/invalid.yaml | 2 +- .../checks/v32/format/OAR115/valid.json | 2 +- .../checks/v32/format/OAR115/valid.yaml | 2 +- .../checks/v32/operations/OAR008/plain.json | 2 +- .../checks/v32/operations/OAR008/plain.yaml | 2 +- .../checks/v32/operations/OAR013/plain.json | 25 ++ .../checks/v32/operations/OAR013/plain.yaml | 14 + .../checks/v32/operations/OAR014/plain.json | 54 ++++ .../checks/v32/operations/OAR014/plain.yaml | 30 ++ .../checks/v32/operations/OAR015/plain.json | 72 +++++ .../checks/v32/operations/OAR015/plain.yaml | 40 +++ .../checks/v32/operations/OAR017/plain.json | 54 ++++ .../checks/v32/operations/OAR017/plain.yaml | 30 ++ .../checks/v32/operations/OAR018/plain.json | 194 ++++++++++++ .../checks/v32/operations/OAR018/plain.yaml | 114 +++++++ .../checks/v32/operations/OAR027/no-post.json | 18 ++ .../checks/v32/operations/OAR027/no-post.yaml | 10 + .../OAR027/post-201-with-location.json | 25 ++ .../OAR027/post-201-with-location.yaml | 14 + .../OAR027/post-201-with-other-headers.json | 25 ++ .../OAR027/post-201-with-other-headers.yaml | 14 + .../OAR027/post-201-without-location.json | 18 ++ .../OAR027/post-201-without-location.yaml | 10 + .../v32/operations/OAR027/post-no-201.json | 18 ++ .../v32/operations/OAR027/post-no-201.yaml | 10 + .../checks/v32/operations/OAR030/valid.json | 27 ++ .../checks/v32/operations/OAR030/valid.yaml | 15 + .../OAR030/with-status-without-get.json | 27 ++ .../OAR030/with-status-without-get.yaml | 15 + .../v32/operations/OAR030/without-status.json | 18 ++ .../v32/operations/OAR030/without-status.yaml | 10 + .../operations/OAR032/forbidden-names.json | 36 +++ .../operations/OAR032/forbidden-names.yaml | 20 ++ .../checks/v32/operations/OAR032/valid.json | 27 ++ .../checks/v32/operations/OAR032/valid.yaml | 15 + .../OAR038/valid-multiple-properties.json | 48 +++ .../OAR038/valid-multiple-properties.yaml | 29 ++ .../operations/OAR038/valid-one-property.json | 45 +++ .../operations/OAR038/valid-one-property.yaml | 27 ++ .../OAR038/with-properties-empty.json | 41 +++ .../OAR038/with-properties-empty.yaml | 25 ++ .../v32/operations/OAR038/without-data.json | 35 +++ .../v32/operations/OAR038/without-data.yaml | 21 ++ .../operations/OAR038/without-properties.json | 53 ++++ .../operations/OAR038/without-properties.yaml | 33 ++ .../v32/operations/OAR038/without-schema.json | 21 ++ .../v32/operations/OAR038/without-schema.yaml | 12 + .../v32/operations/OAR039/missing-codes.json | 109 +++++++ .../v32/operations/OAR039/missing-codes.yaml | 68 +++++ .../checks/v32/operations/OAR039/valid.json | 283 ++++++++++++++++++ .../checks/v32/operations/OAR039/valid.yaml | 184 ++++++++++++ .../operations/OAR045/defined-response.json | 2 +- .../operations/OAR045/defined-response.yaml | 2 +- .../v32/operations/OAR046/declared-tag.json | 26 ++ .../v32/operations/OAR046/declared-tag.yaml | 17 ++ .../operations/OAR048/many-body-params.json | 2 +- .../operations/OAR048/many-body-params.yaml | 2 +- .../OAR061/insuficent-response-codes.json | 2 +- .../OAR061/insuficent-response-codes.yaml | 2 +- .../checks/v32/operations/OAR061/valid.json | 2 +- .../checks/v32/operations/OAR061/valid.yaml | 2 +- .../OAR062/insuficent-response-codes.json | 2 +- .../OAR062/insuficent-response-codes.yaml | 2 +- .../checks/v32/operations/OAR062/valid.json | 2 +- .../checks/v32/operations/OAR062/valid.yaml | 2 +- .../OAR063/insuficent-response-codes.json | 2 +- .../OAR063/insuficent-response-codes.yaml | 2 +- .../checks/v32/operations/OAR063/valid.json | 2 +- .../checks/v32/operations/OAR063/valid.yaml | 2 +- .../OAR064/insuficent-response-codes.json | 2 +- .../OAR064/insuficent-response-codes.yaml | 2 +- .../checks/v32/operations/OAR064/valid.json | 2 +- .../checks/v32/operations/OAR064/valid.yaml | 2 +- .../OAR065/insuficent-response-codes.json | 2 +- .../OAR065/insuficent-response-codes.yaml | 2 +- .../checks/v32/operations/OAR065/valid.json | 2 +- .../checks/v32/operations/OAR065/valid.yaml | 2 +- .../OAR071/missing-query-params.json | 2 +- .../OAR071/missing-query-params.yaml | 2 +- .../operations/OAR071/valid-query-params.json | 2 +- .../operations/OAR071/valid-query-params.yaml | 2 +- .../checks/v32/operations/OAR091/no-ref.json | 2 +- .../checks/v32/operations/OAR091/no-ref.yaml | 2 +- .../v32/operations/OAR091/with-ref.json | 2 +- .../v32/operations/OAR091/with-ref.yaml | 2 +- .../checks/v32/operations/OAR092/no-ref.json | 2 +- .../checks/v32/operations/OAR092/no-ref.yaml | 2 +- .../v32/operations/OAR092/with-ref.json | 2 +- .../v32/operations/OAR092/with-ref.yaml | 2 +- .../checks/v32/operations/OAR093/no-ref.json | 2 +- .../checks/v32/operations/OAR093/no-ref.yaml | 2 +- .../v32/operations/OAR093/with-ref.json | 2 +- .../v32/operations/OAR093/with-ref.yaml | 2 +- .../checks/v32/operations/OAR103/plain.json | 2 +- .../checks/v32/operations/OAR103/plain.yaml | 2 +- .../checks/v32/operations/OAR104/plain.yaml | 2 +- .../checks/v32/operations/OAR105/plain.json | 2 +- .../checks/v32/operations/OAR105/plain.yaml | 2 +- .../checks/v32/operations/OAR106/plain.json | 2 +- .../checks/v32/operations/OAR106/plain.yaml | 2 +- .../checks/v32/operations/OAR107/plain.json | 2 +- .../checks/v32/operations/OAR107/plain.yaml | 2 +- .../checks/v32/operations/OAR109/plain.json | 2 +- .../checks/v32/operations/OAR109/plain.yaml | 2 +- .../checks/v32/owasp/OAR070/no-numeric.json | 2 +- .../checks/v32/owasp/OAR070/no-numeric.yaml | 2 +- .../checks/v32/owasp/OAR070/numeric.json | 2 +- .../checks/v32/owasp/OAR070/numeric.yaml | 2 +- .../v32/owasp/OAR073/no-rate-limit.json | 2 +- .../v32/owasp/OAR073/no-rate-limit.yaml | 2 +- .../checks/v32/owasp/OAR073/no-responses.json | 2 +- .../checks/v32/owasp/OAR073/no-responses.yaml | 2 +- .../checks/v32/owasp/OAR073/rate-limit.json | 2 +- .../checks/v32/owasp/OAR073/rate-limit.yaml | 2 +- .../v32/parameters/OAR019/excluded.json | 2 +- .../v32/parameters/OAR019/excluded.yaml | 2 +- .../v32/parameters/OAR019/plain-without.json | 2 +- .../v32/parameters/OAR019/plain-without.yaml | 2 +- .../checks/v32/parameters/OAR019/plain.json | 2 +- .../checks/v32/parameters/OAR019/plain.yaml | 2 +- .../parameters/OAR019/with-$ref-without.json | 2 +- .../parameters/OAR019/with-$ref-without.yaml | 2 +- .../v32/parameters/OAR019/with-$ref.json | 2 +- .../v32/parameters/OAR019/with-$ref.yaml | 2 +- .../v32/parameters/OAR019/with-param.json | 2 +- .../v32/parameters/OAR019/with-param.yaml | 2 +- .../v32/parameters/OAR019/with-ref.json | 2 +- .../v32/parameters/OAR019/with-ref.yaml | 2 +- .../parameters/OAR019/without-parameters.json | 2 +- .../parameters/OAR019/without-parameters.yaml | 2 +- .../v32/parameters/OAR020/excluded.json | 2 +- .../v32/parameters/OAR020/excluded.yaml | 2 +- .../v32/parameters/OAR020/excluded2.json | 2 +- .../v32/parameters/OAR020/excluded2.yaml | 2 +- .../v32/parameters/OAR020/plain-without.json | 2 +- .../v32/parameters/OAR020/plain-without.yaml | 2 +- .../v32/parameters/OAR020/plain-without2.json | 2 +- .../v32/parameters/OAR020/plain-without2.yaml | 2 +- .../checks/v32/parameters/OAR020/plain.json | 2 +- .../checks/v32/parameters/OAR020/plain.yaml | 2 +- .../checks/v32/parameters/OAR020/plain2.json | 2 +- .../checks/v32/parameters/OAR020/plain2.yaml | 2 +- .../parameters/OAR020/with-$ref-without.json | 2 +- .../parameters/OAR020/with-$ref-without.yaml | 2 +- .../v32/parameters/OAR020/with-$ref.json | 2 +- .../v32/parameters/OAR020/with-$ref.yaml | 2 +- .../v32/parameters/OAR020/with-param.json | 2 +- .../v32/parameters/OAR020/with-param.yaml | 2 +- .../v32/parameters/OAR020/with-ref.json | 2 +- .../v32/parameters/OAR020/with-ref.yaml | 2 +- .../parameters/OAR020/without-parameters.json | 2 +- .../parameters/OAR020/without-parameters.yaml | 2 +- .../v32/parameters/OAR021/excluded.json | 2 +- .../v32/parameters/OAR021/excluded.yaml | 2 +- .../v32/parameters/OAR021/plain-without.json | 2 +- .../v32/parameters/OAR021/plain-without.yaml | 2 +- .../checks/v32/parameters/OAR021/plain.json | 2 +- .../checks/v32/parameters/OAR021/plain.yaml | 2 +- .../parameters/OAR021/with-$ref-without.json | 2 +- .../parameters/OAR021/with-$ref-without.yaml | 2 +- .../v32/parameters/OAR021/with-$ref.json | 2 +- .../v32/parameters/OAR021/with-$ref.yaml | 2 +- .../v32/parameters/OAR021/with-param.json | 2 +- .../v32/parameters/OAR021/with-param.yaml | 2 +- .../v32/parameters/OAR021/with-ref.json | 2 +- .../v32/parameters/OAR021/with-ref.yaml | 2 +- .../parameters/OAR021/without-parameters.json | 2 +- .../parameters/OAR021/without-parameters.yaml | 2 +- .../v32/parameters/OAR022/excluded.json | 2 +- .../v32/parameters/OAR022/excluded.yaml | 2 +- .../v32/parameters/OAR022/plain-without.json | 2 +- .../v32/parameters/OAR022/plain-without.yaml | 2 +- .../checks/v32/parameters/OAR022/plain.json | 2 +- .../checks/v32/parameters/OAR022/plain.yaml | 2 +- .../parameters/OAR022/with-$ref-without.json | 2 +- .../parameters/OAR022/with-$ref-without.yaml | 2 +- .../v32/parameters/OAR022/with-$ref.json | 2 +- .../v32/parameters/OAR022/with-$ref.yaml | 2 +- .../parameters/OAR022/without-parameters.json | 2 +- .../parameters/OAR022/without-parameters.yaml | 2 +- .../v32/parameters/OAR023/excluded.json | 2 +- .../v32/parameters/OAR023/excluded.yaml | 2 +- .../v32/parameters/OAR023/plain-without.json | 2 +- .../v32/parameters/OAR023/plain-without.yaml | 2 +- .../checks/v32/parameters/OAR023/plain.json | 2 +- .../checks/v32/parameters/OAR023/plain.yaml | 2 +- .../parameters/OAR023/with-$ref-without.json | 2 +- .../parameters/OAR023/with-$ref-without.yaml | 2 +- .../v32/parameters/OAR023/with-$ref.json | 2 +- .../v32/parameters/OAR023/with-$ref.yaml | 2 +- .../parameters/OAR023/without-parameters.json | 2 +- .../parameters/OAR023/without-parameters.yaml | 2 +- .../v32/parameters/OAR024/excluded.json | 2 +- .../v32/parameters/OAR024/excluded.yaml | 2 +- .../v32/parameters/OAR024/plain-without.json | 2 +- .../v32/parameters/OAR024/plain-without.yaml | 2 +- .../checks/v32/parameters/OAR024/plain.json | 2 +- .../checks/v32/parameters/OAR024/plain.yaml | 2 +- .../parameters/OAR024/with-$ref-without.json | 2 +- .../parameters/OAR024/with-$ref-without.yaml | 2 +- .../v32/parameters/OAR024/with-$ref.json | 2 +- .../v32/parameters/OAR024/with-$ref.yaml | 2 +- .../parameters/OAR024/without-parameters.json | 2 +- .../parameters/OAR024/without-parameters.yaml | 2 +- .../v32/parameters/OAR025/excluded.json | 2 +- .../v32/parameters/OAR025/excluded.yaml | 2 +- .../v32/parameters/OAR025/plain-without.json | 2 +- .../v32/parameters/OAR025/plain-without.yaml | 2 +- .../checks/v32/parameters/OAR025/plain.json | 2 +- .../checks/v32/parameters/OAR025/plain.yaml | 2 +- .../parameters/OAR025/with-$ref-without.json | 2 +- .../parameters/OAR025/with-$ref-without.yaml | 2 +- .../v32/parameters/OAR025/with-$ref.json | 2 +- .../v32/parameters/OAR025/with-$ref.yaml | 2 +- .../parameters/OAR025/without-parameters.json | 2 +- .../parameters/OAR025/without-parameters.yaml | 2 +- .../plain-with-$total-with-defval-false.json | 2 +- .../plain-with-$total-with-defval-false.yaml | 2 +- .../plain-with-$total-with-defval-true.json | 2 +- .../plain-with-$total-with-defval-true.yaml | 2 +- .../plain-with-$total-without-defval.json | 2 +- .../plain-with-$total-without-defval.yaml | 2 +- .../OAR026/plain-without-$total.json | 2 +- .../OAR026/plain-without-$total.yaml | 2 +- ...th-$ref-with-$total-with-defval-false.json | 2 +- ...th-$ref-with-$total-with-defval-false.yaml | 2 +- ...ith-$ref-with-$total-with-defval-true.json | 2 +- ...ith-$ref-with-$total-with-defval-true.yaml | 2 +- .../with-$ref-with-$total-without-defval.json | 2 +- .../with-$ref-with-$total-without-defval.yaml | 2 +- .../OAR026/with-$ref-without-$total.json | 2 +- .../OAR026/with-$ref-without-$total.yaml | 2 +- .../parameters/OAR026/without-parameters.json | 2 +- .../parameters/OAR026/without-parameters.yaml | 2 +- .../parameters/OAR028/components-param.json | 2 +- .../parameters/OAR028/components-param.yaml | 2 +- .../OAR028/exclude-noncompliant.json | 2 +- .../OAR028/exclude-noncompliant.yaml | 2 +- .../v32/parameters/OAR028/excluded.json | 2 +- .../v32/parameters/OAR028/excluded.yaml | 2 +- .../v32/parameters/OAR028/plain-without.json | 2 +- .../v32/parameters/OAR028/plain-without.yaml | 2 +- .../checks/v32/parameters/OAR028/plain.json | 2 +- .../checks/v32/parameters/OAR028/plain.yaml | 2 +- .../parameters/OAR028/with-$ref-without.json | 2 +- .../parameters/OAR028/with-$ref-without.yaml | 2 +- .../v32/parameters/OAR028/with-$ref.json | 2 +- .../v32/parameters/OAR028/with-$ref.yaml | 2 +- .../parameters/OAR028/without-parameters.json | 2 +- .../parameters/OAR028/without-parameters.yaml | 2 +- .../v32/parameters/OAR060/required-false.json | 2 +- .../v32/parameters/OAR060/required-false.yaml | 2 +- .../v32/parameters/OAR060/required-true.json | 2 +- .../v32/parameters/OAR060/required-true.yaml | 2 +- .../v32/parameters/OAR069/bad-request400.json | 2 +- .../v32/parameters/OAR069/bad-request400.yaml | 2 +- .../parameters/OAR069/no-bad-request400.json | 2 +- .../parameters/OAR069/no-bad-request400.yaml | 2 +- .../regex/OAR112/external-docs-invalid.json | 2 +- .../regex/OAR112/external-docs-invalid.yaml | 2 +- .../v32/regex/OAR112/external-docs-valid.json | 2 +- .../v32/regex/OAR112/external-docs-valid.yaml | 2 +- .../checks/v32/regex/OAR112/info-invalid.json | 2 +- .../checks/v32/regex/OAR112/info-invalid.yaml | 2 +- .../checks/v32/regex/OAR112/minimal.json | 2 +- .../checks/v32/regex/OAR112/minimal.yaml | 2 +- .../v32/regex/OAR112/missing-description.json | 2 +- .../v32/regex/OAR112/missing-description.yaml | 2 +- .../v32/regex/OAR112/operation-invalid.json | 2 +- .../v32/regex/OAR112/operation-invalid.yaml | 2 +- .../v32/regex/OAR112/operation-valid.json | 2 +- .../v32/regex/OAR112/operation-valid.yaml | 2 +- .../v32/regex/OAR112/parameters-invalid.json | 2 +- .../v32/regex/OAR112/parameters-invalid.yaml | 2 +- .../v32/regex/OAR112/parameters-valid.json | 2 +- .../v32/regex/OAR112/parameters-valid.yaml | 2 +- .../checks/v32/regex/OAR112/plain.json | 2 +- .../checks/v32/regex/OAR112/plain.yaml | 2 +- .../v32/regex/OAR112/servers-invalid.json | 2 +- .../v32/regex/OAR112/servers-invalid.yaml | 2 +- .../v32/regex/OAR112/servers-valid.json | 2 +- .../v32/regex/OAR112/servers-valid.yaml | 2 +- .../checks/v32/regex/OAR112/tags-invalid.json | 2 +- .../checks/v32/regex/OAR112/tags-invalid.yaml | 2 +- .../checks/v32/regex/OAR112/tags-valid.json | 2 +- .../checks/v32/regex/OAR112/tags-valid.yaml | 2 +- .../checks/v32/resources/OAR008/plain.json | 2 +- .../checks/v32/resources/OAR008/plain.yaml | 2 +- .../checks/v32/resources/OAR013/plain.json | 2 +- .../checks/v32/resources/OAR013/plain.yaml | 2 +- .../checks/v32/resources/OAR014/plain.json | 2 +- .../checks/v32/resources/OAR014/plain.yaml | 2 +- .../checks/v32/resources/OAR015/plain.json | 2 +- .../checks/v32/resources/OAR015/plain.yaml | 2 +- .../checks/v32/resources/OAR017/plain.json | 2 +- .../checks/v32/resources/OAR017/plain.yaml | 2 +- .../checks/v32/resources/OAR018/plain.json | 2 +- .../checks/v32/resources/OAR018/plain.yaml | 2 +- .../checks/v32/resources/OAR027/no-post.json | 2 +- .../checks/v32/resources/OAR027/no-post.yaml | 2 +- .../OAR027/post-201-with-location.json | 2 +- .../OAR027/post-201-with-location.yaml | 2 +- .../OAR027/post-201-with-other-headers.json | 2 +- .../OAR027/post-201-with-other-headers.yaml | 2 +- .../OAR027/post-201-without-location.json | 2 +- .../OAR027/post-201-without-location.yaml | 2 +- .../v32/resources/OAR027/post-no-201.json | 2 +- .../v32/resources/OAR027/post-no-201.yaml | 2 +- .../v32/resources/OAR029/valid-all-of-md.json | 2 +- .../v32/resources/OAR029/valid-all-of-md.yaml | 2 +- .../v32/resources/OAR029/valid-all-of.json | 2 +- .../v32/resources/OAR029/valid-all-of.yaml | 2 +- .../checks/v32/resources/OAR029/valid-md.json | 2 +- .../checks/v32/resources/OAR029/valid-md.yaml | 2 +- .../checks/v32/resources/OAR029/valid-r.json | 2 +- .../checks/v32/resources/OAR029/valid-r.yaml | 2 +- .../checks/v32/resources/OAR029/valid.json | 2 +- .../checks/v32/resources/OAR029/valid.yaml | 2 +- ...th-error-with-properties-wrong-type-r.json | 2 +- ...th-error-with-properties-wrong-type-r.yaml | 2 +- .../with-error-without-properties-r.json | 2 +- .../with-error-without-properties-r.yaml | 2 +- .../OAR029/with-error-wrong-type-r.json | 2 +- .../OAR029/with-error-wrong-type-r.yaml | 2 +- ...-result-with-properties-wrong-type-md.json | 2 +- ...-result-with-properties-wrong-type-md.yaml | 2 +- .../with-result-without-properties-md.json | 2 +- .../with-result-without-properties-md.yaml | 2 +- .../OAR029/with-result-wrong-type-md.json | 2 +- .../OAR029/with-result-wrong-type-md.yaml | 2 +- ...ith-status-with-properties-wrong-type.json | 2 +- ...ith-status-with-properties-wrong-type.yaml | 2 +- .../with-status-without-properties.json | 2 +- .../with-status-without-properties.yaml | 2 +- .../OAR029/with-status-wrong-type.json | 2 +- .../OAR029/with-status-wrong-type.yaml | 2 +- .../v32/resources/OAR029/without-data-md.json | 2 +- .../v32/resources/OAR029/without-data-md.yaml | 2 +- .../v32/resources/OAR029/without-data.json | 2 +- .../v32/resources/OAR029/without-data.yaml | 2 +- .../v32/resources/OAR029/without-error-r.json | 2 +- .../v32/resources/OAR029/without-error-r.yaml | 2 +- .../resources/OAR029/without-payload-r.json | 2 +- .../resources/OAR029/without-payload-r.yaml | 2 +- .../OAR029/without-required-fields-md.json | 2 +- .../OAR029/without-required-fields-md.yaml | 2 +- .../OAR029/without-required-fields-r.json | 2 +- .../OAR029/without-required-fields-r.yaml | 2 +- .../OAR029/without-required-fields.json | 2 +- .../OAR029/without-required-fields.yaml | 2 +- .../resources/OAR029/without-result-md.json | 2 +- .../resources/OAR029/without-result-md.yaml | 2 +- .../v32/resources/OAR029/without-status.json | 2 +- .../v32/resources/OAR029/without-status.yaml | 2 +- .../checks/v32/resources/OAR030/valid.json | 2 +- .../checks/v32/resources/OAR030/valid.yaml | 2 +- .../OAR030/with-status-without-get.json | 2 +- .../OAR030/with-status-without-get.yaml | 2 +- .../v32/resources/OAR030/without-status.json | 2 +- .../v32/resources/OAR030/without-status.yaml | 2 +- .../checks/v32/resources/OAR031/valid.json | 2 +- .../checks/v32/resources/OAR031/valid.yaml | 2 +- .../resources/OAR031/without-examples.json | 2 +- .../resources/OAR031/without-examples.yaml | 2 +- .../v32/resources/OAR032/forbidden-names.json | 2 +- .../v32/resources/OAR032/forbidden-names.yaml | 2 +- .../checks/v32/resources/OAR032/valid.json | 2 +- .../checks/v32/resources/OAR032/valid.yaml | 2 +- .../v32/resources/OAR034/valid-all-of.json | 2 +- .../v32/resources/OAR034/valid-all-of.yaml | 2 +- .../checks/v32/resources/OAR034/valid.json | 2 +- .../checks/v32/resources/OAR034/valid.yaml | 2 +- .../OAR034/with-links-without-properties.json | 2 +- .../OAR034/with-links-without-properties.yaml | 2 +- ...th-paging-with-properties-wrong-types.json | 2 +- ...th-paging-with-properties-wrong-types.yaml | 2 +- .../with-paging-without-properties.json | 2 +- .../with-paging-without-properties.yaml | 2 +- .../OAR034/with-paging-wrong-type.json | 2 +- .../OAR034/with-paging-wrong-type.yaml | 2 +- .../OAR034/without-links-required-fields.json | 2 +- .../OAR034/without-links-required-fields.yaml | 2 +- .../without-pagination-required-fields.json | 2 +- .../without-pagination-required-fields.yaml | 2 +- .../v32/resources/OAR034/without-paging.json | 2 +- .../v32/resources/OAR034/without-paging.yaml | 2 +- .../OAR038/valid-multiple-properties.json | 2 +- .../OAR038/valid-multiple-properties.yaml | 2 +- .../resources/OAR038/valid-one-property.json | 2 +- .../resources/OAR038/valid-one-property.yaml | 2 +- .../OAR038/with-properties-empty.json | 2 +- .../OAR038/with-properties-empty.yaml | 2 +- .../v32/resources/OAR038/without-data.json | 2 +- .../v32/resources/OAR038/without-data.yaml | 2 +- .../resources/OAR038/without-properties.json | 2 +- .../resources/OAR038/without-properties.yaml | 2 +- .../v32/resources/OAR038/without-schema.json | 2 +- .../v32/resources/OAR038/without-schema.yaml | 2 +- .../v32/resources/OAR039/missing-codes.json | 2 +- .../v32/resources/OAR039/missing-codes.yaml | 2 +- .../checks/v32/resources/OAR039/valid.json | 2 +- .../checks/v32/resources/OAR039/valid.yaml | 2 +- .../v32/schemas/OAR029/valid-all-of-md.json | 134 +++++++++ .../v32/schemas/OAR029/valid-all-of-md.yaml | 78 +++++ .../v32/schemas/OAR029/valid-all-of.json | 116 +++++++ .../v32/schemas/OAR029/valid-all-of.yaml | 76 +++++ .../checks/v32/schemas/OAR029/valid-md.json | 116 +++++++ .../checks/v32/schemas/OAR029/valid-md.yaml | 69 +++++ .../checks/v32/schemas/OAR029/valid-r.json | 96 ++++++ .../checks/v32/schemas/OAR029/valid-r.yaml | 59 ++++ .../checks/v32/schemas/OAR029/valid.json | 105 +++++++ .../checks/v32/schemas/OAR029/valid.yaml | 135 +++++++++ .../v32/schemas/OAR034/valid-all-of.json | 126 ++++++++ .../v32/schemas/OAR034/valid-all-of.yaml | 84 ++++++ .../checks/v32/schemas/OAR034/valid.json | 116 +++++++ .../checks/v32/schemas/OAR034/valid.yaml | 79 +++++ .../OAR034/with-links-without-properties.json | 96 ++++++ .../OAR034/with-links-without-properties.yaml | 66 ++++ ...th-paging-with-properties-wrong-types.json | 91 ++++++ ...th-paging-with-properties-wrong-types.yaml | 63 ++++ .../with-paging-without-properties.json | 78 +++++ .../with-paging-without-properties.yaml | 51 ++++ .../OAR034/with-paging-wrong-type.json | 73 +++++ .../OAR034/with-paging-wrong-type.yaml | 48 +++ .../OAR034/without-links-required-fields.json | 116 +++++++ .../OAR034/without-links-required-fields.yaml | 77 +++++ .../without-pagination-required-fields.json | 116 +++++++ .../without-pagination-required-fields.yaml | 77 +++++ .../v32/schemas/OAR034/without-paging.json | 61 ++++ .../v32/schemas/OAR034/without-paging.yaml | 37 +++ .../schemas/OAR080/empty-global-security.json | 2 +- .../schemas/OAR080/empty-global-security.yaml | 2 +- .../v32/schemas/OAR080/empty-security.json | 2 +- .../v32/schemas/OAR080/empty-security.yaml | 2 +- .../v32/schemas/OAR080/global-security.json | 2 +- .../v32/schemas/OAR080/global-security.yaml | 2 +- .../v32/schemas/OAR080/with-security.json | 2 +- .../v32/schemas/OAR080/with-security.yaml | 2 +- .../v32/schemas/OAR080/without-security.json | 2 +- .../v32/schemas/OAR080/without-security.yaml | 2 +- .../v32/schemas/OAR080/wrong-scheme.json | 2 +- .../v32/schemas/OAR080/wrong-scheme.yaml | 2 +- .../checks/v32/schemas/OAR108/invalid.json | 2 +- .../checks/v32/schemas/OAR108/invalid.yaml | 2 +- .../checks/v32/schemas/OAR108/valid.json | 2 +- .../checks/v32/schemas/OAR108/valid.yaml | 2 +- .../v32/security/OAR001/with-servers.json | 2 +- .../v32/security/OAR001/with-servers.yaml | 2 +- .../v32/security/OAR001/without-servers.json | 2 +- .../v32/security/OAR001/without-servers.yaml | 2 +- .../checks/v32/security/OAR033/valid.json | 2 +- .../checks/v32/security/OAR033/valid.yaml | 2 +- .../OAR033/with-forbidden-params.json | 2 +- .../OAR033/with-forbidden-params.yaml | 2 +- .../OAR033/without-required-params.json | 2 +- .../OAR033/without-required-params.yaml | 2 +- .../checks/v32/security/OAR035/valid.json | 2 +- .../checks/v32/security/OAR035/valid.yaml | 2 +- .../without-authorization-responses.json | 2 +- .../without-authorization-responses.yaml | 2 +- .../checks/v32/security/OAR036/valid.json | 2 +- .../checks/v32/security/OAR036/valid.yaml | 2 +- .../v32/security/OAR036/with-cookie.json | 2 +- .../v32/security/OAR036/with-cookie.yaml | 2 +- .../v32/security/OAR045/defined-response.json | 2 +- .../v32/security/OAR045/defined-response.yaml | 2 +- .../security/OAR049/no-content-in-204.json | 25 ++ .../security/OAR049/no-content-in-204.yaml | 14 + .../checks/v32/security/OAR053/valid.json | 2 +- .../checks/v32/security/OAR053/valid.yaml | 2 +- .../checks/v32/security/OAR054/valid.json | 2 +- .../checks/v32/security/OAR054/valid.yaml | 2 +- .../v32/security/OAR072/no-stack-trace.json | 2 +- .../v32/security/OAR072/no-stack-trace.yaml | 2 +- .../v32/security/OAR072/with-stack-trace.json | 2 +- .../v32/security/OAR072/with-stack-trace.yaml | 2 +- .../v32/security/OAR074/no-restrictions.json | 2 +- .../v32/security/OAR074/no-restrictions.yaml | 2 +- .../security/OAR074/with-restrictions.json | 2 +- .../security/OAR074/with-restrictions.yaml | 2 +- .../v32/security/OAR075/no-restrictions.json | 2 +- .../v32/security/OAR075/no-restrictions.yaml | 2 +- .../security/OAR075/with-restrictions.json | 2 +- .../security/OAR075/with-restrictions.yaml | 2 +- .../checks/v32/security/OAR076/nested.json | 2 +- .../checks/v32/security/OAR076/nested.yaml | 2 +- .../checks/v32/security/OAR076/plain.json | 2 +- .../checks/v32/security/OAR076/plain.yaml | 2 +- .../checks/v32/security/OAR076/with-$ref.json | 2 +- .../checks/v32/security/OAR076/with-$ref.yaml | 2 +- .../v32/security/OAR078/no-security.json | 2 +- .../v32/security/OAR078/no-security.yaml | 2 +- .../v32/security/OAR078/with-security.json | 2 +- .../v32/security/OAR078/with-security.yaml | 2 +- .../v32/security/OAR079/bad-request404.json | 2 +- .../v32/security/OAR079/bad-request404.yaml | 2 +- .../security/OAR079/no-bad-request404.json | 2 +- .../security/OAR079/no-bad-request404.yaml | 2 +- .../v32/security/OAR079/no-parameters.json | 2 +- .../v32/security/OAR079/no-parameters.yaml | 2 +- .../v32/security/OAR079/query-param-only.json | 2 +- .../v32/security/OAR079/query-param-only.yaml | 2 +- .../security/OAR081/not-valid-password.json | 2 +- .../security/OAR081/not-valid-password.yaml | 2 +- .../v32/security/OAR081/valid-password.json | 2 +- .../v32/security/OAR081/valid-password.yaml | 2 +- .../OAR081/valid-with-components.json | 2 +- .../OAR081/valid-with-components.yaml | 2 +- .../v32/security/OAR082/valid-format.json | 2 +- .../v32/security/OAR082/valid-format.yaml | 2 +- .../OAR083/forbidden-query-params.json | 2 +- .../OAR083/forbidden-query-params.yaml | 2 +- .../v32/security/OAR083/no-parameters.json | 2 +- .../v32/security/OAR083/no-parameters.yaml | 2 +- .../v32/security/OAR083/null-name-param.json | 2 +- .../v32/security/OAR083/null-name-param.yaml | 2 +- .../security/OAR083/options-operation.json | 2 +- .../security/OAR083/options-operation.yaml | 2 +- .../security/OAR083/valid-query-params.json | 2 +- .../security/OAR083/valid-query-params.yaml | 2 +- .../OAR084/forbidden-query-formats.json | 2 +- .../OAR084/forbidden-query-formats.yaml | 2 +- .../v32/security/OAR084/no-parameters.json | 2 +- .../v32/security/OAR084/no-parameters.yaml | 2 +- .../v32/security/OAR084/non-query-param.json | 2 +- .../v32/security/OAR084/non-query-param.yaml | 2 +- .../security/OAR084/null-format-param.json | 2 +- .../security/OAR084/null-format-param.yaml | 2 +- .../security/OAR084/valid-query-formats.json | 2 +- .../security/OAR084/valid-query-formats.yaml | 2 +- .../OAR085/invalid-openapi-version.json | 2 +- .../OAR085/invalid-openapi-version.yaml | 2 +- .../OAR085/valid-openapi-version.json | 2 +- .../OAR085/valid-openapi-version.yaml | 2 +- .../checks/v32/security/OAR096/valid.json | 2 +- .../checks/v32/security/OAR096/valid.yaml | 2 +- .../without-authorization-responses.json | 2 +- .../without-authorization-responses.yaml | 2 +- .../checks/v32/security/OAR114/valid.json | 2 +- .../checks/v32/security/OAR114/valid.yaml | 2 +- .../OAR114/with-forbidden-params.json | 2 +- .../OAR114/with-forbidden-params.yaml | 2 +- .../OAR114/without-required-params.json | 2 +- .../OAR114/without-required-params.yaml | 2 +- 1547 files changed, 13389 insertions(+), 1314 deletions(-) create mode 100644 src/test/resources/checks/v31/apim/OAR002/with-empty-scopes.json create mode 100644 src/test/resources/checks/v31/apim/OAR002/with-empty-scopes.yaml create mode 100644 src/test/resources/checks/v31/apim/OAR002/with-null-scopes.json create mode 100644 src/test/resources/checks/v31/apim/OAR002/with-null-scopes.yaml create mode 100644 src/test/resources/checks/v31/apim/OAR002/with-scopes.json create mode 100644 src/test/resources/checks/v31/apim/OAR002/with-scopes.yaml create mode 100644 src/test/resources/checks/v31/apim/OAR002/without-scopes.json create mode 100644 src/test/resources/checks/v31/apim/OAR002/without-scopes.yaml create mode 100644 src/test/resources/checks/v31/apim/OAR002/without-security.json create mode 100644 src/test/resources/checks/v31/apim/OAR002/without-security.yaml create mode 100644 src/test/resources/checks/v31/apim/OAR003/with-description.json create mode 100644 src/test/resources/checks/v31/apim/OAR003/with-description.yaml create mode 100644 src/test/resources/checks/v31/apim/OAR003/with-null-description.json create mode 100644 src/test/resources/checks/v31/apim/OAR003/with-null-description.yaml create mode 100644 src/test/resources/checks/v31/apim/OAR003/without-description.json create mode 100644 src/test/resources/checks/v31/apim/OAR003/without-description.yaml create mode 100644 src/test/resources/checks/v31/apim/OAR004/with-invalid-roles.json create mode 100644 src/test/resources/checks/v31/apim/OAR004/with-invalid-roles.yaml create mode 100644 src/test/resources/checks/v31/apim/OAR004/with-valid-roles.json create mode 100644 src/test/resources/checks/v31/apim/OAR004/with-valid-roles.yaml create mode 100644 src/test/resources/checks/v31/apim/OAR005/with-correct-operation-scope.json create mode 100644 src/test/resources/checks/v31/apim/OAR005/with-correct-operation-scope.yaml create mode 100644 src/test/resources/checks/v31/apim/OAR005/with-null-operation-scope.json create mode 100644 src/test/resources/checks/v31/apim/OAR005/with-null-operation-scope.yaml create mode 100644 src/test/resources/checks/v31/apim/OAR005/with-wrong-operation-scope.json create mode 100644 src/test/resources/checks/v31/apim/OAR005/with-wrong-operation-scope.yaml create mode 100644 src/test/resources/checks/v31/apim/OAR040/invalid.json create mode 100644 src/test/resources/checks/v31/apim/OAR040/invalid.yaml create mode 100644 src/test/resources/checks/v31/apim/OAR040/valid.json create mode 100644 src/test/resources/checks/v31/apim/OAR040/valid.yaml create mode 100644 src/test/resources/checks/v31/apim/OAR041/with-scope-and-auth.json create mode 100644 src/test/resources/checks/v31/apim/OAR041/with-scope-and-auth.yaml create mode 100644 src/test/resources/checks/v31/apim/OAR041/with-scope-without-auth.json create mode 100644 src/test/resources/checks/v31/apim/OAR041/with-scope-without-auth.yaml create mode 100644 src/test/resources/checks/v31/apim/OAR041/without-scope-and-auth.json create mode 100644 src/test/resources/checks/v31/apim/OAR041/without-scope-and-auth.yaml create mode 100644 src/test/resources/checks/v31/examples/OAR031/externalref.yaml create mode 100644 src/test/resources/checks/v31/examples/OAR031/nested-properties-examples.yaml create mode 100644 src/test/resources/checks/v31/examples/OAR031/valid.json create mode 100644 src/test/resources/checks/v31/examples/OAR031/valid.yaml create mode 100644 src/test/resources/checks/v31/examples/OAR031/without-examples.json create mode 100644 src/test/resources/checks/v31/examples/OAR031/without-examples.yaml create mode 100644 src/test/resources/checks/v31/format/OAR044/media-type.json create mode 100644 src/test/resources/checks/v31/format/OAR044/media-type.yaml create mode 100644 src/test/resources/checks/v31/format/OAR050/provide-summary.json create mode 100644 src/test/resources/checks/v31/format/OAR050/provide-summary.yaml create mode 100644 src/test/resources/checks/v31/format/OAR051/different-description.json create mode 100644 src/test/resources/checks/v31/format/OAR051/different-description.yaml create mode 100644 src/test/resources/checks/v31/operations/OAR013/plain.json create mode 100644 src/test/resources/checks/v31/operations/OAR013/plain.yaml create mode 100644 src/test/resources/checks/v31/operations/OAR014/plain.json create mode 100644 src/test/resources/checks/v31/operations/OAR014/plain.yaml create mode 100644 src/test/resources/checks/v31/operations/OAR015/plain.json create mode 100644 src/test/resources/checks/v31/operations/OAR015/plain.yaml create mode 100644 src/test/resources/checks/v31/operations/OAR017/plain.json create mode 100644 src/test/resources/checks/v31/operations/OAR017/plain.yaml create mode 100644 src/test/resources/checks/v31/operations/OAR018/plain.json create mode 100644 src/test/resources/checks/v31/operations/OAR018/plain.yaml create mode 100644 src/test/resources/checks/v31/operations/OAR027/no-post.json create mode 100644 src/test/resources/checks/v31/operations/OAR027/no-post.yaml create mode 100644 src/test/resources/checks/v31/operations/OAR027/post-201-with-location.json create mode 100644 src/test/resources/checks/v31/operations/OAR027/post-201-with-location.yaml create mode 100644 src/test/resources/checks/v31/operations/OAR027/post-201-with-other-headers.json create mode 100644 src/test/resources/checks/v31/operations/OAR027/post-201-with-other-headers.yaml create mode 100644 src/test/resources/checks/v31/operations/OAR027/post-201-without-location.json create mode 100644 src/test/resources/checks/v31/operations/OAR027/post-201-without-location.yaml create mode 100644 src/test/resources/checks/v31/operations/OAR027/post-no-201.json create mode 100644 src/test/resources/checks/v31/operations/OAR027/post-no-201.yaml create mode 100644 src/test/resources/checks/v31/operations/OAR030/valid.json create mode 100644 src/test/resources/checks/v31/operations/OAR030/valid.yaml create mode 100644 src/test/resources/checks/v31/operations/OAR030/with-status-without-get.json create mode 100644 src/test/resources/checks/v31/operations/OAR030/with-status-without-get.yaml create mode 100644 src/test/resources/checks/v31/operations/OAR030/without-status.json create mode 100644 src/test/resources/checks/v31/operations/OAR030/without-status.yaml create mode 100644 src/test/resources/checks/v31/operations/OAR032/forbidden-names.json create mode 100644 src/test/resources/checks/v31/operations/OAR032/forbidden-names.yaml create mode 100644 src/test/resources/checks/v31/operations/OAR032/valid.json create mode 100644 src/test/resources/checks/v31/operations/OAR032/valid.yaml create mode 100644 src/test/resources/checks/v31/operations/OAR038/valid-multiple-properties.json create mode 100644 src/test/resources/checks/v31/operations/OAR038/valid-multiple-properties.yaml create mode 100644 src/test/resources/checks/v31/operations/OAR038/valid-one-property.json create mode 100644 src/test/resources/checks/v31/operations/OAR038/valid-one-property.yaml create mode 100644 src/test/resources/checks/v31/operations/OAR038/with-properties-empty.json create mode 100644 src/test/resources/checks/v31/operations/OAR038/with-properties-empty.yaml create mode 100644 src/test/resources/checks/v31/operations/OAR038/without-data.json create mode 100644 src/test/resources/checks/v31/operations/OAR038/without-data.yaml create mode 100644 src/test/resources/checks/v31/operations/OAR038/without-properties.json create mode 100644 src/test/resources/checks/v31/operations/OAR038/without-properties.yaml create mode 100644 src/test/resources/checks/v31/operations/OAR038/without-schema.json create mode 100644 src/test/resources/checks/v31/operations/OAR038/without-schema.yaml create mode 100644 src/test/resources/checks/v31/operations/OAR039/missing-codes.json create mode 100644 src/test/resources/checks/v31/operations/OAR039/missing-codes.yaml create mode 100644 src/test/resources/checks/v31/operations/OAR039/valid.json create mode 100644 src/test/resources/checks/v31/operations/OAR039/valid.yaml create mode 100644 src/test/resources/checks/v31/operations/OAR046/declared-tag.json create mode 100644 src/test/resources/checks/v31/operations/OAR046/declared-tag.yaml create mode 100644 src/test/resources/checks/v31/schemas/OAR029/valid-all-of-md.json create mode 100644 src/test/resources/checks/v31/schemas/OAR029/valid-all-of-md.yaml create mode 100644 src/test/resources/checks/v31/schemas/OAR029/valid-all-of.json create mode 100644 src/test/resources/checks/v31/schemas/OAR029/valid-all-of.yaml create mode 100644 src/test/resources/checks/v31/schemas/OAR029/valid-md.json create mode 100644 src/test/resources/checks/v31/schemas/OAR029/valid-md.yaml create mode 100644 src/test/resources/checks/v31/schemas/OAR029/valid-r.json create mode 100644 src/test/resources/checks/v31/schemas/OAR029/valid-r.yaml create mode 100644 src/test/resources/checks/v31/schemas/OAR029/valid.json create mode 100644 src/test/resources/checks/v31/schemas/OAR034/valid-all-of.json create mode 100644 src/test/resources/checks/v31/schemas/OAR034/valid-all-of.yaml create mode 100644 src/test/resources/checks/v31/schemas/OAR034/valid.json create mode 100644 src/test/resources/checks/v31/schemas/OAR034/valid.yaml create mode 100644 src/test/resources/checks/v31/schemas/OAR034/with-links-without-properties.json create mode 100644 src/test/resources/checks/v31/schemas/OAR034/with-links-without-properties.yaml create mode 100644 src/test/resources/checks/v31/schemas/OAR034/with-paging-with-properties-wrong-types.json create mode 100644 src/test/resources/checks/v31/schemas/OAR034/with-paging-with-properties-wrong-types.yaml create mode 100644 src/test/resources/checks/v31/schemas/OAR034/with-paging-without-properties.json create mode 100644 src/test/resources/checks/v31/schemas/OAR034/with-paging-without-properties.yaml create mode 100644 src/test/resources/checks/v31/schemas/OAR034/with-paging-wrong-type.json create mode 100644 src/test/resources/checks/v31/schemas/OAR034/with-paging-wrong-type.yaml create mode 100644 src/test/resources/checks/v31/schemas/OAR034/without-links-required-fields.json create mode 100644 src/test/resources/checks/v31/schemas/OAR034/without-links-required-fields.yaml create mode 100644 src/test/resources/checks/v31/schemas/OAR034/without-pagination-required-fields.json create mode 100644 src/test/resources/checks/v31/schemas/OAR034/without-pagination-required-fields.yaml create mode 100644 src/test/resources/checks/v31/schemas/OAR034/without-paging.json create mode 100644 src/test/resources/checks/v31/schemas/OAR034/without-paging.yaml create mode 100644 src/test/resources/checks/v31/security/OAR049/no-content-in-204.json create mode 100644 src/test/resources/checks/v31/security/OAR049/no-content-in-204.yaml create mode 100644 src/test/resources/checks/v32/apim/OAR002/with-empty-scopes.json create mode 100644 src/test/resources/checks/v32/apim/OAR002/with-empty-scopes.yaml create mode 100644 src/test/resources/checks/v32/apim/OAR002/with-null-scopes.json create mode 100644 src/test/resources/checks/v32/apim/OAR002/with-null-scopes.yaml create mode 100644 src/test/resources/checks/v32/apim/OAR002/with-scopes.json create mode 100644 src/test/resources/checks/v32/apim/OAR002/with-scopes.yaml create mode 100644 src/test/resources/checks/v32/apim/OAR002/without-scopes.json create mode 100644 src/test/resources/checks/v32/apim/OAR002/without-scopes.yaml create mode 100644 src/test/resources/checks/v32/apim/OAR002/without-security.json create mode 100644 src/test/resources/checks/v32/apim/OAR002/without-security.yaml create mode 100644 src/test/resources/checks/v32/apim/OAR003/with-description.json create mode 100644 src/test/resources/checks/v32/apim/OAR003/with-description.yaml create mode 100644 src/test/resources/checks/v32/apim/OAR003/with-null-description.json create mode 100644 src/test/resources/checks/v32/apim/OAR003/with-null-description.yaml create mode 100644 src/test/resources/checks/v32/apim/OAR003/without-description.json create mode 100644 src/test/resources/checks/v32/apim/OAR003/without-description.yaml create mode 100644 src/test/resources/checks/v32/apim/OAR004/with-invalid-roles.json create mode 100644 src/test/resources/checks/v32/apim/OAR004/with-invalid-roles.yaml create mode 100644 src/test/resources/checks/v32/apim/OAR004/with-valid-roles.json create mode 100644 src/test/resources/checks/v32/apim/OAR004/with-valid-roles.yaml create mode 100644 src/test/resources/checks/v32/apim/OAR005/with-correct-operation-scope.json create mode 100644 src/test/resources/checks/v32/apim/OAR005/with-correct-operation-scope.yaml create mode 100644 src/test/resources/checks/v32/apim/OAR005/with-null-operation-scope.json create mode 100644 src/test/resources/checks/v32/apim/OAR005/with-null-operation-scope.yaml create mode 100644 src/test/resources/checks/v32/apim/OAR005/with-wrong-operation-scope.json create mode 100644 src/test/resources/checks/v32/apim/OAR005/with-wrong-operation-scope.yaml create mode 100644 src/test/resources/checks/v32/apim/OAR040/invalid.json create mode 100644 src/test/resources/checks/v32/apim/OAR040/invalid.yaml create mode 100644 src/test/resources/checks/v32/apim/OAR040/valid.json create mode 100644 src/test/resources/checks/v32/apim/OAR040/valid.yaml create mode 100644 src/test/resources/checks/v32/apim/OAR041/with-scope-and-auth.json create mode 100644 src/test/resources/checks/v32/apim/OAR041/with-scope-and-auth.yaml create mode 100644 src/test/resources/checks/v32/apim/OAR041/with-scope-without-auth.json create mode 100644 src/test/resources/checks/v32/apim/OAR041/with-scope-without-auth.yaml create mode 100644 src/test/resources/checks/v32/apim/OAR041/without-scope-and-auth.json create mode 100644 src/test/resources/checks/v32/apim/OAR041/without-scope-and-auth.yaml create mode 100644 src/test/resources/checks/v32/examples/OAR031/externalref.yaml create mode 100644 src/test/resources/checks/v32/examples/OAR031/nested-properties-examples.yaml create mode 100644 src/test/resources/checks/v32/examples/OAR031/valid.json create mode 100644 src/test/resources/checks/v32/examples/OAR031/valid.yaml create mode 100644 src/test/resources/checks/v32/examples/OAR031/without-examples.json create mode 100644 src/test/resources/checks/v32/examples/OAR031/without-examples.yaml create mode 100644 src/test/resources/checks/v32/format/OAR044/media-type.json create mode 100644 src/test/resources/checks/v32/format/OAR044/media-type.yaml create mode 100644 src/test/resources/checks/v32/format/OAR050/provide-summary.json create mode 100644 src/test/resources/checks/v32/format/OAR050/provide-summary.yaml create mode 100644 src/test/resources/checks/v32/format/OAR051/different-description.json create mode 100644 src/test/resources/checks/v32/format/OAR051/different-description.yaml create mode 100644 src/test/resources/checks/v32/operations/OAR013/plain.json create mode 100644 src/test/resources/checks/v32/operations/OAR013/plain.yaml create mode 100644 src/test/resources/checks/v32/operations/OAR014/plain.json create mode 100644 src/test/resources/checks/v32/operations/OAR014/plain.yaml create mode 100644 src/test/resources/checks/v32/operations/OAR015/plain.json create mode 100644 src/test/resources/checks/v32/operations/OAR015/plain.yaml create mode 100644 src/test/resources/checks/v32/operations/OAR017/plain.json create mode 100644 src/test/resources/checks/v32/operations/OAR017/plain.yaml create mode 100644 src/test/resources/checks/v32/operations/OAR018/plain.json create mode 100644 src/test/resources/checks/v32/operations/OAR018/plain.yaml create mode 100644 src/test/resources/checks/v32/operations/OAR027/no-post.json create mode 100644 src/test/resources/checks/v32/operations/OAR027/no-post.yaml create mode 100644 src/test/resources/checks/v32/operations/OAR027/post-201-with-location.json create mode 100644 src/test/resources/checks/v32/operations/OAR027/post-201-with-location.yaml create mode 100644 src/test/resources/checks/v32/operations/OAR027/post-201-with-other-headers.json create mode 100644 src/test/resources/checks/v32/operations/OAR027/post-201-with-other-headers.yaml create mode 100644 src/test/resources/checks/v32/operations/OAR027/post-201-without-location.json create mode 100644 src/test/resources/checks/v32/operations/OAR027/post-201-without-location.yaml create mode 100644 src/test/resources/checks/v32/operations/OAR027/post-no-201.json create mode 100644 src/test/resources/checks/v32/operations/OAR027/post-no-201.yaml create mode 100644 src/test/resources/checks/v32/operations/OAR030/valid.json create mode 100644 src/test/resources/checks/v32/operations/OAR030/valid.yaml create mode 100644 src/test/resources/checks/v32/operations/OAR030/with-status-without-get.json create mode 100644 src/test/resources/checks/v32/operations/OAR030/with-status-without-get.yaml create mode 100644 src/test/resources/checks/v32/operations/OAR030/without-status.json create mode 100644 src/test/resources/checks/v32/operations/OAR030/without-status.yaml create mode 100644 src/test/resources/checks/v32/operations/OAR032/forbidden-names.json create mode 100644 src/test/resources/checks/v32/operations/OAR032/forbidden-names.yaml create mode 100644 src/test/resources/checks/v32/operations/OAR032/valid.json create mode 100644 src/test/resources/checks/v32/operations/OAR032/valid.yaml create mode 100644 src/test/resources/checks/v32/operations/OAR038/valid-multiple-properties.json create mode 100644 src/test/resources/checks/v32/operations/OAR038/valid-multiple-properties.yaml create mode 100644 src/test/resources/checks/v32/operations/OAR038/valid-one-property.json create mode 100644 src/test/resources/checks/v32/operations/OAR038/valid-one-property.yaml create mode 100644 src/test/resources/checks/v32/operations/OAR038/with-properties-empty.json create mode 100644 src/test/resources/checks/v32/operations/OAR038/with-properties-empty.yaml create mode 100644 src/test/resources/checks/v32/operations/OAR038/without-data.json create mode 100644 src/test/resources/checks/v32/operations/OAR038/without-data.yaml create mode 100644 src/test/resources/checks/v32/operations/OAR038/without-properties.json create mode 100644 src/test/resources/checks/v32/operations/OAR038/without-properties.yaml create mode 100644 src/test/resources/checks/v32/operations/OAR038/without-schema.json create mode 100644 src/test/resources/checks/v32/operations/OAR038/without-schema.yaml create mode 100644 src/test/resources/checks/v32/operations/OAR039/missing-codes.json create mode 100644 src/test/resources/checks/v32/operations/OAR039/missing-codes.yaml create mode 100644 src/test/resources/checks/v32/operations/OAR039/valid.json create mode 100644 src/test/resources/checks/v32/operations/OAR039/valid.yaml create mode 100644 src/test/resources/checks/v32/operations/OAR046/declared-tag.json create mode 100644 src/test/resources/checks/v32/operations/OAR046/declared-tag.yaml create mode 100644 src/test/resources/checks/v32/schemas/OAR029/valid-all-of-md.json create mode 100644 src/test/resources/checks/v32/schemas/OAR029/valid-all-of-md.yaml create mode 100644 src/test/resources/checks/v32/schemas/OAR029/valid-all-of.json create mode 100644 src/test/resources/checks/v32/schemas/OAR029/valid-all-of.yaml create mode 100644 src/test/resources/checks/v32/schemas/OAR029/valid-md.json create mode 100644 src/test/resources/checks/v32/schemas/OAR029/valid-md.yaml create mode 100644 src/test/resources/checks/v32/schemas/OAR029/valid-r.json create mode 100644 src/test/resources/checks/v32/schemas/OAR029/valid-r.yaml create mode 100644 src/test/resources/checks/v32/schemas/OAR029/valid.json create mode 100644 src/test/resources/checks/v32/schemas/OAR029/valid.yaml create mode 100644 src/test/resources/checks/v32/schemas/OAR034/valid-all-of.json create mode 100644 src/test/resources/checks/v32/schemas/OAR034/valid-all-of.yaml create mode 100644 src/test/resources/checks/v32/schemas/OAR034/valid.json create mode 100644 src/test/resources/checks/v32/schemas/OAR034/valid.yaml create mode 100644 src/test/resources/checks/v32/schemas/OAR034/with-links-without-properties.json create mode 100644 src/test/resources/checks/v32/schemas/OAR034/with-links-without-properties.yaml create mode 100644 src/test/resources/checks/v32/schemas/OAR034/with-paging-with-properties-wrong-types.json create mode 100644 src/test/resources/checks/v32/schemas/OAR034/with-paging-with-properties-wrong-types.yaml create mode 100644 src/test/resources/checks/v32/schemas/OAR034/with-paging-without-properties.json create mode 100644 src/test/resources/checks/v32/schemas/OAR034/with-paging-without-properties.yaml create mode 100644 src/test/resources/checks/v32/schemas/OAR034/with-paging-wrong-type.json create mode 100644 src/test/resources/checks/v32/schemas/OAR034/with-paging-wrong-type.yaml create mode 100644 src/test/resources/checks/v32/schemas/OAR034/without-links-required-fields.json create mode 100644 src/test/resources/checks/v32/schemas/OAR034/without-links-required-fields.yaml create mode 100644 src/test/resources/checks/v32/schemas/OAR034/without-pagination-required-fields.json create mode 100644 src/test/resources/checks/v32/schemas/OAR034/without-pagination-required-fields.yaml create mode 100644 src/test/resources/checks/v32/schemas/OAR034/without-paging.json create mode 100644 src/test/resources/checks/v32/schemas/OAR034/without-paging.yaml create mode 100644 src/test/resources/checks/v32/security/OAR049/no-content-in-204.json create mode 100644 src/test/resources/checks/v32/security/OAR049/no-content-in-204.yaml diff --git a/CHANGELOG.md b/CHANGELOG.md index a135c7d0..abdc796d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,16 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [1.4.0] - 2024-05-06 + +## Added + +### Now, support for OpenAPI 3.2 is included. These are some of the new changes: + +- All existing rules (OAR001 - OAR115) have been updated and validated for compatibility with the OpenAPI 3.2 specification. +- Added a comprehensive set of test cases for every rule to ensure correct behavior and validation under OpenAPI 3.2 schemas. +- Enhanced the engine to support new 3.2 structural changes, including updated reference handling and metadata fields. + ## [1.3.6] - 2026-05-05 ### Fixed diff --git a/pom.xml b/pom.xml index c39e397a..177be358 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 org.apiaddicts.apitools.dosonarapi sonaropenapi-rules-community - 1.3.6 + 1.4.0 sonar-plugin SonarQube OpenAPI Community Rules @@ -64,7 +64,7 @@ 8.7.0.41497 6.7 - 1.1.1 + 1.2.0 1.22.0.848 20220320 4.13.2 @@ -94,7 +94,7 @@ org.apiaddicts.apitools.dosonarapi openapi-front-end - 1.1.1 + 1.2.0 org.sonarsource.sonarqube @@ -128,7 +128,7 @@ org.apiaddicts.apitools.dosonarapi openapi-test-tools - 1.1.1 + 1.2.0 junit diff --git a/src/main/java/apiaddicts/sonar/openapi/checks/apim/wso2/AbstractWso2OperationCheck.java b/src/main/java/apiaddicts/sonar/openapi/checks/apim/wso2/AbstractWso2OperationCheck.java index a8b4c7f0..7a4d7496 100644 --- a/src/main/java/apiaddicts/sonar/openapi/checks/apim/wso2/AbstractWso2OperationCheck.java +++ b/src/main/java/apiaddicts/sonar/openapi/checks/apim/wso2/AbstractWso2OperationCheck.java @@ -5,6 +5,8 @@ import apiaddicts.sonar.openapi.checks.BaseCheck; import org.apiaddicts.apitools.dosonarapi.api.v2.OpenApi2Grammar; import org.apiaddicts.apitools.dosonarapi.api.v3.OpenApi3Grammar; +import org.apiaddicts.apitools.dosonarapi.api.v31.OpenApi31Grammar; +import org.apiaddicts.apitools.dosonarapi.api.v32.OpenApi32Grammar; import org.apiaddicts.apitools.dosonarapi.sslr.yaml.grammar.JsonNode; import java.util.Set; @@ -15,7 +17,9 @@ public abstract class AbstractWso2OperationCheck extends BaseCheck { public Set subscribedKinds() { return ImmutableSet.of( OpenApi2Grammar.OPERATION, - OpenApi3Grammar.OPERATION + OpenApi3Grammar.OPERATION, + OpenApi31Grammar.OPERATION, + OpenApi32Grammar.OPERATION ); } diff --git a/src/main/java/apiaddicts/sonar/openapi/checks/apim/wso2/AbstractWso2ScopesCheck.java b/src/main/java/apiaddicts/sonar/openapi/checks/apim/wso2/AbstractWso2ScopesCheck.java index c1bf9f0e..e87b71ff 100644 --- a/src/main/java/apiaddicts/sonar/openapi/checks/apim/wso2/AbstractWso2ScopesCheck.java +++ b/src/main/java/apiaddicts/sonar/openapi/checks/apim/wso2/AbstractWso2ScopesCheck.java @@ -4,6 +4,8 @@ import com.sonar.sslr.api.AstNodeType; import org.apiaddicts.apitools.dosonarapi.api.v2.OpenApi2Grammar; import org.apiaddicts.apitools.dosonarapi.api.v3.OpenApi3Grammar; +import org.apiaddicts.apitools.dosonarapi.api.v31.OpenApi31Grammar; +import org.apiaddicts.apitools.dosonarapi.api.v32.OpenApi32Grammar; import apiaddicts.sonar.openapi.checks.BaseCheck; import org.apiaddicts.apitools.dosonarapi.sslr.yaml.grammar.JsonNode; @@ -14,7 +16,7 @@ public abstract class AbstractWso2ScopesCheck extends BaseCheck { @Override public Set subscribedKinds() { - return ImmutableSet.of(OpenApi2Grammar.ROOT, OpenApi3Grammar.ROOT); + return ImmutableSet.of(OpenApi2Grammar.ROOT, OpenApi3Grammar.ROOT, OpenApi31Grammar.ROOT, OpenApi32Grammar.ROOT); } @Override diff --git a/src/main/java/apiaddicts/sonar/openapi/checks/examples/OAR031ExamplesCheck.java b/src/main/java/apiaddicts/sonar/openapi/checks/examples/OAR031ExamplesCheck.java index 2c4fb058..c98fdeae 100644 --- a/src/main/java/apiaddicts/sonar/openapi/checks/examples/OAR031ExamplesCheck.java +++ b/src/main/java/apiaddicts/sonar/openapi/checks/examples/OAR031ExamplesCheck.java @@ -167,7 +167,9 @@ private void visitSchemaNode(JsonNode node) { } if (parentNode.getType().equals(OpenApi3Grammar.SCHEMA_PROPERTIES) - || parentNode.getType().toString().equals("BLOCK_MAPPING") + || parentNode.getType().equals(OpenApi31Grammar.SCHEMA_PROPERTIES) + || parentNode.getType().equals(OpenApi32Grammar.SCHEMA_PROPERTIES) + || parentNode.getType().toString().equals("BLOCK_MAPPING") || parentNode.getType().toString().equals("FLOW_MAPPING")) { JsonNode schemaParent = (JsonNode) parentNode.getParent().getParent(); diff --git a/src/main/java/apiaddicts/sonar/openapi/checks/format/AbstractDefaultMediaTypeCheck.java b/src/main/java/apiaddicts/sonar/openapi/checks/format/AbstractDefaultMediaTypeCheck.java index 21a8e2ee..1da0417d 100644 --- a/src/main/java/apiaddicts/sonar/openapi/checks/format/AbstractDefaultMediaTypeCheck.java +++ b/src/main/java/apiaddicts/sonar/openapi/checks/format/AbstractDefaultMediaTypeCheck.java @@ -94,13 +94,13 @@ private void visitV2Node(JsonNode node) { } private void visitV3Node(JsonNode node) { - - if (node.getType() == OpenApi3Grammar.OPERATION && section.equals("consumes")) { + AstNodeType type = node.getType(); + if ((type == OpenApi3Grammar.OPERATION || type == OpenApi31Grammar.OPERATION || type == OpenApi32Grammar.OPERATION) && section.equals("consumes")) { handleConsumesOperation(node); return; } - if (node.getType() == OpenApi3Grammar.RESPONSES && section.equals("produces")) { + if ((type == OpenApi3Grammar.RESPONSES || type == OpenApi31Grammar.RESPONSES || type == OpenApi32Grammar.RESPONSES) && section.equals("produces")) { MediaTypeUtils.handleProducesResponses(node, externalRefNode, this::visitContentNode); } } diff --git a/src/main/java/apiaddicts/sonar/openapi/checks/format/AbstractUndefinedMediaTypeCheck.java b/src/main/java/apiaddicts/sonar/openapi/checks/format/AbstractUndefinedMediaTypeCheck.java index 07fd3cf0..7812a758 100644 --- a/src/main/java/apiaddicts/sonar/openapi/checks/format/AbstractUndefinedMediaTypeCheck.java +++ b/src/main/java/apiaddicts/sonar/openapi/checks/format/AbstractUndefinedMediaTypeCheck.java @@ -60,12 +60,13 @@ private void visitV2Node(JsonNode node) { } private void visitV3Node(JsonNode node) { - if (node.getType() == OpenApi3Grammar.OPERATION && section.equals("consumes")) { + AstNodeType type = node.getType(); + if ((type == OpenApi3Grammar.OPERATION || type == OpenApi31Grammar.OPERATION || type == OpenApi32Grammar.OPERATION) && section.equals("consumes")) { handleConsumesOperation(node); return; } - if (node.getType() == OpenApi3Grammar.RESPONSES && section.equals("produces")) { + if ((type == OpenApi3Grammar.RESPONSES || type == OpenApi31Grammar.RESPONSES || type == OpenApi32Grammar.RESPONSES) && section.equals("produces")) { MediaTypeUtils.handleProducesResponses(node, externalRefNode, this::visitContentNode); } } diff --git a/src/main/java/apiaddicts/sonar/openapi/checks/format/OAR011UrlNamingConventionCheck.java b/src/main/java/apiaddicts/sonar/openapi/checks/format/OAR011UrlNamingConventionCheck.java index 4409e791..349f2093 100644 --- a/src/main/java/apiaddicts/sonar/openapi/checks/format/OAR011UrlNamingConventionCheck.java +++ b/src/main/java/apiaddicts/sonar/openapi/checks/format/OAR011UrlNamingConventionCheck.java @@ -57,7 +57,7 @@ private void visitV2Node(JsonNode node) { } private void visitV3Node(JsonNode node) { - if (node.is(OpenApi3Grammar.SERVER)) { + if (node.is(OpenApi3Grammar.SERVER) || node.is(OpenApi31Grammar.SERVER) || node.is(OpenApi32Grammar.SERVER)) { visitV3ServerNode(node); } else { visitPathNode(node); diff --git a/src/main/java/apiaddicts/sonar/openapi/checks/format/OAR044MediaTypeCheck.java b/src/main/java/apiaddicts/sonar/openapi/checks/format/OAR044MediaTypeCheck.java index 50ce1ec7..aa7992ef 100644 --- a/src/main/java/apiaddicts/sonar/openapi/checks/format/OAR044MediaTypeCheck.java +++ b/src/main/java/apiaddicts/sonar/openapi/checks/format/OAR044MediaTypeCheck.java @@ -61,7 +61,7 @@ public class OAR044MediaTypeCheck extends BaseCheck { @Override public Set subscribedKinds() { - return Sets.newHashSet(OpenApi2Grammar.ROOT, OpenApi2Grammar.OPERATION, OpenApi3Grammar.OPERATION, OpenApi3Grammar.RESPONSE, OpenApi3Grammar.RESPONSES, OpenApi3Grammar.REQUEST_BODY, OpenApi3Grammar.PARAMETER, OpenApi31Grammar.PARAMETER, OpenApi31Grammar.REQUEST_BODY, OpenApi31Grammar.RESPONSE, OpenApi32Grammar.PARAMETER, OpenApi32Grammar.REQUEST_BODY, OpenApi32Grammar.RESPONSE); + return Sets.newHashSet(OpenApi2Grammar.ROOT, OpenApi2Grammar.OPERATION, OpenApi3Grammar.OPERATION, OpenApi3Grammar.RESPONSE, OpenApi3Grammar.RESPONSES, OpenApi3Grammar.REQUEST_BODY, OpenApi3Grammar.PARAMETER, OpenApi31Grammar.PARAMETER, OpenApi31Grammar.REQUEST_BODY, OpenApi31Grammar.RESPONSE, OpenApi31Grammar.RESPONSES, OpenApi31Grammar.OPERATION, OpenApi32Grammar.PARAMETER, OpenApi32Grammar.REQUEST_BODY, OpenApi32Grammar.RESPONSE, OpenApi32Grammar.RESPONSES, OpenApi32Grammar.OPERATION); } @Override diff --git a/src/main/java/apiaddicts/sonar/openapi/checks/format/OAR086DescriptionFormatCheck.java b/src/main/java/apiaddicts/sonar/openapi/checks/format/OAR086DescriptionFormatCheck.java index 44c1ebb4..7552ee40 100644 --- a/src/main/java/apiaddicts/sonar/openapi/checks/format/OAR086DescriptionFormatCheck.java +++ b/src/main/java/apiaddicts/sonar/openapi/checks/format/OAR086DescriptionFormatCheck.java @@ -30,19 +30,19 @@ public class OAR086DescriptionFormatCheck extends BaseCheck { @Override public Set subscribedKinds() { - return ImmutableSet.of(OpenApi2Grammar.ROOT, OpenApi3Grammar.ROOT, OpenApi31Grammar.ROOT, OpenApi2Grammar.PATHS, OpenApi3Grammar.PATHS, OpenApi31Grammar.PATHS, OpenApi2Grammar.OPERATION, OpenApi3Grammar.OPERATION, OpenApi31Grammar.OPERATION, OpenApi2Grammar.PATH, OpenApi3Grammar.PATH, OpenApi31Grammar.PATH); + return ImmutableSet.of(OpenApi2Grammar.ROOT, OpenApi3Grammar.ROOT, OpenApi31Grammar.ROOT, OpenApi32Grammar.ROOT, OpenApi2Grammar.PATHS, OpenApi3Grammar.PATHS, OpenApi31Grammar.PATHS, OpenApi32Grammar.PATHS, OpenApi2Grammar.OPERATION, OpenApi3Grammar.OPERATION, OpenApi31Grammar.OPERATION, OpenApi32Grammar.OPERATION, OpenApi2Grammar.PATH, OpenApi3Grammar.PATH, OpenApi31Grammar.PATH, OpenApi32Grammar.PATH); } @Override public void visitNode(JsonNode node) { - if (OpenApi2Grammar.ROOT.equals(node.getType()) || OpenApi3Grammar.ROOT.equals(node.getType()) || OpenApi31Grammar.ROOT.equals(node.getType())) { + if (OpenApi2Grammar.ROOT.equals(node.getType()) || OpenApi3Grammar.ROOT.equals(node.getType()) || OpenApi31Grammar.ROOT.equals(node.getType()) || OpenApi32Grammar.ROOT.equals(node.getType())) { checkInfoDescription(node); checkDefinitionsDescription(node); } - if (OpenApi2Grammar.PATHS.equals(node.getType()) || OpenApi3Grammar.PATHS.equals(node.getType())|| OpenApi31Grammar.PATHS.equals(node.getType())) { + if (OpenApi2Grammar.PATHS.equals(node.getType()) || OpenApi3Grammar.PATHS.equals(node.getType()) || OpenApi31Grammar.PATHS.equals(node.getType()) || OpenApi32Grammar.PATHS.equals(node.getType())) { visitPathsNode(node); } - if (OpenApi2Grammar.PATH.equals(node.getType()) || OpenApi3Grammar.PATH.equals(node.getType()) || OpenApi31Grammar.PATH.equals(node.getType())) { + if (OpenApi2Grammar.PATH.equals(node.getType()) || OpenApi3Grammar.PATH.equals(node.getType()) || OpenApi31Grammar.PATH.equals(node.getType()) || OpenApi32Grammar.PATH.equals(node.getType())) { visitPathNode(node); } } @@ -113,9 +113,10 @@ private void visitPathNode(JsonNode node) { .filter(responses -> !responses.isMissing()) .flatMap(responses -> responses.propertyMap().values().stream()) .forEach(response -> handleExternalRef.resolve(response, resolved -> { - if (resolved.getType().equals(OpenApi2Grammar.RESPONSE)) { + AstNodeType responseType = resolved.getType(); + if (responseType.equals(OpenApi2Grammar.RESPONSE)) { visitSchemaNode(resolved); - } else if (resolved.getType().equals(OpenApi3Grammar.RESPONSE)) { + } else if (responseType.equals(OpenApi3Grammar.RESPONSE) || responseType.equals(OpenApi31Grammar.RESPONSE) || responseType.equals(OpenApi32Grammar.RESPONSE)) { resolved.at("/content").propertyMap().forEach((mediaType, mediaTypeNode) -> { if (mediaType.toLowerCase().contains("json")) visitSchemaNode(mediaTypeNode); }); diff --git a/src/test/java/apiaddicts/sonar/openapi/checks/parameters/OAR028FilterParameterCheckTest.java b/src/test/java/apiaddicts/sonar/openapi/checks/parameters/OAR028FilterParameterCheckTest.java index 4502efd2..9fdee131 100644 --- a/src/test/java/apiaddicts/sonar/openapi/checks/parameters/OAR028FilterParameterCheckTest.java +++ b/src/test/java/apiaddicts/sonar/openapi/checks/parameters/OAR028FilterParameterCheckTest.java @@ -99,10 +99,14 @@ public void verifyInV3ExcludeStrategy() { } @Test public void verifyInV31ExcludeStrategy() { + setField("pathCheckStrategy", "/exclude"); + setField("pathsStr", "/examples"); verifyV31("exclude-noncompliant"); } @Test public void verifyInV32ExcludeStrategy() { + setField("pathCheckStrategy", "/exclude"); + setField("pathsStr", "/examples"); verifyV32("exclude-noncompliant"); } diff --git a/src/test/java/apiaddicts/sonar/openapi/checks/regex/OAR112RegexCheckTest.java b/src/test/java/apiaddicts/sonar/openapi/checks/regex/OAR112RegexCheckTest.java index 5974a8fd..58533ad5 100644 --- a/src/test/java/apiaddicts/sonar/openapi/checks/regex/OAR112RegexCheckTest.java +++ b/src/test/java/apiaddicts/sonar/openapi/checks/regex/OAR112RegexCheckTest.java @@ -88,10 +88,12 @@ public void verifyServersDescriptionInvalidInV3() { } @Test public void verifyServersDescriptionInvalidInV31() { + setField("nodes", "servers/description"); verifyV31("servers-invalid"); } @Test public void verifyServersDescriptionInvalidInV32() { + setField("nodes", "servers/description"); verifyV32("servers-invalid"); } @@ -116,10 +118,12 @@ public void verifyOperationSummaryInvalidInV3() { } @Test public void verifyOperationSummaryInvalidInV31() { + setField("nodes", "paths/get/summary"); verifyV31("operation-invalid"); } @Test public void verifyOperationSummaryInvalidInV32() { + setField("nodes", "paths/get/summary"); verifyV32("operation-invalid"); } @@ -156,10 +160,12 @@ public void verifyTagsNameInvalidInV3() { } @Test public void verifyTagsNameInvalidInV31() { + setField("nodes", "tags/name"); verifyV31("tags-invalid"); } @Test public void verifyTagsNameInvalidInV32() { + setField("nodes", "tags/name"); verifyV32("tags-invalid"); } @@ -196,10 +202,12 @@ public void verifyExternalDocsDescriptionInvalidInV3() { } @Test public void verifyExternalDocsDescriptionInvalidInV31() { + setField("nodes", "externalDocs/description"); verifyV31("external-docs-invalid"); } @Test public void verifyExternalDocsDescriptionInvalidInV32() { + setField("nodes", "externalDocs/description"); verifyV32("external-docs-invalid"); } @@ -236,10 +244,12 @@ public void verifyParametersDescriptionInvalidInV3() { } @Test public void verifyParametersDescriptionInvalidInV31() { + setField("nodes", "paths/get/parameters/description"); verifyV31("parameters-invalid"); } @Test public void verifyParametersDescriptionInvalidInV32() { + setField("nodes", "paths/get/parameters/description"); verifyV32("parameters-invalid"); } diff --git a/src/test/java/apiaddicts/sonar/openapi/checks/security/OAR085OpenAPIVersionCheckTest.java b/src/test/java/apiaddicts/sonar/openapi/checks/security/OAR085OpenAPIVersionCheckTest.java index cf5e9875..10a7feff 100644 --- a/src/test/java/apiaddicts/sonar/openapi/checks/security/OAR085OpenAPIVersionCheckTest.java +++ b/src/test/java/apiaddicts/sonar/openapi/checks/security/OAR085OpenAPIVersionCheckTest.java @@ -63,6 +63,6 @@ public void verifyRule() { @Override public void verifyParameters() { assertNumberOfParameters(1); - assertParameterProperties("valid-versions", "2.0,3.0.0,3.0.1,3.0.2,3.0.3,3.1.0", RuleParamType.STRING); + assertParameterProperties("valid-versions", "2.0,3.0.0,3.0.1,3.0.2,3.0.3,3.1.0,3.2.0", RuleParamType.STRING); } } \ No newline at end of file diff --git a/src/test/resources/checks/v31/apim/OAR002/with-empty-scopes.json b/src/test/resources/checks/v31/apim/OAR002/with-empty-scopes.json new file mode 100644 index 00000000..86dd3681 --- /dev/null +++ b/src/test/resources/checks/v31/apim/OAR002/with-empty-scopes.json @@ -0,0 +1,15 @@ +{ + "openapi" : "3.1.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/pets" : { } + }, + "x-wso2-security" : { + "apim" : { + "x-wso2-scopes" : [ ] # Noncompliant {{OAR002: WSO2 scopes definition is wrong}} + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/apim/OAR002/with-empty-scopes.yaml b/src/test/resources/checks/v31/apim/OAR002/with-empty-scopes.yaml new file mode 100644 index 00000000..05a0c109 --- /dev/null +++ b/src/test/resources/checks/v31/apim/OAR002/with-empty-scopes.yaml @@ -0,0 +1,10 @@ +openapi: "3.1.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: {} + +x-wso2-security: + apim: + x-wso2-scopes: [] # Noncompliant {{OAR002: WSO2 scopes definition is wrong}} \ No newline at end of file diff --git a/src/test/resources/checks/v31/apim/OAR002/with-null-scopes.json b/src/test/resources/checks/v31/apim/OAR002/with-null-scopes.json new file mode 100644 index 00000000..951533cb --- /dev/null +++ b/src/test/resources/checks/v31/apim/OAR002/with-null-scopes.json @@ -0,0 +1,15 @@ +{ + "openapi" : "3.1.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/pets" : { } + }, + "x-wso2-security" : { + "apim" : { + "x-wso2-scopes" : null # Noncompliant {{OAR002: WSO2 scopes definition is wrong}} + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/apim/OAR002/with-null-scopes.yaml b/src/test/resources/checks/v31/apim/OAR002/with-null-scopes.yaml new file mode 100644 index 00000000..d61474e7 --- /dev/null +++ b/src/test/resources/checks/v31/apim/OAR002/with-null-scopes.yaml @@ -0,0 +1,10 @@ +openapi: "3.1.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: {} + +x-wso2-security: + apim: + x-wso2-scopes: null # Noncompliant {{OAR002: WSO2 scopes definition is wrong}} \ No newline at end of file diff --git a/src/test/resources/checks/v31/apim/OAR002/with-scopes.json b/src/test/resources/checks/v31/apim/OAR002/with-scopes.json new file mode 100644 index 00000000..807c5ce0 --- /dev/null +++ b/src/test/resources/checks/v31/apim/OAR002/with-scopes.json @@ -0,0 +1,36 @@ +{ + "openapi" : "3.1.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/pets" : { } + }, + "x-wso2-security" : { + "apim" : { + "x-wso2-scopes" : [ { # Noncompliant {{OAR002: WSO2 scope 'key' is required}} + "name" : "read", + "roles" : "ROLE_READ" + }, { # Noncompliant {{OAR002: WSO2 scope 'roles' is required}} + "name" : "write", + "key" : "write" + }, { # Noncompliant {{OAR002: WSO2 scope 'name' is required}} + "key" : "view", + "roles" : "ROLE_VIEW" + }, { + "name" : "read2", + "roles" : "ROLE_READ_2", + "key" : null # Noncompliant {{OAR002: WSO2 scope 'key' is required}} + }, { + "name" : "write2", + "key" : "write2", + "roles" : null # Noncompliant {{OAR002: WSO2 scope 'roles' is required}} + }, { + "key" : "view2", + "roles" : "ROLE_VIEW_2", + "name" : null # Noncompliant {{OAR002: WSO2 scope 'name' is required}} + } ] + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/apim/OAR002/with-scopes.yaml b/src/test/resources/checks/v31/apim/OAR002/with-scopes.yaml new file mode 100644 index 00000000..3c78c8ee --- /dev/null +++ b/src/test/resources/checks/v31/apim/OAR002/with-scopes.yaml @@ -0,0 +1,25 @@ +openapi: "3.1.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: {} + +x-wso2-security: + apim: + x-wso2-scopes: + - name: read # Noncompliant {{OAR002: WSO2 scope 'key' is required}} + roles: ROLE_READ + - name: write # Noncompliant {{OAR002: WSO2 scope 'roles' is required}} + key: write + - key: view # Noncompliant {{OAR002: WSO2 scope 'name' is required}} + roles: ROLE_VIEW + - name: read2 + roles: ROLE_READ_2 + key: null # Noncompliant {{OAR002: WSO2 scope 'key' is required}} + - name: write2 + key: write2 + roles: null # Noncompliant {{OAR002: WSO2 scope 'roles' is required}} + - key: view2 + roles: ROLE_VIEW_2 + name: null # Noncompliant {{OAR002: WSO2 scope 'name' is required}} \ No newline at end of file diff --git a/src/test/resources/checks/v31/apim/OAR002/without-scopes.json b/src/test/resources/checks/v31/apim/OAR002/without-scopes.json new file mode 100644 index 00000000..ef8e7c9f --- /dev/null +++ b/src/test/resources/checks/v31/apim/OAR002/without-scopes.json @@ -0,0 +1,13 @@ +{ + "openapi" : "3.1.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/pets" : { } + }, + "x-wso2-security" : { + "apim" : null + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/apim/OAR002/without-scopes.yaml b/src/test/resources/checks/v31/apim/OAR002/without-scopes.yaml new file mode 100644 index 00000000..1122903d --- /dev/null +++ b/src/test/resources/checks/v31/apim/OAR002/without-scopes.yaml @@ -0,0 +1,9 @@ +openapi: "3.1.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: {} + +x-wso2-security: + apim: null \ No newline at end of file diff --git a/src/test/resources/checks/v31/apim/OAR002/without-security.json b/src/test/resources/checks/v31/apim/OAR002/without-security.json new file mode 100644 index 00000000..f33ac2ec --- /dev/null +++ b/src/test/resources/checks/v31/apim/OAR002/without-security.json @@ -0,0 +1,10 @@ +{ + "openapi" : "3.1.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/pets" : { } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/apim/OAR002/without-security.yaml b/src/test/resources/checks/v31/apim/OAR002/without-security.yaml new file mode 100644 index 00000000..5f9407a2 --- /dev/null +++ b/src/test/resources/checks/v31/apim/OAR002/without-security.yaml @@ -0,0 +1,6 @@ +openapi: "3.1.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: {} \ No newline at end of file diff --git a/src/test/resources/checks/v31/apim/OAR003/with-description.json b/src/test/resources/checks/v31/apim/OAR003/with-description.json new file mode 100644 index 00000000..a413fbdc --- /dev/null +++ b/src/test/resources/checks/v31/apim/OAR003/with-description.json @@ -0,0 +1,20 @@ +{ + "openapi" : "3.1.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/pets" : { } + }, + "x-wso2-security" : { + "apim" : { + "x-wso2-scopes" : [ { + "name" : "read", + "key" : "read", + "roles" : "ROLE_READ", + "description" : "Allows users to read records" + } ] + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/apim/OAR003/with-description.yaml b/src/test/resources/checks/v31/apim/OAR003/with-description.yaml new file mode 100644 index 00000000..a985339a --- /dev/null +++ b/src/test/resources/checks/v31/apim/OAR003/with-description.yaml @@ -0,0 +1,14 @@ +openapi: "3.1.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: {} + +x-wso2-security: + apim: + x-wso2-scopes: + - name: read + key: read + roles: ROLE_READ + description: Allows users to read records \ No newline at end of file diff --git a/src/test/resources/checks/v31/apim/OAR003/with-null-description.json b/src/test/resources/checks/v31/apim/OAR003/with-null-description.json new file mode 100644 index 00000000..5f3dde3d --- /dev/null +++ b/src/test/resources/checks/v31/apim/OAR003/with-null-description.json @@ -0,0 +1,20 @@ +{ + "openapi" : "3.1.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/pets" : { } + }, + "x-wso2-security" : { + "apim" : { + "x-wso2-scopes" : [ { + "name" : "read", + "key" : "read", + "roles" : "ROLE_READ", + "description" : null # Noncompliant {{OAR003: WSO2 scope 'description' is recommended}} + } ] + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/apim/OAR003/with-null-description.yaml b/src/test/resources/checks/v31/apim/OAR003/with-null-description.yaml new file mode 100644 index 00000000..6c14ec1c --- /dev/null +++ b/src/test/resources/checks/v31/apim/OAR003/with-null-description.yaml @@ -0,0 +1,14 @@ +openapi: "3.1.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: {} + +x-wso2-security: + apim: + x-wso2-scopes: + - name: read + key: read + roles: ROLE_READ + description: null # Noncompliant {{OAR003: WSO2 scope 'description' is recommended}} \ No newline at end of file diff --git a/src/test/resources/checks/v31/apim/OAR003/without-description.json b/src/test/resources/checks/v31/apim/OAR003/without-description.json new file mode 100644 index 00000000..f2dbc4eb --- /dev/null +++ b/src/test/resources/checks/v31/apim/OAR003/without-description.json @@ -0,0 +1,19 @@ +{ + "openapi" : "3.1.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/pets" : { } + }, + "x-wso2-security" : { + "apim" : { + "x-wso2-scopes" : [ { # Noncompliant {{OAR003: WSO2 scope 'description' is recommended}} + "name" : "read", + "key" : "read", + "roles" : "ROLE_READ" + } ] + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/apim/OAR003/without-description.yaml b/src/test/resources/checks/v31/apim/OAR003/without-description.yaml new file mode 100644 index 00000000..d19fc16f --- /dev/null +++ b/src/test/resources/checks/v31/apim/OAR003/without-description.yaml @@ -0,0 +1,13 @@ +openapi: "3.1.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: {} + +x-wso2-security: + apim: + x-wso2-scopes: + - name: read # Noncompliant {{OAR003: WSO2 scope 'description' is recommended}} + key: read + roles: ROLE_READ \ No newline at end of file diff --git a/src/test/resources/checks/v31/apim/OAR004/with-invalid-roles.json b/src/test/resources/checks/v31/apim/OAR004/with-invalid-roles.json new file mode 100644 index 00000000..6d2e1cb8 --- /dev/null +++ b/src/test/resources/checks/v31/apim/OAR004/with-invalid-roles.json @@ -0,0 +1,20 @@ +{ + "openapi" : "3.1.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/pets" : { } + }, + "x-wso2-security" : { + "apim" : { + "x-wso2-scopes" : [ { + "name" : "read", + "key" : "read", + "roles" : "ROLE_READ, ROL€_V¡€U", # Noncompliant {{OAR004: WSO2 scope roles value is not valid}} + "description" : "Allows users to read records" + } ] + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/apim/OAR004/with-invalid-roles.yaml b/src/test/resources/checks/v31/apim/OAR004/with-invalid-roles.yaml new file mode 100644 index 00000000..0f470c00 --- /dev/null +++ b/src/test/resources/checks/v31/apim/OAR004/with-invalid-roles.yaml @@ -0,0 +1,14 @@ +openapi: "3.1.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: {} + +x-wso2-security: + apim: + x-wso2-scopes: + - name: read + key: read + roles: ROLE_READ, ROL€_V¡€U # Noncompliant {{OAR004: WSO2 scope roles value is not valid}} + description: Allows users to read records \ No newline at end of file diff --git a/src/test/resources/checks/v31/apim/OAR004/with-valid-roles.json b/src/test/resources/checks/v31/apim/OAR004/with-valid-roles.json new file mode 100644 index 00000000..c3941d96 --- /dev/null +++ b/src/test/resources/checks/v31/apim/OAR004/with-valid-roles.json @@ -0,0 +1,20 @@ +{ + "openapi" : "3.1.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/pets" : { } + }, + "x-wso2-security" : { + "apim" : { + "x-wso2-scopes" : [ { + "name" : "read", + "key" : "read", + "roles" : "ROLE_READ, ROLE_VIEW", + "description" : "Allows users to read records" + } ] + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/apim/OAR004/with-valid-roles.yaml b/src/test/resources/checks/v31/apim/OAR004/with-valid-roles.yaml new file mode 100644 index 00000000..9cab865c --- /dev/null +++ b/src/test/resources/checks/v31/apim/OAR004/with-valid-roles.yaml @@ -0,0 +1,14 @@ +openapi: "3.1.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: {} + +x-wso2-security: + apim: + x-wso2-scopes: + - name: read + key: read + roles: ROLE_READ, ROLE_VIEW + description: Allows users to read records \ No newline at end of file diff --git a/src/test/resources/checks/v31/apim/OAR005/with-correct-operation-scope.json b/src/test/resources/checks/v31/apim/OAR005/with-correct-operation-scope.json new file mode 100644 index 00000000..db247ec0 --- /dev/null +++ b/src/test/resources/checks/v31/apim/OAR005/with-correct-operation-scope.json @@ -0,0 +1,34 @@ +{ + "openapi" : "3.1.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/pets" : { + "get" : { + "responses" : { + "200" : { + "description" : "Ok" + } + }, + "x-scope" : "scope_two" + } + } + }, + "x-wso2-security" : { + "apim" : { + "x-wso2-scopes" : [ { + "name" : "scope_one", + "description" : "scope_one", + "key" : "scope_one", + "roles" : "role_one" + }, { + "name" : "scope_two", + "description" : "scope_two", + "key" : "scope_two", + "roles" : "role_two" + } ] + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/apim/OAR005/with-correct-operation-scope.yaml b/src/test/resources/checks/v31/apim/OAR005/with-correct-operation-scope.yaml new file mode 100644 index 00000000..c133f505 --- /dev/null +++ b/src/test/resources/checks/v31/apim/OAR005/with-correct-operation-scope.yaml @@ -0,0 +1,23 @@ +openapi: "3.1.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: + get: + responses: + 200: + description: Ok + x-scope: scope_two + +x-wso2-security: + apim: + x-wso2-scopes: + - name: scope_one + description: scope_one + key: scope_one + roles: role_one + - name: scope_two + description: scope_two + key: scope_two + roles: role_two \ No newline at end of file diff --git a/src/test/resources/checks/v31/apim/OAR005/with-null-operation-scope.json b/src/test/resources/checks/v31/apim/OAR005/with-null-operation-scope.json new file mode 100644 index 00000000..0857015b --- /dev/null +++ b/src/test/resources/checks/v31/apim/OAR005/with-null-operation-scope.json @@ -0,0 +1,34 @@ +{ + "openapi" : "3.1.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/pets" : { + "get" : { + "responses" : { + "200" : { + "description" : "Ok" + } + }, + "x-scope" : null # Noncompliant {{OAR005: WSO2 scope definition does not exists}} + } + } + }, + "x-wso2-security" : { + "apim" : { + "x-wso2-scopes" : [ { + "name" : "scope_one", + "description" : "scope_one", + "key" : "scope_one", + "roles" : "role_one" + }, { + "name" : "scope_two", + "description" : "scope_two", + "key" : "scope_two", + "roles" : "role_two" + } ] + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/apim/OAR005/with-null-operation-scope.yaml b/src/test/resources/checks/v31/apim/OAR005/with-null-operation-scope.yaml new file mode 100644 index 00000000..456fbe2f --- /dev/null +++ b/src/test/resources/checks/v31/apim/OAR005/with-null-operation-scope.yaml @@ -0,0 +1,23 @@ +openapi: "3.1.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: + get: + responses: + 200: + description: Ok + x-scope: null # Noncompliant {{OAR005: WSO2 scope definition does not exists}} + +x-wso2-security: + apim: + x-wso2-scopes: + - name: scope_one + description: scope_one + key: scope_one + roles: role_one + - name: scope_two + description: scope_two + key: scope_two + roles: role_two \ No newline at end of file diff --git a/src/test/resources/checks/v31/apim/OAR005/with-wrong-operation-scope.json b/src/test/resources/checks/v31/apim/OAR005/with-wrong-operation-scope.json new file mode 100644 index 00000000..b497904f --- /dev/null +++ b/src/test/resources/checks/v31/apim/OAR005/with-wrong-operation-scope.json @@ -0,0 +1,34 @@ +{ + "openapi" : "3.1.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/pets" : { + "get" : { + "responses" : { + "200" : { + "description" : "Ok" + } + }, + "x-scope" : "scope_five" # Noncompliant {{OAR005: WSO2 scope definition does not exists}} + } + } + }, + "x-wso2-security" : { + "apim" : { + "x-wso2-scopes" : [ { + "name" : "scope_one", + "description" : "scope_one", + "key" : "scope_one", + "roles" : "role_one" + }, { + "name" : "scope_two", + "description" : "scope_two", + "key" : "scope_two", + "roles" : "role_two, role_x" + } ] + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/apim/OAR005/with-wrong-operation-scope.yaml b/src/test/resources/checks/v31/apim/OAR005/with-wrong-operation-scope.yaml new file mode 100644 index 00000000..edd510b9 --- /dev/null +++ b/src/test/resources/checks/v31/apim/OAR005/with-wrong-operation-scope.yaml @@ -0,0 +1,23 @@ +openapi: "3.1.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: + get: + responses: + 200: + description: Ok + x-scope: scope_five # Noncompliant {{OAR005: WSO2 scope definition does not exists}} + +x-wso2-security: + apim: + x-wso2-scopes: + - name: scope_one + description: scope_one + key: scope_one + roles: role_one + - name: scope_two + description: scope_two + key: scope_two + roles: role_two, role_x \ No newline at end of file diff --git a/src/test/resources/checks/v31/apim/OAR040/invalid.json b/src/test/resources/checks/v31/apim/OAR040/invalid.json new file mode 100644 index 00000000..802839a0 --- /dev/null +++ b/src/test/resources/checks/v31/apim/OAR040/invalid.json @@ -0,0 +1,23 @@ +{ + "openapi" : "3.1.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/pets" : { } + }, + "x-wso2-security" : { + "apim" : { + "x-wso2-scopes" : [ { + "name" : "app" # Noncompliant {{OAR040: WSO2 scope name value is non compliant with the standard}} + }, { + "name" : "app1_sc_ran" # Noncompliant {{OAR040: WSO2 scope name value is non compliant with the standard}} + }, { + "name" : "GENE_Sc_ran" # Noncompliant {{OAR040: WSO2 scope name value is non compliant with the standard}} + }, { + "name" : "X_SC_A" # Noncompliant {{OAR040: WSO2 scope name value is non compliant with the standard}} + } ] + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/apim/OAR040/invalid.yaml b/src/test/resources/checks/v31/apim/OAR040/invalid.yaml new file mode 100644 index 00000000..0f445609 --- /dev/null +++ b/src/test/resources/checks/v31/apim/OAR040/invalid.yaml @@ -0,0 +1,14 @@ +openapi: "3.1.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: {} + +x-wso2-security: + apim: + x-wso2-scopes: + - name: app # Noncompliant {{OAR040: WSO2 scope name value is non compliant with the standard}} + - name: app1_sc_ran # Noncompliant {{OAR040: WSO2 scope name value is non compliant with the standard}} + - name: GENE_Sc_ran # Noncompliant {{OAR040: WSO2 scope name value is non compliant with the standard}} + - name: X_SC_A # Noncompliant {{OAR040: WSO2 scope name value is non compliant with the standard}} \ No newline at end of file diff --git a/src/test/resources/checks/v31/apim/OAR040/valid.json b/src/test/resources/checks/v31/apim/OAR040/valid.json new file mode 100644 index 00000000..4b5ebfe5 --- /dev/null +++ b/src/test/resources/checks/v31/apim/OAR040/valid.json @@ -0,0 +1,19 @@ +{ + "openapi" : "3.1.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/pets" : { } + }, + "x-wso2-security" : { + "apim" : { + "x-wso2-scopes" : [ { + "name" : "xfcn_sc_1" + }, { + "name" : "GENGA_SC_RE1" + } ] + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/apim/OAR040/valid.yaml b/src/test/resources/checks/v31/apim/OAR040/valid.yaml new file mode 100644 index 00000000..7de6120f --- /dev/null +++ b/src/test/resources/checks/v31/apim/OAR040/valid.yaml @@ -0,0 +1,12 @@ +openapi: "3.1.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: {} + +x-wso2-security: + apim: + x-wso2-scopes: + - name: xfcn_sc_1 + - name: GENGA_SC_RE1 \ No newline at end of file diff --git a/src/test/resources/checks/v31/apim/OAR041/with-scope-and-auth.json b/src/test/resources/checks/v31/apim/OAR041/with-scope-and-auth.json new file mode 100644 index 00000000..a9ecb0a2 --- /dev/null +++ b/src/test/resources/checks/v31/apim/OAR041/with-scope-and-auth.json @@ -0,0 +1,35 @@ +{ + "openapi" : "3.1.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/pets" : { + "get" : { + "responses" : { + "200" : { + "description" : "Ok" + } + }, + "x-scope" : "scope_two", + "x-auth-type" : "Application" + } + } + }, + "x-wso2-security" : { + "apim" : { + "x-wso2-scopes" : [ { + "name" : "scope_one", + "description" : "scope_one", + "key" : "scope_one", + "roles" : "role_one" + }, { + "name" : "scope_two", + "description" : "scope_two", + "key" : "scope_two", + "roles" : "role_two" + } ] + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/apim/OAR041/with-scope-and-auth.yaml b/src/test/resources/checks/v31/apim/OAR041/with-scope-and-auth.yaml new file mode 100644 index 00000000..740a0852 --- /dev/null +++ b/src/test/resources/checks/v31/apim/OAR041/with-scope-and-auth.yaml @@ -0,0 +1,24 @@ +openapi: "3.1.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: + get: + responses: + 200: + description: Ok + x-scope: scope_two + x-auth-type: "Application" + +x-wso2-security: + apim: + x-wso2-scopes: + - name: scope_one + description: scope_one + key: scope_one + roles: role_one + - name: scope_two + description: scope_two + key: scope_two + roles: role_two \ No newline at end of file diff --git a/src/test/resources/checks/v31/apim/OAR041/with-scope-without-auth.json b/src/test/resources/checks/v31/apim/OAR041/with-scope-without-auth.json new file mode 100644 index 00000000..dbca04d4 --- /dev/null +++ b/src/test/resources/checks/v31/apim/OAR041/with-scope-without-auth.json @@ -0,0 +1,34 @@ +{ + "openapi" : "3.1.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/pets" : { + "get" : { + "responses" : { + "200" : { + "description" : "Ok" + } + }, + "x-scope" : "scope_two" # Noncompliant {{OAR041: WSO2 x-scope requires x-auth-type definition}} + } + } + }, + "x-wso2-security" : { + "apim" : { + "x-wso2-scopes" : [ { + "name" : "scope_one", + "description" : "scope_one", + "key" : "scope_one", + "roles" : "role_one" + }, { + "name" : "scope_two", + "description" : "scope_two", + "key" : "scope_two", + "roles" : "role_two" + } ] + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/apim/OAR041/with-scope-without-auth.yaml b/src/test/resources/checks/v31/apim/OAR041/with-scope-without-auth.yaml new file mode 100644 index 00000000..833dd710 --- /dev/null +++ b/src/test/resources/checks/v31/apim/OAR041/with-scope-without-auth.yaml @@ -0,0 +1,23 @@ +openapi: "3.1.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: + get: + responses: + 200: + description: Ok + x-scope: scope_two # Noncompliant {{OAR041: WSO2 x-scope requires x-auth-type definition}} + +x-wso2-security: + apim: + x-wso2-scopes: + - name: scope_one + description: scope_one + key: scope_one + roles: role_one + - name: scope_two + description: scope_two + key: scope_two + roles: role_two \ No newline at end of file diff --git a/src/test/resources/checks/v31/apim/OAR041/without-scope-and-auth.json b/src/test/resources/checks/v31/apim/OAR041/without-scope-and-auth.json new file mode 100644 index 00000000..3eb83d1d --- /dev/null +++ b/src/test/resources/checks/v31/apim/OAR041/without-scope-and-auth.json @@ -0,0 +1,33 @@ +{ + "openapi" : "3.1.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/pets" : { + "get" : { + "responses" : { + "200" : { + "description" : "Ok" + } + } + } + } + }, + "x-wso2-security" : { + "apim" : { + "x-wso2-scopes" : [ { + "name" : "scope_one", + "description" : "scope_one", + "key" : "scope_one", + "roles" : "role_one" + }, { + "name" : "scope_two", + "description" : "scope_two", + "key" : "scope_two", + "roles" : "role_two" + } ] + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/apim/OAR041/without-scope-and-auth.yaml b/src/test/resources/checks/v31/apim/OAR041/without-scope-and-auth.yaml new file mode 100644 index 00000000..c25eabfc --- /dev/null +++ b/src/test/resources/checks/v31/apim/OAR041/without-scope-and-auth.yaml @@ -0,0 +1,22 @@ +openapi: "3.1.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: + get: + responses: + 200: + description: Ok + +x-wso2-security: + apim: + x-wso2-scopes: + - name: scope_one + description: scope_one + key: scope_one + roles: role_one + - name: scope_two + description: scope_two + key: scope_two + roles: role_two \ No newline at end of file diff --git a/src/test/resources/checks/v31/core/OAR044/media-type.json b/src/test/resources/checks/v31/core/OAR044/media-type.json index 992ea7bd..938aab91 100644 --- a/src/test/resources/checks/v31/core/OAR044/media-type.json +++ b/src/test/resources/checks/v31/core/OAR044/media-type.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.1", + "openapi" : "3.1.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v31/core/OAR044/media-type.yaml b/src/test/resources/checks/v31/core/OAR044/media-type.yaml index 80aba718..67d72d30 100644 --- a/src/test/resources/checks/v31/core/OAR044/media-type.yaml +++ b/src/test/resources/checks/v31/core/OAR044/media-type.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.1" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/core/OAR045/defined-response.json b/src/test/resources/checks/v31/core/OAR045/defined-response.json index f86d6ac4..b73d9c78 100644 --- a/src/test/resources/checks/v31/core/OAR045/defined-response.json +++ b/src/test/resources/checks/v31/core/OAR045/defined-response.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v31/core/OAR045/defined-response.yaml b/src/test/resources/checks/v31/core/OAR045/defined-response.yaml index 4370ac6c..6540560a 100644 --- a/src/test/resources/checks/v31/core/OAR045/defined-response.yaml +++ b/src/test/resources/checks/v31/core/OAR045/defined-response.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.0 +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/core/OAR046/declared-tag.json b/src/test/resources/checks/v31/core/OAR046/declared-tag.json index 82549a89..ba269228 100644 --- a/src/test/resources/checks/v31/core/OAR046/declared-tag.json +++ b/src/test/resources/checks/v31/core/OAR046/declared-tag.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.1", + "openapi" : "3.1.0", "tags" : [ { "name" : "used-tag", "description" : "a tag referenced in the operations" diff --git a/src/test/resources/checks/v31/core/OAR046/declared-tag.yaml b/src/test/resources/checks/v31/core/OAR046/declared-tag.yaml index 2bf092e6..ad2e2943 100644 --- a/src/test/resources/checks/v31/core/OAR046/declared-tag.yaml +++ b/src/test/resources/checks/v31/core/OAR046/declared-tag.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.1" +openapi: "3.1.0" tags: - name: used-tag description: a tag referenced in the operations diff --git a/src/test/resources/checks/v31/core/OAR047/documented-tag.json b/src/test/resources/checks/v31/core/OAR047/documented-tag.json index 12326a3a..699a856b 100644 --- a/src/test/resources/checks/v31/core/OAR047/documented-tag.json +++ b/src/test/resources/checks/v31/core/OAR047/documented-tag.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.1", + "openapi" : "3.1.0", "tags" : [ { "name" : "used-tag", "description" : "a tag referenced in the operations" diff --git a/src/test/resources/checks/v31/core/OAR047/documented-tag.yaml b/src/test/resources/checks/v31/core/OAR047/documented-tag.yaml index 197ffd50..561e6f15 100644 --- a/src/test/resources/checks/v31/core/OAR047/documented-tag.yaml +++ b/src/test/resources/checks/v31/core/OAR047/documented-tag.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.1" +openapi: "3.1.0" tags: - name: used-tag description: a tag referenced in the operations diff --git a/src/test/resources/checks/v31/core/OAR049/no-content-in-204.json b/src/test/resources/checks/v31/core/OAR049/no-content-in-204.json index c27c9ad6..dcfe19fe 100644 --- a/src/test/resources/checks/v31/core/OAR049/no-content-in-204.json +++ b/src/test/resources/checks/v31/core/OAR049/no-content-in-204.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.1", + "openapi" : "3.1.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v31/core/OAR049/no-content-in-204.yaml b/src/test/resources/checks/v31/core/OAR049/no-content-in-204.yaml index 8567c679..6f13e302 100644 --- a/src/test/resources/checks/v31/core/OAR049/no-content-in-204.yaml +++ b/src/test/resources/checks/v31/core/OAR049/no-content-in-204.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.1" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/core/OAR050/provide-summary.json b/src/test/resources/checks/v31/core/OAR050/provide-summary.json index a5b45a2a..8d2ea1b5 100644 --- a/src/test/resources/checks/v31/core/OAR050/provide-summary.json +++ b/src/test/resources/checks/v31/core/OAR050/provide-summary.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.1", + "openapi" : "3.1.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v31/core/OAR050/provide-summary.yaml b/src/test/resources/checks/v31/core/OAR050/provide-summary.yaml index 8d19ba90..b523fda2 100644 --- a/src/test/resources/checks/v31/core/OAR050/provide-summary.yaml +++ b/src/test/resources/checks/v31/core/OAR050/provide-summary.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.1" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/core/OAR051/different-description.json b/src/test/resources/checks/v31/core/OAR051/different-description.json index 784c6b8b..976500ed 100644 --- a/src/test/resources/checks/v31/core/OAR051/different-description.json +++ b/src/test/resources/checks/v31/core/OAR051/different-description.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.1", + "openapi" : "3.1.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v31/core/OAR051/different-description.yaml b/src/test/resources/checks/v31/core/OAR051/different-description.yaml index 600efaff..cb97cd8f 100644 --- a/src/test/resources/checks/v31/core/OAR051/different-description.yaml +++ b/src/test/resources/checks/v31/core/OAR051/different-description.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.1" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/examples/OAR031/externalref.yaml b/src/test/resources/checks/v31/examples/OAR031/externalref.yaml new file mode 100644 index 00000000..21cee27e --- /dev/null +++ b/src/test/resources/checks/v31/examples/OAR031/externalref.yaml @@ -0,0 +1,68 @@ +openapi: "3.1.0" +info: + title: Example API + description: This is a basic example of an OpenAPI document. + version: 1.0.0 +servers: + - url: https://api.example.com/v1 + description: Main (production) server + - url: https://api.staging.example.com + description: Staging server +paths: + /users: + get: + summary: Get all users + description: Returns a list of users. + responses: + '200': + description: A JSON array of user objects + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/User' + '400': + $ref: >- # Noncompliant {{OAR031: Responses must have one or more examples defined}} + http://localhost:18089/OAR031.yaml#/components/responses/server_error_response + /users/{userId}: + get: + summary: Get a user by ID + description: Returns a single user. + parameters: + - name: userId + in: path + required: true + description: The ID of the user to retrieve + schema: + type: string + example: + name: Puppy + type: dog + responses: + '200': + description: A single user object + content: + application/json: + schema: + $ref: '#/components/schemas/User' + '400': + $ref: >- # Noncompliant {{OAR031: Responses must have one or more examples defined}} + http://localhost:18089/OAR031.yaml#/components/responses/server_error_response +components: + schemas: + User: + type: object + required: + - id + - name + properties: + id: + type: string + example: '12345' + name: + type: string + example: 'John Doe' + email: + type: string + example: 'john.doe@example.com' diff --git a/src/test/resources/checks/v31/examples/OAR031/nested-properties-examples.yaml b/src/test/resources/checks/v31/examples/OAR031/nested-properties-examples.yaml new file mode 100644 index 00000000..bf96e975 --- /dev/null +++ b/src/test/resources/checks/v31/examples/OAR031/nested-properties-examples.yaml @@ -0,0 +1,39 @@ +openapi: "3.1.0" +info: + title: OAR031 Nested Examples + version: 1.0.0 +paths: + /profile: + put: + summary: Update user profile + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + email: + type: string + example: "apellido@madrid.org" + telefono_fijo: + type: string + example: "600345345" + direccion: + type: object + properties: + calle: + type: string + example: "Calle Indeterminada, 18" + localidad: + type: string + example: "Madrid" + provincia: + type: string + example: "Madrid" + codigo_postal: + type: string + example: "28001" + responses: + '200': # Noncompliant {{OAR031: Responses must have one or more examples defined}} + description: OK \ No newline at end of file diff --git a/src/test/resources/checks/v31/examples/OAR031/valid.json b/src/test/resources/checks/v31/examples/OAR031/valid.json new file mode 100644 index 00000000..403837e3 --- /dev/null +++ b/src/test/resources/checks/v31/examples/OAR031/valid.json @@ -0,0 +1,170 @@ +{ + "openapi": "3.1.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/pets": { + "post": { + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/pet" + }, + "example": { + "name": "Puppy", + "type": "dog" + } + } + } + }, + "responses": { + "201": { + "description": "Pet list", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/pet" + }, + "example": { + "name": "Puppy", + "type": "dog" + } + } + } + }, + "default": { + "$ref": "#/components/responses/server_error_response" + } + } + }, + "get": { + "responses": { + "206": { + "description": "Pet created", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/pets" + }, + "example": { + "size": 2, + "pets": [ + { + "name": "Fluffy", + "type": "cat" + }, + { + "name": "Sparky", + "type": "dog" + } + ] + } + } + } + }, + "default": { + "$ref": "#/components/responses/server_error_response" + } + } + } + }, + "/pets/{id}": { + "get": { + "parameters": [ + { + "$ref": "#/components/parameters/id" + } + ], + "responses": { + "200": { + "description": "One pet", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/pet" + }, + "example": { + "name": "Fluffy", + "type": "cat" + } + } + } + }, + "default": { + "$ref": "#/components/responses/server_error_response" + } + } + } + } + }, + "components": { + "parameters": { + "id": { + "in": "path", + "name": "id", + "schema": { + "type": "integer", + "format": "int64", + "maxLength": 22 + }, + "description": "Identificador del tipo de centro a obtener, actualizar o eliminar.", + "required": true, + "example": 513168138 + } + }, + "schemas": { + "pet": { + "type": "object", + "properties": { + "name": { + "type": "string", + "example": "Snow" + }, + "type": { + "type": "string", + "example": "dog" + } + } + }, + "pets": { + "type": "object", + "properties": { + "size": { + "type": "integer", + "example": 1 + }, + "pets": { + "type": "array", + "items": { + "$ref": "#/components/schemas/pet" + } + } + } + } + }, + "responses": { + "server_error_response": { + "description": "Default error response", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "example": "Server error" + } + } + }, + "example": { + "error": "Server error" + } + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/examples/OAR031/valid.yaml b/src/test/resources/checks/v31/examples/OAR031/valid.yaml new file mode 100644 index 00000000..9b68a04e --- /dev/null +++ b/src/test/resources/checks/v31/examples/OAR031/valid.yaml @@ -0,0 +1,113 @@ +openapi: "3.1.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: + post: + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/pet" + example: + name: Puppy + type: dog + responses: + 201: + description: Pet list + content: + application/json: + schema: + $ref: '#/components/schemas/pet' + example: + name: Puppy + type: dog + 204: + description: No content + default: + $ref: "#/components/responses/server_error_response" + get: + responses: + 204: + description: No content + 206: + description: Pet created + content: + application/json: + schema: + $ref: '#/components/schemas/pets' + example: + size: 2 + pets: + - name: Fluffy + type: cat + - name: Sparky + type: dog + default: + $ref: "#/components/responses/server_error_response" + /pets/{id}: + get: + parameters: + - $ref: "#/components/parameters/id" + responses: + 200: + description: One pet + content: + application/json: + schema: + $ref: "#/components/schemas/pet" + example: + name: Fluffy + type: cat + 204: + description: No content + default: + $ref: "#/components/responses/server_error_response" + +components: + parameters: + id: + in: path + name: id + schema: + type: integer + format: int64 + maxLength: 22 + example: 513168138 + description: Identificador del tipo de centro a obtener, actualizar o eliminar. + required: true + + schemas: + pet: + type: object + properties: + name: + type: string + example: "Snow" + type: + type: string + example: "dog" + pets: + type: object + properties: + size: + type: integer + example: 1 + pets: + type: array + items: + $ref: '#/components/schemas/pet' + responses: + server_error_response: + description: Default error response + content: + application/json: + schema: + type: object + properties: + error: + type: string + example: "Server error" + example: + error: "Server error" \ No newline at end of file diff --git a/src/test/resources/checks/v31/examples/OAR031/without-examples.json b/src/test/resources/checks/v31/examples/OAR031/without-examples.json new file mode 100644 index 00000000..706de65f --- /dev/null +++ b/src/test/resources/checks/v31/examples/OAR031/without-examples.json @@ -0,0 +1,120 @@ +{ + "openapi": "3.1.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/pets": { + "get": { + "responses": { + "206": { # Noncompliant {{OAR031: Responses must have one or more examples defined}} + "description": "Pet list", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/pets" + } + } + } + }, + "default": { + "$ref": "#/components/responses/server_error_response" + } + } + } + }, + "/pets/{id}": { + "parameters": [ + { # Noncompliant {{OAR031: Parameters must have one or more examples defined}} + "in": "query", + "name": "$start", + "schema": { + "type": "integer" + } + } + ], + "get": { + "parameters": [ + { + "$ref": "#/components/parameters/id" + } + ], + "responses": { + "200": { # Noncompliant {{OAR031: Responses must have one or more examples defined}} + "description": "One pet", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/pet" + } + } + } + }, + "default": { + "$ref": "#/components/responses/server_error_response" + } + } + } + } + }, + "components": { + "parameters": { + "id": { # Noncompliant {{OAR031: Parameters must have one or more examples defined}} + "in": "path", + "name": "id", + "schema": { + "type": "integer", + "format": "int64", + "maxLength": 22 + }, + "description": "Identificador del tipo de centro a obtener, actualizar o eliminar.", + "required": true + } + }, + "schemas": { + "pet": { + "type": "object", + "properties": { + "name": { # Noncompliant {{OAR031: Properties must have an example defined}} + "type": "string" + }, + "type": { # Noncompliant {{OAR031: Properties must have an example defined}} + "type": "string" + } + } + }, + "pets": { + "type": "object", + "properties": { + "size": { # Noncompliant {{OAR031: Properties must have an example defined}} + "type": "integer" + }, + "pets": { + "type": "array", + "items": { + "$ref": "#/components/schemas/pet" + } + } + } + } + }, + "responses": { + "server_error_response": { # Noncompliant {{OAR031: Responses must have one or more examples defined}} + "description": "Default error response", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "error": { # Noncompliant {{OAR031: Properties must have an example defined}} + "type": "string" + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/examples/OAR031/without-examples.yaml b/src/test/resources/checks/v31/examples/OAR031/without-examples.yaml new file mode 100644 index 00000000..5fa170e9 --- /dev/null +++ b/src/test/resources/checks/v31/examples/OAR031/without-examples.yaml @@ -0,0 +1,73 @@ +openapi: "3.1.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: + get: + responses: + 206: # Noncompliant {{OAR031: Responses must have one or more examples defined}} + description: Pet list + content: + application/json: + schema: + $ref: '#/components/schemas/pets' + default: + $ref: "#/components/responses/server_error_response" + /pets/{id}: + parameters: + - in: query # Noncompliant {{OAR031: Parameters must have one or more examples defined}} + name: $start + schema: + type: integer + get: + parameters: + - $ref: "#/components/parameters/id" + responses: + 200: # Noncompliant {{OAR031: Responses must have one or more examples defined}} + description: One pet + content: + application/json: + schema: + $ref: "#/components/schemas/pet" + default: + $ref: "#/components/responses/server_error_response" + +components: + parameters: + id: + in: path # Noncompliant {{OAR031: Parameters must have one or more examples defined}} + name: id + schema: + type: integer + format: int64 + maxLength: 22 + description: Identificador del tipo de centro a obtener, actualizar o eliminar. + required: true + schemas: + pet: + type: object + properties: + name: # Noncompliant {{OAR031: Properties must have an example defined}} + type: string + type: # Noncompliant {{OAR031: Properties must have an example defined}} + type: string + pets: + type: object + properties: + size: # Noncompliant {{OAR031: Properties must have an example defined}} + type: integer + pets: + type: array + items: + $ref: '#/components/schemas/pet' + responses: + server_error_response: # Noncompliant {{OAR031: Responses must have one or more examples defined}} + description: Default error response + content: + application/json: + schema: + type: object + properties: + error: # Noncompliant {{OAR031: Properties must have an example defined}} + type: string \ No newline at end of file diff --git a/src/test/resources/checks/v31/examples/OAR094/externalref.yaml b/src/test/resources/checks/v31/examples/OAR094/externalref.yaml index d750e57a..f0a660ef 100644 --- a/src/test/resources/checks/v31/examples/OAR094/externalref.yaml +++ b/src/test/resources/checks/v31/examples/OAR094/externalref.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.1 +openapi: "3.1.0" info: title: Sample-API_efc2b9f76813_V contact: diff --git a/src/test/resources/checks/v31/examples/OAR094/invalid-example.json b/src/test/resources/checks/v31/examples/OAR094/invalid-example.json index 70dc0305..b1d91b67 100644 --- a/src/test/resources/checks/v31/examples/OAR094/invalid-example.json +++ b/src/test/resources/checks/v31/examples/OAR094/invalid-example.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "title": "API con Example", "version": "1.0.0" diff --git a/src/test/resources/checks/v31/examples/OAR094/invalid-example.yaml b/src/test/resources/checks/v31/examples/OAR094/invalid-example.yaml index 31628bcd..b999a5a3 100644 --- a/src/test/resources/checks/v31/examples/OAR094/invalid-example.yaml +++ b/src/test/resources/checks/v31/examples/OAR094/invalid-example.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.0 +openapi: "3.1.0" info: title: API con Example version: 1.0.0 diff --git a/src/test/resources/checks/v31/examples/OAR094/valid-example.json b/src/test/resources/checks/v31/examples/OAR094/valid-example.json index c1cc5b38..891f164d 100644 --- a/src/test/resources/checks/v31/examples/OAR094/valid-example.json +++ b/src/test/resources/checks/v31/examples/OAR094/valid-example.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "title": "API con Examples", "version": "1.0.0" diff --git a/src/test/resources/checks/v31/examples/OAR094/valid-example.yaml b/src/test/resources/checks/v31/examples/OAR094/valid-example.yaml index ab2b5d5a..a7211027 100644 --- a/src/test/resources/checks/v31/examples/OAR094/valid-example.yaml +++ b/src/test/resources/checks/v31/examples/OAR094/valid-example.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.0 +openapi: "3.1.0" info: title: API con Examples version: 1.0.0 diff --git a/src/test/resources/checks/v31/format/OAR006/without-anything.json b/src/test/resources/checks/v31/format/OAR006/without-anything.json index e7eb8518..c12e90bf 100644 --- a/src/test/resources/checks/v31/format/OAR006/without-anything.json +++ b/src/test/resources/checks/v31/format/OAR006/without-anything.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v31/format/OAR006/without-anything.yaml b/src/test/resources/checks/v31/format/OAR006/without-anything.yaml index 88d684f0..0d07eb68 100644 --- a/src/test/resources/checks/v31/format/OAR006/without-anything.yaml +++ b/src/test/resources/checks/v31/format/OAR006/without-anything.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.0 +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/format/OAR007/without-anything.json b/src/test/resources/checks/v31/format/OAR007/without-anything.json index 805f9d37..a7cccf09 100644 --- a/src/test/resources/checks/v31/format/OAR007/without-anything.json +++ b/src/test/resources/checks/v31/format/OAR007/without-anything.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v31/format/OAR007/without-anything.yaml b/src/test/resources/checks/v31/format/OAR007/without-anything.yaml index ad6533a3..2a4a9580 100644 --- a/src/test/resources/checks/v31/format/OAR007/without-anything.yaml +++ b/src/test/resources/checks/v31/format/OAR007/without-anything.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/format/OAR009/operation-not-allows-request-body.json b/src/test/resources/checks/v31/format/OAR009/operation-not-allows-request-body.json index 87c3e35c..cb1e7ca9 100644 --- a/src/test/resources/checks/v31/format/OAR009/operation-not-allows-request-body.json +++ b/src/test/resources/checks/v31/format/OAR009/operation-not-allows-request-body.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v31/format/OAR009/operation-not-allows-request-body.yaml b/src/test/resources/checks/v31/format/OAR009/operation-not-allows-request-body.yaml index 7a0f59fa..88e6ab85 100644 --- a/src/test/resources/checks/v31/format/OAR009/operation-not-allows-request-body.yaml +++ b/src/test/resources/checks/v31/format/OAR009/operation-not-allows-request-body.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/format/OAR009/with-default-and-$ref.json b/src/test/resources/checks/v31/format/OAR009/with-default-and-$ref.json index 55f22b21..6e1385c3 100644 --- a/src/test/resources/checks/v31/format/OAR009/with-default-and-$ref.json +++ b/src/test/resources/checks/v31/format/OAR009/with-default-and-$ref.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v31/format/OAR009/with-default-and-$ref.yaml b/src/test/resources/checks/v31/format/OAR009/with-default-and-$ref.yaml index 19eb54b9..b914bb12 100644 --- a/src/test/resources/checks/v31/format/OAR009/with-default-and-$ref.yaml +++ b/src/test/resources/checks/v31/format/OAR009/with-default-and-$ref.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/format/OAR009/with-default-and-specific.json b/src/test/resources/checks/v31/format/OAR009/with-default-and-specific.json index 5c1ec6af..fcbaa75d 100644 --- a/src/test/resources/checks/v31/format/OAR009/with-default-and-specific.json +++ b/src/test/resources/checks/v31/format/OAR009/with-default-and-specific.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v31/format/OAR009/with-default-and-specific.yaml b/src/test/resources/checks/v31/format/OAR009/with-default-and-specific.yaml index 7cb1533a..2ff870ec 100644 --- a/src/test/resources/checks/v31/format/OAR009/with-default-and-specific.yaml +++ b/src/test/resources/checks/v31/format/OAR009/with-default-and-specific.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/format/OAR009/with-specific.json b/src/test/resources/checks/v31/format/OAR009/with-specific.json index e2f86e06..1321836e 100644 --- a/src/test/resources/checks/v31/format/OAR009/with-specific.json +++ b/src/test/resources/checks/v31/format/OAR009/with-specific.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v31/format/OAR009/with-specific.yaml b/src/test/resources/checks/v31/format/OAR009/with-specific.yaml index 8275c170..2732b297 100644 --- a/src/test/resources/checks/v31/format/OAR009/with-specific.yaml +++ b/src/test/resources/checks/v31/format/OAR009/with-specific.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/format/OAR009/with-wrong-default-and-specific.json b/src/test/resources/checks/v31/format/OAR009/with-wrong-default-and-specific.json index 717e2ce1..f65659c0 100644 --- a/src/test/resources/checks/v31/format/OAR009/with-wrong-default-and-specific.json +++ b/src/test/resources/checks/v31/format/OAR009/with-wrong-default-and-specific.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v31/format/OAR009/with-wrong-default-and-specific.yaml b/src/test/resources/checks/v31/format/OAR009/with-wrong-default-and-specific.yaml index 5f5a2c42..f73d07ef 100644 --- a/src/test/resources/checks/v31/format/OAR009/with-wrong-default-and-specific.yaml +++ b/src/test/resources/checks/v31/format/OAR009/with-wrong-default-and-specific.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/format/OAR009/with-wrong-default.json b/src/test/resources/checks/v31/format/OAR009/with-wrong-default.json index 8858d3f7..977475d4 100644 --- a/src/test/resources/checks/v31/format/OAR009/with-wrong-default.json +++ b/src/test/resources/checks/v31/format/OAR009/with-wrong-default.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v31/format/OAR009/with-wrong-default.yaml b/src/test/resources/checks/v31/format/OAR009/with-wrong-default.yaml index d318d68c..b42810a7 100644 --- a/src/test/resources/checks/v31/format/OAR009/with-wrong-default.yaml +++ b/src/test/resources/checks/v31/format/OAR009/with-wrong-default.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/format/OAR009/without-anything.json b/src/test/resources/checks/v31/format/OAR009/without-anything.json index 75ad9f22..b2618e4f 100644 --- a/src/test/resources/checks/v31/format/OAR009/without-anything.json +++ b/src/test/resources/checks/v31/format/OAR009/without-anything.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v31/format/OAR009/without-anything.yaml b/src/test/resources/checks/v31/format/OAR009/without-anything.yaml index a7e26847..e0606d8c 100644 --- a/src/test/resources/checks/v31/format/OAR009/without-anything.yaml +++ b/src/test/resources/checks/v31/format/OAR009/without-anything.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/format/OAR010/with-default-and-$ref.json b/src/test/resources/checks/v31/format/OAR010/with-default-and-$ref.json index 93c56075..ebcb2191 100644 --- a/src/test/resources/checks/v31/format/OAR010/with-default-and-$ref.json +++ b/src/test/resources/checks/v31/format/OAR010/with-default-and-$ref.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v31/format/OAR010/with-default-and-$ref.yaml b/src/test/resources/checks/v31/format/OAR010/with-default-and-$ref.yaml index 37260cd9..2ad5d668 100644 --- a/src/test/resources/checks/v31/format/OAR010/with-default-and-$ref.yaml +++ b/src/test/resources/checks/v31/format/OAR010/with-default-and-$ref.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.0 +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/format/OAR010/with-default-and-specific.json b/src/test/resources/checks/v31/format/OAR010/with-default-and-specific.json index 714dc3e9..265464aa 100644 --- a/src/test/resources/checks/v31/format/OAR010/with-default-and-specific.json +++ b/src/test/resources/checks/v31/format/OAR010/with-default-and-specific.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v31/format/OAR010/with-default-and-specific.yaml b/src/test/resources/checks/v31/format/OAR010/with-default-and-specific.yaml index 1059a75d..bbcc31a4 100644 --- a/src/test/resources/checks/v31/format/OAR010/with-default-and-specific.yaml +++ b/src/test/resources/checks/v31/format/OAR010/with-default-and-specific.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.0 +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/format/OAR010/with-specific.json b/src/test/resources/checks/v31/format/OAR010/with-specific.json index 59a2ee24..87e39490 100644 --- a/src/test/resources/checks/v31/format/OAR010/with-specific.json +++ b/src/test/resources/checks/v31/format/OAR010/with-specific.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v31/format/OAR010/with-specific.yaml b/src/test/resources/checks/v31/format/OAR010/with-specific.yaml index 0026c70d..ab6e19fa 100644 --- a/src/test/resources/checks/v31/format/OAR010/with-specific.yaml +++ b/src/test/resources/checks/v31/format/OAR010/with-specific.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/format/OAR010/with-wrong-default-and-specific.json b/src/test/resources/checks/v31/format/OAR010/with-wrong-default-and-specific.json index fb05f275..968f61cb 100644 --- a/src/test/resources/checks/v31/format/OAR010/with-wrong-default-and-specific.json +++ b/src/test/resources/checks/v31/format/OAR010/with-wrong-default-and-specific.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v31/format/OAR010/with-wrong-default-and-specific.yaml b/src/test/resources/checks/v31/format/OAR010/with-wrong-default-and-specific.yaml index 561511e4..f85a8b61 100644 --- a/src/test/resources/checks/v31/format/OAR010/with-wrong-default-and-specific.yaml +++ b/src/test/resources/checks/v31/format/OAR010/with-wrong-default-and-specific.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.0 +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/format/OAR010/with-wrong-default.json b/src/test/resources/checks/v31/format/OAR010/with-wrong-default.json index 345e4ba0..77d537e7 100644 --- a/src/test/resources/checks/v31/format/OAR010/with-wrong-default.json +++ b/src/test/resources/checks/v31/format/OAR010/with-wrong-default.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v31/format/OAR010/with-wrong-default.yaml b/src/test/resources/checks/v31/format/OAR010/with-wrong-default.yaml index d0513d3e..45ccab83 100644 --- a/src/test/resources/checks/v31/format/OAR010/with-wrong-default.yaml +++ b/src/test/resources/checks/v31/format/OAR010/with-wrong-default.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.0 +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/format/OAR010/without-anything.json b/src/test/resources/checks/v31/format/OAR010/without-anything.json index fe401526..9d3c99ba 100644 --- a/src/test/resources/checks/v31/format/OAR010/without-anything.json +++ b/src/test/resources/checks/v31/format/OAR010/without-anything.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v31/format/OAR010/without-anything.yaml b/src/test/resources/checks/v31/format/OAR010/without-anything.yaml index 2a4bf55e..d563f6d0 100644 --- a/src/test/resources/checks/v31/format/OAR010/without-anything.yaml +++ b/src/test/resources/checks/v31/format/OAR010/without-anything.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/format/OAR011/base-path-ok.json b/src/test/resources/checks/v31/format/OAR011/base-path-ok.json index 56dd4fa1..a461588e 100644 --- a/src/test/resources/checks/v31/format/OAR011/base-path-ok.json +++ b/src/test/resources/checks/v31/format/OAR011/base-path-ok.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v31/format/OAR011/base-path-ok.yaml b/src/test/resources/checks/v31/format/OAR011/base-path-ok.yaml index 6e24d7c7..e2a055bb 100644 --- a/src/test/resources/checks/v31/format/OAR011/base-path-ok.yaml +++ b/src/test/resources/checks/v31/format/OAR011/base-path-ok.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/format/OAR011/base-path-wrong.json b/src/test/resources/checks/v31/format/OAR011/base-path-wrong.json index 535e82b4..afda8f94 100644 --- a/src/test/resources/checks/v31/format/OAR011/base-path-wrong.json +++ b/src/test/resources/checks/v31/format/OAR011/base-path-wrong.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v31/format/OAR011/base-path-wrong.yaml b/src/test/resources/checks/v31/format/OAR011/base-path-wrong.yaml index 6833d3fc..353195af 100644 --- a/src/test/resources/checks/v31/format/OAR011/base-path-wrong.yaml +++ b/src/test/resources/checks/v31/format/OAR011/base-path-wrong.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/format/OAR011/plain.json b/src/test/resources/checks/v31/format/OAR011/plain.json index cf5279d9..6e4e6c27 100644 --- a/src/test/resources/checks/v31/format/OAR011/plain.json +++ b/src/test/resources/checks/v31/format/OAR011/plain.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v31/format/OAR011/plain.yaml b/src/test/resources/checks/v31/format/OAR011/plain.yaml index 7b13396a..c9ff7eeb 100644 --- a/src/test/resources/checks/v31/format/OAR011/plain.yaml +++ b/src/test/resources/checks/v31/format/OAR011/plain.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/format/OAR012/camel-case-plain.json b/src/test/resources/checks/v31/format/OAR012/camel-case-plain.json index bb26e131..68635bc7 100644 --- a/src/test/resources/checks/v31/format/OAR012/camel-case-plain.json +++ b/src/test/resources/checks/v31/format/OAR012/camel-case-plain.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v31/format/OAR012/camel-case-plain.yaml b/src/test/resources/checks/v31/format/OAR012/camel-case-plain.yaml index ccbabec1..542366c3 100644 --- a/src/test/resources/checks/v31/format/OAR012/camel-case-plain.yaml +++ b/src/test/resources/checks/v31/format/OAR012/camel-case-plain.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/format/OAR012/camel-case-with-$ref.json b/src/test/resources/checks/v31/format/OAR012/camel-case-with-$ref.json index 8a695818..67e45d45 100644 --- a/src/test/resources/checks/v31/format/OAR012/camel-case-with-$ref.json +++ b/src/test/resources/checks/v31/format/OAR012/camel-case-with-$ref.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v31/format/OAR012/camel-case-with-$ref.yaml b/src/test/resources/checks/v31/format/OAR012/camel-case-with-$ref.yaml index 7cca23f2..61c03ec2 100644 --- a/src/test/resources/checks/v31/format/OAR012/camel-case-with-$ref.yaml +++ b/src/test/resources/checks/v31/format/OAR012/camel-case-with-$ref.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/format/OAR012/kebab-case-plain.json b/src/test/resources/checks/v31/format/OAR012/kebab-case-plain.json index 8d726a20..47146bf9 100644 --- a/src/test/resources/checks/v31/format/OAR012/kebab-case-plain.json +++ b/src/test/resources/checks/v31/format/OAR012/kebab-case-plain.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v31/format/OAR012/kebab-case-plain.yaml b/src/test/resources/checks/v31/format/OAR012/kebab-case-plain.yaml index a1b924e6..7c42ef9a 100644 --- a/src/test/resources/checks/v31/format/OAR012/kebab-case-plain.yaml +++ b/src/test/resources/checks/v31/format/OAR012/kebab-case-plain.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/format/OAR012/kebab-case-with-$ref.json b/src/test/resources/checks/v31/format/OAR012/kebab-case-with-$ref.json index bedb4b36..db8c3a1f 100644 --- a/src/test/resources/checks/v31/format/OAR012/kebab-case-with-$ref.json +++ b/src/test/resources/checks/v31/format/OAR012/kebab-case-with-$ref.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v31/format/OAR012/kebab-case-with-$ref.yaml b/src/test/resources/checks/v31/format/OAR012/kebab-case-with-$ref.yaml index 73975f4f..1e62f853 100644 --- a/src/test/resources/checks/v31/format/OAR012/kebab-case-with-$ref.yaml +++ b/src/test/resources/checks/v31/format/OAR012/kebab-case-with-$ref.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/format/OAR012/snake-case-plain.json b/src/test/resources/checks/v31/format/OAR012/snake-case-plain.json index 48e07f45..f3c64e30 100644 --- a/src/test/resources/checks/v31/format/OAR012/snake-case-plain.json +++ b/src/test/resources/checks/v31/format/OAR012/snake-case-plain.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v31/format/OAR012/snake-case-plain.yaml b/src/test/resources/checks/v31/format/OAR012/snake-case-plain.yaml index 20bfa7f7..e4b8a1f0 100644 --- a/src/test/resources/checks/v31/format/OAR012/snake-case-plain.yaml +++ b/src/test/resources/checks/v31/format/OAR012/snake-case-plain.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/format/OAR012/snake-case-with-$ref.json b/src/test/resources/checks/v31/format/OAR012/snake-case-with-$ref.json index 21c21650..52846b38 100644 --- a/src/test/resources/checks/v31/format/OAR012/snake-case-with-$ref.json +++ b/src/test/resources/checks/v31/format/OAR012/snake-case-with-$ref.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v31/format/OAR012/snake-case-with-$ref.yaml b/src/test/resources/checks/v31/format/OAR012/snake-case-with-$ref.yaml index c453758f..ed7ae02e 100644 --- a/src/test/resources/checks/v31/format/OAR012/snake-case-with-$ref.yaml +++ b/src/test/resources/checks/v31/format/OAR012/snake-case-with-$ref.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/format/OAR016/nested.json b/src/test/resources/checks/v31/format/OAR016/nested.json index 3e10ecf6..10b592a8 100644 --- a/src/test/resources/checks/v31/format/OAR016/nested.json +++ b/src/test/resources/checks/v31/format/OAR016/nested.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v31/format/OAR016/nested.yaml b/src/test/resources/checks/v31/format/OAR016/nested.yaml index 99858ae1..471f8ebe 100644 --- a/src/test/resources/checks/v31/format/OAR016/nested.yaml +++ b/src/test/resources/checks/v31/format/OAR016/nested.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/format/OAR016/plain.json b/src/test/resources/checks/v31/format/OAR016/plain.json index d49aef02..6191bf50 100644 --- a/src/test/resources/checks/v31/format/OAR016/plain.json +++ b/src/test/resources/checks/v31/format/OAR016/plain.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v31/format/OAR016/plain.yaml b/src/test/resources/checks/v31/format/OAR016/plain.yaml index 004e61d7..6a11aa64 100644 --- a/src/test/resources/checks/v31/format/OAR016/plain.yaml +++ b/src/test/resources/checks/v31/format/OAR016/plain.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/format/OAR016/with-$ref.json b/src/test/resources/checks/v31/format/OAR016/with-$ref.json index 44d77260..21b1d55f 100644 --- a/src/test/resources/checks/v31/format/OAR016/with-$ref.json +++ b/src/test/resources/checks/v31/format/OAR016/with-$ref.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v31/format/OAR016/with-$ref.yaml b/src/test/resources/checks/v31/format/OAR016/with-$ref.yaml index 32be02fd..fffed48c 100644 --- a/src/test/resources/checks/v31/format/OAR016/with-$ref.yaml +++ b/src/test/resources/checks/v31/format/OAR016/with-$ref.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/format/OAR037/complete.json b/src/test/resources/checks/v31/format/OAR037/complete.json index dfefdf0b..94e76d39 100644 --- a/src/test/resources/checks/v31/format/OAR037/complete.json +++ b/src/test/resources/checks/v31/format/OAR037/complete.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v31/format/OAR037/complete.yaml b/src/test/resources/checks/v31/format/OAR037/complete.yaml index 2e7b6f3f..cfcb826e 100644 --- a/src/test/resources/checks/v31/format/OAR037/complete.yaml +++ b/src/test/resources/checks/v31/format/OAR037/complete.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/format/OAR037/nested.json b/src/test/resources/checks/v31/format/OAR037/nested.json index 4b6316e6..7d632201 100644 --- a/src/test/resources/checks/v31/format/OAR037/nested.json +++ b/src/test/resources/checks/v31/format/OAR037/nested.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v31/format/OAR037/nested.yaml b/src/test/resources/checks/v31/format/OAR037/nested.yaml index e2ba0a91..4a1accb7 100644 --- a/src/test/resources/checks/v31/format/OAR037/nested.yaml +++ b/src/test/resources/checks/v31/format/OAR037/nested.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/format/OAR037/with-$ref.json b/src/test/resources/checks/v31/format/OAR037/with-$ref.json index 5707bfcb..d5ed29ea 100644 --- a/src/test/resources/checks/v31/format/OAR037/with-$ref.json +++ b/src/test/resources/checks/v31/format/OAR037/with-$ref.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v31/format/OAR037/with-$ref.yaml b/src/test/resources/checks/v31/format/OAR037/with-$ref.yaml index c7d2f1f4..b6437060 100644 --- a/src/test/resources/checks/v31/format/OAR037/with-$ref.yaml +++ b/src/test/resources/checks/v31/format/OAR037/with-$ref.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/format/OAR042/incorrect-version.json b/src/test/resources/checks/v31/format/OAR042/incorrect-version.json index 74006c75..f7a8fc9e 100644 --- a/src/test/resources/checks/v31/format/OAR042/incorrect-version.json +++ b/src/test/resources/checks/v31/format/OAR042/incorrect-version.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.1.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v31/format/OAR042/incorrect-version.yaml b/src/test/resources/checks/v31/format/OAR042/incorrect-version.yaml index 1a3a569a..c998e93e 100644 --- a/src/test/resources/checks/v31/format/OAR042/incorrect-version.yaml +++ b/src/test/resources/checks/v31/format/OAR042/incorrect-version.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/format/OAR042/too-long.json b/src/test/resources/checks/v31/format/OAR042/too-long.json index 8e22a1a2..cf18102e 100644 --- a/src/test/resources/checks/v31/format/OAR042/too-long.json +++ b/src/test/resources/checks/v31/format/OAR042/too-long.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.1.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v31/format/OAR042/too-long.yaml b/src/test/resources/checks/v31/format/OAR042/too-long.yaml index a8df7af5..a2e8437b 100644 --- a/src/test/resources/checks/v31/format/OAR042/too-long.yaml +++ b/src/test/resources/checks/v31/format/OAR042/too-long.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/format/OAR042/too-short.json b/src/test/resources/checks/v31/format/OAR042/too-short.json index 9f25cf4a..4850c130 100644 --- a/src/test/resources/checks/v31/format/OAR042/too-short.json +++ b/src/test/resources/checks/v31/format/OAR042/too-short.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.1.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v31/format/OAR042/too-short.yaml b/src/test/resources/checks/v31/format/OAR042/too-short.yaml index cb29e522..16c63bf8 100644 --- a/src/test/resources/checks/v31/format/OAR042/too-short.yaml +++ b/src/test/resources/checks/v31/format/OAR042/too-short.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/format/OAR042/valid.json b/src/test/resources/checks/v31/format/OAR042/valid.json index 6d48f8b4..f42208e2 100644 --- a/src/test/resources/checks/v31/format/OAR042/valid.json +++ b/src/test/resources/checks/v31/format/OAR042/valid.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v31/format/OAR042/valid.yaml b/src/test/resources/checks/v31/format/OAR042/valid.yaml index 89bfccfb..d57d39cb 100644 --- a/src/test/resources/checks/v31/format/OAR042/valid.yaml +++ b/src/test/resources/checks/v31/format/OAR042/valid.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/format/OAR042/without-api-prefix.json b/src/test/resources/checks/v31/format/OAR042/without-api-prefix.json index 0f7cf628..0eaad7fa 100644 --- a/src/test/resources/checks/v31/format/OAR042/without-api-prefix.json +++ b/src/test/resources/checks/v31/format/OAR042/without-api-prefix.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.1.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v31/format/OAR042/without-api-prefix.yaml b/src/test/resources/checks/v31/format/OAR042/without-api-prefix.yaml index e026b5a3..84e5630f 100644 --- a/src/test/resources/checks/v31/format/OAR042/without-api-prefix.yaml +++ b/src/test/resources/checks/v31/format/OAR042/without-api-prefix.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/format/OAR044/media-type.json b/src/test/resources/checks/v31/format/OAR044/media-type.json new file mode 100644 index 00000000..86ec986a --- /dev/null +++ b/src/test/resources/checks/v31/format/OAR044/media-type.json @@ -0,0 +1,46 @@ +{ + "openapi" : "3.1.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/pets" : { + "get" : { + "responses" : { + "200" : { + "description" : "some operation", + "content" : { + "application" : { } # Noncompliant {{OAR044: Declared media type range should conform to RFC7231}} + } + } + }, + "parameters" : [ { + "name" : "someParam", + "in" : "query", + "content" : { + "application" : { }, # Noncompliant {{OAR044: Declared mime type should conform to RFC6838}} + "text/plain" : { } + } + }, + { + "name" : "otherParam", + "in" : "path" + } ] + }, + "post" : { + "requestBody" : { + "content" : { + "application" : { }, # Noncompliant {{OAR044: Declared media type range should conform to RFC7231}} + "text/*" : { } + } + }, + "responses" : { + "200" : { + "description" : "some operation" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/format/OAR044/media-type.yaml b/src/test/resources/checks/v31/format/OAR044/media-type.yaml new file mode 100644 index 00000000..60015c9b --- /dev/null +++ b/src/test/resources/checks/v31/format/OAR044/media-type.yaml @@ -0,0 +1,28 @@ +openapi: "3.1.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: + get: + responses: + '200': + description: some operation + content: + 'application': {} # Noncompliant {{OAR044: Declared media type range should conform to RFC7231}} + parameters: + - name: someParam + in: query + content: + 'application': {} # Noncompliant {{OAR044: Declared mime type should conform to RFC6838}} + 'text/plain': {} # invalid (only 1 content allowed by spec), but should not be caught by this rule + - name: otherParam + in: path + post: + requestBody: + content: + 'application': { } # Noncompliant {{OAR044: Declared media type range should conform to RFC7231}} + 'text/*': { } + responses: + '200': + description: some operation diff --git a/src/test/resources/checks/v31/format/OAR050/provide-summary.json b/src/test/resources/checks/v31/format/OAR050/provide-summary.json new file mode 100644 index 00000000..8d2ea1b5 --- /dev/null +++ b/src/test/resources/checks/v31/format/OAR050/provide-summary.json @@ -0,0 +1,26 @@ +{ + "openapi" : "3.1.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/pets" : { + "post" : { # Noncompliant {{OAR050: Provide a summary for each operation}} + "responses" : { + "default" : { + "description" : "the default response" + } + } + }, + "get" : { + "summary" : "list all pets", + "responses" : { + "default" : { + "description" : "the default response" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/format/OAR050/provide-summary.yaml b/src/test/resources/checks/v31/format/OAR050/provide-summary.yaml new file mode 100644 index 00000000..b523fda2 --- /dev/null +++ b/src/test/resources/checks/v31/format/OAR050/provide-summary.yaml @@ -0,0 +1,15 @@ +openapi: "3.1.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: + post: # Noncompliant {{OAR050: Provide a summary for each operation}} + responses: + default: + description: the default response + get: + summary: list all pets + responses: + default: + description: the default response \ No newline at end of file diff --git a/src/test/resources/checks/v31/format/OAR051/different-description.json b/src/test/resources/checks/v31/format/OAR051/different-description.json new file mode 100644 index 00000000..976500ed --- /dev/null +++ b/src/test/resources/checks/v31/format/OAR051/different-description.json @@ -0,0 +1,30 @@ +{ + "openapi" : "3.1.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/pets" : { + "post" : { + "summary" : "create a pet", + "description" : "Create a new pet. The pet type is assigned a new unique ID, and can then be referenced in other operations.", + "responses" : { + "default" : { + "description" : "the default response" + } + } + }, + "get" : { + "summary" : "list all pets", + # Noncompliant@+1 {{OAR051: Description must differ from summary}} + "description" : "List all pets", + "responses" : { + "default" : { + "description" : "the default response" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/format/OAR051/different-description.yaml b/src/test/resources/checks/v31/format/OAR051/different-description.yaml new file mode 100644 index 00000000..cb97cd8f --- /dev/null +++ b/src/test/resources/checks/v31/format/OAR051/different-description.yaml @@ -0,0 +1,21 @@ +openapi: "3.1.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: + post: + summary: create a pet + description: Create a new pet. The pet type is assigned a new unique ID, and can then be referenced in other + operations. + responses: + default: + description: the default response + get: + summary: list all pets + # Noncompliant@+1 {{OAR051: Description must differ from summary}} + description: List all pets +# ^^^^^^^^^^^ + responses: + default: + description: the default response \ No newline at end of file diff --git a/src/test/resources/checks/v31/format/OAR052/nested.json b/src/test/resources/checks/v31/format/OAR052/nested.json index 42d01c17..c4657e7a 100644 --- a/src/test/resources/checks/v31/format/OAR052/nested.json +++ b/src/test/resources/checks/v31/format/OAR052/nested.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v31/format/OAR052/nested.yaml b/src/test/resources/checks/v31/format/OAR052/nested.yaml index 9d3b88ee..5d6710d3 100644 --- a/src/test/resources/checks/v31/format/OAR052/nested.yaml +++ b/src/test/resources/checks/v31/format/OAR052/nested.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.0 +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/format/OAR052/plain.json b/src/test/resources/checks/v31/format/OAR052/plain.json index e1189a6e..e2e764fc 100644 --- a/src/test/resources/checks/v31/format/OAR052/plain.json +++ b/src/test/resources/checks/v31/format/OAR052/plain.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v31/format/OAR052/plain.yaml b/src/test/resources/checks/v31/format/OAR052/plain.yaml index 498442a5..5acaf918 100644 --- a/src/test/resources/checks/v31/format/OAR052/plain.yaml +++ b/src/test/resources/checks/v31/format/OAR052/plain.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.0 +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/format/OAR052/with-$ref.json b/src/test/resources/checks/v31/format/OAR052/with-$ref.json index f6d48586..d4bc6a7d 100644 --- a/src/test/resources/checks/v31/format/OAR052/with-$ref.json +++ b/src/test/resources/checks/v31/format/OAR052/with-$ref.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v31/format/OAR052/with-$ref.yaml b/src/test/resources/checks/v31/format/OAR052/with-$ref.yaml index 5db4e652..2cf00322 100644 --- a/src/test/resources/checks/v31/format/OAR052/with-$ref.yaml +++ b/src/test/resources/checks/v31/format/OAR052/with-$ref.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.0 +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/format/OAR066/snake-case-error.json b/src/test/resources/checks/v31/format/OAR066/snake-case-error.json index 5362c7f2..e30a89b5 100644 --- a/src/test/resources/checks/v31/format/OAR066/snake-case-error.json +++ b/src/test/resources/checks/v31/format/OAR066/snake-case-error.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v31/format/OAR066/snake-case-error.yaml b/src/test/resources/checks/v31/format/OAR066/snake-case-error.yaml index 6bf327fb..90474029 100644 --- a/src/test/resources/checks/v31/format/OAR066/snake-case-error.yaml +++ b/src/test/resources/checks/v31/format/OAR066/snake-case-error.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.0 +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/format/OAR066/valid.json b/src/test/resources/checks/v31/format/OAR066/valid.json index 67217b92..bff3c33a 100644 --- a/src/test/resources/checks/v31/format/OAR066/valid.json +++ b/src/test/resources/checks/v31/format/OAR066/valid.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v31/format/OAR066/valid.yaml b/src/test/resources/checks/v31/format/OAR066/valid.yaml index 04c50530..d18e0971 100644 --- a/src/test/resources/checks/v31/format/OAR066/valid.yaml +++ b/src/test/resources/checks/v31/format/OAR066/valid.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.0 +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/format/OAR067/camel-case-error.json b/src/test/resources/checks/v31/format/OAR067/camel-case-error.json index 4307fccb..1fa9d435 100644 --- a/src/test/resources/checks/v31/format/OAR067/camel-case-error.json +++ b/src/test/resources/checks/v31/format/OAR067/camel-case-error.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v31/format/OAR067/camel-case-error.yaml b/src/test/resources/checks/v31/format/OAR067/camel-case-error.yaml index ff6ba5c0..05c51345 100644 --- a/src/test/resources/checks/v31/format/OAR067/camel-case-error.yaml +++ b/src/test/resources/checks/v31/format/OAR067/camel-case-error.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.0 +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/format/OAR067/valid.json b/src/test/resources/checks/v31/format/OAR067/valid.json index 337a2f9b..8e10ee7b 100644 --- a/src/test/resources/checks/v31/format/OAR067/valid.json +++ b/src/test/resources/checks/v31/format/OAR067/valid.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v31/format/OAR067/valid.yaml b/src/test/resources/checks/v31/format/OAR067/valid.yaml index 8c80f35d..8c0124b7 100644 --- a/src/test/resources/checks/v31/format/OAR067/valid.yaml +++ b/src/test/resources/checks/v31/format/OAR067/valid.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.0 +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/format/OAR068/externalref.yaml b/src/test/resources/checks/v31/format/OAR068/externalref.yaml index 5035f52c..bf976457 100644 --- a/src/test/resources/checks/v31/format/OAR068/externalref.yaml +++ b/src/test/resources/checks/v31/format/OAR068/externalref.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.1 +openapi: "3.1.0" info: title: Sample-API_efc2b9f76813_V contact: diff --git a/src/test/resources/checks/v31/format/OAR068/pascal-case-error.json b/src/test/resources/checks/v31/format/OAR068/pascal-case-error.json index b5f9521e..c9e0898c 100644 --- a/src/test/resources/checks/v31/format/OAR068/pascal-case-error.json +++ b/src/test/resources/checks/v31/format/OAR068/pascal-case-error.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v31/format/OAR068/pascal-case-error.yaml b/src/test/resources/checks/v31/format/OAR068/pascal-case-error.yaml index eed1491d..6261794d 100644 --- a/src/test/resources/checks/v31/format/OAR068/pascal-case-error.yaml +++ b/src/test/resources/checks/v31/format/OAR068/pascal-case-error.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.0 +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/format/OAR068/valid.json b/src/test/resources/checks/v31/format/OAR068/valid.json index f6204f15..8a6b1e3f 100644 --- a/src/test/resources/checks/v31/format/OAR068/valid.json +++ b/src/test/resources/checks/v31/format/OAR068/valid.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v31/format/OAR068/valid.yaml b/src/test/resources/checks/v31/format/OAR068/valid.yaml index b99b3dcc..1bef4d8e 100644 --- a/src/test/resources/checks/v31/format/OAR068/valid.yaml +++ b/src/test/resources/checks/v31/format/OAR068/valid.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.0 +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/format/OAR077/not-valid-in-query.json b/src/test/resources/checks/v31/format/OAR077/not-valid-in-query.json index 29dddea3..e24c26d4 100644 --- a/src/test/resources/checks/v31/format/OAR077/not-valid-in-query.json +++ b/src/test/resources/checks/v31/format/OAR077/not-valid-in-query.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "version": "1.0.0", "title": "API que cumple" diff --git a/src/test/resources/checks/v31/format/OAR077/not-valid-in-query.yaml b/src/test/resources/checks/v31/format/OAR077/not-valid-in-query.yaml index 6c43154d..92c3971c 100644 --- a/src/test/resources/checks/v31/format/OAR077/not-valid-in-query.yaml +++ b/src/test/resources/checks/v31/format/OAR077/not-valid-in-query.yaml @@ -1,4 +1,4 @@ - openapi: "3.0.0" + openapi: "3.1.0" info: version: "1.0.0" title: "API que cumple" diff --git a/src/test/resources/checks/v31/format/OAR077/valid-in-query.json b/src/test/resources/checks/v31/format/OAR077/valid-in-query.json index bd383fd9..911d9e83 100644 --- a/src/test/resources/checks/v31/format/OAR077/valid-in-query.json +++ b/src/test/resources/checks/v31/format/OAR077/valid-in-query.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "version": "1.0.0", "title": "API que cumple" diff --git a/src/test/resources/checks/v31/format/OAR077/valid-in-query.yaml b/src/test/resources/checks/v31/format/OAR077/valid-in-query.yaml index 286bf500..fbfe9032 100644 --- a/src/test/resources/checks/v31/format/OAR077/valid-in-query.yaml +++ b/src/test/resources/checks/v31/format/OAR077/valid-in-query.yaml @@ -1,4 +1,4 @@ - openapi: "3.0.0" + openapi: "3.1.0" info: version: "1.0.0" title: "API que cumple" diff --git a/src/test/resources/checks/v31/format/OAR086/external-refexample.yaml b/src/test/resources/checks/v31/format/OAR086/external-refexample.yaml index 942a056b..da58e493 100644 --- a/src/test/resources/checks/v31/format/OAR086/external-refexample.yaml +++ b/src/test/resources/checks/v31/format/OAR086/external-refexample.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.1 +openapi: "3.1.0" info: title: Sample-API_efc2b9f76813_V contact: diff --git a/src/test/resources/checks/v31/format/OAR086/internal-refexample.yaml b/src/test/resources/checks/v31/format/OAR086/internal-refexample.yaml index 940aa7ce..41131129 100644 --- a/src/test/resources/checks/v31/format/OAR086/internal-refexample.yaml +++ b/src/test/resources/checks/v31/format/OAR086/internal-refexample.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.1 +openapi: "3.1.0" info: title: Sample-API_efc2b9f76813_V contact: diff --git a/src/test/resources/checks/v31/format/OAR086/invalid-example.json b/src/test/resources/checks/v31/format/OAR086/invalid-example.json index 8321f08a..6c8b1e3b 100644 --- a/src/test/resources/checks/v31/format/OAR086/invalid-example.json +++ b/src/test/resources/checks/v31/format/OAR086/invalid-example.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "title": "Sample API", "version": "1.0.0", diff --git a/src/test/resources/checks/v31/format/OAR086/invalid-example.yaml b/src/test/resources/checks/v31/format/OAR086/invalid-example.yaml index 6c04e09d..70567c6e 100644 --- a/src/test/resources/checks/v31/format/OAR086/invalid-example.yaml +++ b/src/test/resources/checks/v31/format/OAR086/invalid-example.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.0 +openapi: "3.1.0" info: title: Sample API version: 1.0.0 diff --git a/src/test/resources/checks/v31/format/OAR086/valid-example.json b/src/test/resources/checks/v31/format/OAR086/valid-example.json index 01e82101..d5ab5527 100644 --- a/src/test/resources/checks/v31/format/OAR086/valid-example.json +++ b/src/test/resources/checks/v31/format/OAR086/valid-example.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "title": "Sample API", "version": "1.0.0", diff --git a/src/test/resources/checks/v31/format/OAR086/valid-example.yaml b/src/test/resources/checks/v31/format/OAR086/valid-example.yaml index ef4ed2a8..80f3e098 100644 --- a/src/test/resources/checks/v31/format/OAR086/valid-example.yaml +++ b/src/test/resources/checks/v31/format/OAR086/valid-example.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.1 +openapi: "3.1.0" info: title: Sample-API_efc2b9f76813_V description: API de ejemplo para pruebas. diff --git a/src/test/resources/checks/v31/format/OAR087/invalid-example.json b/src/test/resources/checks/v31/format/OAR087/invalid-example.json index afcb9b95..889a27d5 100644 --- a/src/test/resources/checks/v31/format/OAR087/invalid-example.json +++ b/src/test/resources/checks/v31/format/OAR087/invalid-example.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "title": "Sample API", "version": "1.0.0", diff --git a/src/test/resources/checks/v31/format/OAR087/invalid-example.yaml b/src/test/resources/checks/v31/format/OAR087/invalid-example.yaml index 32d303bf..75505d39 100644 --- a/src/test/resources/checks/v31/format/OAR087/invalid-example.yaml +++ b/src/test/resources/checks/v31/format/OAR087/invalid-example.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.0 +openapi: "3.1.0" info: title: Sample API version: 1.0.0 diff --git a/src/test/resources/checks/v31/format/OAR087/valid-example.json b/src/test/resources/checks/v31/format/OAR087/valid-example.json index e5974b79..8cd05ea7 100644 --- a/src/test/resources/checks/v31/format/OAR087/valid-example.json +++ b/src/test/resources/checks/v31/format/OAR087/valid-example.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "title": "Sample API", "version": "1.0.0", diff --git a/src/test/resources/checks/v31/format/OAR087/valid-example.yaml b/src/test/resources/checks/v31/format/OAR087/valid-example.yaml index 640a360c..b34f0e82 100644 --- a/src/test/resources/checks/v31/format/OAR087/valid-example.yaml +++ b/src/test/resources/checks/v31/format/OAR087/valid-example.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.0 +openapi: "3.1.0" info: title: Sample API version: 1.0.0 diff --git a/src/test/resources/checks/v31/format/OAR088/invalid-ref.json b/src/test/resources/checks/v31/format/OAR088/invalid-ref.json index 0c64ff1b..ced98ae3 100644 --- a/src/test/resources/checks/v31/format/OAR088/invalid-ref.json +++ b/src/test/resources/checks/v31/format/OAR088/invalid-ref.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "title": "API de ejemplo", "version": "1.0" diff --git a/src/test/resources/checks/v31/format/OAR088/invalid-ref.yaml b/src/test/resources/checks/v31/format/OAR088/invalid-ref.yaml index 1fcb570d..1abb7819 100644 --- a/src/test/resources/checks/v31/format/OAR088/invalid-ref.yaml +++ b/src/test/resources/checks/v31/format/OAR088/invalid-ref.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.0 +openapi: "3.1.0" info: title: API de ejemplo version: "1.0" diff --git a/src/test/resources/checks/v31/format/OAR088/valid-ref.json b/src/test/resources/checks/v31/format/OAR088/valid-ref.json index c113399f..c361f98d 100644 --- a/src/test/resources/checks/v31/format/OAR088/valid-ref.json +++ b/src/test/resources/checks/v31/format/OAR088/valid-ref.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "title": "API de ejemplo", "version": "1.0" diff --git a/src/test/resources/checks/v31/format/OAR088/valid-ref.yaml b/src/test/resources/checks/v31/format/OAR088/valid-ref.yaml index 3a2d8abe..ef683a20 100644 --- a/src/test/resources/checks/v31/format/OAR088/valid-ref.yaml +++ b/src/test/resources/checks/v31/format/OAR088/valid-ref.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.0 +openapi: "3.1.0" info: title: API de ejemplo version: "1.0" diff --git a/src/test/resources/checks/v31/format/OAR089/invalid-ref.json b/src/test/resources/checks/v31/format/OAR089/invalid-ref.json index 9c316602..8cc79655 100644 --- a/src/test/resources/checks/v31/format/OAR089/invalid-ref.json +++ b/src/test/resources/checks/v31/format/OAR089/invalid-ref.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "title": "API Sample", "version": "1.0.0" diff --git a/src/test/resources/checks/v31/format/OAR089/invalid-ref.yaml b/src/test/resources/checks/v31/format/OAR089/invalid-ref.yaml index 21fe46df..49be8527 100644 --- a/src/test/resources/checks/v31/format/OAR089/invalid-ref.yaml +++ b/src/test/resources/checks/v31/format/OAR089/invalid-ref.yaml @@ -1,4 +1,4 @@ -openapi: '3.0.0' +openapi: '3.1.0' info: title: API Sample version: '1.0.0' diff --git a/src/test/resources/checks/v31/format/OAR089/valid-ref.json b/src/test/resources/checks/v31/format/OAR089/valid-ref.json index 0dcbcfa9..55fb2ff7 100644 --- a/src/test/resources/checks/v31/format/OAR089/valid-ref.json +++ b/src/test/resources/checks/v31/format/OAR089/valid-ref.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "title": "API Sample", "version": "1.0.0" diff --git a/src/test/resources/checks/v31/format/OAR089/valid-ref.yaml b/src/test/resources/checks/v31/format/OAR089/valid-ref.yaml index df379934..0c67ffbb 100644 --- a/src/test/resources/checks/v31/format/OAR089/valid-ref.yaml +++ b/src/test/resources/checks/v31/format/OAR089/valid-ref.yaml @@ -1,4 +1,4 @@ -openapi: '3.0.0' +openapi: '3.1.0' info: title: API Sample version: '1.0.0' diff --git a/src/test/resources/checks/v31/format/OAR090/invalid-ref.json b/src/test/resources/checks/v31/format/OAR090/invalid-ref.json index 497987b9..b92997a8 100644 --- a/src/test/resources/checks/v31/format/OAR090/invalid-ref.json +++ b/src/test/resources/checks/v31/format/OAR090/invalid-ref.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "title": "Sample API", "version": "1.0.0" diff --git a/src/test/resources/checks/v31/format/OAR090/invalid-ref.yaml b/src/test/resources/checks/v31/format/OAR090/invalid-ref.yaml index 8bcdbea7..2d69ecf6 100644 --- a/src/test/resources/checks/v31/format/OAR090/invalid-ref.yaml +++ b/src/test/resources/checks/v31/format/OAR090/invalid-ref.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.0 +openapi: "3.1.0" info: title: Sample API version: 1.0.0 diff --git a/src/test/resources/checks/v31/format/OAR090/valid-ref.json b/src/test/resources/checks/v31/format/OAR090/valid-ref.json index 304be99f..22faee1d 100644 --- a/src/test/resources/checks/v31/format/OAR090/valid-ref.json +++ b/src/test/resources/checks/v31/format/OAR090/valid-ref.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "title": "Sample API", "version": "1.0.0" diff --git a/src/test/resources/checks/v31/format/OAR090/valid-ref.yaml b/src/test/resources/checks/v31/format/OAR090/valid-ref.yaml index a93e0313..7996672c 100644 --- a/src/test/resources/checks/v31/format/OAR090/valid-ref.yaml +++ b/src/test/resources/checks/v31/format/OAR090/valid-ref.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.0 +openapi: "3.1.0" info: title: Sample API version: 1.0.0 diff --git a/src/test/resources/checks/v31/format/OAR097/too-short.json b/src/test/resources/checks/v31/format/OAR097/too-short.json index aefcb581..9a614754 100644 --- a/src/test/resources/checks/v31/format/OAR097/too-short.json +++ b/src/test/resources/checks/v31/format/OAR097/too-short.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.1.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v31/format/OAR097/too-short.yaml b/src/test/resources/checks/v31/format/OAR097/too-short.yaml index 8ace3d73..3b60c330 100644 --- a/src/test/resources/checks/v31/format/OAR097/too-short.yaml +++ b/src/test/resources/checks/v31/format/OAR097/too-short.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/format/OAR097/valid.json b/src/test/resources/checks/v31/format/OAR097/valid.json index 6d48f8b4..f42208e2 100644 --- a/src/test/resources/checks/v31/format/OAR097/valid.json +++ b/src/test/resources/checks/v31/format/OAR097/valid.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v31/format/OAR097/valid.yaml b/src/test/resources/checks/v31/format/OAR097/valid.yaml index 89bfccfb..d57d39cb 100644 --- a/src/test/resources/checks/v31/format/OAR097/valid.yaml +++ b/src/test/resources/checks/v31/format/OAR097/valid.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/format/OAR098/too-long.json b/src/test/resources/checks/v31/format/OAR098/too-long.json index c142c217..b77b2423 100644 --- a/src/test/resources/checks/v31/format/OAR098/too-long.json +++ b/src/test/resources/checks/v31/format/OAR098/too-long.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.1.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v31/format/OAR098/too-long.yaml b/src/test/resources/checks/v31/format/OAR098/too-long.yaml index a24776c2..d396d837 100644 --- a/src/test/resources/checks/v31/format/OAR098/too-long.yaml +++ b/src/test/resources/checks/v31/format/OAR098/too-long.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/format/OAR098/valid.json b/src/test/resources/checks/v31/format/OAR098/valid.json index 6d48f8b4..f42208e2 100644 --- a/src/test/resources/checks/v31/format/OAR098/valid.json +++ b/src/test/resources/checks/v31/format/OAR098/valid.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v31/format/OAR098/valid.yaml b/src/test/resources/checks/v31/format/OAR098/valid.yaml index 89bfccfb..d57d39cb 100644 --- a/src/test/resources/checks/v31/format/OAR098/valid.yaml +++ b/src/test/resources/checks/v31/format/OAR098/valid.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/format/OAR099/valid.json b/src/test/resources/checks/v31/format/OAR099/valid.json index 6d48f8b4..f42208e2 100644 --- a/src/test/resources/checks/v31/format/OAR099/valid.json +++ b/src/test/resources/checks/v31/format/OAR099/valid.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v31/format/OAR099/valid.yaml b/src/test/resources/checks/v31/format/OAR099/valid.yaml index 89bfccfb..d57d39cb 100644 --- a/src/test/resources/checks/v31/format/OAR099/valid.yaml +++ b/src/test/resources/checks/v31/format/OAR099/valid.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/format/OAR099/without-api-prefix.json b/src/test/resources/checks/v31/format/OAR099/without-api-prefix.json index f3940f84..3004908b 100644 --- a/src/test/resources/checks/v31/format/OAR099/without-api-prefix.json +++ b/src/test/resources/checks/v31/format/OAR099/without-api-prefix.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.1.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v31/format/OAR099/without-api-prefix.yaml b/src/test/resources/checks/v31/format/OAR099/without-api-prefix.yaml index f774c12e..52d0ce55 100644 --- a/src/test/resources/checks/v31/format/OAR099/without-api-prefix.yaml +++ b/src/test/resources/checks/v31/format/OAR099/without-api-prefix.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/format/OAR100/incorrect-version.json b/src/test/resources/checks/v31/format/OAR100/incorrect-version.json index c2673393..2e24e8e4 100644 --- a/src/test/resources/checks/v31/format/OAR100/incorrect-version.json +++ b/src/test/resources/checks/v31/format/OAR100/incorrect-version.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.1.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v31/format/OAR100/incorrect-version.yaml b/src/test/resources/checks/v31/format/OAR100/incorrect-version.yaml index 9c20380c..a6aeb985 100644 --- a/src/test/resources/checks/v31/format/OAR100/incorrect-version.yaml +++ b/src/test/resources/checks/v31/format/OAR100/incorrect-version.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/format/OAR100/valid.json b/src/test/resources/checks/v31/format/OAR100/valid.json index 6d48f8b4..f42208e2 100644 --- a/src/test/resources/checks/v31/format/OAR100/valid.json +++ b/src/test/resources/checks/v31/format/OAR100/valid.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v31/format/OAR100/valid.yaml b/src/test/resources/checks/v31/format/OAR100/valid.yaml index 89bfccfb..d57d39cb 100644 --- a/src/test/resources/checks/v31/format/OAR100/valid.yaml +++ b/src/test/resources/checks/v31/format/OAR100/valid.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/format/OAR101/empty-path.json b/src/test/resources/checks/v31/format/OAR101/empty-path.json index 6341fc10..e207fd95 100644 --- a/src/test/resources/checks/v31/format/OAR101/empty-path.json +++ b/src/test/resources/checks/v31/format/OAR101/empty-path.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v31/format/OAR101/empty-path.yaml b/src/test/resources/checks/v31/format/OAR101/empty-path.yaml index 8925b6e8..1af86644 100644 --- a/src/test/resources/checks/v31/format/OAR101/empty-path.yaml +++ b/src/test/resources/checks/v31/format/OAR101/empty-path.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/format/OAR101/invalid.json b/src/test/resources/checks/v31/format/OAR101/invalid.json index 0ab8f8ab..6c4219c6 100644 --- a/src/test/resources/checks/v31/format/OAR101/invalid.json +++ b/src/test/resources/checks/v31/format/OAR101/invalid.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v31/format/OAR101/invalid.yaml b/src/test/resources/checks/v31/format/OAR101/invalid.yaml index d06571ea..7cf78e4d 100644 --- a/src/test/resources/checks/v31/format/OAR101/invalid.yaml +++ b/src/test/resources/checks/v31/format/OAR101/invalid.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/format/OAR101/valid-with-values.json b/src/test/resources/checks/v31/format/OAR101/valid-with-values.json index 3ea07fc5..646c5820 100644 --- a/src/test/resources/checks/v31/format/OAR101/valid-with-values.json +++ b/src/test/resources/checks/v31/format/OAR101/valid-with-values.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v31/format/OAR101/valid-with-values.yaml b/src/test/resources/checks/v31/format/OAR101/valid-with-values.yaml index 89bfccfb..d57d39cb 100644 --- a/src/test/resources/checks/v31/format/OAR101/valid-with-values.yaml +++ b/src/test/resources/checks/v31/format/OAR101/valid-with-values.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/format/OAR101/valid.json b/src/test/resources/checks/v31/format/OAR101/valid.json index 6d48f8b4..f42208e2 100644 --- a/src/test/resources/checks/v31/format/OAR101/valid.json +++ b/src/test/resources/checks/v31/format/OAR101/valid.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v31/format/OAR101/valid.yaml b/src/test/resources/checks/v31/format/OAR101/valid.yaml index 89bfccfb..d57d39cb 100644 --- a/src/test/resources/checks/v31/format/OAR101/valid.yaml +++ b/src/test/resources/checks/v31/format/OAR101/valid.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/format/OAR102/invalid.json b/src/test/resources/checks/v31/format/OAR102/invalid.json index ee51dd65..6a65ea93 100644 --- a/src/test/resources/checks/v31/format/OAR102/invalid.json +++ b/src/test/resources/checks/v31/format/OAR102/invalid.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v31/format/OAR102/invalid.yaml b/src/test/resources/checks/v31/format/OAR102/invalid.yaml index ca2c1240..213b4cf7 100644 --- a/src/test/resources/checks/v31/format/OAR102/invalid.yaml +++ b/src/test/resources/checks/v31/format/OAR102/invalid.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/format/OAR102/one-part-path.json b/src/test/resources/checks/v31/format/OAR102/one-part-path.json index 3679b681..a0c31961 100644 --- a/src/test/resources/checks/v31/format/OAR102/one-part-path.json +++ b/src/test/resources/checks/v31/format/OAR102/one-part-path.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v31/format/OAR102/one-part-path.yaml b/src/test/resources/checks/v31/format/OAR102/one-part-path.yaml index 84c7df71..68b06983 100644 --- a/src/test/resources/checks/v31/format/OAR102/one-part-path.yaml +++ b/src/test/resources/checks/v31/format/OAR102/one-part-path.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/format/OAR102/valid-with-values.json b/src/test/resources/checks/v31/format/OAR102/valid-with-values.json index 3ea07fc5..646c5820 100644 --- a/src/test/resources/checks/v31/format/OAR102/valid-with-values.json +++ b/src/test/resources/checks/v31/format/OAR102/valid-with-values.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v31/format/OAR102/valid-with-values.yaml b/src/test/resources/checks/v31/format/OAR102/valid-with-values.yaml index 89bfccfb..d57d39cb 100644 --- a/src/test/resources/checks/v31/format/OAR102/valid-with-values.yaml +++ b/src/test/resources/checks/v31/format/OAR102/valid-with-values.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/format/OAR102/valid.json b/src/test/resources/checks/v31/format/OAR102/valid.json index 6d48f8b4..f42208e2 100644 --- a/src/test/resources/checks/v31/format/OAR102/valid.json +++ b/src/test/resources/checks/v31/format/OAR102/valid.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v31/format/OAR102/valid.yaml b/src/test/resources/checks/v31/format/OAR102/valid.yaml index 89bfccfb..d57d39cb 100644 --- a/src/test/resources/checks/v31/format/OAR102/valid.yaml +++ b/src/test/resources/checks/v31/format/OAR102/valid.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/format/OAR110/valid.json b/src/test/resources/checks/v31/format/OAR110/valid.json index 0828cc2f..8ccf378f 100644 --- a/src/test/resources/checks/v31/format/OAR110/valid.json +++ b/src/test/resources/checks/v31/format/OAR110/valid.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "title": "API de Ejemplo", "version": "1.0.0", diff --git a/src/test/resources/checks/v31/format/OAR110/valid.yaml b/src/test/resources/checks/v31/format/OAR110/valid.yaml index 0185cb17..b044e7c9 100644 --- a/src/test/resources/checks/v31/format/OAR110/valid.yaml +++ b/src/test/resources/checks/v31/format/OAR110/valid.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.0 +openapi: "3.1.0" info: title: API de Ejemplo version: 1.0.0 diff --git a/src/test/resources/checks/v31/format/OAR111/valid.json b/src/test/resources/checks/v31/format/OAR111/valid.json index 0828cc2f..8ccf378f 100644 --- a/src/test/resources/checks/v31/format/OAR111/valid.json +++ b/src/test/resources/checks/v31/format/OAR111/valid.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "title": "API de Ejemplo", "version": "1.0.0", diff --git a/src/test/resources/checks/v31/format/OAR111/valid.yaml b/src/test/resources/checks/v31/format/OAR111/valid.yaml index 5b95c019..625fb374 100644 --- a/src/test/resources/checks/v31/format/OAR111/valid.yaml +++ b/src/test/resources/checks/v31/format/OAR111/valid.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.0 +openapi: "3.1.0" info: title: API de Ejemplo version: 1.0.0 diff --git a/src/test/resources/checks/v31/format/OAR113/invalid.json b/src/test/resources/checks/v31/format/OAR113/invalid.json index 8fc8181f..2cf39330 100644 --- a/src/test/resources/checks/v31/format/OAR113/invalid.json +++ b/src/test/resources/checks/v31/format/OAR113/invalid.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "version": "1.0.0", "title": "Sample API" diff --git a/src/test/resources/checks/v31/format/OAR113/invalid.yaml b/src/test/resources/checks/v31/format/OAR113/invalid.yaml index eaab54bb..194ad4a4 100644 --- a/src/test/resources/checks/v31/format/OAR113/invalid.yaml +++ b/src/test/resources/checks/v31/format/OAR113/invalid.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: "1.0.0" title: "Sample API" diff --git a/src/test/resources/checks/v31/format/OAR113/valid.json b/src/test/resources/checks/v31/format/OAR113/valid.json index 3c078dc6..88a6b00a 100644 --- a/src/test/resources/checks/v31/format/OAR113/valid.json +++ b/src/test/resources/checks/v31/format/OAR113/valid.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "version": "1.0.0", "title": "Sample API", diff --git a/src/test/resources/checks/v31/format/OAR113/valid.yaml b/src/test/resources/checks/v31/format/OAR113/valid.yaml index be171009..da6fd6ce 100644 --- a/src/test/resources/checks/v31/format/OAR113/valid.yaml +++ b/src/test/resources/checks/v31/format/OAR113/valid.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: "1.0.0" title: "Sample API" diff --git a/src/test/resources/checks/v31/format/OAR115/invalid.json b/src/test/resources/checks/v31/format/OAR115/invalid.json index 5b686976..7147848f 100644 --- a/src/test/resources/checks/v31/format/OAR115/invalid.json +++ b/src/test/resources/checks/v31/format/OAR115/invalid.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "title": "API de ejemplo", "version": "1.0.0" diff --git a/src/test/resources/checks/v31/format/OAR115/invalid.yaml b/src/test/resources/checks/v31/format/OAR115/invalid.yaml index 5f3876b2..29ea6f8e 100644 --- a/src/test/resources/checks/v31/format/OAR115/invalid.yaml +++ b/src/test/resources/checks/v31/format/OAR115/invalid.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.0 +openapi: "3.1.0" info: title: API de ejemplo version: "1.0.0" diff --git a/src/test/resources/checks/v31/format/OAR115/valid.json b/src/test/resources/checks/v31/format/OAR115/valid.json index 1574947e..1bc0ee2a 100644 --- a/src/test/resources/checks/v31/format/OAR115/valid.json +++ b/src/test/resources/checks/v31/format/OAR115/valid.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "title": "API de ejemplo", "version": "1.0.0" diff --git a/src/test/resources/checks/v31/format/OAR115/valid.yaml b/src/test/resources/checks/v31/format/OAR115/valid.yaml index c97cfb50..16c59909 100644 --- a/src/test/resources/checks/v31/format/OAR115/valid.yaml +++ b/src/test/resources/checks/v31/format/OAR115/valid.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.0 +openapi: "3.1.0" info: title: API de ejemplo version: "1.0.0" diff --git a/src/test/resources/checks/v31/operations/OAR008/plain.json b/src/test/resources/checks/v31/operations/OAR008/plain.json index 872d387f..ab584727 100644 --- a/src/test/resources/checks/v31/operations/OAR008/plain.json +++ b/src/test/resources/checks/v31/operations/OAR008/plain.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.1.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v31/operations/OAR008/plain.yaml b/src/test/resources/checks/v31/operations/OAR008/plain.yaml index 97f9dab8..7465d2ea 100644 --- a/src/test/resources/checks/v31/operations/OAR008/plain.yaml +++ b/src/test/resources/checks/v31/operations/OAR008/plain.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/operations/OAR013/plain.json b/src/test/resources/checks/v31/operations/OAR013/plain.json new file mode 100644 index 00000000..f490b2bb --- /dev/null +++ b/src/test/resources/checks/v31/operations/OAR013/plain.json @@ -0,0 +1,25 @@ +{ + "openapi" : "3.1.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/pets" : { + "get" : { + "responses" : { # Noncompliant {{OAR013: Default response is required}} + "200" : { + "description" : "Ok" + } + } + }, + "post" : { + "responses" : { + "default" : { + "description" : "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/operations/OAR013/plain.yaml b/src/test/resources/checks/v31/operations/OAR013/plain.yaml new file mode 100644 index 00000000..4b796abc --- /dev/null +++ b/src/test/resources/checks/v31/operations/OAR013/plain.yaml @@ -0,0 +1,14 @@ +openapi: "3.1.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: + get: + responses: # Noncompliant {{OAR013: Default response is required}} + 200: + description: Ok + post: + responses: + default: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v31/operations/OAR014/plain.json b/src/test/resources/checks/v31/operations/OAR014/plain.json new file mode 100644 index 00000000..ae30763d --- /dev/null +++ b/src/test/resources/checks/v31/operations/OAR014/plain.json @@ -0,0 +1,54 @@ +{ + "openapi": "3.1.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/one": { + "get": { + "responses": { + "default": { + "description": "Ok" + } + } + } + }, + "/one/two": { + "get": { + "responses": { + "default": { + "description": "Ok" + } + } + } + }, + "/one/two/three": { + "get": { + "responses": { + "default": { + "description": "Ok" + } + } + } + }, + "/one/two/three/four": { # Noncompliant {{OAR014: Resources depth level should be smaller}} + "get": { + "responses": { + "default": { + "description": "Ok" + } + } + } + }, + "/one/two/three/four/five": { # Noncompliant {{OAR014: Resources depth level should be smaller}} + "get": { + "responses": { + "default": { + "description": "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/operations/OAR014/plain.yaml b/src/test/resources/checks/v31/operations/OAR014/plain.yaml new file mode 100644 index 00000000..0e563616 --- /dev/null +++ b/src/test/resources/checks/v31/operations/OAR014/plain.yaml @@ -0,0 +1,30 @@ +openapi: "3.1.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /one: + get: + responses: + default: + description: Ok + /one/two: + get: + responses: + default: + description: Ok + /one/two/three: + get: + responses: + default: + description: Ok + /one/two/three/four: # Noncompliant {{OAR014: Resources depth level should be smaller}} + get: + responses: + default: + description: Ok + /one/two/three/four/five: # Noncompliant {{OAR014: Resources depth level should be smaller}} + get: + responses: + default: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v31/operations/OAR015/plain.json b/src/test/resources/checks/v31/operations/OAR015/plain.json new file mode 100644 index 00000000..cbdd1838 --- /dev/null +++ b/src/test/resources/checks/v31/operations/OAR015/plain.json @@ -0,0 +1,72 @@ +{ + "openapi": "3.1.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/one": { + "get": { + "responses": { + "default": { + "description": "Ok" + } + } + } + }, + "/one/two": { + "get": { + "responses": { + "default": { + "description": "Ok" + } + } + } + }, + "/one/two/three": { + "get": { + "responses": { + "default": { + "description": "Ok" + } + } + } + }, + "/one/two/three/four": { + "get": { + "responses": { + "default": { + "description": "Ok" + } + } + } + }, + "/one/two/three/four/five": { + "get": { + "responses": { + "default": { + "description": "Ok" + } + } + } + }, + "/one/two/three/four/five/six": { # Noncompliant {{OAR015: Resources depth level should be smaller}} + "get": { + "responses": { + "default": { + "description": "Ok" + } + } + } + }, + "/one/two/three/four/five/six/seven": { # Noncompliant {{OAR015: Resources depth level should be smaller}} + "get": { + "responses": { + "default": { + "description": "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/operations/OAR015/plain.yaml b/src/test/resources/checks/v31/operations/OAR015/plain.yaml new file mode 100644 index 00000000..e298945b --- /dev/null +++ b/src/test/resources/checks/v31/operations/OAR015/plain.yaml @@ -0,0 +1,40 @@ +openapi: "3.1.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /one: + get: + responses: + default: + description: Ok + /one/two: + get: + responses: + default: + description: Ok + /one/two/three: + get: + responses: + default: + description: Ok + /one/two/three/four: + get: + responses: + default: + description: Ok + /one/two/three/four/five: + get: + responses: + default: + description: Ok + /one/two/three/four/five/six: # Noncompliant {{OAR015: Resources depth level should be smaller}} + get: + responses: + default: + description: Ok + /one/two/three/four/five/six/seven: # Noncompliant {{OAR015: Resources depth level should be smaller}} + get: + responses: + default: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v31/operations/OAR017/plain.json b/src/test/resources/checks/v31/operations/OAR017/plain.json new file mode 100644 index 00000000..53a7d191 --- /dev/null +++ b/src/test/resources/checks/v31/operations/OAR017/plain.json @@ -0,0 +1,54 @@ +{ + "openapi" : "3.1.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/one/me" : { # Noncompliant {{OAR017: Pattern 'me' not allowed}} + "get" : { + "responses" : { + "200" : { + "description" : "Ok" + } + } + } + }, + "/{one}" : { + "get" : { + "responses" : { + "200" : { + "description" : "Ok" + } + } + } + }, + "/one/two" : { + "get" : { + "responses" : { + "200" : { + "description" : "Ok" + } + } + } + }, + "/one/{two}" : { + "get" : { + "responses" : { + "200" : { + "description" : "Ok" + } + } + } + }, + "/one/{two}/three" : { + "get" : { + "responses" : { + "200" : { + "description" : "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/operations/OAR017/plain.yaml b/src/test/resources/checks/v31/operations/OAR017/plain.yaml new file mode 100644 index 00000000..4d0c3ae4 --- /dev/null +++ b/src/test/resources/checks/v31/operations/OAR017/plain.yaml @@ -0,0 +1,30 @@ +openapi: "3.1.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /one/me: # Noncompliant {{OAR017: Pattern 'me' not allowed}} + get: + responses: + 200: + description: Ok + /{one}: + get: + responses: + 200: + description: Ok + /one/two: + get: + responses: + 200: + description: Ok + /one/{two}: + get: + responses: + 200: + description: Ok + /one/{two}/three: + get: + responses: + 200: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v31/operations/OAR018/plain.json b/src/test/resources/checks/v31/operations/OAR018/plain.json new file mode 100644 index 00000000..81702ff0 --- /dev/null +++ b/src/test/resources/checks/v31/operations/OAR018/plain.json @@ -0,0 +1,194 @@ +{ + "openapi": "3.1.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/resources": { + "get": { + "responses": { + "200": { + "description": "Ok" + } + } + }, + "post": { + "responses": { + "200": { + "description": "Ok" + } + } + }, + "put": { # Noncompliant {{OAR018: Operation not recommended for resource path: /resources}} + "responses": { + "200": { + "description": "Ok" + } + } + }, + "patch": { # Noncompliant {{OAR018: Operation not recommended for resource path: /resources}} + "responses": { + "200": { + "description": "Ok" + } + } + }, + "delete": { # Noncompliant {{OAR018: Operation not recommended for resource path: /resources}} + "responses": { + "200": { + "description": "Ok" + } + } + } + }, + "/resources/{r_id}": { + "get": { + "responses": { + "200": { + "description": "Ok" + } + } + }, + "post": { # Noncompliant {{OAR018: Operation not recommended for resource path: /resources/{r_id}}} + "responses": { + "200": { + "description": "Ok" + } + } + }, + "put": { + "responses": { + "200": { + "description": "Ok" + } + } + }, + "patch": { + "responses": { + "200": { + "description": "Ok" + } + } + }, + "delete": { + "responses": { + "200": { + "description": "Ok" + } + } + } + }, + "/resources/get": { + "get": { # Noncompliant {{OAR018: Operation not recommended for resource path: /resources/get}} + "responses": { + "200": { + "description": "Ok" + } + } + }, + "post": { + "responses": { + "200": { + "description": "Ok" + } + } + }, + "put": { # Noncompliant {{OAR018: Operation not recommended for resource path: /resources/get}} + "responses": { + "200": { + "description": "Ok" + } + } + }, + "patch": { # Noncompliant {{OAR018: Operation not recommended for resource path: /resources/get}} + "responses": { + "200": { + "description": "Ok" + } + } + }, + "delete": { # Noncompliant {{OAR018: Operation not recommended for resource path: /resources/get}} + "responses": { + "200": { + "description": "Ok" + } + } + } + }, + "/resources/delete": { + "get": { # Noncompliant {{OAR018: Operation not recommended for resource path: /resources/delete}} + "responses": { + "200": { + "description": "Ok" + } + } + }, + "post": { + "responses": { + "200": { + "description": "Ok" + } + } + }, + "put": { # Noncompliant {{OAR018: Operation not recommended for resource path: /resources/delete}} + "responses": { + "200": { + "description": "Ok" + } + } + }, + "patch": { # Noncompliant {{OAR018: Operation not recommended for resource path: /resources/delete}} + "responses": { + "200": { + "description": "Ok" + } + } + }, + "delete": { # Noncompliant {{OAR018: Operation not recommended for resource path: /resources/delete}} + "responses": { + "200": { + "description": "Ok" + } + } + } + }, + "/resources/{r_id}/other": { + "get": { + "responses": { + "200": { + "description": "Ok" + } + } + }, + "post": { + "responses": { + "200": { + "description": "Ok" + } + } + }, + "put": { # Noncompliant {{OAR018: Operation not recommended for resource path: /resources/{r_id}/other}} + "responses": { + "200": { + "description": "Ok" + } + } + }, + "patch": { # Noncompliant {{OAR018: Operation not recommended for resource path: /resources/{r_id}/other}} + "responses": { + "200": { + "description": "Ok" + } + } + }, + "delete": { # Noncompliant {{OAR018: Operation not recommended for resource path: /resources/{r_id}/other}} + "responses": { + "200": { + "description": "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/operations/OAR018/plain.yaml b/src/test/resources/checks/v31/operations/OAR018/plain.yaml new file mode 100644 index 00000000..7dda8975 --- /dev/null +++ b/src/test/resources/checks/v31/operations/OAR018/plain.yaml @@ -0,0 +1,114 @@ +openapi: "3.1.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /resources: + get: + responses: + 200: + description: Ok + post: + responses: + 200: + description: Ok + put: # Noncompliant {{OAR018: Operation not recommended for resource path: /resources}} + responses: + 200: + description: Ok + patch: # Noncompliant {{OAR018: Operation not recommended for resource path: /resources}} + responses: + 200: + description: Ok + delete: # Noncompliant {{OAR018: Operation not recommended for resource path: /resources}} + responses: + 200: + description: Ok + + /resources/{r_id}: + get: + responses: + 200: + description: Ok + post: # Noncompliant {{OAR018: Operation not recommended for resource path: /resources/{r_id}}} + responses: + 200: + description: Ok + put: + responses: + 200: + description: Ok + patch: + responses: + 200: + description: Ok + delete: + responses: + 200: + description: Ok + + /resources/get: + get: # Noncompliant {{OAR018: Operation not recommended for resource path: /resources/get}} + responses: + 200: + description: Ok + post: + responses: + 200: + description: Ok + put: # Noncompliant {{OAR018: Operation not recommended for resource path: /resources/get}} + responses: + 200: + description: Ok + patch: # Noncompliant {{OAR018: Operation not recommended for resource path: /resources/get}} + responses: + 200: + description: Ok + delete: # Noncompliant {{OAR018: Operation not recommended for resource path: /resources/get}} + responses: + 200: + description: Ok + + /resources/delete: + get: # Noncompliant {{OAR018: Operation not recommended for resource path: /resources/delete}} + responses: + 200: + description: Ok + post: + responses: + 200: + description: Ok + put: # Noncompliant {{OAR018: Operation not recommended for resource path: /resources/delete}} + responses: + 200: + description: Ok + patch: # Noncompliant {{OAR018: Operation not recommended for resource path: /resources/delete}} + responses: + 200: + description: Ok + delete: # Noncompliant {{OAR018: Operation not recommended for resource path: /resources/delete}} + responses: + 200: + description: Ok + + /resources/{r_id}/other: + get: + responses: + 200: + description: Ok + post: + responses: + 200: + description: Ok + put: # Noncompliant {{OAR018: Operation not recommended for resource path: /resources/{r_id}/other}} + responses: + 200: + description: Ok + patch: # Noncompliant {{OAR018: Operation not recommended for resource path: /resources/{r_id}/other}} + responses: + 200: + description: Ok + delete: # Noncompliant {{OAR018: Operation not recommended for resource path: /resources/{r_id}/other}} + responses: + 200: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v31/operations/OAR027/no-post.json b/src/test/resources/checks/v31/operations/OAR027/no-post.json new file mode 100644 index 00000000..eead3f51 --- /dev/null +++ b/src/test/resources/checks/v31/operations/OAR027/no-post.json @@ -0,0 +1,18 @@ +{ + "openapi" : "3.1.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/pets" : { + "get" : { + "responses" : { + "201" : { + "description" : "Found" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/operations/OAR027/no-post.yaml b/src/test/resources/checks/v31/operations/OAR027/no-post.yaml new file mode 100644 index 00000000..63054920 --- /dev/null +++ b/src/test/resources/checks/v31/operations/OAR027/no-post.yaml @@ -0,0 +1,10 @@ +openapi: "3.1.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: + get: + responses: + 201: + description: Found \ No newline at end of file diff --git a/src/test/resources/checks/v31/operations/OAR027/post-201-with-location.json b/src/test/resources/checks/v31/operations/OAR027/post-201-with-location.json new file mode 100644 index 00000000..d1359d6e --- /dev/null +++ b/src/test/resources/checks/v31/operations/OAR027/post-201-with-location.json @@ -0,0 +1,25 @@ +{ + "openapi" : "3.1.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/pets/" : { + "post" : { + "responses" : { + "201" : { + "description" : "Created", + "headers" : { + "Location" : { + "schema": { + "type" : "string" + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/operations/OAR027/post-201-with-location.yaml b/src/test/resources/checks/v31/operations/OAR027/post-201-with-location.yaml new file mode 100644 index 00000000..e772b5ce --- /dev/null +++ b/src/test/resources/checks/v31/operations/OAR027/post-201-with-location.yaml @@ -0,0 +1,14 @@ +openapi: "3.1.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets/: + post: + responses: + 201: + description: Created + headers: + Location: + schema: + type: string \ No newline at end of file diff --git a/src/test/resources/checks/v31/operations/OAR027/post-201-with-other-headers.json b/src/test/resources/checks/v31/operations/OAR027/post-201-with-other-headers.json new file mode 100644 index 00000000..e62d413a --- /dev/null +++ b/src/test/resources/checks/v31/operations/OAR027/post-201-with-other-headers.json @@ -0,0 +1,25 @@ +{ + "openapi" : "3.1.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/pets/" : { + "post" : { + "responses" : { + "201" : { + "description" : "Created", + "headers" : { # Noncompliant {{OAR027: Location header is required in responses with code 201 from POST operations}} + "X-Location" : { + "schema": { + "type" : "string" + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/operations/OAR027/post-201-with-other-headers.yaml b/src/test/resources/checks/v31/operations/OAR027/post-201-with-other-headers.yaml new file mode 100644 index 00000000..8e8b26a3 --- /dev/null +++ b/src/test/resources/checks/v31/operations/OAR027/post-201-with-other-headers.yaml @@ -0,0 +1,14 @@ +openapi: "3.1.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets/: + post: + responses: + 201: + description: Created + headers: # Noncompliant {{OAR027: Location header is required in responses with code 201 from POST operations}} + X-Location: + schema: + type: string \ No newline at end of file diff --git a/src/test/resources/checks/v31/operations/OAR027/post-201-without-location.json b/src/test/resources/checks/v31/operations/OAR027/post-201-without-location.json new file mode 100644 index 00000000..efd4f635 --- /dev/null +++ b/src/test/resources/checks/v31/operations/OAR027/post-201-without-location.json @@ -0,0 +1,18 @@ +{ + "openapi" : "3.1.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/pets" : { + "post" : { + "responses" : { + "201" : { # Noncompliant {{OAR027: Location header is required in responses with code 201 from POST operations}} + "description" : "Created" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/operations/OAR027/post-201-without-location.yaml b/src/test/resources/checks/v31/operations/OAR027/post-201-without-location.yaml new file mode 100644 index 00000000..33660a6a --- /dev/null +++ b/src/test/resources/checks/v31/operations/OAR027/post-201-without-location.yaml @@ -0,0 +1,10 @@ +openapi: "3.1.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: + post: + responses: + 201: # Noncompliant {{OAR027: Location header is required in responses with code 201 from POST operations}} + description: Created \ No newline at end of file diff --git a/src/test/resources/checks/v31/operations/OAR027/post-no-201.json b/src/test/resources/checks/v31/operations/OAR027/post-no-201.json new file mode 100644 index 00000000..361a35ce --- /dev/null +++ b/src/test/resources/checks/v31/operations/OAR027/post-no-201.json @@ -0,0 +1,18 @@ +{ + "openapi" : "3.1.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/pets" : { + "post" : { + "responses" : { + "200" : { + "description" : "OK" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/operations/OAR027/post-no-201.yaml b/src/test/resources/checks/v31/operations/OAR027/post-no-201.yaml new file mode 100644 index 00000000..efa20b71 --- /dev/null +++ b/src/test/resources/checks/v31/operations/OAR027/post-no-201.yaml @@ -0,0 +1,10 @@ +openapi: "3.1.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: + post: + responses: + 200: + description: OK \ No newline at end of file diff --git a/src/test/resources/checks/v31/operations/OAR030/valid.json b/src/test/resources/checks/v31/operations/OAR030/valid.json new file mode 100644 index 00000000..af20c983 --- /dev/null +++ b/src/test/resources/checks/v31/operations/OAR030/valid.json @@ -0,0 +1,27 @@ +{ + "openapi" : "3.1.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/status" : { + "get" : { + "responses" : { + "200" : { + "description" : "Ok" + } + } + } + }, + "/other" : { + "get" : { + "responses" : { + "200" : { + "description" : "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/operations/OAR030/valid.yaml b/src/test/resources/checks/v31/operations/OAR030/valid.yaml new file mode 100644 index 00000000..08dbbc2b --- /dev/null +++ b/src/test/resources/checks/v31/operations/OAR030/valid.yaml @@ -0,0 +1,15 @@ +openapi: "3.1.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /status: + get: + responses: + 200: + description: Ok + /other: + get: + responses: + 200: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v31/operations/OAR030/with-status-without-get.json b/src/test/resources/checks/v31/operations/OAR030/with-status-without-get.json new file mode 100644 index 00000000..d5a75192 --- /dev/null +++ b/src/test/resources/checks/v31/operations/OAR030/with-status-without-get.json @@ -0,0 +1,27 @@ +{ + "openapi" : "3.1.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/status" : { # Noncompliant {{OAR030: Method get must be declared}} + "post" : { + "responses" : { + "200" : { + "description" : "Ok" + } + } + } + }, + "/other" : { + "get" : { + "responses" : { + "200" : { + "description" : "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/operations/OAR030/with-status-without-get.yaml b/src/test/resources/checks/v31/operations/OAR030/with-status-without-get.yaml new file mode 100644 index 00000000..343b365c --- /dev/null +++ b/src/test/resources/checks/v31/operations/OAR030/with-status-without-get.yaml @@ -0,0 +1,15 @@ +openapi: "3.1.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /status: # Noncompliant {{OAR030: Method get must be declared}} + post: + responses: + 200: + description: Ok + /other: + get: + responses: + 200: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v31/operations/OAR030/without-status.json b/src/test/resources/checks/v31/operations/OAR030/without-status.json new file mode 100644 index 00000000..840b42bb --- /dev/null +++ b/src/test/resources/checks/v31/operations/OAR030/without-status.json @@ -0,0 +1,18 @@ +{ + "openapi" : "3.1.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { # Noncompliant {{OAR030: The path '/status' must be declared}} + "/other" : { + "get" : { + "responses" : { + "200" : { + "description" : "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/operations/OAR030/without-status.yaml b/src/test/resources/checks/v31/operations/OAR030/without-status.yaml new file mode 100644 index 00000000..b59b6167 --- /dev/null +++ b/src/test/resources/checks/v31/operations/OAR030/without-status.yaml @@ -0,0 +1,10 @@ +openapi: "3.1.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: # Noncompliant {{OAR030: The path '/status' must be declared}} + /other: + get: + responses: + 200: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v31/operations/OAR032/forbidden-names.json b/src/test/resources/checks/v31/operations/OAR032/forbidden-names.json new file mode 100644 index 00000000..401f94be --- /dev/null +++ b/src/test/resources/checks/v31/operations/OAR032/forbidden-names.json @@ -0,0 +1,36 @@ +{ + "openapi" : "3.1.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/elements" : { # Noncompliant {{OAR032: Ambiguous path parts not encouraged: elements}} + "get" : { + "responses" : { + "200" : { + "description" : "Ok" + } + } + } + }, + "/a/nested/items" : { # Noncompliant {{OAR032: Ambiguous path parts not encouraged: items}} + "get" : { + "responses" : { + "200" : { + "description" : "Ok" + } + } + } + }, + "/another/{param}/with/valores" : { # Noncompliant {{OAR032: Ambiguous path parts not encouraged: valores}} + "get" : { + "responses" : { + "200" : { + "description" : "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/operations/OAR032/forbidden-names.yaml b/src/test/resources/checks/v31/operations/OAR032/forbidden-names.yaml new file mode 100644 index 00000000..7810e795 --- /dev/null +++ b/src/test/resources/checks/v31/operations/OAR032/forbidden-names.yaml @@ -0,0 +1,20 @@ +openapi: "3.1.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /elements: # Noncompliant {{OAR032: Ambiguous path parts not encouraged: elements}} + get: + responses: + 200: + description: Ok + /a/nested/items: # Noncompliant {{OAR032: Ambiguous path parts not encouraged: items}} + get: + responses: + 200: + description: Ok + /another/{param}/with/valores: # Noncompliant {{OAR032: Ambiguous path parts not encouraged: valores}} + get: + responses: + 200: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v31/operations/OAR032/valid.json b/src/test/resources/checks/v31/operations/OAR032/valid.json new file mode 100644 index 00000000..9cfe7d75 --- /dev/null +++ b/src/test/resources/checks/v31/operations/OAR032/valid.json @@ -0,0 +1,27 @@ +{ + "openapi" : "3.1.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/pets" : { + "get" : { + "responses" : { + "200" : { + "description" : "Ok" + } + } + } + }, + "/pets/{elements}" : { + "get" : { + "responses" : { + "200" : { + "description" : "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/operations/OAR032/valid.yaml b/src/test/resources/checks/v31/operations/OAR032/valid.yaml new file mode 100644 index 00000000..eae1ceba --- /dev/null +++ b/src/test/resources/checks/v31/operations/OAR032/valid.yaml @@ -0,0 +1,15 @@ +openapi: "3.1.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: + get: + responses: + 200: + description: Ok + /pets/{elements}: + get: + responses: + 200: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v31/operations/OAR038/valid-multiple-properties.json b/src/test/resources/checks/v31/operations/OAR038/valid-multiple-properties.json new file mode 100644 index 00000000..67723422 --- /dev/null +++ b/src/test/resources/checks/v31/operations/OAR038/valid-multiple-properties.json @@ -0,0 +1,48 @@ +{ + "openapi" : "3.1.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/endpoint" : { + "post" : { + "responses" : { + "201" : { + "description" : "Ok", + "content": { + "application/json":{ + "schema" : { + "$ref" : "#/components/schemas/response" + } + } + } + }, + "204" : { + "description" : "No content" + } + } + } + } + }, + "components": { + "schemas": { + "response" : { + "type" : "object", + "properties" : { + "data" : { + "type" : "object", + "properties" : { + "id" : { + "type" : "string" + }, + "name" : { + "type" : "string" + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/operations/OAR038/valid-multiple-properties.yaml b/src/test/resources/checks/v31/operations/OAR038/valid-multiple-properties.yaml new file mode 100644 index 00000000..fb5498dd --- /dev/null +++ b/src/test/resources/checks/v31/operations/OAR038/valid-multiple-properties.yaml @@ -0,0 +1,29 @@ +openapi: "3.1.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /endpoint: + post: + responses: + 201: + description: Ok + content: + application/json: + schema: + $ref: '#/components/schemas/response' + 204: + description: No content + +components: + schemas: + response: + type: object + properties: + data: + type: object + properties: + id: + type: string + name: + type: string diff --git a/src/test/resources/checks/v31/operations/OAR038/valid-one-property.json b/src/test/resources/checks/v31/operations/OAR038/valid-one-property.json new file mode 100644 index 00000000..c4ded0b4 --- /dev/null +++ b/src/test/resources/checks/v31/operations/OAR038/valid-one-property.json @@ -0,0 +1,45 @@ +{ + "openapi" : "3.1.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/endpoint" : { + "post" : { + "responses" : { + "201" : { + "description" : "Ok", + "content": { + "application/json":{ + "schema" : { + "$ref" : "#/components/schemas/response" + } + } + } + }, + "204" : { + "description" : "No content" + } + } + } + } + }, + "components": { + "schemas": { + "response" : { + "type" : "object", + "properties" : { + "data" : { + "type" : "object", + "properties" : { + "id" : { + "type" : "string" + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/operations/OAR038/valid-one-property.yaml b/src/test/resources/checks/v31/operations/OAR038/valid-one-property.yaml new file mode 100644 index 00000000..50656cb5 --- /dev/null +++ b/src/test/resources/checks/v31/operations/OAR038/valid-one-property.yaml @@ -0,0 +1,27 @@ +openapi: "3.1.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /endpoint: + post: + responses: + 201: + description: Ok + content: + application/json: + schema: + $ref: '#/components/schemas/response' + 204: + description: No content + +components: + schemas: + response: + type: object + properties: + data: + type: object + properties: + id: + type: string diff --git a/src/test/resources/checks/v31/operations/OAR038/with-properties-empty.json b/src/test/resources/checks/v31/operations/OAR038/with-properties-empty.json new file mode 100644 index 00000000..3f45a592 --- /dev/null +++ b/src/test/resources/checks/v31/operations/OAR038/with-properties-empty.json @@ -0,0 +1,41 @@ +{ + "openapi" : "3.1.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/endpoint" : { + "post" : { + "responses" : { + "201" : { + "description" : "Ok", + "content": { + "application/json":{ + "schema" : { + "$ref" : "#/components/schemas/response" + } + } + } + }, + "204" : { + "description" : "No content" + } + } + } + } + }, + "components": { + "schemas": { + "response" : { + "type" : "object", + "properties" : { + "data" : { # Noncompliant {{OAR038: At least you have to define the identifier property}} + "type" : "object", + "properties" : { } + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/operations/OAR038/with-properties-empty.yaml b/src/test/resources/checks/v31/operations/OAR038/with-properties-empty.yaml new file mode 100644 index 00000000..5cdefc1a --- /dev/null +++ b/src/test/resources/checks/v31/operations/OAR038/with-properties-empty.yaml @@ -0,0 +1,25 @@ +openapi: "3.1.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /endpoint: + post: + responses: + 201: + description: Ok + content: + application/json: + schema: + $ref: '#/components/schemas/response' + 204: + description: No content + +components: + schemas: + response: + type: object + properties: + data: # Noncompliant {{OAR038: At least you have to define the identifier property}} + type: object + properties: {} diff --git a/src/test/resources/checks/v31/operations/OAR038/without-data.json b/src/test/resources/checks/v31/operations/OAR038/without-data.json new file mode 100644 index 00000000..d326bab4 --- /dev/null +++ b/src/test/resources/checks/v31/operations/OAR038/without-data.json @@ -0,0 +1,35 @@ +{ + "openapi" : "3.1.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/endpoint" : { + "post" : { + "responses" : { + "201" : { + "description" : "Ok", + "content": { + "application/json":{ + "schema" : { + "$ref" : "#/components/schemas/response" + } + } + } + }, + "204" : { + "description" : "No content" + } + } + } + } + }, + "components": { + "schemas" : { + "response" : { # Noncompliant {{OAR038: 'data' property is missing}} + "type" : "object" + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/operations/OAR038/without-data.yaml b/src/test/resources/checks/v31/operations/OAR038/without-data.yaml new file mode 100644 index 00000000..ef46e463 --- /dev/null +++ b/src/test/resources/checks/v31/operations/OAR038/without-data.yaml @@ -0,0 +1,21 @@ +openapi: "3.1.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /endpoint: + post: + responses: + 201: + description: Ok + content: + application/json: + schema: + $ref: '#/components/schemas/response' + 204: + description: No content + +components: + schemas: + response: # Noncompliant {{OAR038: 'data' property is missing}} + type: object \ No newline at end of file diff --git a/src/test/resources/checks/v31/operations/OAR038/without-properties.json b/src/test/resources/checks/v31/operations/OAR038/without-properties.json new file mode 100644 index 00000000..bc549d80 --- /dev/null +++ b/src/test/resources/checks/v31/operations/OAR038/without-properties.json @@ -0,0 +1,53 @@ +{ + "openapi": "3.1.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/endpoint": { + "post": { + "responses": { + "201": { + "$ref": "#/components/responses/createResponse" + }, + "204": { + "description": "No content" + } + } + } + } + }, + "components": { + "schemas": { + "response": { + "type": "object", + "allOf": [ + { + "$ref": "#/components/schemas/post_response" + } + ] + }, + "post_response": { + "type": "object", + "properties": { + "data": { # Noncompliant {{OAR038: At least you have to define the identifier property}} + "type": "object" + } + } + } + }, + "responses": { + "createResponse": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/response" + } + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/operations/OAR038/without-properties.yaml b/src/test/resources/checks/v31/operations/OAR038/without-properties.yaml new file mode 100644 index 00000000..50fb5b62 --- /dev/null +++ b/src/test/resources/checks/v31/operations/OAR038/without-properties.yaml @@ -0,0 +1,33 @@ +openapi: "3.1.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /endpoint: + post: + responses: + 201: + $ref: '#/components/responses/createResponse' + 204: + description: No content + +components: + schemas: + response: + type: object + allOf: + - $ref: '#/components/schemas/post_response' + + post_response: + type: object + properties: + data: # Noncompliant {{OAR038: At least you have to define the identifier property}} + type: object + + responses: + createResponse: + description: Ok + content: + application/json: + schema: + $ref: '#/components/schemas/response' \ No newline at end of file diff --git a/src/test/resources/checks/v31/operations/OAR038/without-schema.json b/src/test/resources/checks/v31/operations/OAR038/without-schema.json new file mode 100644 index 00000000..4ac5063e --- /dev/null +++ b/src/test/resources/checks/v31/operations/OAR038/without-schema.json @@ -0,0 +1,21 @@ +{ + "openapi" : "3.1.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/endpoint" : { + "post" : { + "responses" : { + "201" : { # Noncompliant {{OAR038: Response schema is required}} + "description" : "Ok" + }, + "204" : { + "description" : "No content" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/operations/OAR038/without-schema.yaml b/src/test/resources/checks/v31/operations/OAR038/without-schema.yaml new file mode 100644 index 00000000..9eecdf8a --- /dev/null +++ b/src/test/resources/checks/v31/operations/OAR038/without-schema.yaml @@ -0,0 +1,12 @@ +openapi: "3.1.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /endpoint: + post: + responses: + 201: # Noncompliant {{OAR038: Response schema is required}} + description: Ok + 204: + description: No content \ No newline at end of file diff --git a/src/test/resources/checks/v31/operations/OAR039/missing-codes.json b/src/test/resources/checks/v31/operations/OAR039/missing-codes.json new file mode 100644 index 00000000..18cf09e2 --- /dev/null +++ b/src/test/resources/checks/v31/operations/OAR039/missing-codes.json @@ -0,0 +1,109 @@ +{ + "openapi" : "3.1.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths": { + "/pets": { + "get": { + "responses": { # Noncompliant {{OAR039: Response code 200 or 206 must be defined}} {{OAR039: Response code 400 must be defined}} {{OAR039: Response code 500 must be defined}} {{OAR039: Response code 503 must be defined}} + "default": { + "description": "Unexpected error" + } + } + }, + "post": { + "responses": { # Noncompliant {{OAR039: Response code 200 or 201 or 202 must be defined}} {{OAR039: Response code 400 must be defined}} {{OAR039: Response code 415 must be defined}} {{OAR039: Response code 500 must be defined}} {{OAR039: Response code 503 must be defined}} + "default": { + "description": "Unexpected error" + } + } + } + }, + "/pets/get": { + "post": { + "responses": { # Noncompliant {{OAR039: Response code 200 must be defined}} {{OAR039: Response code 400 must be defined}} {{OAR039: Response code 404 must be defined}} {{OAR039: Response code 415 must be defined}} {{OAR039: Response code 500 must be defined}} {{OAR039: Response code 503 must be defined}} + "default": { + "description": "Unexpected error" + } + } + } + }, + "/pets/delete": { + "post": { + "responses": { # Noncompliant {{OAR039: Response code 200 must be defined}} {{OAR039: Response code 400 must be defined}} {{OAR039: Response code 404 must be defined}} {{OAR039: Response code 415 must be defined}} {{OAR039: Response code 500 must be defined}} {{OAR039: Response code 503 must be defined}} + "default": { + "description": "Unexpected error" + } + } + } + }, + "/pets/{id}": { + "get": { + "responses": { # Noncompliant {{OAR039: Response code 200 must be defined}} {{OAR039: Response code 400 must be defined}} {{OAR039: Response code 404 must be defined}} {{OAR039: Response code 500 must be defined}} {{OAR039: Response code 503 must be defined}} + "default": { + "description": "Unexpected error" + } + } + }, + "put": { + "responses": { # Noncompliant {{OAR039: Response code 200 must be defined}} {{OAR039: Response code 400 must be defined}} {{OAR039: Response code 404 must be defined}} {{OAR039: Response code 415 must be defined}} {{OAR039: Response code 500 must be defined}} {{OAR039: Response code 503 must be defined}} + "default": { + "description": "Unexpected error" + } + } + }, + "patch": { + "responses": { # Noncompliant {{OAR039: Response code 200 must be defined}} {{OAR039: Response code 400 must be defined}} {{OAR039: Response code 404 must be defined}} {{OAR039: Response code 415 must be defined}} {{OAR039: Response code 500 must be defined}} {{OAR039: Response code 503 must be defined}} + "default": { + "description": "Unexpected error" + } + } + }, + "delete": { + "responses": { # Noncompliant {{OAR039: Response code 200 must be defined}} {{OAR039: Response code 400 must be defined}} {{OAR039: Response code 404 must be defined}} {{OAR039: Response code 500 must be defined}} {{OAR039: Response code 503 must be defined}} + "default": { + "description": "Unexpected error" + } + } + } + }, + "/pets/{id}/owner": { + "post": { + "responses": { # Noncompliant {{OAR039: Response code 200 or 201 or 202 must be defined}} {{OAR039: Response code 400 must be defined}} {{OAR039: Response code 404 must be defined}} {{OAR039: Response code 415 must be defined}} {{OAR039: Response code 500 must be defined}} {{OAR039: Response code 503 must be defined}} + "default": { + "description": "Unexpected error" + } + } + } + }, + "/pets/{id}/owner/get": { + "post": { + "responses": { # Noncompliant {{OAR039: Response code 200 must be defined}} {{OAR039: Response code 400 must be defined}} {{OAR039: Response code 404 must be defined}} {{OAR039: Response code 415 must be defined}} {{OAR039: Response code 500 must be defined}} {{OAR039: Response code 503 must be defined}} + "default": { + "description": "Unexpected error" + } + } + } + }, + "/pets/{id}/owner/delete": { + "post": { + "responses": { # Noncompliant {{OAR039: Response code 200 must be defined}} {{OAR039: Response code 400 must be defined}} {{OAR039: Response code 404 must be defined}} {{OAR039: Response code 415 must be defined}} {{OAR039: Response code 500 must be defined}} {{OAR039: Response code 503 must be defined}} + "default": { + "description": "Unexpected error" + } + } + } + }, + "/status": { + "get": { + "responses": { + "default": { + "description": "Unexpected error" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/operations/OAR039/missing-codes.yaml b/src/test/resources/checks/v31/operations/OAR039/missing-codes.yaml new file mode 100644 index 00000000..da2618e7 --- /dev/null +++ b/src/test/resources/checks/v31/operations/OAR039/missing-codes.yaml @@ -0,0 +1,68 @@ +openapi: "3.1.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: + get: + responses: # Noncompliant {{OAR039: Response code 200 or 206 must be defined}} {{OAR039: Response code 400 must be defined}} {{OAR039: Response code 500 must be defined}} {{OAR039: Response code 503 must be defined}} + default: + description: Unexpected error + post: + responses: # Noncompliant {{OAR039: Response code 200 or 201 or 202 must be defined}} {{OAR039: Response code 400 must be defined}} {{OAR039: Response code 415 must be defined}} {{OAR039: Response code 500 must be defined}} {{OAR039: Response code 503 must be defined}} + default: + description: Unexpected error + + /pets/get: + post: + responses: # Noncompliant {{OAR039: Response code 200 must be defined}} {{OAR039: Response code 400 must be defined}} {{OAR039: Response code 404 must be defined}} {{OAR039: Response code 415 must be defined}} {{OAR039: Response code 500 must be defined}} {{OAR039: Response code 503 must be defined}} + default: + description: Unexpected error + + /pets/delete: + post: + responses: # Noncompliant {{OAR039: Response code 200 must be defined}} {{OAR039: Response code 400 must be defined}} {{OAR039: Response code 404 must be defined}} {{OAR039: Response code 415 must be defined}} {{OAR039: Response code 500 must be defined}} {{OAR039: Response code 503 must be defined}} + default: + description: Unexpected error + + /pets/{id}: + get: + responses: # Noncompliant {{OAR039: Response code 200 must be defined}} {{OAR039: Response code 400 must be defined}} {{OAR039: Response code 404 must be defined}} {{OAR039: Response code 500 must be defined}} {{OAR039: Response code 503 must be defined}} + default: + description: Unexpected error + put: + responses: # Noncompliant {{OAR039: Response code 200 must be defined}} {{OAR039: Response code 400 must be defined}} {{OAR039: Response code 404 must be defined}} {{OAR039: Response code 415 must be defined}} {{OAR039: Response code 500 must be defined}} {{OAR039: Response code 503 must be defined}} + default: + description: Unexpected error + patch: + responses: # Noncompliant {{OAR039: Response code 200 must be defined}} {{OAR039: Response code 400 must be defined}} {{OAR039: Response code 404 must be defined}} {{OAR039: Response code 415 must be defined}} {{OAR039: Response code 500 must be defined}} {{OAR039: Response code 503 must be defined}} + default: + description: Unexpected error + delete: + responses: # Noncompliant {{OAR039: Response code 200 must be defined}} {{OAR039: Response code 400 must be defined}} {{OAR039: Response code 404 must be defined}} {{OAR039: Response code 500 must be defined}} {{OAR039: Response code 503 must be defined}} + default: + description: Unexpected error + + /pets/{id}/owner: + post: + responses: # Noncompliant {{OAR039: Response code 200 or 201 or 202 must be defined}} {{OAR039: Response code 400 must be defined}} {{OAR039: Response code 404 must be defined}} {{OAR039: Response code 415 must be defined}} {{OAR039: Response code 500 must be defined}} {{OAR039: Response code 503 must be defined}} + default: + description: Unexpected error + + /pets/{id}/owner/get: + post: + responses: # Noncompliant {{OAR039: Response code 200 must be defined}} {{OAR039: Response code 400 must be defined}} {{OAR039: Response code 404 must be defined}} {{OAR039: Response code 415 must be defined}} {{OAR039: Response code 500 must be defined}} {{OAR039: Response code 503 must be defined}} + default: + description: Unexpected error + + /pets/{id}/owner/delete: + post: + responses: # Noncompliant {{OAR039: Response code 200 must be defined}} {{OAR039: Response code 400 must be defined}} {{OAR039: Response code 404 must be defined}} {{OAR039: Response code 415 must be defined}} {{OAR039: Response code 500 must be defined}} {{OAR039: Response code 503 must be defined}} + default: + description: Unexpected error + + /status: + get: + responses: + default: + description: Unexpected error \ No newline at end of file diff --git a/src/test/resources/checks/v31/operations/OAR039/valid.json b/src/test/resources/checks/v31/operations/OAR039/valid.json new file mode 100644 index 00000000..aa5bfe3b --- /dev/null +++ b/src/test/resources/checks/v31/operations/OAR039/valid.json @@ -0,0 +1,283 @@ +{ + "openapi" : "3.1.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths": { + "/pets": { + "get": { + "responses": { + "206": { + "description": "Partial collection" + }, + "400": { + "description": "Bad request" + }, + "500": { + "description": "Internal server error" + }, + "503": { + "description": "Service unavailable" + } + } + }, + "post": { + "responses": { + "201": { + "description": "Created" + }, + "400": { + "description": "Bad request" + }, + "413": { + "description": "Payload too large" + }, + "415": { + "description": "Unsupported media type" + }, + "500": { + "description": "Internal server error" + }, + "503": { + "description": "Service unavailable" + } + } + } + }, + "/pets/get": { + "post": { + "responses": { + "200": { + "description": "Ok" + }, + "400": { + "description": "Bad request" + }, + "404": { + "description": "Not found" + }, + "413": { + "description": "Payload too large" + }, + "415": { + "description": "Unsupported media type" + }, + "500": { + "description": "Internal server error" + }, + "503": { + "description": "Service unavailable" + } + } + } + }, + "/pets/delete": { + "post": { + "responses": { + "200": { + "description": "Ok" + }, + "400": { + "description": "Bad request" + }, + "404": { + "description": "Not found" + }, + "413": { + "description": "Payload too large" + }, + "415": { + "description": "Unsupported media type" + }, + "500": { + "description": "Internal server error" + }, + "503": { + "description": "Service unavailable" + } + } + } + }, + "/pets/{id}": { + "get": { + "responses": { + "200": { + "description": "Ok" + }, + "400": { + "description": "Bad request" + }, + "404": { + "description": "Not found" + }, + "500": { + "description": "Internal server error" + }, + "503": { + "description": "Service unavailable" + } + } + }, + "put": { + "responses": { + "200": { + "description": "Ok" + }, + "400": { + "description": "Bad request" + }, + "404": { + "description": "Not found" + }, + "413": { + "description": "Payload too large" + }, + "415": { + "description": "Unsupported media type" + }, + "500": { + "description": "Internal server error" + }, + "503": { + "description": "Service unavailable" + } + } + }, + "patch": { + "responses": { + "200": { + "description": "Ok" + }, + "400": { + "description": "Bad request" + }, + "404": { + "description": "Not found" + }, + "413": { + "description": "Payload too large" + }, + "415": { + "description": "Unsupported media type" + }, + "500": { + "description": "Internal server error" + }, + "503": { + "description": "Service unavailable" + } + } + }, + "delete": { + "responses": { + "200": { + "description": "Ok" + }, + "400": { + "description": "Bad request" + }, + "404": { + "description": "Not found" + }, + "500": { + "description": "Internal server error" + }, + "503": { + "description": "Service unavailable" + } + } + } + }, + "/pets/{id}/owner": { + "post": { + "responses": { + "201": { + "description": "Created" + }, + "400": { + "description": "Bad request" + }, + "404": { + "description": "Not found" + }, + "413": { + "description": "Payload too large" + }, + "415": { + "description": "Unsupported media type" + }, + "500": { + "description": "Internal server error" + }, + "503": { + "description": "Service unavailable" + } + } + } + }, + "/pets/{id}/owner/get": { + "post": { + "responses": { + "200": { + "description": "Ok" + }, + "400": { + "description": "Bad request" + }, + "404": { + "description": "Not found" + }, + "413": { + "description": "Payload too large" + }, + "415": { + "description": "Unsupported media type" + }, + "500": { + "description": "Internal server error" + }, + "503": { + "description": "Service unavailable" + } + } + } + }, + "/pets/{id}/owner/delete": { + "post": { + "responses": { + "200": { + "description": "Ok" + }, + "400": { + "description": "Bad request" + }, + "404": { + "description": "Not found" + }, + "413": { + "description": "Payload too large" + }, + "415": { + "description": "Unsupported media type" + }, + "500": { + "description": "Internal server error" + }, + "503": { + "description": "Service unavailable" + } + } + } + }, + "/status": { + "get": { + "responses": { + "default": { + "description": "Unexpected error" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/operations/OAR039/valid.yaml b/src/test/resources/checks/v31/operations/OAR039/valid.yaml new file mode 100644 index 00000000..5f7621b2 --- /dev/null +++ b/src/test/resources/checks/v31/operations/OAR039/valid.yaml @@ -0,0 +1,184 @@ +openapi: "3.1.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: + get: + responses: + 206: + description: Partial collection + 400: + description: Bad request + 500: + description: Internal server error + 503: + description: Service unavailable + post: + responses: + 201: + description: Created + 400: + description: Bad request + 413: + description: Payload too large + 415: + description: Unsupported media type + 500: + description: Internal server error + 503: + description: Service unavailable + + /pets/get: + post: + responses: + 200: + description: Ok + 400: + description: Bad request + 404: + description: Not found + 413: + description: Payload too large + 415: + description: Unsupported media type + 500: + description: Internal server error + 503: + description: Service unavailable + + /pets/delete: + post: + responses: + 200: + description: Ok + 400: + description: Bad request + 404: + description: Not found + 413: + description: Payload too large + 415: + description: Unsupported media type + 500: + description: Internal server error + 503: + description: Service unavailable + + /pets/{id}: + get: + responses: + 200: + description: Ok + 400: + description: Bad request + 404: + description: Not found + 500: + description: Internal server error + 503: + description: Service unavailable + put: + responses: + 200: + description: Ok + 400: + description: Bad request + 404: + description: Not found + 413: + description: Payload too large + 415: + description: Unsupported media type + 500: + description: Internal server error + 503: + description: Service unavailable + patch: + responses: + 200: + description: Ok + 400: + description: Bad request + 404: + description: Not found + 413: + description: Payload too large + 415: + description: Unsupported media type + 500: + description: Internal server error + 503: + description: Service unavailable + delete: + responses: + 200: + description: Ok + 400: + description: Bad request + 404: + description: Not found + 500: + description: Internal server error + 503: + description: Service unavailable + + /pets/{id}/owner: + post: + responses: + 201: + description: Created + 400: + description: Bad request + 404: + description: Not found + 413: + description: Payload too large + 415: + description: Unsupported media type + 500: + description: Internal server error + 503: + description: Service unavailable + + /pets/{id}/owner/get: + post: + responses: + 200: + description: Ok + 400: + description: Bad request + 404: + description: Not found + 413: + description: Payload too large + 415: + description: Unsupported media type + 500: + description: Internal server error + 503: + description: Service unavailable + + /pets/{id}/owner/delete: + post: + responses: + 200: + description: Ok + 400: + description: Bad request + 404: + description: Not found + 413: + description: Payload too large + 415: + description: Unsupported media type + 500: + description: Internal server error + 503: + description: Service unavailable + + /status: + get: + responses: + default: + description: Unexpected error \ No newline at end of file diff --git a/src/test/resources/checks/v31/operations/OAR045/defined-response.json b/src/test/resources/checks/v31/operations/OAR045/defined-response.json index f86d6ac4..b73d9c78 100644 --- a/src/test/resources/checks/v31/operations/OAR045/defined-response.json +++ b/src/test/resources/checks/v31/operations/OAR045/defined-response.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v31/operations/OAR045/defined-response.yaml b/src/test/resources/checks/v31/operations/OAR045/defined-response.yaml index 4370ac6c..6540560a 100644 --- a/src/test/resources/checks/v31/operations/OAR045/defined-response.yaml +++ b/src/test/resources/checks/v31/operations/OAR045/defined-response.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.0 +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/operations/OAR046/declared-tag.json b/src/test/resources/checks/v31/operations/OAR046/declared-tag.json new file mode 100644 index 00000000..ba269228 --- /dev/null +++ b/src/test/resources/checks/v31/operations/OAR046/declared-tag.json @@ -0,0 +1,26 @@ +{ + "openapi" : "3.1.0", + "tags" : [ { + "name" : "used-tag", + "description" : "a tag referenced in the operations" + } ], + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/pets" : { + "get" : { + "tags" : [ "used-tag" ], + "responses" : { } + }, + "post" : { # Noncompliant {{OAR046: Associate a tag to this operation}} + "responses" : { + "default" : { + "description" : "the default response" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/operations/OAR046/declared-tag.yaml b/src/test/resources/checks/v31/operations/OAR046/declared-tag.yaml new file mode 100644 index 00000000..ad2e2943 --- /dev/null +++ b/src/test/resources/checks/v31/operations/OAR046/declared-tag.yaml @@ -0,0 +1,17 @@ +openapi: "3.1.0" +tags: +- name: used-tag + description: a tag referenced in the operations +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: + get: + tags: + - used-tag + responses: {} + post: # Noncompliant {{OAR046: Associate a tag to this operation}} + responses: + default: + description: the default response \ No newline at end of file diff --git a/src/test/resources/checks/v31/operations/OAR048/many-body-params.json b/src/test/resources/checks/v31/operations/OAR048/many-body-params.json index 6efb018b..27c7c9ef 100644 --- a/src/test/resources/checks/v31/operations/OAR048/many-body-params.json +++ b/src/test/resources/checks/v31/operations/OAR048/many-body-params.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v31/operations/OAR048/many-body-params.yaml b/src/test/resources/checks/v31/operations/OAR048/many-body-params.yaml index 6e4df5b8..16c23f86 100644 --- a/src/test/resources/checks/v31/operations/OAR048/many-body-params.yaml +++ b/src/test/resources/checks/v31/operations/OAR048/many-body-params.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/operations/OAR061/insuficent-response-codes.json b/src/test/resources/checks/v31/operations/OAR061/insuficent-response-codes.json index d6afd0b7..250fc7cc 100644 --- a/src/test/resources/checks/v31/operations/OAR061/insuficent-response-codes.json +++ b/src/test/resources/checks/v31/operations/OAR061/insuficent-response-codes.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v31/operations/OAR061/insuficent-response-codes.yaml b/src/test/resources/checks/v31/operations/OAR061/insuficent-response-codes.yaml index be4253c1..89ebbce6 100644 --- a/src/test/resources/checks/v31/operations/OAR061/insuficent-response-codes.yaml +++ b/src/test/resources/checks/v31/operations/OAR061/insuficent-response-codes.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/operations/OAR061/valid.json b/src/test/resources/checks/v31/operations/OAR061/valid.json index eebb26a9..4cf7cc59 100644 --- a/src/test/resources/checks/v31/operations/OAR061/valid.json +++ b/src/test/resources/checks/v31/operations/OAR061/valid.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v31/operations/OAR061/valid.yaml b/src/test/resources/checks/v31/operations/OAR061/valid.yaml index 46fd051f..b6412fa3 100644 --- a/src/test/resources/checks/v31/operations/OAR061/valid.yaml +++ b/src/test/resources/checks/v31/operations/OAR061/valid.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/operations/OAR062/insuficent-response-codes.json b/src/test/resources/checks/v31/operations/OAR062/insuficent-response-codes.json index 5c5c07f3..54b242b4 100644 --- a/src/test/resources/checks/v31/operations/OAR062/insuficent-response-codes.json +++ b/src/test/resources/checks/v31/operations/OAR062/insuficent-response-codes.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v31/operations/OAR062/insuficent-response-codes.yaml b/src/test/resources/checks/v31/operations/OAR062/insuficent-response-codes.yaml index b6afd0f4..7af54946 100644 --- a/src/test/resources/checks/v31/operations/OAR062/insuficent-response-codes.yaml +++ b/src/test/resources/checks/v31/operations/OAR062/insuficent-response-codes.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/operations/OAR062/valid.json b/src/test/resources/checks/v31/operations/OAR062/valid.json index 41369536..e282f658 100644 --- a/src/test/resources/checks/v31/operations/OAR062/valid.json +++ b/src/test/resources/checks/v31/operations/OAR062/valid.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v31/operations/OAR062/valid.yaml b/src/test/resources/checks/v31/operations/OAR062/valid.yaml index cbd378fe..e4a5ed0b 100644 --- a/src/test/resources/checks/v31/operations/OAR062/valid.yaml +++ b/src/test/resources/checks/v31/operations/OAR062/valid.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/operations/OAR063/insuficent-response-codes.json b/src/test/resources/checks/v31/operations/OAR063/insuficent-response-codes.json index fd50ba37..79ce1629 100644 --- a/src/test/resources/checks/v31/operations/OAR063/insuficent-response-codes.json +++ b/src/test/resources/checks/v31/operations/OAR063/insuficent-response-codes.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v31/operations/OAR063/insuficent-response-codes.yaml b/src/test/resources/checks/v31/operations/OAR063/insuficent-response-codes.yaml index 46cb15dd..1ce595a9 100644 --- a/src/test/resources/checks/v31/operations/OAR063/insuficent-response-codes.yaml +++ b/src/test/resources/checks/v31/operations/OAR063/insuficent-response-codes.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/operations/OAR063/valid.json b/src/test/resources/checks/v31/operations/OAR063/valid.json index 5f3a20ed..657750f3 100644 --- a/src/test/resources/checks/v31/operations/OAR063/valid.json +++ b/src/test/resources/checks/v31/operations/OAR063/valid.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v31/operations/OAR063/valid.yaml b/src/test/resources/checks/v31/operations/OAR063/valid.yaml index d61b7b23..d165ef82 100644 --- a/src/test/resources/checks/v31/operations/OAR063/valid.yaml +++ b/src/test/resources/checks/v31/operations/OAR063/valid.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/operations/OAR064/insuficent-response-codes.json b/src/test/resources/checks/v31/operations/OAR064/insuficent-response-codes.json index d72c819c..1027f256 100644 --- a/src/test/resources/checks/v31/operations/OAR064/insuficent-response-codes.json +++ b/src/test/resources/checks/v31/operations/OAR064/insuficent-response-codes.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v31/operations/OAR064/insuficent-response-codes.yaml b/src/test/resources/checks/v31/operations/OAR064/insuficent-response-codes.yaml index 84beaded..74e5c6ee 100644 --- a/src/test/resources/checks/v31/operations/OAR064/insuficent-response-codes.yaml +++ b/src/test/resources/checks/v31/operations/OAR064/insuficent-response-codes.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/operations/OAR064/valid.json b/src/test/resources/checks/v31/operations/OAR064/valid.json index 4109a3e7..ca44dca1 100644 --- a/src/test/resources/checks/v31/operations/OAR064/valid.json +++ b/src/test/resources/checks/v31/operations/OAR064/valid.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v31/operations/OAR064/valid.yaml b/src/test/resources/checks/v31/operations/OAR064/valid.yaml index fb387b6e..74def602 100644 --- a/src/test/resources/checks/v31/operations/OAR064/valid.yaml +++ b/src/test/resources/checks/v31/operations/OAR064/valid.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/operations/OAR065/insuficent-response-codes.json b/src/test/resources/checks/v31/operations/OAR065/insuficent-response-codes.json index e246e5a4..4192edaf 100644 --- a/src/test/resources/checks/v31/operations/OAR065/insuficent-response-codes.json +++ b/src/test/resources/checks/v31/operations/OAR065/insuficent-response-codes.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v31/operations/OAR065/insuficent-response-codes.yaml b/src/test/resources/checks/v31/operations/OAR065/insuficent-response-codes.yaml index 9ef40629..d5f09172 100644 --- a/src/test/resources/checks/v31/operations/OAR065/insuficent-response-codes.yaml +++ b/src/test/resources/checks/v31/operations/OAR065/insuficent-response-codes.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/operations/OAR065/valid.json b/src/test/resources/checks/v31/operations/OAR065/valid.json index f4e0b010..395464f8 100644 --- a/src/test/resources/checks/v31/operations/OAR065/valid.json +++ b/src/test/resources/checks/v31/operations/OAR065/valid.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v31/operations/OAR065/valid.yaml b/src/test/resources/checks/v31/operations/OAR065/valid.yaml index 5b7b3230..cac7aad6 100644 --- a/src/test/resources/checks/v31/operations/OAR065/valid.yaml +++ b/src/test/resources/checks/v31/operations/OAR065/valid.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/operations/OAR071/missing-query-params.json b/src/test/resources/checks/v31/operations/OAR071/missing-query-params.json index a3c5fe59..c90d3c5d 100644 --- a/src/test/resources/checks/v31/operations/OAR071/missing-query-params.json +++ b/src/test/resources/checks/v31/operations/OAR071/missing-query-params.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "version": "1.0.0", "title": "My API" diff --git a/src/test/resources/checks/v31/operations/OAR071/missing-query-params.yaml b/src/test/resources/checks/v31/operations/OAR071/missing-query-params.yaml index fef15e36..952b888e 100644 --- a/src/test/resources/checks/v31/operations/OAR071/missing-query-params.yaml +++ b/src/test/resources/checks/v31/operations/OAR071/missing-query-params.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: My API diff --git a/src/test/resources/checks/v31/operations/OAR071/valid-query-params.json b/src/test/resources/checks/v31/operations/OAR071/valid-query-params.json index 5dcdf248..66335243 100644 --- a/src/test/resources/checks/v31/operations/OAR071/valid-query-params.json +++ b/src/test/resources/checks/v31/operations/OAR071/valid-query-params.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "version": "1.0.0", "title": "My API" diff --git a/src/test/resources/checks/v31/operations/OAR071/valid-query-params.yaml b/src/test/resources/checks/v31/operations/OAR071/valid-query-params.yaml index 7a8d8899..ec932c65 100644 --- a/src/test/resources/checks/v31/operations/OAR071/valid-query-params.yaml +++ b/src/test/resources/checks/v31/operations/OAR071/valid-query-params.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: My API diff --git a/src/test/resources/checks/v31/operations/OAR091/no-ref.json b/src/test/resources/checks/v31/operations/OAR091/no-ref.json index 0a13ec43..e7add18e 100644 --- a/src/test/resources/checks/v31/operations/OAR091/no-ref.json +++ b/src/test/resources/checks/v31/operations/OAR091/no-ref.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "title": "Sample API", "version": "1.0.0" diff --git a/src/test/resources/checks/v31/operations/OAR091/no-ref.yaml b/src/test/resources/checks/v31/operations/OAR091/no-ref.yaml index cf71ac9a..29dd6c9e 100644 --- a/src/test/resources/checks/v31/operations/OAR091/no-ref.yaml +++ b/src/test/resources/checks/v31/operations/OAR091/no-ref.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.0 +openapi: "3.1.0" info: title: Sample API version: 1.0.0 diff --git a/src/test/resources/checks/v31/operations/OAR091/with-ref.json b/src/test/resources/checks/v31/operations/OAR091/with-ref.json index 262538cd..f5e72fdd 100644 --- a/src/test/resources/checks/v31/operations/OAR091/with-ref.json +++ b/src/test/resources/checks/v31/operations/OAR091/with-ref.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "title": "Sample API", "version": "1.0.0" diff --git a/src/test/resources/checks/v31/operations/OAR091/with-ref.yaml b/src/test/resources/checks/v31/operations/OAR091/with-ref.yaml index ad4061d5..96c8e0f4 100644 --- a/src/test/resources/checks/v31/operations/OAR091/with-ref.yaml +++ b/src/test/resources/checks/v31/operations/OAR091/with-ref.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.0 +openapi: "3.1.0" info: title: Sample API version: 1.0.0 diff --git a/src/test/resources/checks/v31/operations/OAR092/no-ref.json b/src/test/resources/checks/v31/operations/OAR092/no-ref.json index b46235db..8bedb1ff 100644 --- a/src/test/resources/checks/v31/operations/OAR092/no-ref.json +++ b/src/test/resources/checks/v31/operations/OAR092/no-ref.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "title": "Sample API", "version": "1.0.0" diff --git a/src/test/resources/checks/v31/operations/OAR092/no-ref.yaml b/src/test/resources/checks/v31/operations/OAR092/no-ref.yaml index a44925c1..60291f6e 100644 --- a/src/test/resources/checks/v31/operations/OAR092/no-ref.yaml +++ b/src/test/resources/checks/v31/operations/OAR092/no-ref.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.1 +openapi: "3.1.0" info: title: Sample-API_efc2b9f76813_V description: API de ejemplo para pruebas diff --git a/src/test/resources/checks/v31/operations/OAR092/with-ref.json b/src/test/resources/checks/v31/operations/OAR092/with-ref.json index bfda972c..edf695d4 100644 --- a/src/test/resources/checks/v31/operations/OAR092/with-ref.json +++ b/src/test/resources/checks/v31/operations/OAR092/with-ref.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "title": "Sample API", "version": "1.0.0" diff --git a/src/test/resources/checks/v31/operations/OAR092/with-ref.yaml b/src/test/resources/checks/v31/operations/OAR092/with-ref.yaml index aa5503ab..ddcdf1b6 100644 --- a/src/test/resources/checks/v31/operations/OAR092/with-ref.yaml +++ b/src/test/resources/checks/v31/operations/OAR092/with-ref.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.0 +openapi: "3.1.0" info: title: Sample API version: '1.0.0' diff --git a/src/test/resources/checks/v31/operations/OAR093/no-ref.json b/src/test/resources/checks/v31/operations/OAR093/no-ref.json index a03de219..a32c7a39 100644 --- a/src/test/resources/checks/v31/operations/OAR093/no-ref.json +++ b/src/test/resources/checks/v31/operations/OAR093/no-ref.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "title": "Sample API", "version": "1.0.0" diff --git a/src/test/resources/checks/v31/operations/OAR093/no-ref.yaml b/src/test/resources/checks/v31/operations/OAR093/no-ref.yaml index ba07aaf3..246e039d 100644 --- a/src/test/resources/checks/v31/operations/OAR093/no-ref.yaml +++ b/src/test/resources/checks/v31/operations/OAR093/no-ref.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.0 +openapi: "3.1.0" info: title: Sample API version: 1.0.0 diff --git a/src/test/resources/checks/v31/operations/OAR093/with-ref.json b/src/test/resources/checks/v31/operations/OAR093/with-ref.json index 1a4fa488..31a42d87 100644 --- a/src/test/resources/checks/v31/operations/OAR093/with-ref.json +++ b/src/test/resources/checks/v31/operations/OAR093/with-ref.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "title": "Sample API", "version": "1.0.0" diff --git a/src/test/resources/checks/v31/operations/OAR093/with-ref.yaml b/src/test/resources/checks/v31/operations/OAR093/with-ref.yaml index 44518a95..c899dcab 100644 --- a/src/test/resources/checks/v31/operations/OAR093/with-ref.yaml +++ b/src/test/resources/checks/v31/operations/OAR093/with-ref.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.0 +openapi: "3.1.0" info: title: Sample API version: 1.0.0 diff --git a/src/test/resources/checks/v31/operations/OAR103/plain.json b/src/test/resources/checks/v31/operations/OAR103/plain.json index 2d2671b6..2df241d0 100644 --- a/src/test/resources/checks/v31/operations/OAR103/plain.json +++ b/src/test/resources/checks/v31/operations/OAR103/plain.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "version": "1.0.0", "title": "Swagger Petstore (GETs only)" diff --git a/src/test/resources/checks/v31/operations/OAR103/plain.yaml b/src/test/resources/checks/v31/operations/OAR103/plain.yaml index a06d2246..72e3afdd 100644 --- a/src/test/resources/checks/v31/operations/OAR103/plain.yaml +++ b/src/test/resources/checks/v31/operations/OAR103/plain.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.0 +openapi: "3.1.0" info: version: '1.0.0' title: Swagger Petstore (GETs only) diff --git a/src/test/resources/checks/v31/operations/OAR104/plain.yaml b/src/test/resources/checks/v31/operations/OAR104/plain.yaml index 521a52ca..a55e6d78 100644 --- a/src/test/resources/checks/v31/operations/OAR104/plain.yaml +++ b/src/test/resources/checks/v31/operations/OAR104/plain.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.0 +openapi: "3.1.0" info: version: '1.0.0' title: Swagger Petstore (Posts only) diff --git a/src/test/resources/checks/v31/operations/OAR105/plain.json b/src/test/resources/checks/v31/operations/OAR105/plain.json index ff990d20..08acb742 100644 --- a/src/test/resources/checks/v31/operations/OAR105/plain.json +++ b/src/test/resources/checks/v31/operations/OAR105/plain.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "version": "1.0.0", "title": "Swagger Petstore (POSTs only)" diff --git a/src/test/resources/checks/v31/operations/OAR105/plain.yaml b/src/test/resources/checks/v31/operations/OAR105/plain.yaml index 0708ff20..8ea22b04 100644 --- a/src/test/resources/checks/v31/operations/OAR105/plain.yaml +++ b/src/test/resources/checks/v31/operations/OAR105/plain.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.0 +openapi: "3.1.0" info: version: '1.0.0' title: Swagger Petstore (Posts only) diff --git a/src/test/resources/checks/v31/operations/OAR106/plain.json b/src/test/resources/checks/v31/operations/OAR106/plain.json index 7cf21ad0..d0a5d86b 100644 --- a/src/test/resources/checks/v31/operations/OAR106/plain.json +++ b/src/test/resources/checks/v31/operations/OAR106/plain.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "version": "1.0.0", "title": "Swagger Petstore (POSTs only)" diff --git a/src/test/resources/checks/v31/operations/OAR106/plain.yaml b/src/test/resources/checks/v31/operations/OAR106/plain.yaml index 7072bd07..28bb3ef6 100644 --- a/src/test/resources/checks/v31/operations/OAR106/plain.yaml +++ b/src/test/resources/checks/v31/operations/OAR106/plain.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.0 +openapi: "3.1.0" info: version: '1.0.0' title: Swagger Petstore (Posts only) diff --git a/src/test/resources/checks/v31/operations/OAR107/plain.json b/src/test/resources/checks/v31/operations/OAR107/plain.json index 6bd61a1d..848c07b5 100644 --- a/src/test/resources/checks/v31/operations/OAR107/plain.json +++ b/src/test/resources/checks/v31/operations/OAR107/plain.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "version": "1.0.0", "title": "Swagger Petstore (POSTs only)" diff --git a/src/test/resources/checks/v31/operations/OAR107/plain.yaml b/src/test/resources/checks/v31/operations/OAR107/plain.yaml index 7b87298e..0ac22415 100644 --- a/src/test/resources/checks/v31/operations/OAR107/plain.yaml +++ b/src/test/resources/checks/v31/operations/OAR107/plain.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.0 +openapi: "3.1.0" info: version: '1.0.0' title: Swagger Petstore (Posts only) diff --git a/src/test/resources/checks/v31/operations/OAR109/plain.json b/src/test/resources/checks/v31/operations/OAR109/plain.json index 1d2a84df..c5f4cc3b 100644 --- a/src/test/resources/checks/v31/operations/OAR109/plain.json +++ b/src/test/resources/checks/v31/operations/OAR109/plain.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v31/operations/OAR109/plain.yaml b/src/test/resources/checks/v31/operations/OAR109/plain.yaml index 97cdd572..16518e02 100644 --- a/src/test/resources/checks/v31/operations/OAR109/plain.yaml +++ b/src/test/resources/checks/v31/operations/OAR109/plain.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.0 +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/owasp/OAR070/no-numeric.json b/src/test/resources/checks/v31/owasp/OAR070/no-numeric.json index 6c4d7036..aa8bac1d 100644 --- a/src/test/resources/checks/v31/owasp/OAR070/no-numeric.json +++ b/src/test/resources/checks/v31/owasp/OAR070/no-numeric.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v31/owasp/OAR070/no-numeric.yaml b/src/test/resources/checks/v31/owasp/OAR070/no-numeric.yaml index b561d78e..549c62c3 100644 --- a/src/test/resources/checks/v31/owasp/OAR070/no-numeric.yaml +++ b/src/test/resources/checks/v31/owasp/OAR070/no-numeric.yaml @@ -1,4 +1,4 @@ - openapi: "3.0.0" + openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/owasp/OAR070/numeric.json b/src/test/resources/checks/v31/owasp/OAR070/numeric.json index 95833d45..98ba2b76 100644 --- a/src/test/resources/checks/v31/owasp/OAR070/numeric.json +++ b/src/test/resources/checks/v31/owasp/OAR070/numeric.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v31/owasp/OAR070/numeric.yaml b/src/test/resources/checks/v31/owasp/OAR070/numeric.yaml index c71f0c38..8c4d10ad 100644 --- a/src/test/resources/checks/v31/owasp/OAR070/numeric.yaml +++ b/src/test/resources/checks/v31/owasp/OAR070/numeric.yaml @@ -1,4 +1,4 @@ - openapi: "3.0.0" + openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/owasp/OAR073/no-rate-limit.json b/src/test/resources/checks/v31/owasp/OAR073/no-rate-limit.json index 6416f160..6518d062 100644 --- a/src/test/resources/checks/v31/owasp/OAR073/no-rate-limit.json +++ b/src/test/resources/checks/v31/owasp/OAR073/no-rate-limit.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "version": "1.0.0", "title": "Non-compliant API" diff --git a/src/test/resources/checks/v31/owasp/OAR073/no-rate-limit.yaml b/src/test/resources/checks/v31/owasp/OAR073/no-rate-limit.yaml index e8cf9dae..3a7d6e14 100644 --- a/src/test/resources/checks/v31/owasp/OAR073/no-rate-limit.yaml +++ b/src/test/resources/checks/v31/owasp/OAR073/no-rate-limit.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Non-compliant API diff --git a/src/test/resources/checks/v31/owasp/OAR073/no-responses.json b/src/test/resources/checks/v31/owasp/OAR073/no-responses.json index e0294c8b..66ce8dc7 100644 --- a/src/test/resources/checks/v31/owasp/OAR073/no-responses.json +++ b/src/test/resources/checks/v31/owasp/OAR073/no-responses.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "version": "1.0.0", "title": "Compliant API" diff --git a/src/test/resources/checks/v31/owasp/OAR073/no-responses.yaml b/src/test/resources/checks/v31/owasp/OAR073/no-responses.yaml index 2575f439..100aac36 100644 --- a/src/test/resources/checks/v31/owasp/OAR073/no-responses.yaml +++ b/src/test/resources/checks/v31/owasp/OAR073/no-responses.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Compliant API diff --git a/src/test/resources/checks/v31/owasp/OAR073/rate-limit.json b/src/test/resources/checks/v31/owasp/OAR073/rate-limit.json index 3103396f..1c80ee0b 100644 --- a/src/test/resources/checks/v31/owasp/OAR073/rate-limit.json +++ b/src/test/resources/checks/v31/owasp/OAR073/rate-limit.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "version": "1.0.0", "title": "Compliant API" diff --git a/src/test/resources/checks/v31/owasp/OAR073/rate-limit.yaml b/src/test/resources/checks/v31/owasp/OAR073/rate-limit.yaml index d01f36ad..52e29e1e 100644 --- a/src/test/resources/checks/v31/owasp/OAR073/rate-limit.yaml +++ b/src/test/resources/checks/v31/owasp/OAR073/rate-limit.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Compliant API diff --git a/src/test/resources/checks/v31/parameters/OAR019/excluded.json b/src/test/resources/checks/v31/parameters/OAR019/excluded.json index 7b77042f..7d8ea3ca 100644 --- a/src/test/resources/checks/v31/parameters/OAR019/excluded.json +++ b/src/test/resources/checks/v31/parameters/OAR019/excluded.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.1.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v31/parameters/OAR019/excluded.yaml b/src/test/resources/checks/v31/parameters/OAR019/excluded.yaml index 7758deac..8a1c820c 100644 --- a/src/test/resources/checks/v31/parameters/OAR019/excluded.yaml +++ b/src/test/resources/checks/v31/parameters/OAR019/excluded.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/parameters/OAR019/plain-without.json b/src/test/resources/checks/v31/parameters/OAR019/plain-without.json index 2e628a27..de97027f 100644 --- a/src/test/resources/checks/v31/parameters/OAR019/plain-without.json +++ b/src/test/resources/checks/v31/parameters/OAR019/plain-without.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.1.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v31/parameters/OAR019/plain-without.yaml b/src/test/resources/checks/v31/parameters/OAR019/plain-without.yaml index 2f1bd5d6..3fbbb5e2 100644 --- a/src/test/resources/checks/v31/parameters/OAR019/plain-without.yaml +++ b/src/test/resources/checks/v31/parameters/OAR019/plain-without.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/parameters/OAR019/plain.json b/src/test/resources/checks/v31/parameters/OAR019/plain.json index 18138264..dec31428 100644 --- a/src/test/resources/checks/v31/parameters/OAR019/plain.json +++ b/src/test/resources/checks/v31/parameters/OAR019/plain.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.1.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v31/parameters/OAR019/plain.yaml b/src/test/resources/checks/v31/parameters/OAR019/plain.yaml index af676143..13d61bd4 100644 --- a/src/test/resources/checks/v31/parameters/OAR019/plain.yaml +++ b/src/test/resources/checks/v31/parameters/OAR019/plain.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/parameters/OAR019/with-$ref-without.json b/src/test/resources/checks/v31/parameters/OAR019/with-$ref-without.json index 4b111e51..292760a3 100644 --- a/src/test/resources/checks/v31/parameters/OAR019/with-$ref-without.json +++ b/src/test/resources/checks/v31/parameters/OAR019/with-$ref-without.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.1.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v31/parameters/OAR019/with-$ref-without.yaml b/src/test/resources/checks/v31/parameters/OAR019/with-$ref-without.yaml index 40bd84a8..7dd092c2 100644 --- a/src/test/resources/checks/v31/parameters/OAR019/with-$ref-without.yaml +++ b/src/test/resources/checks/v31/parameters/OAR019/with-$ref-without.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/parameters/OAR019/with-$ref.json b/src/test/resources/checks/v31/parameters/OAR019/with-$ref.json index 44519b76..6104acb4 100644 --- a/src/test/resources/checks/v31/parameters/OAR019/with-$ref.json +++ b/src/test/resources/checks/v31/parameters/OAR019/with-$ref.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.1.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v31/parameters/OAR019/with-$ref.yaml b/src/test/resources/checks/v31/parameters/OAR019/with-$ref.yaml index 8144cd2f..9fadc127 100644 --- a/src/test/resources/checks/v31/parameters/OAR019/with-$ref.yaml +++ b/src/test/resources/checks/v31/parameters/OAR019/with-$ref.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/parameters/OAR019/with-param.json b/src/test/resources/checks/v31/parameters/OAR019/with-param.json index 1097b436..98bed098 100644 --- a/src/test/resources/checks/v31/parameters/OAR019/with-param.json +++ b/src/test/resources/checks/v31/parameters/OAR019/with-param.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "title": "Swagger Petstore", "version": "1.0.0" diff --git a/src/test/resources/checks/v31/parameters/OAR019/with-param.yaml b/src/test/resources/checks/v31/parameters/OAR019/with-param.yaml index 8b012753..73ffc8cc 100644 --- a/src/test/resources/checks/v31/parameters/OAR019/with-param.yaml +++ b/src/test/resources/checks/v31/parameters/OAR019/with-param.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.0 +openapi: "3.1.0" info: title: Swagger Petstore version: 1.0.0 diff --git a/src/test/resources/checks/v31/parameters/OAR019/with-ref.json b/src/test/resources/checks/v31/parameters/OAR019/with-ref.json index e6772a42..cfdbbe8e 100644 --- a/src/test/resources/checks/v31/parameters/OAR019/with-ref.json +++ b/src/test/resources/checks/v31/parameters/OAR019/with-ref.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v31/parameters/OAR019/with-ref.yaml b/src/test/resources/checks/v31/parameters/OAR019/with-ref.yaml index dfc1b239..8fdd9227 100644 --- a/src/test/resources/checks/v31/parameters/OAR019/with-ref.yaml +++ b/src/test/resources/checks/v31/parameters/OAR019/with-ref.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.0 +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/parameters/OAR019/without-parameters.json b/src/test/resources/checks/v31/parameters/OAR019/without-parameters.json index 5fc9f4c1..c91042b4 100644 --- a/src/test/resources/checks/v31/parameters/OAR019/without-parameters.json +++ b/src/test/resources/checks/v31/parameters/OAR019/without-parameters.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.1.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v31/parameters/OAR019/without-parameters.yaml b/src/test/resources/checks/v31/parameters/OAR019/without-parameters.yaml index 7d1f1941..80561084 100644 --- a/src/test/resources/checks/v31/parameters/OAR019/without-parameters.yaml +++ b/src/test/resources/checks/v31/parameters/OAR019/without-parameters.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/parameters/OAR020/excluded.json b/src/test/resources/checks/v31/parameters/OAR020/excluded.json index abb1867f..cd74ed03 100644 --- a/src/test/resources/checks/v31/parameters/OAR020/excluded.json +++ b/src/test/resources/checks/v31/parameters/OAR020/excluded.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.1.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v31/parameters/OAR020/excluded.yaml b/src/test/resources/checks/v31/parameters/OAR020/excluded.yaml index 528f119e..b3d500eb 100644 --- a/src/test/resources/checks/v31/parameters/OAR020/excluded.yaml +++ b/src/test/resources/checks/v31/parameters/OAR020/excluded.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/parameters/OAR020/excluded2.json b/src/test/resources/checks/v31/parameters/OAR020/excluded2.json index 7b77042f..7d8ea3ca 100644 --- a/src/test/resources/checks/v31/parameters/OAR020/excluded2.json +++ b/src/test/resources/checks/v31/parameters/OAR020/excluded2.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.1.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v31/parameters/OAR020/excluded2.yaml b/src/test/resources/checks/v31/parameters/OAR020/excluded2.yaml index 5bb25ac8..67391c40 100644 --- a/src/test/resources/checks/v31/parameters/OAR020/excluded2.yaml +++ b/src/test/resources/checks/v31/parameters/OAR020/excluded2.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/parameters/OAR020/plain-without.json b/src/test/resources/checks/v31/parameters/OAR020/plain-without.json index ac05e24d..d9ee579e 100644 --- a/src/test/resources/checks/v31/parameters/OAR020/plain-without.json +++ b/src/test/resources/checks/v31/parameters/OAR020/plain-without.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.1.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v31/parameters/OAR020/plain-without.yaml b/src/test/resources/checks/v31/parameters/OAR020/plain-without.yaml index aadbb6e3..dde9ca94 100644 --- a/src/test/resources/checks/v31/parameters/OAR020/plain-without.yaml +++ b/src/test/resources/checks/v31/parameters/OAR020/plain-without.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/parameters/OAR020/plain-without2.json b/src/test/resources/checks/v31/parameters/OAR020/plain-without2.json index 96bdfe49..654e495d 100644 --- a/src/test/resources/checks/v31/parameters/OAR020/plain-without2.json +++ b/src/test/resources/checks/v31/parameters/OAR020/plain-without2.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.1.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v31/parameters/OAR020/plain-without2.yaml b/src/test/resources/checks/v31/parameters/OAR020/plain-without2.yaml index 798c326e..6a37c815 100644 --- a/src/test/resources/checks/v31/parameters/OAR020/plain-without2.yaml +++ b/src/test/resources/checks/v31/parameters/OAR020/plain-without2.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/parameters/OAR020/plain.json b/src/test/resources/checks/v31/parameters/OAR020/plain.json index bdb3c7d1..76d1f1b6 100644 --- a/src/test/resources/checks/v31/parameters/OAR020/plain.json +++ b/src/test/resources/checks/v31/parameters/OAR020/plain.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.1.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v31/parameters/OAR020/plain.yaml b/src/test/resources/checks/v31/parameters/OAR020/plain.yaml index ad2fc836..8f3532ee 100644 --- a/src/test/resources/checks/v31/parameters/OAR020/plain.yaml +++ b/src/test/resources/checks/v31/parameters/OAR020/plain.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/parameters/OAR020/plain2.json b/src/test/resources/checks/v31/parameters/OAR020/plain2.json index b349d610..d29027c7 100644 --- a/src/test/resources/checks/v31/parameters/OAR020/plain2.json +++ b/src/test/resources/checks/v31/parameters/OAR020/plain2.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.1.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v31/parameters/OAR020/plain2.yaml b/src/test/resources/checks/v31/parameters/OAR020/plain2.yaml index d6c6860b..4fef92c5 100644 --- a/src/test/resources/checks/v31/parameters/OAR020/plain2.yaml +++ b/src/test/resources/checks/v31/parameters/OAR020/plain2.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/parameters/OAR020/with-$ref-without.json b/src/test/resources/checks/v31/parameters/OAR020/with-$ref-without.json index 33a10da9..e73bb0a3 100644 --- a/src/test/resources/checks/v31/parameters/OAR020/with-$ref-without.json +++ b/src/test/resources/checks/v31/parameters/OAR020/with-$ref-without.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.1.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v31/parameters/OAR020/with-$ref-without.yaml b/src/test/resources/checks/v31/parameters/OAR020/with-$ref-without.yaml index 6080512e..901c6c9b 100644 --- a/src/test/resources/checks/v31/parameters/OAR020/with-$ref-without.yaml +++ b/src/test/resources/checks/v31/parameters/OAR020/with-$ref-without.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/parameters/OAR020/with-$ref.json b/src/test/resources/checks/v31/parameters/OAR020/with-$ref.json index 1354ddee..d3290cbc 100644 --- a/src/test/resources/checks/v31/parameters/OAR020/with-$ref.json +++ b/src/test/resources/checks/v31/parameters/OAR020/with-$ref.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.1.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v31/parameters/OAR020/with-$ref.yaml b/src/test/resources/checks/v31/parameters/OAR020/with-$ref.yaml index 04c46fa9..685b73dc 100644 --- a/src/test/resources/checks/v31/parameters/OAR020/with-$ref.yaml +++ b/src/test/resources/checks/v31/parameters/OAR020/with-$ref.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/parameters/OAR020/with-param.json b/src/test/resources/checks/v31/parameters/OAR020/with-param.json index 1097b436..98bed098 100644 --- a/src/test/resources/checks/v31/parameters/OAR020/with-param.json +++ b/src/test/resources/checks/v31/parameters/OAR020/with-param.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "title": "Swagger Petstore", "version": "1.0.0" diff --git a/src/test/resources/checks/v31/parameters/OAR020/with-param.yaml b/src/test/resources/checks/v31/parameters/OAR020/with-param.yaml index 8b012753..73ffc8cc 100644 --- a/src/test/resources/checks/v31/parameters/OAR020/with-param.yaml +++ b/src/test/resources/checks/v31/parameters/OAR020/with-param.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.0 +openapi: "3.1.0" info: title: Swagger Petstore version: 1.0.0 diff --git a/src/test/resources/checks/v31/parameters/OAR020/with-ref.json b/src/test/resources/checks/v31/parameters/OAR020/with-ref.json index 52a22a10..ff4aa030 100644 --- a/src/test/resources/checks/v31/parameters/OAR020/with-ref.json +++ b/src/test/resources/checks/v31/parameters/OAR020/with-ref.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v31/parameters/OAR020/with-ref.yaml b/src/test/resources/checks/v31/parameters/OAR020/with-ref.yaml index 315ab8f9..16d2246f 100644 --- a/src/test/resources/checks/v31/parameters/OAR020/with-ref.yaml +++ b/src/test/resources/checks/v31/parameters/OAR020/with-ref.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.0 +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/parameters/OAR020/without-parameters.json b/src/test/resources/checks/v31/parameters/OAR020/without-parameters.json index dd4f0781..9d16a3ef 100644 --- a/src/test/resources/checks/v31/parameters/OAR020/without-parameters.json +++ b/src/test/resources/checks/v31/parameters/OAR020/without-parameters.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.1.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v31/parameters/OAR020/without-parameters.yaml b/src/test/resources/checks/v31/parameters/OAR020/without-parameters.yaml index 17256a1a..f16d31f9 100644 --- a/src/test/resources/checks/v31/parameters/OAR020/without-parameters.yaml +++ b/src/test/resources/checks/v31/parameters/OAR020/without-parameters.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/parameters/OAR021/excluded.json b/src/test/resources/checks/v31/parameters/OAR021/excluded.json index 7b77042f..7d8ea3ca 100644 --- a/src/test/resources/checks/v31/parameters/OAR021/excluded.json +++ b/src/test/resources/checks/v31/parameters/OAR021/excluded.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.1.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v31/parameters/OAR021/excluded.yaml b/src/test/resources/checks/v31/parameters/OAR021/excluded.yaml index 5bb25ac8..67391c40 100644 --- a/src/test/resources/checks/v31/parameters/OAR021/excluded.yaml +++ b/src/test/resources/checks/v31/parameters/OAR021/excluded.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/parameters/OAR021/plain-without.json b/src/test/resources/checks/v31/parameters/OAR021/plain-without.json index 78c3e87b..3e134736 100644 --- a/src/test/resources/checks/v31/parameters/OAR021/plain-without.json +++ b/src/test/resources/checks/v31/parameters/OAR021/plain-without.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.1.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v31/parameters/OAR021/plain-without.yaml b/src/test/resources/checks/v31/parameters/OAR021/plain-without.yaml index 72854964..917b9693 100644 --- a/src/test/resources/checks/v31/parameters/OAR021/plain-without.yaml +++ b/src/test/resources/checks/v31/parameters/OAR021/plain-without.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/parameters/OAR021/plain.json b/src/test/resources/checks/v31/parameters/OAR021/plain.json index f07e2f8a..ae8fecfb 100644 --- a/src/test/resources/checks/v31/parameters/OAR021/plain.json +++ b/src/test/resources/checks/v31/parameters/OAR021/plain.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.1.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v31/parameters/OAR021/plain.yaml b/src/test/resources/checks/v31/parameters/OAR021/plain.yaml index f5d21041..47439ebe 100644 --- a/src/test/resources/checks/v31/parameters/OAR021/plain.yaml +++ b/src/test/resources/checks/v31/parameters/OAR021/plain.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/parameters/OAR021/with-$ref-without.json b/src/test/resources/checks/v31/parameters/OAR021/with-$ref-without.json index a9531c2f..c1deb4db 100644 --- a/src/test/resources/checks/v31/parameters/OAR021/with-$ref-without.json +++ b/src/test/resources/checks/v31/parameters/OAR021/with-$ref-without.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.1.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v31/parameters/OAR021/with-$ref-without.yaml b/src/test/resources/checks/v31/parameters/OAR021/with-$ref-without.yaml index c31ca64e..23f92400 100644 --- a/src/test/resources/checks/v31/parameters/OAR021/with-$ref-without.yaml +++ b/src/test/resources/checks/v31/parameters/OAR021/with-$ref-without.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/parameters/OAR021/with-$ref.json b/src/test/resources/checks/v31/parameters/OAR021/with-$ref.json index 60b07834..640ac5c1 100644 --- a/src/test/resources/checks/v31/parameters/OAR021/with-$ref.json +++ b/src/test/resources/checks/v31/parameters/OAR021/with-$ref.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.1.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v31/parameters/OAR021/with-$ref.yaml b/src/test/resources/checks/v31/parameters/OAR021/with-$ref.yaml index 967c1d7d..abffd701 100644 --- a/src/test/resources/checks/v31/parameters/OAR021/with-$ref.yaml +++ b/src/test/resources/checks/v31/parameters/OAR021/with-$ref.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/parameters/OAR021/with-param.json b/src/test/resources/checks/v31/parameters/OAR021/with-param.json index 1097b436..98bed098 100644 --- a/src/test/resources/checks/v31/parameters/OAR021/with-param.json +++ b/src/test/resources/checks/v31/parameters/OAR021/with-param.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "title": "Swagger Petstore", "version": "1.0.0" diff --git a/src/test/resources/checks/v31/parameters/OAR021/with-param.yaml b/src/test/resources/checks/v31/parameters/OAR021/with-param.yaml index 8b012753..73ffc8cc 100644 --- a/src/test/resources/checks/v31/parameters/OAR021/with-param.yaml +++ b/src/test/resources/checks/v31/parameters/OAR021/with-param.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.0 +openapi: "3.1.0" info: title: Swagger Petstore version: 1.0.0 diff --git a/src/test/resources/checks/v31/parameters/OAR021/with-ref.json b/src/test/resources/checks/v31/parameters/OAR021/with-ref.json index f3a1eb3d..518c3c8c 100644 --- a/src/test/resources/checks/v31/parameters/OAR021/with-ref.json +++ b/src/test/resources/checks/v31/parameters/OAR021/with-ref.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v31/parameters/OAR021/with-ref.yaml b/src/test/resources/checks/v31/parameters/OAR021/with-ref.yaml index 382897e5..ff0ae19b 100644 --- a/src/test/resources/checks/v31/parameters/OAR021/with-ref.yaml +++ b/src/test/resources/checks/v31/parameters/OAR021/with-ref.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.0 +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/parameters/OAR021/without-parameters.json b/src/test/resources/checks/v31/parameters/OAR021/without-parameters.json index fb4f3709..de714e9e 100644 --- a/src/test/resources/checks/v31/parameters/OAR021/without-parameters.json +++ b/src/test/resources/checks/v31/parameters/OAR021/without-parameters.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.1.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v31/parameters/OAR021/without-parameters.yaml b/src/test/resources/checks/v31/parameters/OAR021/without-parameters.yaml index f9ca221f..b80091fc 100644 --- a/src/test/resources/checks/v31/parameters/OAR021/without-parameters.yaml +++ b/src/test/resources/checks/v31/parameters/OAR021/without-parameters.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/parameters/OAR022/excluded.json b/src/test/resources/checks/v31/parameters/OAR022/excluded.json index 7b77042f..7d8ea3ca 100644 --- a/src/test/resources/checks/v31/parameters/OAR022/excluded.json +++ b/src/test/resources/checks/v31/parameters/OAR022/excluded.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.1.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v31/parameters/OAR022/excluded.yaml b/src/test/resources/checks/v31/parameters/OAR022/excluded.yaml index 5bb25ac8..67391c40 100644 --- a/src/test/resources/checks/v31/parameters/OAR022/excluded.yaml +++ b/src/test/resources/checks/v31/parameters/OAR022/excluded.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/parameters/OAR022/plain-without.json b/src/test/resources/checks/v31/parameters/OAR022/plain-without.json index e263f6bb..d7ed379d 100644 --- a/src/test/resources/checks/v31/parameters/OAR022/plain-without.json +++ b/src/test/resources/checks/v31/parameters/OAR022/plain-without.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.1.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v31/parameters/OAR022/plain-without.yaml b/src/test/resources/checks/v31/parameters/OAR022/plain-without.yaml index a284f1f4..ead64c1c 100644 --- a/src/test/resources/checks/v31/parameters/OAR022/plain-without.yaml +++ b/src/test/resources/checks/v31/parameters/OAR022/plain-without.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/parameters/OAR022/plain.json b/src/test/resources/checks/v31/parameters/OAR022/plain.json index dcf5ec3b..65fbba98 100644 --- a/src/test/resources/checks/v31/parameters/OAR022/plain.json +++ b/src/test/resources/checks/v31/parameters/OAR022/plain.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.1.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v31/parameters/OAR022/plain.yaml b/src/test/resources/checks/v31/parameters/OAR022/plain.yaml index 173955f8..42fb1be4 100644 --- a/src/test/resources/checks/v31/parameters/OAR022/plain.yaml +++ b/src/test/resources/checks/v31/parameters/OAR022/plain.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/parameters/OAR022/with-$ref-without.json b/src/test/resources/checks/v31/parameters/OAR022/with-$ref-without.json index 64cfcc5e..92208ba0 100644 --- a/src/test/resources/checks/v31/parameters/OAR022/with-$ref-without.json +++ b/src/test/resources/checks/v31/parameters/OAR022/with-$ref-without.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.1.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v31/parameters/OAR022/with-$ref-without.yaml b/src/test/resources/checks/v31/parameters/OAR022/with-$ref-without.yaml index 7c120401..876b37cd 100644 --- a/src/test/resources/checks/v31/parameters/OAR022/with-$ref-without.yaml +++ b/src/test/resources/checks/v31/parameters/OAR022/with-$ref-without.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/parameters/OAR022/with-$ref.json b/src/test/resources/checks/v31/parameters/OAR022/with-$ref.json index de939029..4219957b 100644 --- a/src/test/resources/checks/v31/parameters/OAR022/with-$ref.json +++ b/src/test/resources/checks/v31/parameters/OAR022/with-$ref.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.1.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v31/parameters/OAR022/with-$ref.yaml b/src/test/resources/checks/v31/parameters/OAR022/with-$ref.yaml index f4c69d5b..8ac1a909 100644 --- a/src/test/resources/checks/v31/parameters/OAR022/with-$ref.yaml +++ b/src/test/resources/checks/v31/parameters/OAR022/with-$ref.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/parameters/OAR022/without-parameters.json b/src/test/resources/checks/v31/parameters/OAR022/without-parameters.json index be5c3701..42024fdf 100644 --- a/src/test/resources/checks/v31/parameters/OAR022/without-parameters.json +++ b/src/test/resources/checks/v31/parameters/OAR022/without-parameters.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.1.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v31/parameters/OAR022/without-parameters.yaml b/src/test/resources/checks/v31/parameters/OAR022/without-parameters.yaml index 3e65a579..b6975c61 100644 --- a/src/test/resources/checks/v31/parameters/OAR022/without-parameters.yaml +++ b/src/test/resources/checks/v31/parameters/OAR022/without-parameters.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/parameters/OAR023/excluded.json b/src/test/resources/checks/v31/parameters/OAR023/excluded.json index 7b77042f..7d8ea3ca 100644 --- a/src/test/resources/checks/v31/parameters/OAR023/excluded.json +++ b/src/test/resources/checks/v31/parameters/OAR023/excluded.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.1.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v31/parameters/OAR023/excluded.yaml b/src/test/resources/checks/v31/parameters/OAR023/excluded.yaml index 5bb25ac8..67391c40 100644 --- a/src/test/resources/checks/v31/parameters/OAR023/excluded.yaml +++ b/src/test/resources/checks/v31/parameters/OAR023/excluded.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/parameters/OAR023/plain-without.json b/src/test/resources/checks/v31/parameters/OAR023/plain-without.json index 871eddb2..5f22df41 100644 --- a/src/test/resources/checks/v31/parameters/OAR023/plain-without.json +++ b/src/test/resources/checks/v31/parameters/OAR023/plain-without.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.1.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v31/parameters/OAR023/plain-without.yaml b/src/test/resources/checks/v31/parameters/OAR023/plain-without.yaml index 6f8d8d99..07eb9ca0 100644 --- a/src/test/resources/checks/v31/parameters/OAR023/plain-without.yaml +++ b/src/test/resources/checks/v31/parameters/OAR023/plain-without.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/parameters/OAR023/plain.json b/src/test/resources/checks/v31/parameters/OAR023/plain.json index 93ef330b..db9de69d 100644 --- a/src/test/resources/checks/v31/parameters/OAR023/plain.json +++ b/src/test/resources/checks/v31/parameters/OAR023/plain.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.1.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v31/parameters/OAR023/plain.yaml b/src/test/resources/checks/v31/parameters/OAR023/plain.yaml index e3b89931..1cfb12ad 100644 --- a/src/test/resources/checks/v31/parameters/OAR023/plain.yaml +++ b/src/test/resources/checks/v31/parameters/OAR023/plain.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/parameters/OAR023/with-$ref-without.json b/src/test/resources/checks/v31/parameters/OAR023/with-$ref-without.json index 16176996..e82547c6 100644 --- a/src/test/resources/checks/v31/parameters/OAR023/with-$ref-without.json +++ b/src/test/resources/checks/v31/parameters/OAR023/with-$ref-without.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.1.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v31/parameters/OAR023/with-$ref-without.yaml b/src/test/resources/checks/v31/parameters/OAR023/with-$ref-without.yaml index fd019cc6..12a75d80 100644 --- a/src/test/resources/checks/v31/parameters/OAR023/with-$ref-without.yaml +++ b/src/test/resources/checks/v31/parameters/OAR023/with-$ref-without.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/parameters/OAR023/with-$ref.json b/src/test/resources/checks/v31/parameters/OAR023/with-$ref.json index db373f26..7c1388b1 100644 --- a/src/test/resources/checks/v31/parameters/OAR023/with-$ref.json +++ b/src/test/resources/checks/v31/parameters/OAR023/with-$ref.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.1.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v31/parameters/OAR023/with-$ref.yaml b/src/test/resources/checks/v31/parameters/OAR023/with-$ref.yaml index 702bb880..985a84f6 100644 --- a/src/test/resources/checks/v31/parameters/OAR023/with-$ref.yaml +++ b/src/test/resources/checks/v31/parameters/OAR023/with-$ref.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/parameters/OAR023/without-parameters.json b/src/test/resources/checks/v31/parameters/OAR023/without-parameters.json index f2376bff..4a939e4d 100644 --- a/src/test/resources/checks/v31/parameters/OAR023/without-parameters.json +++ b/src/test/resources/checks/v31/parameters/OAR023/without-parameters.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.1.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v31/parameters/OAR023/without-parameters.yaml b/src/test/resources/checks/v31/parameters/OAR023/without-parameters.yaml index 76a349a0..d3754e51 100644 --- a/src/test/resources/checks/v31/parameters/OAR023/without-parameters.yaml +++ b/src/test/resources/checks/v31/parameters/OAR023/without-parameters.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/parameters/OAR024/excluded.json b/src/test/resources/checks/v31/parameters/OAR024/excluded.json index 7b77042f..7d8ea3ca 100644 --- a/src/test/resources/checks/v31/parameters/OAR024/excluded.json +++ b/src/test/resources/checks/v31/parameters/OAR024/excluded.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.1.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v31/parameters/OAR024/excluded.yaml b/src/test/resources/checks/v31/parameters/OAR024/excluded.yaml index 5bb25ac8..67391c40 100644 --- a/src/test/resources/checks/v31/parameters/OAR024/excluded.yaml +++ b/src/test/resources/checks/v31/parameters/OAR024/excluded.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/parameters/OAR024/plain-without.json b/src/test/resources/checks/v31/parameters/OAR024/plain-without.json index d3533f31..b80f1ac8 100644 --- a/src/test/resources/checks/v31/parameters/OAR024/plain-without.json +++ b/src/test/resources/checks/v31/parameters/OAR024/plain-without.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.1.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v31/parameters/OAR024/plain-without.yaml b/src/test/resources/checks/v31/parameters/OAR024/plain-without.yaml index 4e44fb6e..8dfda543 100644 --- a/src/test/resources/checks/v31/parameters/OAR024/plain-without.yaml +++ b/src/test/resources/checks/v31/parameters/OAR024/plain-without.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/parameters/OAR024/plain.json b/src/test/resources/checks/v31/parameters/OAR024/plain.json index 0e100ef0..69618890 100644 --- a/src/test/resources/checks/v31/parameters/OAR024/plain.json +++ b/src/test/resources/checks/v31/parameters/OAR024/plain.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.1.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v31/parameters/OAR024/plain.yaml b/src/test/resources/checks/v31/parameters/OAR024/plain.yaml index 59d15dba..42d4d1e9 100644 --- a/src/test/resources/checks/v31/parameters/OAR024/plain.yaml +++ b/src/test/resources/checks/v31/parameters/OAR024/plain.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/parameters/OAR024/with-$ref-without.json b/src/test/resources/checks/v31/parameters/OAR024/with-$ref-without.json index da1de6a6..1215bd29 100644 --- a/src/test/resources/checks/v31/parameters/OAR024/with-$ref-without.json +++ b/src/test/resources/checks/v31/parameters/OAR024/with-$ref-without.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.1.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v31/parameters/OAR024/with-$ref-without.yaml b/src/test/resources/checks/v31/parameters/OAR024/with-$ref-without.yaml index 09efcc5a..56dce587 100644 --- a/src/test/resources/checks/v31/parameters/OAR024/with-$ref-without.yaml +++ b/src/test/resources/checks/v31/parameters/OAR024/with-$ref-without.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/parameters/OAR024/with-$ref.json b/src/test/resources/checks/v31/parameters/OAR024/with-$ref.json index 4e4888fd..456a17bf 100644 --- a/src/test/resources/checks/v31/parameters/OAR024/with-$ref.json +++ b/src/test/resources/checks/v31/parameters/OAR024/with-$ref.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.1.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v31/parameters/OAR024/with-$ref.yaml b/src/test/resources/checks/v31/parameters/OAR024/with-$ref.yaml index 32148ae7..25f60835 100644 --- a/src/test/resources/checks/v31/parameters/OAR024/with-$ref.yaml +++ b/src/test/resources/checks/v31/parameters/OAR024/with-$ref.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/parameters/OAR024/without-parameters.json b/src/test/resources/checks/v31/parameters/OAR024/without-parameters.json index 1d44370b..fffc2673 100644 --- a/src/test/resources/checks/v31/parameters/OAR024/without-parameters.json +++ b/src/test/resources/checks/v31/parameters/OAR024/without-parameters.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.1.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v31/parameters/OAR024/without-parameters.yaml b/src/test/resources/checks/v31/parameters/OAR024/without-parameters.yaml index eb66f92f..84341362 100644 --- a/src/test/resources/checks/v31/parameters/OAR024/without-parameters.yaml +++ b/src/test/resources/checks/v31/parameters/OAR024/without-parameters.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/parameters/OAR025/excluded.json b/src/test/resources/checks/v31/parameters/OAR025/excluded.json index 7b77042f..7d8ea3ca 100644 --- a/src/test/resources/checks/v31/parameters/OAR025/excluded.json +++ b/src/test/resources/checks/v31/parameters/OAR025/excluded.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.1.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v31/parameters/OAR025/excluded.yaml b/src/test/resources/checks/v31/parameters/OAR025/excluded.yaml index 5bb25ac8..67391c40 100644 --- a/src/test/resources/checks/v31/parameters/OAR025/excluded.yaml +++ b/src/test/resources/checks/v31/parameters/OAR025/excluded.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/parameters/OAR025/plain-without.json b/src/test/resources/checks/v31/parameters/OAR025/plain-without.json index e255f777..76c976f6 100644 --- a/src/test/resources/checks/v31/parameters/OAR025/plain-without.json +++ b/src/test/resources/checks/v31/parameters/OAR025/plain-without.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.1.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v31/parameters/OAR025/plain-without.yaml b/src/test/resources/checks/v31/parameters/OAR025/plain-without.yaml index aba5d2c0..b99a35ce 100644 --- a/src/test/resources/checks/v31/parameters/OAR025/plain-without.yaml +++ b/src/test/resources/checks/v31/parameters/OAR025/plain-without.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/parameters/OAR025/plain.json b/src/test/resources/checks/v31/parameters/OAR025/plain.json index b853da7f..96bc8d9a 100644 --- a/src/test/resources/checks/v31/parameters/OAR025/plain.json +++ b/src/test/resources/checks/v31/parameters/OAR025/plain.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.1.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v31/parameters/OAR025/plain.yaml b/src/test/resources/checks/v31/parameters/OAR025/plain.yaml index 7eebb8fa..3bf57ba7 100644 --- a/src/test/resources/checks/v31/parameters/OAR025/plain.yaml +++ b/src/test/resources/checks/v31/parameters/OAR025/plain.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/parameters/OAR025/with-$ref-without.json b/src/test/resources/checks/v31/parameters/OAR025/with-$ref-without.json index 864d968a..bb12a265 100644 --- a/src/test/resources/checks/v31/parameters/OAR025/with-$ref-without.json +++ b/src/test/resources/checks/v31/parameters/OAR025/with-$ref-without.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.1.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v31/parameters/OAR025/with-$ref-without.yaml b/src/test/resources/checks/v31/parameters/OAR025/with-$ref-without.yaml index 36ceb535..004856ac 100644 --- a/src/test/resources/checks/v31/parameters/OAR025/with-$ref-without.yaml +++ b/src/test/resources/checks/v31/parameters/OAR025/with-$ref-without.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/parameters/OAR025/with-$ref.json b/src/test/resources/checks/v31/parameters/OAR025/with-$ref.json index 8ebf79a9..eec99045 100644 --- a/src/test/resources/checks/v31/parameters/OAR025/with-$ref.json +++ b/src/test/resources/checks/v31/parameters/OAR025/with-$ref.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.1.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v31/parameters/OAR025/with-$ref.yaml b/src/test/resources/checks/v31/parameters/OAR025/with-$ref.yaml index ae38c08d..07e6f0c3 100644 --- a/src/test/resources/checks/v31/parameters/OAR025/with-$ref.yaml +++ b/src/test/resources/checks/v31/parameters/OAR025/with-$ref.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/parameters/OAR025/without-parameters.json b/src/test/resources/checks/v31/parameters/OAR025/without-parameters.json index 2c99e1ea..631f45d0 100644 --- a/src/test/resources/checks/v31/parameters/OAR025/without-parameters.json +++ b/src/test/resources/checks/v31/parameters/OAR025/without-parameters.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.1.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v31/parameters/OAR025/without-parameters.yaml b/src/test/resources/checks/v31/parameters/OAR025/without-parameters.yaml index 729668f0..2b078122 100644 --- a/src/test/resources/checks/v31/parameters/OAR025/without-parameters.yaml +++ b/src/test/resources/checks/v31/parameters/OAR025/without-parameters.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/parameters/OAR026/plain-with-$total-with-defval-false.json b/src/test/resources/checks/v31/parameters/OAR026/plain-with-$total-with-defval-false.json index 1b477763..e1272ccf 100644 --- a/src/test/resources/checks/v31/parameters/OAR026/plain-with-$total-with-defval-false.json +++ b/src/test/resources/checks/v31/parameters/OAR026/plain-with-$total-with-defval-false.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.1.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v31/parameters/OAR026/plain-with-$total-with-defval-false.yaml b/src/test/resources/checks/v31/parameters/OAR026/plain-with-$total-with-defval-false.yaml index c33165c9..4cc63615 100644 --- a/src/test/resources/checks/v31/parameters/OAR026/plain-with-$total-with-defval-false.yaml +++ b/src/test/resources/checks/v31/parameters/OAR026/plain-with-$total-with-defval-false.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/parameters/OAR026/plain-with-$total-with-defval-true.json b/src/test/resources/checks/v31/parameters/OAR026/plain-with-$total-with-defval-true.json index 0295039e..754e4969 100644 --- a/src/test/resources/checks/v31/parameters/OAR026/plain-with-$total-with-defval-true.json +++ b/src/test/resources/checks/v31/parameters/OAR026/plain-with-$total-with-defval-true.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.1.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v31/parameters/OAR026/plain-with-$total-with-defval-true.yaml b/src/test/resources/checks/v31/parameters/OAR026/plain-with-$total-with-defval-true.yaml index 3324a5a2..9fd69cec 100644 --- a/src/test/resources/checks/v31/parameters/OAR026/plain-with-$total-with-defval-true.yaml +++ b/src/test/resources/checks/v31/parameters/OAR026/plain-with-$total-with-defval-true.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/parameters/OAR026/plain-with-$total-without-defval.json b/src/test/resources/checks/v31/parameters/OAR026/plain-with-$total-without-defval.json index d756597f..fe56facb 100644 --- a/src/test/resources/checks/v31/parameters/OAR026/plain-with-$total-without-defval.json +++ b/src/test/resources/checks/v31/parameters/OAR026/plain-with-$total-without-defval.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.1.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v31/parameters/OAR026/plain-with-$total-without-defval.yaml b/src/test/resources/checks/v31/parameters/OAR026/plain-with-$total-without-defval.yaml index c2580dc0..76791b5a 100644 --- a/src/test/resources/checks/v31/parameters/OAR026/plain-with-$total-without-defval.yaml +++ b/src/test/resources/checks/v31/parameters/OAR026/plain-with-$total-without-defval.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/parameters/OAR026/plain-without-$total.json b/src/test/resources/checks/v31/parameters/OAR026/plain-without-$total.json index 03c10cc8..663416b5 100644 --- a/src/test/resources/checks/v31/parameters/OAR026/plain-without-$total.json +++ b/src/test/resources/checks/v31/parameters/OAR026/plain-without-$total.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.1.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v31/parameters/OAR026/plain-without-$total.yaml b/src/test/resources/checks/v31/parameters/OAR026/plain-without-$total.yaml index bf36bc7d..317179df 100644 --- a/src/test/resources/checks/v31/parameters/OAR026/plain-without-$total.yaml +++ b/src/test/resources/checks/v31/parameters/OAR026/plain-without-$total.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/parameters/OAR026/with-$ref-with-$total-with-defval-false.json b/src/test/resources/checks/v31/parameters/OAR026/with-$ref-with-$total-with-defval-false.json index ac0d6d53..005f2e55 100644 --- a/src/test/resources/checks/v31/parameters/OAR026/with-$ref-with-$total-with-defval-false.json +++ b/src/test/resources/checks/v31/parameters/OAR026/with-$ref-with-$total-with-defval-false.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.1.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v31/parameters/OAR026/with-$ref-with-$total-with-defval-false.yaml b/src/test/resources/checks/v31/parameters/OAR026/with-$ref-with-$total-with-defval-false.yaml index 1e0b553f..5f1d91ce 100644 --- a/src/test/resources/checks/v31/parameters/OAR026/with-$ref-with-$total-with-defval-false.yaml +++ b/src/test/resources/checks/v31/parameters/OAR026/with-$ref-with-$total-with-defval-false.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/parameters/OAR026/with-$ref-with-$total-with-defval-true.json b/src/test/resources/checks/v31/parameters/OAR026/with-$ref-with-$total-with-defval-true.json index 45028091..dc6e88e2 100644 --- a/src/test/resources/checks/v31/parameters/OAR026/with-$ref-with-$total-with-defval-true.json +++ b/src/test/resources/checks/v31/parameters/OAR026/with-$ref-with-$total-with-defval-true.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.1.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v31/parameters/OAR026/with-$ref-with-$total-with-defval-true.yaml b/src/test/resources/checks/v31/parameters/OAR026/with-$ref-with-$total-with-defval-true.yaml index 4936969a..707f7559 100644 --- a/src/test/resources/checks/v31/parameters/OAR026/with-$ref-with-$total-with-defval-true.yaml +++ b/src/test/resources/checks/v31/parameters/OAR026/with-$ref-with-$total-with-defval-true.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/parameters/OAR026/with-$ref-with-$total-without-defval.json b/src/test/resources/checks/v31/parameters/OAR026/with-$ref-with-$total-without-defval.json index 9c5ef562..a550035d 100644 --- a/src/test/resources/checks/v31/parameters/OAR026/with-$ref-with-$total-without-defval.json +++ b/src/test/resources/checks/v31/parameters/OAR026/with-$ref-with-$total-without-defval.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.1.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v31/parameters/OAR026/with-$ref-with-$total-without-defval.yaml b/src/test/resources/checks/v31/parameters/OAR026/with-$ref-with-$total-without-defval.yaml index 68f5a74b..a7888290 100644 --- a/src/test/resources/checks/v31/parameters/OAR026/with-$ref-with-$total-without-defval.yaml +++ b/src/test/resources/checks/v31/parameters/OAR026/with-$ref-with-$total-without-defval.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/parameters/OAR026/with-$ref-without-$total.json b/src/test/resources/checks/v31/parameters/OAR026/with-$ref-without-$total.json index e32862b7..b248acab 100644 --- a/src/test/resources/checks/v31/parameters/OAR026/with-$ref-without-$total.json +++ b/src/test/resources/checks/v31/parameters/OAR026/with-$ref-without-$total.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.1.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v31/parameters/OAR026/with-$ref-without-$total.yaml b/src/test/resources/checks/v31/parameters/OAR026/with-$ref-without-$total.yaml index 0b0047cb..6e44d2c0 100644 --- a/src/test/resources/checks/v31/parameters/OAR026/with-$ref-without-$total.yaml +++ b/src/test/resources/checks/v31/parameters/OAR026/with-$ref-without-$total.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/parameters/OAR026/without-parameters.json b/src/test/resources/checks/v31/parameters/OAR026/without-parameters.json index 6eb95f76..7c522e05 100644 --- a/src/test/resources/checks/v31/parameters/OAR026/without-parameters.json +++ b/src/test/resources/checks/v31/parameters/OAR026/without-parameters.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.1.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v31/parameters/OAR026/without-parameters.yaml b/src/test/resources/checks/v31/parameters/OAR026/without-parameters.yaml index 28190798..e097d76a 100644 --- a/src/test/resources/checks/v31/parameters/OAR026/without-parameters.yaml +++ b/src/test/resources/checks/v31/parameters/OAR026/without-parameters.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/parameters/OAR028/components-param.json b/src/test/resources/checks/v31/parameters/OAR028/components-param.json index 38b3f30a..6c2a7460 100644 --- a/src/test/resources/checks/v31/parameters/OAR028/components-param.json +++ b/src/test/resources/checks/v31/parameters/OAR028/components-param.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.1.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v31/parameters/OAR028/components-param.yaml b/src/test/resources/checks/v31/parameters/OAR028/components-param.yaml index 18bc4ac4..f9bd9cd6 100644 --- a/src/test/resources/checks/v31/parameters/OAR028/components-param.yaml +++ b/src/test/resources/checks/v31/parameters/OAR028/components-param.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/parameters/OAR028/exclude-noncompliant.json b/src/test/resources/checks/v31/parameters/OAR028/exclude-noncompliant.json index ec73f987..5fa3e557 100644 --- a/src/test/resources/checks/v31/parameters/OAR028/exclude-noncompliant.json +++ b/src/test/resources/checks/v31/parameters/OAR028/exclude-noncompliant.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.1.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v31/parameters/OAR028/exclude-noncompliant.yaml b/src/test/resources/checks/v31/parameters/OAR028/exclude-noncompliant.yaml index bc7139de..3abbe1cf 100644 --- a/src/test/resources/checks/v31/parameters/OAR028/exclude-noncompliant.yaml +++ b/src/test/resources/checks/v31/parameters/OAR028/exclude-noncompliant.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/parameters/OAR028/excluded.json b/src/test/resources/checks/v31/parameters/OAR028/excluded.json index 7b77042f..7d8ea3ca 100644 --- a/src/test/resources/checks/v31/parameters/OAR028/excluded.json +++ b/src/test/resources/checks/v31/parameters/OAR028/excluded.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.1.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v31/parameters/OAR028/excluded.yaml b/src/test/resources/checks/v31/parameters/OAR028/excluded.yaml index 5bb25ac8..67391c40 100644 --- a/src/test/resources/checks/v31/parameters/OAR028/excluded.yaml +++ b/src/test/resources/checks/v31/parameters/OAR028/excluded.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/parameters/OAR028/plain-without.json b/src/test/resources/checks/v31/parameters/OAR028/plain-without.json index 56ec4af2..3fca9b30 100644 --- a/src/test/resources/checks/v31/parameters/OAR028/plain-without.json +++ b/src/test/resources/checks/v31/parameters/OAR028/plain-without.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.1.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v31/parameters/OAR028/plain-without.yaml b/src/test/resources/checks/v31/parameters/OAR028/plain-without.yaml index e756f798..5d404776 100644 --- a/src/test/resources/checks/v31/parameters/OAR028/plain-without.yaml +++ b/src/test/resources/checks/v31/parameters/OAR028/plain-without.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/parameters/OAR028/plain.json b/src/test/resources/checks/v31/parameters/OAR028/plain.json index aadfd6a9..c7ac1c8a 100644 --- a/src/test/resources/checks/v31/parameters/OAR028/plain.json +++ b/src/test/resources/checks/v31/parameters/OAR028/plain.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.1.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v31/parameters/OAR028/plain.yaml b/src/test/resources/checks/v31/parameters/OAR028/plain.yaml index 69e65b70..abeb201c 100644 --- a/src/test/resources/checks/v31/parameters/OAR028/plain.yaml +++ b/src/test/resources/checks/v31/parameters/OAR028/plain.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/parameters/OAR028/with-$ref-without.json b/src/test/resources/checks/v31/parameters/OAR028/with-$ref-without.json index e045953f..2e7ceb26 100644 --- a/src/test/resources/checks/v31/parameters/OAR028/with-$ref-without.json +++ b/src/test/resources/checks/v31/parameters/OAR028/with-$ref-without.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.1.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v31/parameters/OAR028/with-$ref-without.yaml b/src/test/resources/checks/v31/parameters/OAR028/with-$ref-without.yaml index 74206e3d..c092c813 100644 --- a/src/test/resources/checks/v31/parameters/OAR028/with-$ref-without.yaml +++ b/src/test/resources/checks/v31/parameters/OAR028/with-$ref-without.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/parameters/OAR028/with-$ref.json b/src/test/resources/checks/v31/parameters/OAR028/with-$ref.json index 02cd1cb9..3d94cde9 100644 --- a/src/test/resources/checks/v31/parameters/OAR028/with-$ref.json +++ b/src/test/resources/checks/v31/parameters/OAR028/with-$ref.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.1.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v31/parameters/OAR028/with-$ref.yaml b/src/test/resources/checks/v31/parameters/OAR028/with-$ref.yaml index 1cddb613..80841874 100644 --- a/src/test/resources/checks/v31/parameters/OAR028/with-$ref.yaml +++ b/src/test/resources/checks/v31/parameters/OAR028/with-$ref.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/parameters/OAR028/without-parameters.json b/src/test/resources/checks/v31/parameters/OAR028/without-parameters.json index cd9cbea6..4ab6bba4 100644 --- a/src/test/resources/checks/v31/parameters/OAR028/without-parameters.json +++ b/src/test/resources/checks/v31/parameters/OAR028/without-parameters.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.1.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v31/parameters/OAR028/without-parameters.yaml b/src/test/resources/checks/v31/parameters/OAR028/without-parameters.yaml index 12c50ca8..df692e5f 100644 --- a/src/test/resources/checks/v31/parameters/OAR028/without-parameters.yaml +++ b/src/test/resources/checks/v31/parameters/OAR028/without-parameters.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/parameters/OAR060/required-false.json b/src/test/resources/checks/v31/parameters/OAR060/required-false.json index e0608d51..89eadd24 100644 --- a/src/test/resources/checks/v31/parameters/OAR060/required-false.json +++ b/src/test/resources/checks/v31/parameters/OAR060/required-false.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.1.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v31/parameters/OAR060/required-false.yaml b/src/test/resources/checks/v31/parameters/OAR060/required-false.yaml index 5537b3e6..3c5c725e 100644 --- a/src/test/resources/checks/v31/parameters/OAR060/required-false.yaml +++ b/src/test/resources/checks/v31/parameters/OAR060/required-false.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/parameters/OAR060/required-true.json b/src/test/resources/checks/v31/parameters/OAR060/required-true.json index c57cdd06..d9ffefcf 100644 --- a/src/test/resources/checks/v31/parameters/OAR060/required-true.json +++ b/src/test/resources/checks/v31/parameters/OAR060/required-true.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.1.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v31/parameters/OAR060/required-true.yaml b/src/test/resources/checks/v31/parameters/OAR060/required-true.yaml index 00a697fb..95969ebd 100644 --- a/src/test/resources/checks/v31/parameters/OAR060/required-true.yaml +++ b/src/test/resources/checks/v31/parameters/OAR060/required-true.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/parameters/OAR069/bad-request400.json b/src/test/resources/checks/v31/parameters/OAR069/bad-request400.json index 5f9e2b7c..f261c775 100644 --- a/src/test/resources/checks/v31/parameters/OAR069/bad-request400.json +++ b/src/test/resources/checks/v31/parameters/OAR069/bad-request400.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.1.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v31/parameters/OAR069/bad-request400.yaml b/src/test/resources/checks/v31/parameters/OAR069/bad-request400.yaml index 8e3ad04a..45b5697b 100644 --- a/src/test/resources/checks/v31/parameters/OAR069/bad-request400.yaml +++ b/src/test/resources/checks/v31/parameters/OAR069/bad-request400.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/parameters/OAR069/no-bad-request400.json b/src/test/resources/checks/v31/parameters/OAR069/no-bad-request400.json index 54ace04f..574a3b75 100644 --- a/src/test/resources/checks/v31/parameters/OAR069/no-bad-request400.json +++ b/src/test/resources/checks/v31/parameters/OAR069/no-bad-request400.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.1.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v31/parameters/OAR069/no-bad-request400.yaml b/src/test/resources/checks/v31/parameters/OAR069/no-bad-request400.yaml index 44c1d8ad..295d20b5 100644 --- a/src/test/resources/checks/v31/parameters/OAR069/no-bad-request400.yaml +++ b/src/test/resources/checks/v31/parameters/OAR069/no-bad-request400.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/regex/OAR112/external-docs-invalid.json b/src/test/resources/checks/v31/regex/OAR112/external-docs-invalid.json index 17586e7f..fef731dd 100644 --- a/src/test/resources/checks/v31/regex/OAR112/external-docs-invalid.json +++ b/src/test/resources/checks/v31/regex/OAR112/external-docs-invalid.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.3", + "openapi" : "3.1.0", "info" : { "title" : "Test API", "version" : "1.0.0" diff --git a/src/test/resources/checks/v31/regex/OAR112/external-docs-invalid.yaml b/src/test/resources/checks/v31/regex/OAR112/external-docs-invalid.yaml index 587823ce..f70e3a96 100644 --- a/src/test/resources/checks/v31/regex/OAR112/external-docs-invalid.yaml +++ b/src/test/resources/checks/v31/regex/OAR112/external-docs-invalid.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.3 +openapi: "3.1.0" info: title: Test API version: 1.0.0 diff --git a/src/test/resources/checks/v31/regex/OAR112/external-docs-valid.json b/src/test/resources/checks/v31/regex/OAR112/external-docs-valid.json index b557673e..87c5331d 100644 --- a/src/test/resources/checks/v31/regex/OAR112/external-docs-valid.json +++ b/src/test/resources/checks/v31/regex/OAR112/external-docs-valid.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.3", + "openapi" : "3.1.0", "info" : { "title" : "Test API", "version" : "1.0.0" diff --git a/src/test/resources/checks/v31/regex/OAR112/external-docs-valid.yaml b/src/test/resources/checks/v31/regex/OAR112/external-docs-valid.yaml index a273f219..2c4b3d10 100644 --- a/src/test/resources/checks/v31/regex/OAR112/external-docs-valid.yaml +++ b/src/test/resources/checks/v31/regex/OAR112/external-docs-valid.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.3 +openapi: "3.1.0" info: title: Test API version: 1.0.0 diff --git a/src/test/resources/checks/v31/regex/OAR112/info-invalid.json b/src/test/resources/checks/v31/regex/OAR112/info-invalid.json index 1febb6b1..4a5eaf0d 100644 --- a/src/test/resources/checks/v31/regex/OAR112/info-invalid.json +++ b/src/test/resources/checks/v31/regex/OAR112/info-invalid.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.3", + "openapi" : "3.1.0", "info" : { "title" : "Test API", "version" : "1.0.0", diff --git a/src/test/resources/checks/v31/regex/OAR112/info-invalid.yaml b/src/test/resources/checks/v31/regex/OAR112/info-invalid.yaml index 32fbcf71..44c1aad7 100644 --- a/src/test/resources/checks/v31/regex/OAR112/info-invalid.yaml +++ b/src/test/resources/checks/v31/regex/OAR112/info-invalid.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.3 +openapi: "3.1.0" info: title: Test API version: 1.0.0 diff --git a/src/test/resources/checks/v31/regex/OAR112/minimal.json b/src/test/resources/checks/v31/regex/OAR112/minimal.json index 2c084747..055b2896 100644 --- a/src/test/resources/checks/v31/regex/OAR112/minimal.json +++ b/src/test/resources/checks/v31/regex/OAR112/minimal.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.3", + "openapi" : "3.1.0", "info" : { "title" : "Test API", "version" : "1.0.0" diff --git a/src/test/resources/checks/v31/regex/OAR112/minimal.yaml b/src/test/resources/checks/v31/regex/OAR112/minimal.yaml index f379c272..1e5e454d 100644 --- a/src/test/resources/checks/v31/regex/OAR112/minimal.yaml +++ b/src/test/resources/checks/v31/regex/OAR112/minimal.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.3 +openapi: "3.1.0" info: title: Test API version: 1.0.0 diff --git a/src/test/resources/checks/v31/regex/OAR112/missing-description.json b/src/test/resources/checks/v31/regex/OAR112/missing-description.json index f2549007..22882dfe 100644 --- a/src/test/resources/checks/v31/regex/OAR112/missing-description.json +++ b/src/test/resources/checks/v31/regex/OAR112/missing-description.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.3", + "openapi" : "3.1.0", "info" : { # Noncompliant {{OAR112: Expected to find a value but didn't.}} "title" : "Test API", "version" : "1.0.0" diff --git a/src/test/resources/checks/v31/regex/OAR112/missing-description.yaml b/src/test/resources/checks/v31/regex/OAR112/missing-description.yaml index db4ae777..6593b0c5 100644 --- a/src/test/resources/checks/v31/regex/OAR112/missing-description.yaml +++ b/src/test/resources/checks/v31/regex/OAR112/missing-description.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.3 +openapi: "3.1.0" info: # Noncompliant {{OAR112: Expected to find a value but didn't.}} title: Test API version: 1.0.0 diff --git a/src/test/resources/checks/v31/regex/OAR112/operation-invalid.json b/src/test/resources/checks/v31/regex/OAR112/operation-invalid.json index 8bfbed2b..a69d8f97 100644 --- a/src/test/resources/checks/v31/regex/OAR112/operation-invalid.json +++ b/src/test/resources/checks/v31/regex/OAR112/operation-invalid.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.3", + "openapi" : "3.1.0", "info" : { "title" : "Test API", "version" : "1.0.0" diff --git a/src/test/resources/checks/v31/regex/OAR112/operation-invalid.yaml b/src/test/resources/checks/v31/regex/OAR112/operation-invalid.yaml index 0bc1243b..6cb615b9 100644 --- a/src/test/resources/checks/v31/regex/OAR112/operation-invalid.yaml +++ b/src/test/resources/checks/v31/regex/OAR112/operation-invalid.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.3 +openapi: "3.1.0" info: title: Test API version: 1.0.0 diff --git a/src/test/resources/checks/v31/regex/OAR112/operation-valid.json b/src/test/resources/checks/v31/regex/OAR112/operation-valid.json index 84ad7faa..0633e725 100644 --- a/src/test/resources/checks/v31/regex/OAR112/operation-valid.json +++ b/src/test/resources/checks/v31/regex/OAR112/operation-valid.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.3", + "openapi" : "3.1.0", "info" : { "title" : "Test API", "version" : "1.0.0" diff --git a/src/test/resources/checks/v31/regex/OAR112/operation-valid.yaml b/src/test/resources/checks/v31/regex/OAR112/operation-valid.yaml index 9b62b40c..e80d8333 100644 --- a/src/test/resources/checks/v31/regex/OAR112/operation-valid.yaml +++ b/src/test/resources/checks/v31/regex/OAR112/operation-valid.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.3 +openapi: "3.1.0" info: title: Test API version: 1.0.0 diff --git a/src/test/resources/checks/v31/regex/OAR112/parameters-invalid.json b/src/test/resources/checks/v31/regex/OAR112/parameters-invalid.json index 46495733..ecb86b3e 100644 --- a/src/test/resources/checks/v31/regex/OAR112/parameters-invalid.json +++ b/src/test/resources/checks/v31/regex/OAR112/parameters-invalid.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.3", + "openapi" : "3.1.0", "info" : { "title" : "Test API", "version" : "1.0.0" diff --git a/src/test/resources/checks/v31/regex/OAR112/parameters-invalid.yaml b/src/test/resources/checks/v31/regex/OAR112/parameters-invalid.yaml index 86159506..ea5a1391 100644 --- a/src/test/resources/checks/v31/regex/OAR112/parameters-invalid.yaml +++ b/src/test/resources/checks/v31/regex/OAR112/parameters-invalid.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.3 +openapi: "3.1.0" info: title: Test API version: 1.0.0 diff --git a/src/test/resources/checks/v31/regex/OAR112/parameters-valid.json b/src/test/resources/checks/v31/regex/OAR112/parameters-valid.json index 27af1750..3e3e2c66 100644 --- a/src/test/resources/checks/v31/regex/OAR112/parameters-valid.json +++ b/src/test/resources/checks/v31/regex/OAR112/parameters-valid.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.3", + "openapi" : "3.1.0", "info" : { "title" : "Test API", "version" : "1.0.0" diff --git a/src/test/resources/checks/v31/regex/OAR112/parameters-valid.yaml b/src/test/resources/checks/v31/regex/OAR112/parameters-valid.yaml index 9ec6ebd6..b0e584df 100644 --- a/src/test/resources/checks/v31/regex/OAR112/parameters-valid.yaml +++ b/src/test/resources/checks/v31/regex/OAR112/parameters-valid.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.3 +openapi: "3.1.0" info: title: Test API version: 1.0.0 diff --git a/src/test/resources/checks/v31/regex/OAR112/plain.json b/src/test/resources/checks/v31/regex/OAR112/plain.json index aab1e213..5213c927 100644 --- a/src/test/resources/checks/v31/regex/OAR112/plain.json +++ b/src/test/resources/checks/v31/regex/OAR112/plain.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.1.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v31/regex/OAR112/plain.yaml b/src/test/resources/checks/v31/regex/OAR112/plain.yaml index 4621ff6f..bfddae53 100644 --- a/src/test/resources/checks/v31/regex/OAR112/plain.yaml +++ b/src/test/resources/checks/v31/regex/OAR112/plain.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.3 +openapi: "3.1.0" info: title: Ejemplo de API version: 1.0.0 diff --git a/src/test/resources/checks/v31/regex/OAR112/servers-invalid.json b/src/test/resources/checks/v31/regex/OAR112/servers-invalid.json index c5cda036..15a6eb3b 100644 --- a/src/test/resources/checks/v31/regex/OAR112/servers-invalid.json +++ b/src/test/resources/checks/v31/regex/OAR112/servers-invalid.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.3", + "openapi" : "3.1.0", "info" : { "title" : "Test API", "version" : "1.0.0" diff --git a/src/test/resources/checks/v31/regex/OAR112/servers-invalid.yaml b/src/test/resources/checks/v31/regex/OAR112/servers-invalid.yaml index 835f2b06..48cd017f 100644 --- a/src/test/resources/checks/v31/regex/OAR112/servers-invalid.yaml +++ b/src/test/resources/checks/v31/regex/OAR112/servers-invalid.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.3 +openapi: "3.1.0" info: title: Test API version: 1.0.0 diff --git a/src/test/resources/checks/v31/regex/OAR112/servers-valid.json b/src/test/resources/checks/v31/regex/OAR112/servers-valid.json index 735983f4..43b7a54b 100644 --- a/src/test/resources/checks/v31/regex/OAR112/servers-valid.json +++ b/src/test/resources/checks/v31/regex/OAR112/servers-valid.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.3", + "openapi" : "3.1.0", "info" : { "title" : "Test API", "version" : "1.0.0" diff --git a/src/test/resources/checks/v31/regex/OAR112/servers-valid.yaml b/src/test/resources/checks/v31/regex/OAR112/servers-valid.yaml index 511f93d7..487eeffb 100644 --- a/src/test/resources/checks/v31/regex/OAR112/servers-valid.yaml +++ b/src/test/resources/checks/v31/regex/OAR112/servers-valid.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.3 +openapi: "3.1.0" info: title: Test API version: 1.0.0 diff --git a/src/test/resources/checks/v31/regex/OAR112/tags-invalid.json b/src/test/resources/checks/v31/regex/OAR112/tags-invalid.json index 5995f7ba..b044e523 100644 --- a/src/test/resources/checks/v31/regex/OAR112/tags-invalid.json +++ b/src/test/resources/checks/v31/regex/OAR112/tags-invalid.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.3", + "openapi" : "3.1.0", "info" : { "title" : "Test API", "version" : "1.0.0" diff --git a/src/test/resources/checks/v31/regex/OAR112/tags-invalid.yaml b/src/test/resources/checks/v31/regex/OAR112/tags-invalid.yaml index 48c06b71..30213586 100644 --- a/src/test/resources/checks/v31/regex/OAR112/tags-invalid.yaml +++ b/src/test/resources/checks/v31/regex/OAR112/tags-invalid.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.3 +openapi: "3.1.0" info: title: Test API version: 1.0.0 diff --git a/src/test/resources/checks/v31/regex/OAR112/tags-valid.json b/src/test/resources/checks/v31/regex/OAR112/tags-valid.json index f28ad145..84bc4888 100644 --- a/src/test/resources/checks/v31/regex/OAR112/tags-valid.json +++ b/src/test/resources/checks/v31/regex/OAR112/tags-valid.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.3", + "openapi" : "3.1.0", "info" : { "title" : "Test API", "version" : "1.0.0" diff --git a/src/test/resources/checks/v31/regex/OAR112/tags-valid.yaml b/src/test/resources/checks/v31/regex/OAR112/tags-valid.yaml index 045b483f..4759ab3c 100644 --- a/src/test/resources/checks/v31/regex/OAR112/tags-valid.yaml +++ b/src/test/resources/checks/v31/regex/OAR112/tags-valid.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.3 +openapi: "3.1.0" info: title: Test API version: 1.0.0 diff --git a/src/test/resources/checks/v31/resources/OAR008/plain.json b/src/test/resources/checks/v31/resources/OAR008/plain.json index 9b40ba23..ba75c15c 100644 --- a/src/test/resources/checks/v31/resources/OAR008/plain.json +++ b/src/test/resources/checks/v31/resources/OAR008/plain.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.1.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v31/resources/OAR008/plain.yaml b/src/test/resources/checks/v31/resources/OAR008/plain.yaml index fa0fc5fc..68060ecc 100644 --- a/src/test/resources/checks/v31/resources/OAR008/plain.yaml +++ b/src/test/resources/checks/v31/resources/OAR008/plain.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/resources/OAR013/plain.json b/src/test/resources/checks/v31/resources/OAR013/plain.json index 78e9374c..f490b2bb 100644 --- a/src/test/resources/checks/v31/resources/OAR013/plain.json +++ b/src/test/resources/checks/v31/resources/OAR013/plain.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.1.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v31/resources/OAR013/plain.yaml b/src/test/resources/checks/v31/resources/OAR013/plain.yaml index a58371d8..4b796abc 100644 --- a/src/test/resources/checks/v31/resources/OAR013/plain.yaml +++ b/src/test/resources/checks/v31/resources/OAR013/plain.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/resources/OAR014/plain.json b/src/test/resources/checks/v31/resources/OAR014/plain.json index ec717959..973e4d92 100644 --- a/src/test/resources/checks/v31/resources/OAR014/plain.json +++ b/src/test/resources/checks/v31/resources/OAR014/plain.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v31/resources/OAR014/plain.yaml b/src/test/resources/checks/v31/resources/OAR014/plain.yaml index 08c7baa0..0e563616 100644 --- a/src/test/resources/checks/v31/resources/OAR014/plain.yaml +++ b/src/test/resources/checks/v31/resources/OAR014/plain.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/resources/OAR015/plain.json b/src/test/resources/checks/v31/resources/OAR015/plain.json index 258325fe..28fbb79d 100644 --- a/src/test/resources/checks/v31/resources/OAR015/plain.json +++ b/src/test/resources/checks/v31/resources/OAR015/plain.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v31/resources/OAR015/plain.yaml b/src/test/resources/checks/v31/resources/OAR015/plain.yaml index 94edfe5d..e298945b 100644 --- a/src/test/resources/checks/v31/resources/OAR015/plain.yaml +++ b/src/test/resources/checks/v31/resources/OAR015/plain.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.0 +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/resources/OAR017/plain.json b/src/test/resources/checks/v31/resources/OAR017/plain.json index 1106c56c..37d9774d 100644 --- a/src/test/resources/checks/v31/resources/OAR017/plain.json +++ b/src/test/resources/checks/v31/resources/OAR017/plain.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.1.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v31/resources/OAR017/plain.yaml b/src/test/resources/checks/v31/resources/OAR017/plain.yaml index 29c02541..96278294 100644 --- a/src/test/resources/checks/v31/resources/OAR017/plain.yaml +++ b/src/test/resources/checks/v31/resources/OAR017/plain.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/resources/OAR018/plain.json b/src/test/resources/checks/v31/resources/OAR018/plain.json index 691f21b9..0c894583 100644 --- a/src/test/resources/checks/v31/resources/OAR018/plain.json +++ b/src/test/resources/checks/v31/resources/OAR018/plain.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v31/resources/OAR018/plain.yaml b/src/test/resources/checks/v31/resources/OAR018/plain.yaml index bed03643..9245e482 100644 --- a/src/test/resources/checks/v31/resources/OAR018/plain.yaml +++ b/src/test/resources/checks/v31/resources/OAR018/plain.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/resources/OAR027/no-post.json b/src/test/resources/checks/v31/resources/OAR027/no-post.json index 06e93395..eead3f51 100644 --- a/src/test/resources/checks/v31/resources/OAR027/no-post.json +++ b/src/test/resources/checks/v31/resources/OAR027/no-post.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.1.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v31/resources/OAR027/no-post.yaml b/src/test/resources/checks/v31/resources/OAR027/no-post.yaml index 9e1d488a..63054920 100644 --- a/src/test/resources/checks/v31/resources/OAR027/no-post.yaml +++ b/src/test/resources/checks/v31/resources/OAR027/no-post.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/resources/OAR027/post-201-with-location.json b/src/test/resources/checks/v31/resources/OAR027/post-201-with-location.json index 1911e07c..d1359d6e 100644 --- a/src/test/resources/checks/v31/resources/OAR027/post-201-with-location.json +++ b/src/test/resources/checks/v31/resources/OAR027/post-201-with-location.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.1.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v31/resources/OAR027/post-201-with-location.yaml b/src/test/resources/checks/v31/resources/OAR027/post-201-with-location.yaml index 9b065b0a..e772b5ce 100644 --- a/src/test/resources/checks/v31/resources/OAR027/post-201-with-location.yaml +++ b/src/test/resources/checks/v31/resources/OAR027/post-201-with-location.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/resources/OAR027/post-201-with-other-headers.json b/src/test/resources/checks/v31/resources/OAR027/post-201-with-other-headers.json index 6e423478..e62d413a 100644 --- a/src/test/resources/checks/v31/resources/OAR027/post-201-with-other-headers.json +++ b/src/test/resources/checks/v31/resources/OAR027/post-201-with-other-headers.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.1.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v31/resources/OAR027/post-201-with-other-headers.yaml b/src/test/resources/checks/v31/resources/OAR027/post-201-with-other-headers.yaml index a080d8ed..8e8b26a3 100644 --- a/src/test/resources/checks/v31/resources/OAR027/post-201-with-other-headers.yaml +++ b/src/test/resources/checks/v31/resources/OAR027/post-201-with-other-headers.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/resources/OAR027/post-201-without-location.json b/src/test/resources/checks/v31/resources/OAR027/post-201-without-location.json index 3c46c6a4..efd4f635 100644 --- a/src/test/resources/checks/v31/resources/OAR027/post-201-without-location.json +++ b/src/test/resources/checks/v31/resources/OAR027/post-201-without-location.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.1.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v31/resources/OAR027/post-201-without-location.yaml b/src/test/resources/checks/v31/resources/OAR027/post-201-without-location.yaml index eb45ccf1..33660a6a 100644 --- a/src/test/resources/checks/v31/resources/OAR027/post-201-without-location.yaml +++ b/src/test/resources/checks/v31/resources/OAR027/post-201-without-location.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/resources/OAR027/post-no-201.json b/src/test/resources/checks/v31/resources/OAR027/post-no-201.json index 680dc49d..361a35ce 100644 --- a/src/test/resources/checks/v31/resources/OAR027/post-no-201.json +++ b/src/test/resources/checks/v31/resources/OAR027/post-no-201.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.1.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v31/resources/OAR027/post-no-201.yaml b/src/test/resources/checks/v31/resources/OAR027/post-no-201.yaml index bef9c590..efa20b71 100644 --- a/src/test/resources/checks/v31/resources/OAR027/post-no-201.yaml +++ b/src/test/resources/checks/v31/resources/OAR027/post-no-201.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/resources/OAR029/valid-all-of-md.json b/src/test/resources/checks/v31/resources/OAR029/valid-all-of-md.json index d39ce425..64c76749 100644 --- a/src/test/resources/checks/v31/resources/OAR029/valid-all-of-md.json +++ b/src/test/resources/checks/v31/resources/OAR029/valid-all-of-md.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.1", + "openapi" : "3.1.0", "info": { "title": "Swagger Petstore", "version": "1.0.0" diff --git a/src/test/resources/checks/v31/resources/OAR029/valid-all-of-md.yaml b/src/test/resources/checks/v31/resources/OAR029/valid-all-of-md.yaml index 5413414a..c852082b 100644 --- a/src/test/resources/checks/v31/resources/OAR029/valid-all-of-md.yaml +++ b/src/test/resources/checks/v31/resources/OAR029/valid-all-of-md.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.1 +openapi: "3.1.0" info: title: Swagger Petstore version: 1.0.0 diff --git a/src/test/resources/checks/v31/resources/OAR029/valid-all-of.json b/src/test/resources/checks/v31/resources/OAR029/valid-all-of.json index cae30865..f545bada 100644 --- a/src/test/resources/checks/v31/resources/OAR029/valid-all-of.json +++ b/src/test/resources/checks/v31/resources/OAR029/valid-all-of.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.1.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v31/resources/OAR029/valid-all-of.yaml b/src/test/resources/checks/v31/resources/OAR029/valid-all-of.yaml index a7203f72..96ac8d09 100644 --- a/src/test/resources/checks/v31/resources/OAR029/valid-all-of.yaml +++ b/src/test/resources/checks/v31/resources/OAR029/valid-all-of.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/resources/OAR029/valid-md.json b/src/test/resources/checks/v31/resources/OAR029/valid-md.json index dab6fe31..87649d37 100644 --- a/src/test/resources/checks/v31/resources/OAR029/valid-md.json +++ b/src/test/resources/checks/v31/resources/OAR029/valid-md.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.1", + "openapi" : "3.1.0", "info": { "title": "Swagger Petstore", "version": "1.0.0" diff --git a/src/test/resources/checks/v31/resources/OAR029/valid-md.yaml b/src/test/resources/checks/v31/resources/OAR029/valid-md.yaml index 7df432ae..613f2f7a 100644 --- a/src/test/resources/checks/v31/resources/OAR029/valid-md.yaml +++ b/src/test/resources/checks/v31/resources/OAR029/valid-md.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.1 +openapi: "3.1.0" info: title: Swagger Petstore version: 1.0.0 diff --git a/src/test/resources/checks/v31/resources/OAR029/valid-r.json b/src/test/resources/checks/v31/resources/OAR029/valid-r.json index 95ea5878..72f20533 100644 --- a/src/test/resources/checks/v31/resources/OAR029/valid-r.json +++ b/src/test/resources/checks/v31/resources/OAR029/valid-r.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v31/resources/OAR029/valid-r.yaml b/src/test/resources/checks/v31/resources/OAR029/valid-r.yaml index f3c42c5c..ecb01a86 100644 --- a/src/test/resources/checks/v31/resources/OAR029/valid-r.yaml +++ b/src/test/resources/checks/v31/resources/OAR029/valid-r.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.0 +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/resources/OAR029/valid.json b/src/test/resources/checks/v31/resources/OAR029/valid.json index dc03b61e..4edd28f8 100644 --- a/src/test/resources/checks/v31/resources/OAR029/valid.json +++ b/src/test/resources/checks/v31/resources/OAR029/valid.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.1.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v31/resources/OAR029/valid.yaml b/src/test/resources/checks/v31/resources/OAR029/valid.yaml index 8aa93539..5130357e 100644 --- a/src/test/resources/checks/v31/resources/OAR029/valid.yaml +++ b/src/test/resources/checks/v31/resources/OAR029/valid.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/resources/OAR029/with-error-with-properties-wrong-type-r.json b/src/test/resources/checks/v31/resources/OAR029/with-error-with-properties-wrong-type-r.json index 6a2f1e5e..38b0642b 100644 --- a/src/test/resources/checks/v31/resources/OAR029/with-error-with-properties-wrong-type-r.json +++ b/src/test/resources/checks/v31/resources/OAR029/with-error-with-properties-wrong-type-r.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v31/resources/OAR029/with-error-with-properties-wrong-type-r.yaml b/src/test/resources/checks/v31/resources/OAR029/with-error-with-properties-wrong-type-r.yaml index 32eabe95..be3a4b01 100644 --- a/src/test/resources/checks/v31/resources/OAR029/with-error-with-properties-wrong-type-r.yaml +++ b/src/test/resources/checks/v31/resources/OAR029/with-error-with-properties-wrong-type-r.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/resources/OAR029/with-error-without-properties-r.json b/src/test/resources/checks/v31/resources/OAR029/with-error-without-properties-r.json index d8ea6754..ad6beecf 100644 --- a/src/test/resources/checks/v31/resources/OAR029/with-error-without-properties-r.json +++ b/src/test/resources/checks/v31/resources/OAR029/with-error-without-properties-r.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v31/resources/OAR029/with-error-without-properties-r.yaml b/src/test/resources/checks/v31/resources/OAR029/with-error-without-properties-r.yaml index 16e83e55..5d4d980f 100644 --- a/src/test/resources/checks/v31/resources/OAR029/with-error-without-properties-r.yaml +++ b/src/test/resources/checks/v31/resources/OAR029/with-error-without-properties-r.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/resources/OAR029/with-error-wrong-type-r.json b/src/test/resources/checks/v31/resources/OAR029/with-error-wrong-type-r.json index 2ed7ec61..933edd55 100644 --- a/src/test/resources/checks/v31/resources/OAR029/with-error-wrong-type-r.json +++ b/src/test/resources/checks/v31/resources/OAR029/with-error-wrong-type-r.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v31/resources/OAR029/with-error-wrong-type-r.yaml b/src/test/resources/checks/v31/resources/OAR029/with-error-wrong-type-r.yaml index ac0cbfcf..fb5195fc 100644 --- a/src/test/resources/checks/v31/resources/OAR029/with-error-wrong-type-r.yaml +++ b/src/test/resources/checks/v31/resources/OAR029/with-error-wrong-type-r.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/resources/OAR029/with-result-with-properties-wrong-type-md.json b/src/test/resources/checks/v31/resources/OAR029/with-result-with-properties-wrong-type-md.json index fbdfa315..0f44f2d2 100644 --- a/src/test/resources/checks/v31/resources/OAR029/with-result-with-properties-wrong-type-md.json +++ b/src/test/resources/checks/v31/resources/OAR029/with-result-with-properties-wrong-type-md.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.1", + "openapi" : "3.1.0", "info": { "title": "Swagger Petstore", "version": "1.0.0" diff --git a/src/test/resources/checks/v31/resources/OAR029/with-result-with-properties-wrong-type-md.yaml b/src/test/resources/checks/v31/resources/OAR029/with-result-with-properties-wrong-type-md.yaml index 21b31cd5..5905c287 100644 --- a/src/test/resources/checks/v31/resources/OAR029/with-result-with-properties-wrong-type-md.yaml +++ b/src/test/resources/checks/v31/resources/OAR029/with-result-with-properties-wrong-type-md.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.1 +openapi: "3.1.0" info: title: Swagger Petstore version: 1.0.0 diff --git a/src/test/resources/checks/v31/resources/OAR029/with-result-without-properties-md.json b/src/test/resources/checks/v31/resources/OAR029/with-result-without-properties-md.json index 5b02c8a8..a491ce6b 100644 --- a/src/test/resources/checks/v31/resources/OAR029/with-result-without-properties-md.json +++ b/src/test/resources/checks/v31/resources/OAR029/with-result-without-properties-md.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.1", + "openapi" : "3.1.0", "info": { "title": "Swagger Petstore", "version": "1.0.0" diff --git a/src/test/resources/checks/v31/resources/OAR029/with-result-without-properties-md.yaml b/src/test/resources/checks/v31/resources/OAR029/with-result-without-properties-md.yaml index 6434b79c..792c8b29 100644 --- a/src/test/resources/checks/v31/resources/OAR029/with-result-without-properties-md.yaml +++ b/src/test/resources/checks/v31/resources/OAR029/with-result-without-properties-md.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.1 +openapi: "3.1.0" info: title: Swagger Petstore version: 1.0.0 diff --git a/src/test/resources/checks/v31/resources/OAR029/with-result-wrong-type-md.json b/src/test/resources/checks/v31/resources/OAR029/with-result-wrong-type-md.json index c24b20fd..41d9c8a3 100644 --- a/src/test/resources/checks/v31/resources/OAR029/with-result-wrong-type-md.json +++ b/src/test/resources/checks/v31/resources/OAR029/with-result-wrong-type-md.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.1", + "openapi" : "3.1.0", "info": { "title": "Swagger Petstore", "version": "1.0.0" diff --git a/src/test/resources/checks/v31/resources/OAR029/with-result-wrong-type-md.yaml b/src/test/resources/checks/v31/resources/OAR029/with-result-wrong-type-md.yaml index 37e75c1b..6fd77b70 100644 --- a/src/test/resources/checks/v31/resources/OAR029/with-result-wrong-type-md.yaml +++ b/src/test/resources/checks/v31/resources/OAR029/with-result-wrong-type-md.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.1 +openapi: "3.1.0" info: title: Swagger Petstore version: 1.0.0 diff --git a/src/test/resources/checks/v31/resources/OAR029/with-status-with-properties-wrong-type.json b/src/test/resources/checks/v31/resources/OAR029/with-status-with-properties-wrong-type.json index af6d6d23..4490c9de 100644 --- a/src/test/resources/checks/v31/resources/OAR029/with-status-with-properties-wrong-type.json +++ b/src/test/resources/checks/v31/resources/OAR029/with-status-with-properties-wrong-type.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.1.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v31/resources/OAR029/with-status-with-properties-wrong-type.yaml b/src/test/resources/checks/v31/resources/OAR029/with-status-with-properties-wrong-type.yaml index 68e59b91..4ecd1f33 100644 --- a/src/test/resources/checks/v31/resources/OAR029/with-status-with-properties-wrong-type.yaml +++ b/src/test/resources/checks/v31/resources/OAR029/with-status-with-properties-wrong-type.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/resources/OAR029/with-status-without-properties.json b/src/test/resources/checks/v31/resources/OAR029/with-status-without-properties.json index 80e9dbf2..c083192e 100644 --- a/src/test/resources/checks/v31/resources/OAR029/with-status-without-properties.json +++ b/src/test/resources/checks/v31/resources/OAR029/with-status-without-properties.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.1.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v31/resources/OAR029/with-status-without-properties.yaml b/src/test/resources/checks/v31/resources/OAR029/with-status-without-properties.yaml index 2437684e..3b2a5f59 100644 --- a/src/test/resources/checks/v31/resources/OAR029/with-status-without-properties.yaml +++ b/src/test/resources/checks/v31/resources/OAR029/with-status-without-properties.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/resources/OAR029/with-status-wrong-type.json b/src/test/resources/checks/v31/resources/OAR029/with-status-wrong-type.json index 014223c9..4e13e696 100644 --- a/src/test/resources/checks/v31/resources/OAR029/with-status-wrong-type.json +++ b/src/test/resources/checks/v31/resources/OAR029/with-status-wrong-type.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.1.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v31/resources/OAR029/with-status-wrong-type.yaml b/src/test/resources/checks/v31/resources/OAR029/with-status-wrong-type.yaml index 13bce453..28a93fc2 100644 --- a/src/test/resources/checks/v31/resources/OAR029/with-status-wrong-type.yaml +++ b/src/test/resources/checks/v31/resources/OAR029/with-status-wrong-type.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/resources/OAR029/without-data-md.json b/src/test/resources/checks/v31/resources/OAR029/without-data-md.json index 8262dd65..1cf29d2d 100644 --- a/src/test/resources/checks/v31/resources/OAR029/without-data-md.json +++ b/src/test/resources/checks/v31/resources/OAR029/without-data-md.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.1", + "openapi" : "3.1.0", "info": { "title": "Swagger Petstore", "version": "1.0.0" diff --git a/src/test/resources/checks/v31/resources/OAR029/without-data-md.yaml b/src/test/resources/checks/v31/resources/OAR029/without-data-md.yaml index 950439cb..b440a570 100644 --- a/src/test/resources/checks/v31/resources/OAR029/without-data-md.yaml +++ b/src/test/resources/checks/v31/resources/OAR029/without-data-md.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.1 +openapi: "3.1.0" info: title: Swagger Petstore version: 1.0.0 diff --git a/src/test/resources/checks/v31/resources/OAR029/without-data.json b/src/test/resources/checks/v31/resources/OAR029/without-data.json index 4c36767a..5ff6a704 100644 --- a/src/test/resources/checks/v31/resources/OAR029/without-data.json +++ b/src/test/resources/checks/v31/resources/OAR029/without-data.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.1.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v31/resources/OAR029/without-data.yaml b/src/test/resources/checks/v31/resources/OAR029/without-data.yaml index 02cb167f..24440e00 100644 --- a/src/test/resources/checks/v31/resources/OAR029/without-data.yaml +++ b/src/test/resources/checks/v31/resources/OAR029/without-data.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/resources/OAR029/without-error-r.json b/src/test/resources/checks/v31/resources/OAR029/without-error-r.json index 4a2978a7..967195ea 100644 --- a/src/test/resources/checks/v31/resources/OAR029/without-error-r.json +++ b/src/test/resources/checks/v31/resources/OAR029/without-error-r.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.1.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v31/resources/OAR029/without-error-r.yaml b/src/test/resources/checks/v31/resources/OAR029/without-error-r.yaml index fdaf26ad..90fba77d 100644 --- a/src/test/resources/checks/v31/resources/OAR029/without-error-r.yaml +++ b/src/test/resources/checks/v31/resources/OAR029/without-error-r.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/resources/OAR029/without-payload-r.json b/src/test/resources/checks/v31/resources/OAR029/without-payload-r.json index f2ee25c9..2b41e69d 100644 --- a/src/test/resources/checks/v31/resources/OAR029/without-payload-r.json +++ b/src/test/resources/checks/v31/resources/OAR029/without-payload-r.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.1.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v31/resources/OAR029/without-payload-r.yaml b/src/test/resources/checks/v31/resources/OAR029/without-payload-r.yaml index 0993f891..fd398716 100644 --- a/src/test/resources/checks/v31/resources/OAR029/without-payload-r.yaml +++ b/src/test/resources/checks/v31/resources/OAR029/without-payload-r.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/resources/OAR029/without-required-fields-md.json b/src/test/resources/checks/v31/resources/OAR029/without-required-fields-md.json index 63d7a3bb..b1221148 100644 --- a/src/test/resources/checks/v31/resources/OAR029/without-required-fields-md.json +++ b/src/test/resources/checks/v31/resources/OAR029/without-required-fields-md.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.1", + "openapi" : "3.1.0", "info": { "title": "Swagger Petstore", "version": "1.0.0" diff --git a/src/test/resources/checks/v31/resources/OAR029/without-required-fields-md.yaml b/src/test/resources/checks/v31/resources/OAR029/without-required-fields-md.yaml index efecd06f..93f6b0b3 100644 --- a/src/test/resources/checks/v31/resources/OAR029/without-required-fields-md.yaml +++ b/src/test/resources/checks/v31/resources/OAR029/without-required-fields-md.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.1 +openapi: "3.1.0" info: title: Swagger Petstore version: 1.0.0 diff --git a/src/test/resources/checks/v31/resources/OAR029/without-required-fields-r.json b/src/test/resources/checks/v31/resources/OAR029/without-required-fields-r.json index ea97f57f..5f407b7f 100644 --- a/src/test/resources/checks/v31/resources/OAR029/without-required-fields-r.json +++ b/src/test/resources/checks/v31/resources/OAR029/without-required-fields-r.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v31/resources/OAR029/without-required-fields-r.yaml b/src/test/resources/checks/v31/resources/OAR029/without-required-fields-r.yaml index 8ee987d5..997a6378 100644 --- a/src/test/resources/checks/v31/resources/OAR029/without-required-fields-r.yaml +++ b/src/test/resources/checks/v31/resources/OAR029/without-required-fields-r.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/resources/OAR029/without-required-fields.json b/src/test/resources/checks/v31/resources/OAR029/without-required-fields.json index 350d748a..13e2ec6b 100644 --- a/src/test/resources/checks/v31/resources/OAR029/without-required-fields.json +++ b/src/test/resources/checks/v31/resources/OAR029/without-required-fields.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.1.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v31/resources/OAR029/without-required-fields.yaml b/src/test/resources/checks/v31/resources/OAR029/without-required-fields.yaml index 234683f0..fadbafb1 100644 --- a/src/test/resources/checks/v31/resources/OAR029/without-required-fields.yaml +++ b/src/test/resources/checks/v31/resources/OAR029/without-required-fields.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/resources/OAR029/without-result-md.json b/src/test/resources/checks/v31/resources/OAR029/without-result-md.json index 136cf12d..6ce97bd2 100644 --- a/src/test/resources/checks/v31/resources/OAR029/without-result-md.json +++ b/src/test/resources/checks/v31/resources/OAR029/without-result-md.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.1", + "openapi" : "3.1.0", "info": { "title": "Swagger Petstore", "version": "1.0.0" diff --git a/src/test/resources/checks/v31/resources/OAR029/without-result-md.yaml b/src/test/resources/checks/v31/resources/OAR029/without-result-md.yaml index 81cebda9..ff224728 100644 --- a/src/test/resources/checks/v31/resources/OAR029/without-result-md.yaml +++ b/src/test/resources/checks/v31/resources/OAR029/without-result-md.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.1 +openapi: "3.1.0" info: title: Swagger Petstore version: 1.0.0 diff --git a/src/test/resources/checks/v31/resources/OAR029/without-status.json b/src/test/resources/checks/v31/resources/OAR029/without-status.json index 6e0d5fcb..758c5545 100644 --- a/src/test/resources/checks/v31/resources/OAR029/without-status.json +++ b/src/test/resources/checks/v31/resources/OAR029/without-status.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.1.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v31/resources/OAR029/without-status.yaml b/src/test/resources/checks/v31/resources/OAR029/without-status.yaml index de0781dd..c16999d5 100644 --- a/src/test/resources/checks/v31/resources/OAR029/without-status.yaml +++ b/src/test/resources/checks/v31/resources/OAR029/without-status.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/resources/OAR030/valid.json b/src/test/resources/checks/v31/resources/OAR030/valid.json index 69748c50..af20c983 100644 --- a/src/test/resources/checks/v31/resources/OAR030/valid.json +++ b/src/test/resources/checks/v31/resources/OAR030/valid.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.1.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v31/resources/OAR030/valid.yaml b/src/test/resources/checks/v31/resources/OAR030/valid.yaml index 1f15c90e..08dbbc2b 100644 --- a/src/test/resources/checks/v31/resources/OAR030/valid.yaml +++ b/src/test/resources/checks/v31/resources/OAR030/valid.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/resources/OAR030/with-status-without-get.json b/src/test/resources/checks/v31/resources/OAR030/with-status-without-get.json index c3694e1b..d5a75192 100644 --- a/src/test/resources/checks/v31/resources/OAR030/with-status-without-get.json +++ b/src/test/resources/checks/v31/resources/OAR030/with-status-without-get.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.1.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v31/resources/OAR030/with-status-without-get.yaml b/src/test/resources/checks/v31/resources/OAR030/with-status-without-get.yaml index e7b5a51f..343b365c 100644 --- a/src/test/resources/checks/v31/resources/OAR030/with-status-without-get.yaml +++ b/src/test/resources/checks/v31/resources/OAR030/with-status-without-get.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/resources/OAR030/without-status.json b/src/test/resources/checks/v31/resources/OAR030/without-status.json index 5ae26a3c..840b42bb 100644 --- a/src/test/resources/checks/v31/resources/OAR030/without-status.json +++ b/src/test/resources/checks/v31/resources/OAR030/without-status.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.1.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v31/resources/OAR030/without-status.yaml b/src/test/resources/checks/v31/resources/OAR030/without-status.yaml index 2a015345..b59b6167 100644 --- a/src/test/resources/checks/v31/resources/OAR030/without-status.yaml +++ b/src/test/resources/checks/v31/resources/OAR030/without-status.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/resources/OAR031/valid.json b/src/test/resources/checks/v31/resources/OAR031/valid.json index 2beb36a3..39bcaae7 100644 --- a/src/test/resources/checks/v31/resources/OAR031/valid.json +++ b/src/test/resources/checks/v31/resources/OAR031/valid.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v31/resources/OAR031/valid.yaml b/src/test/resources/checks/v31/resources/OAR031/valid.yaml index d0100253..9b68a04e 100644 --- a/src/test/resources/checks/v31/resources/OAR031/valid.yaml +++ b/src/test/resources/checks/v31/resources/OAR031/valid.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/resources/OAR031/without-examples.json b/src/test/resources/checks/v31/resources/OAR031/without-examples.json index 40728d00..444db64d 100644 --- a/src/test/resources/checks/v31/resources/OAR031/without-examples.json +++ b/src/test/resources/checks/v31/resources/OAR031/without-examples.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v31/resources/OAR031/without-examples.yaml b/src/test/resources/checks/v31/resources/OAR031/without-examples.yaml index ec8cd2a0..5fa170e9 100644 --- a/src/test/resources/checks/v31/resources/OAR031/without-examples.yaml +++ b/src/test/resources/checks/v31/resources/OAR031/without-examples.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/resources/OAR032/forbidden-names.json b/src/test/resources/checks/v31/resources/OAR032/forbidden-names.json index 9c26b26f..401f94be 100644 --- a/src/test/resources/checks/v31/resources/OAR032/forbidden-names.json +++ b/src/test/resources/checks/v31/resources/OAR032/forbidden-names.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.1.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v31/resources/OAR032/forbidden-names.yaml b/src/test/resources/checks/v31/resources/OAR032/forbidden-names.yaml index 2e3b2806..7810e795 100644 --- a/src/test/resources/checks/v31/resources/OAR032/forbidden-names.yaml +++ b/src/test/resources/checks/v31/resources/OAR032/forbidden-names.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/resources/OAR032/valid.json b/src/test/resources/checks/v31/resources/OAR032/valid.json index bce9cd4c..9cfe7d75 100644 --- a/src/test/resources/checks/v31/resources/OAR032/valid.json +++ b/src/test/resources/checks/v31/resources/OAR032/valid.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.1.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v31/resources/OAR032/valid.yaml b/src/test/resources/checks/v31/resources/OAR032/valid.yaml index f26951f4..eae1ceba 100644 --- a/src/test/resources/checks/v31/resources/OAR032/valid.yaml +++ b/src/test/resources/checks/v31/resources/OAR032/valid.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/resources/OAR034/valid-all-of.json b/src/test/resources/checks/v31/resources/OAR034/valid-all-of.json index 0a433770..972429c5 100644 --- a/src/test/resources/checks/v31/resources/OAR034/valid-all-of.json +++ b/src/test/resources/checks/v31/resources/OAR034/valid-all-of.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v31/resources/OAR034/valid-all-of.yaml b/src/test/resources/checks/v31/resources/OAR034/valid-all-of.yaml index 15669c82..2d09e193 100644 --- a/src/test/resources/checks/v31/resources/OAR034/valid-all-of.yaml +++ b/src/test/resources/checks/v31/resources/OAR034/valid-all-of.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/resources/OAR034/valid.json b/src/test/resources/checks/v31/resources/OAR034/valid.json index 242adbb8..66e528b8 100644 --- a/src/test/resources/checks/v31/resources/OAR034/valid.json +++ b/src/test/resources/checks/v31/resources/OAR034/valid.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v31/resources/OAR034/valid.yaml b/src/test/resources/checks/v31/resources/OAR034/valid.yaml index 62da717a..886c61af 100644 --- a/src/test/resources/checks/v31/resources/OAR034/valid.yaml +++ b/src/test/resources/checks/v31/resources/OAR034/valid.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/resources/OAR034/with-links-without-properties.json b/src/test/resources/checks/v31/resources/OAR034/with-links-without-properties.json index 7f789dbc..2e467e85 100644 --- a/src/test/resources/checks/v31/resources/OAR034/with-links-without-properties.json +++ b/src/test/resources/checks/v31/resources/OAR034/with-links-without-properties.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v31/resources/OAR034/with-links-without-properties.yaml b/src/test/resources/checks/v31/resources/OAR034/with-links-without-properties.yaml index 3685c1f3..f4923170 100644 --- a/src/test/resources/checks/v31/resources/OAR034/with-links-without-properties.yaml +++ b/src/test/resources/checks/v31/resources/OAR034/with-links-without-properties.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/resources/OAR034/with-paging-with-properties-wrong-types.json b/src/test/resources/checks/v31/resources/OAR034/with-paging-with-properties-wrong-types.json index 119921b1..eb99e6ab 100644 --- a/src/test/resources/checks/v31/resources/OAR034/with-paging-with-properties-wrong-types.json +++ b/src/test/resources/checks/v31/resources/OAR034/with-paging-with-properties-wrong-types.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v31/resources/OAR034/with-paging-with-properties-wrong-types.yaml b/src/test/resources/checks/v31/resources/OAR034/with-paging-with-properties-wrong-types.yaml index 4d725aca..b08d248f 100644 --- a/src/test/resources/checks/v31/resources/OAR034/with-paging-with-properties-wrong-types.yaml +++ b/src/test/resources/checks/v31/resources/OAR034/with-paging-with-properties-wrong-types.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/resources/OAR034/with-paging-without-properties.json b/src/test/resources/checks/v31/resources/OAR034/with-paging-without-properties.json index ed4ab056..457133c7 100644 --- a/src/test/resources/checks/v31/resources/OAR034/with-paging-without-properties.json +++ b/src/test/resources/checks/v31/resources/OAR034/with-paging-without-properties.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v31/resources/OAR034/with-paging-without-properties.yaml b/src/test/resources/checks/v31/resources/OAR034/with-paging-without-properties.yaml index 153ece2f..1429c9bc 100644 --- a/src/test/resources/checks/v31/resources/OAR034/with-paging-without-properties.yaml +++ b/src/test/resources/checks/v31/resources/OAR034/with-paging-without-properties.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/resources/OAR034/with-paging-wrong-type.json b/src/test/resources/checks/v31/resources/OAR034/with-paging-wrong-type.json index d9966a0b..ab74c779 100644 --- a/src/test/resources/checks/v31/resources/OAR034/with-paging-wrong-type.json +++ b/src/test/resources/checks/v31/resources/OAR034/with-paging-wrong-type.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v31/resources/OAR034/with-paging-wrong-type.yaml b/src/test/resources/checks/v31/resources/OAR034/with-paging-wrong-type.yaml index 33d666d9..7694cb9a 100644 --- a/src/test/resources/checks/v31/resources/OAR034/with-paging-wrong-type.yaml +++ b/src/test/resources/checks/v31/resources/OAR034/with-paging-wrong-type.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/resources/OAR034/without-links-required-fields.json b/src/test/resources/checks/v31/resources/OAR034/without-links-required-fields.json index 5ecd5e4b..82c0353e 100644 --- a/src/test/resources/checks/v31/resources/OAR034/without-links-required-fields.json +++ b/src/test/resources/checks/v31/resources/OAR034/without-links-required-fields.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v31/resources/OAR034/without-links-required-fields.yaml b/src/test/resources/checks/v31/resources/OAR034/without-links-required-fields.yaml index 3ca7987e..cfcd88ef 100644 --- a/src/test/resources/checks/v31/resources/OAR034/without-links-required-fields.yaml +++ b/src/test/resources/checks/v31/resources/OAR034/without-links-required-fields.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/resources/OAR034/without-pagination-required-fields.json b/src/test/resources/checks/v31/resources/OAR034/without-pagination-required-fields.json index fd7e6e38..d666c87c 100644 --- a/src/test/resources/checks/v31/resources/OAR034/without-pagination-required-fields.json +++ b/src/test/resources/checks/v31/resources/OAR034/without-pagination-required-fields.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v31/resources/OAR034/without-pagination-required-fields.yaml b/src/test/resources/checks/v31/resources/OAR034/without-pagination-required-fields.yaml index cc4c316a..d5dd3512 100644 --- a/src/test/resources/checks/v31/resources/OAR034/without-pagination-required-fields.yaml +++ b/src/test/resources/checks/v31/resources/OAR034/without-pagination-required-fields.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/resources/OAR034/without-paging.json b/src/test/resources/checks/v31/resources/OAR034/without-paging.json index 4fb4a8e9..1da7c549 100644 --- a/src/test/resources/checks/v31/resources/OAR034/without-paging.json +++ b/src/test/resources/checks/v31/resources/OAR034/without-paging.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v31/resources/OAR034/without-paging.yaml b/src/test/resources/checks/v31/resources/OAR034/without-paging.yaml index 0bb219ab..d2a7a218 100644 --- a/src/test/resources/checks/v31/resources/OAR034/without-paging.yaml +++ b/src/test/resources/checks/v31/resources/OAR034/without-paging.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/resources/OAR038/valid-multiple-properties.json b/src/test/resources/checks/v31/resources/OAR038/valid-multiple-properties.json index 6c5aa7f8..67723422 100644 --- a/src/test/resources/checks/v31/resources/OAR038/valid-multiple-properties.json +++ b/src/test/resources/checks/v31/resources/OAR038/valid-multiple-properties.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.1.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v31/resources/OAR038/valid-multiple-properties.yaml b/src/test/resources/checks/v31/resources/OAR038/valid-multiple-properties.yaml index 64c4f794..fb5498dd 100644 --- a/src/test/resources/checks/v31/resources/OAR038/valid-multiple-properties.yaml +++ b/src/test/resources/checks/v31/resources/OAR038/valid-multiple-properties.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/resources/OAR038/valid-one-property.json b/src/test/resources/checks/v31/resources/OAR038/valid-one-property.json index 76dae630..c4ded0b4 100644 --- a/src/test/resources/checks/v31/resources/OAR038/valid-one-property.json +++ b/src/test/resources/checks/v31/resources/OAR038/valid-one-property.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.1.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v31/resources/OAR038/valid-one-property.yaml b/src/test/resources/checks/v31/resources/OAR038/valid-one-property.yaml index 6a93ee9d..50656cb5 100644 --- a/src/test/resources/checks/v31/resources/OAR038/valid-one-property.yaml +++ b/src/test/resources/checks/v31/resources/OAR038/valid-one-property.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/resources/OAR038/with-properties-empty.json b/src/test/resources/checks/v31/resources/OAR038/with-properties-empty.json index 8f2032d6..3f45a592 100644 --- a/src/test/resources/checks/v31/resources/OAR038/with-properties-empty.json +++ b/src/test/resources/checks/v31/resources/OAR038/with-properties-empty.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.1.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v31/resources/OAR038/with-properties-empty.yaml b/src/test/resources/checks/v31/resources/OAR038/with-properties-empty.yaml index 4680fd0a..5cdefc1a 100644 --- a/src/test/resources/checks/v31/resources/OAR038/with-properties-empty.yaml +++ b/src/test/resources/checks/v31/resources/OAR038/with-properties-empty.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/resources/OAR038/without-data.json b/src/test/resources/checks/v31/resources/OAR038/without-data.json index a6d5f9a6..d326bab4 100644 --- a/src/test/resources/checks/v31/resources/OAR038/without-data.json +++ b/src/test/resources/checks/v31/resources/OAR038/without-data.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.1.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v31/resources/OAR038/without-data.yaml b/src/test/resources/checks/v31/resources/OAR038/without-data.yaml index b64463dd..ef46e463 100644 --- a/src/test/resources/checks/v31/resources/OAR038/without-data.yaml +++ b/src/test/resources/checks/v31/resources/OAR038/without-data.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/resources/OAR038/without-properties.json b/src/test/resources/checks/v31/resources/OAR038/without-properties.json index 3573e876..f9f423c5 100644 --- a/src/test/resources/checks/v31/resources/OAR038/without-properties.json +++ b/src/test/resources/checks/v31/resources/OAR038/without-properties.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v31/resources/OAR038/without-properties.yaml b/src/test/resources/checks/v31/resources/OAR038/without-properties.yaml index b57f97f7..50fb5b62 100644 --- a/src/test/resources/checks/v31/resources/OAR038/without-properties.yaml +++ b/src/test/resources/checks/v31/resources/OAR038/without-properties.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/resources/OAR038/without-schema.json b/src/test/resources/checks/v31/resources/OAR038/without-schema.json index 8cdacdba..4ac5063e 100644 --- a/src/test/resources/checks/v31/resources/OAR038/without-schema.json +++ b/src/test/resources/checks/v31/resources/OAR038/without-schema.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.1.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v31/resources/OAR038/without-schema.yaml b/src/test/resources/checks/v31/resources/OAR038/without-schema.yaml index 5ec0e410..9eecdf8a 100644 --- a/src/test/resources/checks/v31/resources/OAR038/without-schema.yaml +++ b/src/test/resources/checks/v31/resources/OAR038/without-schema.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/resources/OAR039/missing-codes.json b/src/test/resources/checks/v31/resources/OAR039/missing-codes.json index 1495f285..18cf09e2 100644 --- a/src/test/resources/checks/v31/resources/OAR039/missing-codes.json +++ b/src/test/resources/checks/v31/resources/OAR039/missing-codes.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.1.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v31/resources/OAR039/missing-codes.yaml b/src/test/resources/checks/v31/resources/OAR039/missing-codes.yaml index b2be1e3d..da2618e7 100644 --- a/src/test/resources/checks/v31/resources/OAR039/missing-codes.yaml +++ b/src/test/resources/checks/v31/resources/OAR039/missing-codes.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/resources/OAR039/valid.json b/src/test/resources/checks/v31/resources/OAR039/valid.json index 59eaf067..aa5bfe3b 100644 --- a/src/test/resources/checks/v31/resources/OAR039/valid.json +++ b/src/test/resources/checks/v31/resources/OAR039/valid.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.1.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v31/resources/OAR039/valid.yaml b/src/test/resources/checks/v31/resources/OAR039/valid.yaml index 1f23f21a..5f7621b2 100644 --- a/src/test/resources/checks/v31/resources/OAR039/valid.yaml +++ b/src/test/resources/checks/v31/resources/OAR039/valid.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/schemas/OAR029/valid-all-of-md.json b/src/test/resources/checks/v31/schemas/OAR029/valid-all-of-md.json new file mode 100644 index 00000000..d94e76f8 --- /dev/null +++ b/src/test/resources/checks/v31/schemas/OAR029/valid-all-of-md.json @@ -0,0 +1,134 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "Swagger Petstore", + "version": "1.0.0" + }, + "servers": [ + { + "url": "/" + } + ], + "paths": { + "/endpoint": { + "get": { + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/response" + } + } + } + }, + "204": { + "description": "No content", + "content": { + } + }, + "400": { + "description": "Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/response" + } + } + } + }, + "default": { + "description": "Unknown", + "content": { + } + } + } + } + } + }, + "components": { + "schemas": { + "response": { + "allOf": [ + { + "$ref": "#/components/schemas/standard_response" + } + ], + "properties" : { + "data" : { + "type" : "object", + "properties" : { + "tipos" : { + "type" : "array", + "items" : { + "type" : "string" + } + } + } + } + } + }, + "standard_response": { + "allOf": [ + { + "$ref": "#/components/schemas/standard_response_result" + }, + { + "$ref": "#/components/schemas/standard_response_metadata" + } + ] + }, + "standard_response_result": { + "type": "object", + "properties": { + "result": { + "required": [ + "http_code", + "status", + "trace_id" + ], + "type": "object", + "properties": { + "status": { + "type": "boolean" + }, + "http_code": { + "type": "integer" + }, + "errors": { + "type": "array", + "items": { + "required": [ + "code", + "message" + ], + "type": "object", + "properties": { + "code": { + "type": "integer" + }, + "message": { + "type": "string" + } + } + } + }, + "trace_id": { + "type": "string" + } + } + } + } + }, + "standard_response_metadata": { + "type": "object", + "properties": { + "metadata": { + "type": "string" + } + } + } + } + } + } \ No newline at end of file diff --git a/src/test/resources/checks/v31/schemas/OAR029/valid-all-of-md.yaml b/src/test/resources/checks/v31/schemas/OAR029/valid-all-of-md.yaml new file mode 100644 index 00000000..c852082b --- /dev/null +++ b/src/test/resources/checks/v31/schemas/OAR029/valid-all-of-md.yaml @@ -0,0 +1,78 @@ +openapi: "3.1.0" +info: + title: Swagger Petstore + version: 1.0.0 +servers: +- url: / +paths: + /endpoint: + get: + responses: + 200: + description: Ok + content: + 'application/json': + schema: + $ref: '#/components/schemas/response' + 204: + description: No content + content: {} + 400: + description: Error + content: + 'application/json': + schema: + $ref: '#/components/schemas/response' + default: + description: Unknown + content: {} +components: + schemas: + response: + allOf: + - $ref: '#/components/schemas/standard_response' + properties: + data: + type: object + properties: + tipos: + type: array + items: + type: string + standard_response: + allOf: + - $ref: '#/components/schemas/standard_response_result' + - $ref: '#/components/schemas/standard_response_metadata' + standard_response_result: + type: object + properties: + result: + required: + - http_code + - status + - trace_id + type: object + properties: + status: + type: boolean + http_code: + type: integer + errors: + type: array + items: + required: + - code + - message + type: object + properties: + code: + type: integer + message: + type: string + trace_id: + type: string + standard_response_metadata: + type: object + properties: + metadata: + type: string diff --git a/src/test/resources/checks/v31/schemas/OAR029/valid-all-of.json b/src/test/resources/checks/v31/schemas/OAR029/valid-all-of.json new file mode 100644 index 00000000..9f519b0e --- /dev/null +++ b/src/test/resources/checks/v31/schemas/OAR029/valid-all-of.json @@ -0,0 +1,116 @@ +{ + "openapi": "3.1.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/endpoint" : { + "get" : { + "responses" : { + "200" : { + "description" : "Ok", + "content": { + "application/json": { + "schema" : { + "$ref" : "#/components/schemas/response" + } + } + } + }, + "204" : { + "description" : "No content" + }, + "400" : { + "description" : "Error", + "content": { + "application/json": { + "schema" : { + "$ref" : "#/components/schemas/response" + } + } + } + }, + "default" : { + "description" : "Unknown" + } + } + } + } + }, + "components": { + "schemas" : { + "response" : { + "type" : "object", + "allOf" : [ { + "$ref" : "#/components/schemas/standard_response" + } ], + "properties" : { + "data" : { + "type" : "object", + "properties" : { + "tipos" : { + "type" : "array", + "items" : { + "type" : "string" + } + } + } + } + } + }, + "standard_response" : { + "allOf" : [ { + "$ref" : "#/components/schemas/standard_response_result" + }, { + "$ref" : "#/components/schemas/standard_response_metadata" + } ], + "required" : [ "status" ] + }, + "standard_response_result" : { + "type" : "object", + "properties" : { + "status" : { + "type" : "object", + "properties" : { + "http_status" : { + "type" : "string" + }, + "code" : { + "type" : "integer" + }, + "errors" : { + "type" : "array", + "items" : { + "type" : "object", + "properties": { + "name": { + "type": "string" + }, + "value": { + "type": "string" + } + } + } + }, + "description" : { + "type" : "string" + }, + "internal_code" : { + "type" : "string" + } + }, + "required" : [ "http_status", "code", "description", "errors" ] + } + } + }, + "standard_response_metadata" : { + "properties" : { + "metadata" : { + "type" : "string" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/schemas/OAR029/valid-all-of.yaml b/src/test/resources/checks/v31/schemas/OAR029/valid-all-of.yaml new file mode 100644 index 00000000..96ac8d09 --- /dev/null +++ b/src/test/resources/checks/v31/schemas/OAR029/valid-all-of.yaml @@ -0,0 +1,76 @@ +openapi: "3.1.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /endpoint: + get: + responses: + 200: + description: Ok + content: + application/json: + schema: + $ref: '#/components/schemas/response' + 204: + description: No content + 400: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/response' + default: + description: Unknown +components: + schemas: + response: + type: object + allOf: + - $ref: '#/components/schemas/standard_response' + properties: + data: + type: object + properties: + tipos: + type: array + items: + type: string + standard_response: + allOf: + - $ref: '#/components/schemas/standard_response_result' + - $ref: '#/components/schemas/standard_response_metadata' + required: + - status + standard_response_result: + type: object + properties: + status: + type: object + properties: + http_status: + type: string + code: + type: integer + errors: + type: array + items: + type: object + properties: + name: + type: string + value: + type: string + description: + type: string + internal_code: + type: string + required: + - http_status + - code + - description + - errors + standard_response_metadata: + properties: + metadata: + type: string \ No newline at end of file diff --git a/src/test/resources/checks/v31/schemas/OAR029/valid-md.json b/src/test/resources/checks/v31/schemas/OAR029/valid-md.json new file mode 100644 index 00000000..088962d7 --- /dev/null +++ b/src/test/resources/checks/v31/schemas/OAR029/valid-md.json @@ -0,0 +1,116 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "Swagger Petstore", + "version": "1.0.0" + }, + "servers": [ + { + "url": "/" + } + ], + "paths": { + "/endpoint": { + "get": { + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/response" + } + } + } + }, + "204": { + "description": "No content", + "content": { + } + }, + "400": { + "description": "Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/response" + } + } + } + }, + "default": { + "description": "Unknown", + "content": { + } + } + } + } + } + }, + "components": { + "schemas": { + "response": { + "allOf": [ + { + "$ref": "#/components/schemas/standard_response" + } + ], + "properties" : { + "data" : { + "type" : "object", + "properties" : { + "tipos" : { + "type" : "array", + "items" : { + "type" : "string" + } + } + } + } + } + }, + "standard_response": { + "type": "object", + "properties": { + "result": { + "required": [ + "http_code", + "status", + "trace_id" + ], + "type": "object", + "properties": { + "status": { + "type": "boolean" + }, + "http_code": { + "type": "integer" + }, + "errors": { + "type": "array", + "items": { + "required": [ + "code", + "message" + ], + "type": "object", + "properties": { + "code": { + "type": "integer" + }, + "message": { + "type": "string" + } + } + } + }, + "trace_id": { + "type": "string" + } + } + } + } + } + } + } + } \ No newline at end of file diff --git a/src/test/resources/checks/v31/schemas/OAR029/valid-md.yaml b/src/test/resources/checks/v31/schemas/OAR029/valid-md.yaml new file mode 100644 index 00000000..613f2f7a --- /dev/null +++ b/src/test/resources/checks/v31/schemas/OAR029/valid-md.yaml @@ -0,0 +1,69 @@ +openapi: "3.1.0" +info: + title: Swagger Petstore + version: 1.0.0 +servers: +- url: / +paths: + /endpoint: + get: + responses: + 200: + description: Ok + content: + 'application/json': + schema: + $ref: '#/components/schemas/response' + 204: + description: No content + content: {} + 400: + description: Error + content: + 'application/json': + schema: + $ref: '#/components/schemas/response' + default: + description: Unknown + content: {} +components: + schemas: + response: + allOf: + - $ref: '#/components/schemas/standard_response' + properties: + data: + type: object + properties: + tipos: + type: array + items: + type: string + standard_response: + type: object + properties: + result: + required: + - http_code + - status + - trace_id + type: object + properties: + status: + type: boolean + http_code: + type: integer + errors: + type: array + items: + required: + - code + - message + type: object + properties: + code: + type: integer + message: + type: string + trace_id: + type: string diff --git a/src/test/resources/checks/v31/schemas/OAR029/valid-r.json b/src/test/resources/checks/v31/schemas/OAR029/valid-r.json new file mode 100644 index 00000000..f67f6299 --- /dev/null +++ b/src/test/resources/checks/v31/schemas/OAR029/valid-r.json @@ -0,0 +1,96 @@ +{ + "openapi": "3.1.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/endpoint": { + "get": { + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/successResponseData" + } + } + } + }, + "204": { + "description": "No content" + }, + "400": { + "$ref": "#/components/responses/errorResponse" + }, + "default": { + "description": "Unknown" + } + } + } + } + }, + "components": { + "schemas": { + "successResponseData": { + "type": "object", + "properties": { + "payload": { + "type": "object", + "properties": { + "tipos": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + }, + "errorResponseData": { + "type": "object", + "properties": { + "error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "message": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "type": "string" + } + }, + "httpStatus": { + "type": "integer" + } + }, + "required": [ + "code", + "message", + "httpStatus" + ] + } + } + } + }, + "responses": { + "errorResponse": { + "description": "Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errorResponseData" + } + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/schemas/OAR029/valid-r.yaml b/src/test/resources/checks/v31/schemas/OAR029/valid-r.yaml new file mode 100644 index 00000000..ecb01a86 --- /dev/null +++ b/src/test/resources/checks/v31/schemas/OAR029/valid-r.yaml @@ -0,0 +1,59 @@ +openapi: "3.1.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /endpoint: + get: + responses: + 200: + description: Ok + content: + application/json: + schema: + $ref: '#/components/schemas/successResponseData' + 204: + description: No content + 400: + $ref: '#/components/responses/errorResponse' + default: + description: Unknown +components: + schemas: + successResponseData: + type: object + properties: + payload: + type: object + properties: + tipos: + type: array + items: + type: string + errorResponseData: + type: object + properties: + error: + type: object + properties: + code: + type: string + message: + type: string + details: + type: array + items: + type: string + httpStatus: + type: integer + required: + - code + - message + - httpStatus + responses: + errorResponse: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/errorResponseData' diff --git a/src/test/resources/checks/v31/schemas/OAR029/valid.json b/src/test/resources/checks/v31/schemas/OAR029/valid.json new file mode 100644 index 00000000..b1bc4266 --- /dev/null +++ b/src/test/resources/checks/v31/schemas/OAR029/valid.json @@ -0,0 +1,105 @@ +{ + "openapi": "3.1.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/endpoint" : { + "get" : { + "responses" : { + "200" : { + "description" : "Ok", + "content": { + "application/json": { + "schema" : { + "$ref" : "#/components/schemas/response" + } + } + } + }, + "204" : { + "description" : "No content" + }, + "400" : { + "description" : "Error", + "content": { + "application/json": { + "schema" : { + "$ref" : "#/components/schemas/response" + } + } + } + }, + "default" : { + "description" : "Unknown" + } + } + } + } + }, + "components": { + "schemas" : { + "response" : { + "type" : "object", + "allOf" : [ { + "$ref" : "#/components/schemas/standard_response" + } ], + "properties" : { + "data" : { + "type" : "object", + "properties" : { + "tipos" : { + "type" : "array", + "items" : { + "type" : "string" + } + } + } + } + }, + "required": [ + "status", + "data" + ] + }, + "standard_response" : { + "type" : "object", + "properties" : { + "status" : { + "type" : "object", + "properties" : { + "http_status" : { + "type" : "string" + }, + "code" : { + "type" : "integer" + }, + "errors" : { + "type" : "array", + "items" : { + "type" : "object", + "properties": { + "name": { + "type": "string" + }, + "value": { + "type": "string" + } + } + } + }, + "description" : { + "type" : "string" + }, + "internal_code" : { + "type" : "string" + } + }, + "required" : [ "http_status", "code", "description", "errors" ] + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/schemas/OAR029/valid.yaml b/src/test/resources/checks/v31/schemas/OAR029/valid.yaml index b4c7d96e..9a7afd5f 100644 --- a/src/test/resources/checks/v31/schemas/OAR029/valid.yaml +++ b/src/test/resources/checks/v31/schemas/OAR029/valid.yaml @@ -1,19 +1,135 @@ openapi: "3.1.0" info: - version: 1.0.0 - title: Test + version: 1.0.3 + title: Swagger-Petstore_ab4bbf6031ef_V + license: + name: MIT +servers: + - url: http://petstore.swagger.io/v1 paths: - /test: + /pets: get: + summary: List all pets + operationId: listPets + tags: + - pets + parameters: + - name: limit + in: query + description: How many items to return at one time (max 100). + required: false + schema: + type: integer + maximum: 100 + format: int32 responses: - "200": - description: ok + '200': + description: A paged array of pets + headers: + x-next: + description: A link to the next page of responses + schema: + type: string + content: + application/json: + schema: + $ref: >- + https://gitlab.com/api/v4/projects/55448121/repository/files/pet%2Eyaml/raw?private_token=glpat-Q7s_ciqer49cJB--sMFB#/Pets + default: + description: unexpected error + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + x-microcks-operation: + delay: 100 + dispatcher: SCRIPT + dispatcherRules: >- + def headers = mockRequest.getRequestHeaders(); if (headers.hasValues("X-Microcks-Response-Name")) { return headers.get("X-Microcks-Response-Name", "null") } + post: + summary: Create a pet + operationId: createPets + tags: + - pets + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Pet' + required: true + responses: + '201': + description: Null response + default: + description: unexpected error + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + x-microcks-operation: + delay: 100 + dispatcher: SCRIPT + dispatcherRules: >- + def headers = mockRequest.getRequestHeaders(); if (headers.hasValues("X-Microcks-Response-Name")) { return headers.get("X-Microcks-Response-Name", "null") } + /pets/{petId}: + get: + summary: Info for a specific pet + operationId: showPetById + tags: + - pets + parameters: + - name: petId + in: path + required: true + description: The id of the pet to retrieve + schema: + type: string + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/Pet' + default: + description: unexpected error content: application/json: schema: - type: object - properties: - status: - type: object - payload: - type: object + $ref: '#/components/schemas/Error' + x-microcks-operation: + delay: 100 + dispatcher: SCRIPT + dispatcherRules: >- + def headers = mockRequest.getRequestHeaders(); if (headers.hasValues("X-Microcks-Response-Name")) { return headers.get("X-Microcks-Response-Name", "null") } +components: + schemas: + Pet: + type: object + required: + - id + - name + properties: + id: + type: integer + format: int64 + name: + type: string + tag: + type: string + Pets: + type: array + maxItems: 100 + items: + $ref: '#/components/schemas/Pet' + Error: + type: object + required: + - code + - message + properties: + code: + type: integer + format: int32 + message: + type: string diff --git a/src/test/resources/checks/v31/schemas/OAR034/valid-all-of.json b/src/test/resources/checks/v31/schemas/OAR034/valid-all-of.json new file mode 100644 index 00000000..614ad88f --- /dev/null +++ b/src/test/resources/checks/v31/schemas/OAR034/valid-all-of.json @@ -0,0 +1,126 @@ +{ + "openapi": "3.1.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/endpoint": { + "get": { + "responses": { + "206": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/response" + } + } + } + }, + "204": { + "description": "No content" + }, + "400": { + "description": "Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/response" + } + } + } + }, + "default": { + "description": "Unknown" + } + } + } + } + }, + "components": { + "schemas": { + "response": { + "type": "object", + "allOf": [ { + "$ref": "#/components/schemas/paged_response" + } ], + "properties": { + "data": { + "type": "object", + "properties": { + "values": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + }, + "paged_response": { + "type": "object", + "properties": { + "paging": { + "type": "object", + "properties": { + "start": { + "type": "integer" + }, + "limit": { + "type": "integer" + }, + "total": { + "type": "integer" + }, + "numPages": { + "type": "integer" + }, + "links": { + "type": "object", + "properties": { + "self": { + "allOf": [ { + "$ref": "#/components/schemas/link" + } ] + }, + "first": { + "allOf": [ { + "$ref": "#/components/schemas/link" + } ] + }, + "previous": { + "allOf": [ { + "$ref": "#/components/schemas/link" + } ] + }, + "next": { + "allOf": [ { + "$ref": "#/components/schemas/link" + } ] + }, + "last": { + "allOf": [ { + "$ref": "#/components/schemas/link" + } ] + } + }, + "required": [ "self", "previous", "next" ] + } + }, + "required": [ "start", "limit", "links" ] + } + } + }, + "link": { + "type": "object", + "properties": { + "href": { + "type": "string" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/schemas/OAR034/valid-all-of.yaml b/src/test/resources/checks/v31/schemas/OAR034/valid-all-of.yaml new file mode 100644 index 00000000..2d09e193 --- /dev/null +++ b/src/test/resources/checks/v31/schemas/OAR034/valid-all-of.yaml @@ -0,0 +1,84 @@ +openapi: "3.1.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /endpoint: + get: + responses: + 206: + description: Ok + content: + application/json: + schema: + $ref: '#/components/schemas/response' + 204: + description: No content + 400: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/response' + default: + description: Unknown + +components: + schemas: + response: + type: object + allOf: + - $ref: '#/components/schemas/paged_response' + properties: + data: + type: object + properties: + values: + type: array + items: + type: string + paged_response: + type: object + properties: + paging: + type: object + properties: + start: + type: integer + limit: + type: integer + total: + type: integer + numPages: + type: integer + links: + type: object + properties: + self: + allOf: + - $ref: '#/components/schemas/link' + first: + allOf: + - $ref: '#/components/schemas/link' + previous: + allOf: + - $ref: '#/components/schemas/link' + next: + allOf: + - $ref: '#/components/schemas/link' + last: + allOf: + - $ref: '#/components/schemas/link' + required: + - self + - previous + - next + required: + - start + - limit + - links + link: + type: object + properties: + href: + type: string \ No newline at end of file diff --git a/src/test/resources/checks/v31/schemas/OAR034/valid.json b/src/test/resources/checks/v31/schemas/OAR034/valid.json new file mode 100644 index 00000000..48f81817 --- /dev/null +++ b/src/test/resources/checks/v31/schemas/OAR034/valid.json @@ -0,0 +1,116 @@ +{ + "openapi": "3.1.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/endpoint": { + "get": { + "responses": { + "206": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/response" + } + } + } + }, + "204": { + "description": "No content" + }, + "400": { + "description": "Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/response" + } + } + } + }, + "default": { + "description": "Unknown" + } + } + } + } + }, + "components": { + "schemas": { + "response": { + "type": "object", + "allOf": [ { + "$ref": "#/components/schemas/paged_response" + } ], + "properties": { + "data": { + "type": "object", + "properties": { + "values": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + }, + "paged_response": { + "type": "object", + "properties": { + "paging": { + "type": "object", + "properties": { + "start": { + "type": "integer" + }, + "limit": { + "type": "integer" + }, + "total": { + "type": "integer" + }, + "numPages": { + "type": "integer" + }, + "links": { + "type": "object", + "properties": { + "self": { + "$ref": "#/components/schemas/link" + }, + "first": { + "$ref": "#/components/schemas/link" + }, + "previous": { + "$ref": "#/components/schemas/link" + }, + "next": { + "$ref": "#/components/schemas/link" + }, + "last": { + "$ref": "#/components/schemas/link" + } + }, + "required": [ "self", "previous", "next" ] + } + }, + "required": [ "start", "limit", "links" ] + } + } + }, + "link": { + "type": "object", + "properties": { + "href": { + "type": "string" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/schemas/OAR034/valid.yaml b/src/test/resources/checks/v31/schemas/OAR034/valid.yaml new file mode 100644 index 00000000..886c61af --- /dev/null +++ b/src/test/resources/checks/v31/schemas/OAR034/valid.yaml @@ -0,0 +1,79 @@ +openapi: "3.1.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /endpoint: + get: + responses: + 206: + description: Ok + content: + application/json: + schema: + $ref: '#/components/schemas/response' + 204: + description: No content + 400: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/response' + default: + description: Unknown + +components: + schemas: + response: + type: object + allOf: + - $ref: '#/components/schemas/paged_response' + properties: + data: + type: object + properties: + values: + type: array + items: + type: string + paged_response: + type: object + properties: + paging: + type: object + properties: + start: + type: integer + limit: + type: integer + total: + type: integer + numPages: + type: integer + links: + type: object + properties: + self: + $ref: '#/components/schemas/link' + first: + $ref: '#/components/schemas/link' + previous: + $ref: '#/components/schemas/link' + next: + $ref: '#/components/schemas/link' + last: + $ref: '#/components/schemas/link' + required: + - self + - previous + - next + required: + - start + - limit + - links + link: + type: object + properties: + href: + type: string \ No newline at end of file diff --git a/src/test/resources/checks/v31/schemas/OAR034/with-links-without-properties.json b/src/test/resources/checks/v31/schemas/OAR034/with-links-without-properties.json new file mode 100644 index 00000000..4174dfca --- /dev/null +++ b/src/test/resources/checks/v31/schemas/OAR034/with-links-without-properties.json @@ -0,0 +1,96 @@ +{ + "openapi": "3.1.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/endpoint": { + "get": { + "responses": { + "206": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/response" + } + } + } + }, + "204": { + "description": "No content" + }, + "400": { + "description": "Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/response" + } + } + } + }, + "default": { + "description": "Unknown" + } + } + } + } + }, + "components": { + "schemas": { + "response": { + "type": "object", + "allOf": [ { + "$ref": "#/components/schemas/paged_response" + } ], + "properties": { + "data": { + "type": "object", + "properties": { + "values": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + }, + "paged_response": { + "type": "object", + "properties": { + "paging": { + "type": "object", + "properties": { + "start": { + "type": "integer" + }, + "limit": { + "type": "integer" + }, + "total": { + "type": "integer" + }, + "numPages": { + "type": "integer" + }, + "links": { # Noncompliant {{OAR034: 'first' property is missing}} {{OAR034: 'last' property is missing}} {{OAR034: 'next' property is missing}} {{OAR034: 'previous' property is missing}} {{OAR034: 'self' property is missing}} + "type": "object", + "properties": { + "name": { + "type": "string" + } + }, + "required": [ "self", "previous", "next" ] + } + }, + "required": [ "start", "limit", "links" ] + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/schemas/OAR034/with-links-without-properties.yaml b/src/test/resources/checks/v31/schemas/OAR034/with-links-without-properties.yaml new file mode 100644 index 00000000..f4923170 --- /dev/null +++ b/src/test/resources/checks/v31/schemas/OAR034/with-links-without-properties.yaml @@ -0,0 +1,66 @@ +openapi: "3.1.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /endpoint: + get: + responses: + 206: + description: Ok + content: + application/json: + schema: + $ref: '#/components/schemas/response' + 204: + description: No content + 400: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/response' + default: + description: Unknown + +components: + schemas: + response: + type: object + allOf: + - $ref: '#/components/schemas/paged_response' + properties: + data: + type: object + properties: + values: + type: array + items: + type: string + paged_response: + type: object + properties: + paging: + type: object + properties: + start: + type: integer + limit: + type: integer + total: + type: integer + numPages: + type: integer + links: # Noncompliant {{OAR034: 'first' property is missing}} {{OAR034: 'last' property is missing}} {{OAR034: 'next' property is missing}} {{OAR034: 'previous' property is missing}} {{OAR034: 'self' property is missing}} + type: object + properties: + name: + type: string + required: + - self + - previous + - next + required: + - start + - limit + - links \ No newline at end of file diff --git a/src/test/resources/checks/v31/schemas/OAR034/with-paging-with-properties-wrong-types.json b/src/test/resources/checks/v31/schemas/OAR034/with-paging-with-properties-wrong-types.json new file mode 100644 index 00000000..c65020a4 --- /dev/null +++ b/src/test/resources/checks/v31/schemas/OAR034/with-paging-with-properties-wrong-types.json @@ -0,0 +1,91 @@ +{ + "openapi": "3.1.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/endpoint": { + "get": { + "responses": { + "206": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/response" + } + } + } + }, + "204": { + "description": "No content" + }, + "400": { + "description": "Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/response" + } + } + } + }, + "default": { + "description": "Unknown" + } + } + } + } + }, + "components": { + "schemas": { + "response": { + "type": "object", + "allOf": [ { + "$ref": "#/components/schemas/paged_response" + } ], + "properties": { + "data": { + "type": "object", + "properties": { + "values": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + }, + "paged_response": { + "type": "object", + "properties": { + "paging": { + "type": "object", + "properties": { + "start": { + "type": "string" # Noncompliant {{OAR034: 'start' must be of type integer}} + }, + "limit": { + "type": "string" # Noncompliant {{OAR034: 'limit' must be of type integer}} + }, + "total": { + "type": "string" # Noncompliant {{OAR034: 'total' must be of type integer}} + }, + "numPages": { + "type": "string" # Noncompliant {{OAR034: 'numPages' must be of type integer}} + }, + "links": { + "type": "string", # Noncompliant {{OAR034: 'links' must be of type object}} + "required": [ "self", "previous", "next" ] + } + }, + "required": [ "start", "limit", "links" ] + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/schemas/OAR034/with-paging-with-properties-wrong-types.yaml b/src/test/resources/checks/v31/schemas/OAR034/with-paging-with-properties-wrong-types.yaml new file mode 100644 index 00000000..b08d248f --- /dev/null +++ b/src/test/resources/checks/v31/schemas/OAR034/with-paging-with-properties-wrong-types.yaml @@ -0,0 +1,63 @@ +openapi: "3.1.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /endpoint: + get: + responses: + 206: + description: Ok + content: + application/json: + schema: + $ref: '#/components/schemas/response' + 204: + description: No content + 400: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/response' + default: + description: Unknown + +components: + schemas: + response: + type: object + allOf: + - $ref: '#/components/schemas/paged_response' + properties: + data: + type: object + properties: + values: + type: array + items: + type: string + paged_response: + type: object + properties: + paging: + type: object + properties: + start: + type: string # Noncompliant {{OAR034: 'start' must be of type integer}} + limit: + type: string # Noncompliant {{OAR034: 'limit' must be of type integer}} + total: + type: string # Noncompliant {{OAR034: 'total' must be of type integer}} + numPages: + type: string # Noncompliant {{OAR034: 'numPages' must be of type integer}} + links: + type: string # Noncompliant {{OAR034: 'links' must be of type object}} + required: + - self + - previous + - next + required: + - start + - limit + - links \ No newline at end of file diff --git a/src/test/resources/checks/v31/schemas/OAR034/with-paging-without-properties.json b/src/test/resources/checks/v31/schemas/OAR034/with-paging-without-properties.json new file mode 100644 index 00000000..1352dcc8 --- /dev/null +++ b/src/test/resources/checks/v31/schemas/OAR034/with-paging-without-properties.json @@ -0,0 +1,78 @@ +{ + "openapi": "3.1.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/endpoint": { + "get": { + "responses": { + "206": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/response" + } + } + } + }, + "204": { + "description": "No content" + }, + "400": { + "description": "Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/response" + } + } + } + }, + "default": { + "description": "Unknown" + } + } + } + } + }, + "components": { + "schemas": { + "response": { + "type": "object", + "allOf": [ { + "$ref": "#/components/schemas/paged_response" + } ], + "properties": { + "data": { + "type": "object", + "properties": { + "values": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + }, + "paged_response": { + "type": "object", + "properties": { + "paging": { # Noncompliant {{OAR034: 'limit' property is missing}} {{OAR034: 'links' property is missing}} {{OAR034: 'numPages' property is missing}} {{OAR034: 'start' property is missing}} {{OAR034: 'total' property is missing}} + "type": "object", + "properties": { + "name": { + "type": "string" + } + }, + "required": [ "start", "limit", "links" ] + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/schemas/OAR034/with-paging-without-properties.yaml b/src/test/resources/checks/v31/schemas/OAR034/with-paging-without-properties.yaml new file mode 100644 index 00000000..1429c9bc --- /dev/null +++ b/src/test/resources/checks/v31/schemas/OAR034/with-paging-without-properties.yaml @@ -0,0 +1,51 @@ +openapi: "3.1.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /endpoint: + get: + responses: + 206: + description: Ok + content: + application/json: + schema: + $ref: '#/components/schemas/response' + 204: + description: No content + 400: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/response' + default: + description: Unknown + +components: + schemas: + response: + type: object + allOf: + - $ref: '#/components/schemas/paged_response' + properties: + data: + type: object + properties: + values: + type: array + items: + type: string + paged_response: + type: object + properties: + paging: # Noncompliant {{OAR034: 'limit' property is missing}} {{OAR034: 'links' property is missing}} {{OAR034: 'numPages' property is missing}} {{OAR034: 'start' property is missing}} {{OAR034: 'total' property is missing}} + type: object + properties: + name: + type: string + required: + - start + - limit + - links \ No newline at end of file diff --git a/src/test/resources/checks/v31/schemas/OAR034/with-paging-wrong-type.json b/src/test/resources/checks/v31/schemas/OAR034/with-paging-wrong-type.json new file mode 100644 index 00000000..9a70a9ed --- /dev/null +++ b/src/test/resources/checks/v31/schemas/OAR034/with-paging-wrong-type.json @@ -0,0 +1,73 @@ +{ + "openapi": "3.1.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/endpoint": { + "get": { + "responses": { + "206": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/response" + } + } + } + }, + "204": { + "description": "No content" + }, + "400": { + "description": "Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/response" + } + } + } + }, + "default": { + "description": "Unknown" + } + } + } + } + }, + "components": { + "schemas": { + "response": { + "type": "object", + "allOf": [ { + "$ref": "#/components/schemas/paged_response" + } ], + "properties": { + "data": { + "type": "object", + "properties": { + "values": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + }, + "paged_response": { + "type": "object", + "properties": { + "paging": { + "type": "string", # Noncompliant {{OAR034: 'paging' must be of type object}} + "required": [ "start", "limit", "links" ] + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/schemas/OAR034/with-paging-wrong-type.yaml b/src/test/resources/checks/v31/schemas/OAR034/with-paging-wrong-type.yaml new file mode 100644 index 00000000..7694cb9a --- /dev/null +++ b/src/test/resources/checks/v31/schemas/OAR034/with-paging-wrong-type.yaml @@ -0,0 +1,48 @@ +openapi: "3.1.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /endpoint: + get: + responses: + 206: + description: Ok + content: + application/json: + schema: + $ref: '#/components/schemas/response' + 204: + description: No content + 400: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/response' + default: + description: Unknown + +components: + schemas: + response: + type: object + allOf: + - $ref: '#/components/schemas/paged_response' + properties: + data: + type: object + properties: + values: + type: array + items: + type: string + paged_response: + type: object + properties: + paging: + type: string # Noncompliant {{OAR034: 'paging' must be of type object}} + required: + - start + - limit + - links \ No newline at end of file diff --git a/src/test/resources/checks/v31/schemas/OAR034/without-links-required-fields.json b/src/test/resources/checks/v31/schemas/OAR034/without-links-required-fields.json new file mode 100644 index 00000000..22dc4940 --- /dev/null +++ b/src/test/resources/checks/v31/schemas/OAR034/without-links-required-fields.json @@ -0,0 +1,116 @@ +{ + "openapi": "3.1.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/endpoint": { + "get": { + "responses": { + "206": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/response" + } + } + } + }, + "204": { + "description": "No content" + }, + "400": { + "description": "Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/response" + } + } + } + }, + "default": { + "description": "Unknown" + } + } + } + } + }, + "components": { + "schemas": { + "response": { + "type": "object", + "allOf": [ { + "$ref": "#/components/schemas/paged_response" + } ], + "properties": { + "data": { + "type": "object", + "properties": { + "values": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + }, + "paged_response": { + "type": "object", + "properties": { + "paging": { + "type": "object", + "properties": { + "start": { + "type": "integer" + }, + "limit": { + "type": "integer" + }, + "total": { + "type": "integer" + }, + "numPages": { + "type": "integer" + }, + "links": { + "type": "object", + "properties": { + "self": { + "$ref": "#/components/schemas/link" + }, + "first": { + "$ref": "#/components/schemas/link" + }, + "previous": { + "$ref": "#/components/schemas/link" + }, + "next": { + "$ref": "#/components/schemas/link" + }, + "last": { + "$ref": "#/components/schemas/link" + } + }, + "required": [ "self" ] # Noncompliant {{OAR034: The following fields must be required: next, previous, self}} + } + }, + "required": [ "start", "limit", "links" ] + } + } + }, + "link": { + "type": "object", + "properties": { + "href": { + "type": "string" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/schemas/OAR034/without-links-required-fields.yaml b/src/test/resources/checks/v31/schemas/OAR034/without-links-required-fields.yaml new file mode 100644 index 00000000..cfcd88ef --- /dev/null +++ b/src/test/resources/checks/v31/schemas/OAR034/without-links-required-fields.yaml @@ -0,0 +1,77 @@ +openapi: "3.1.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /endpoint: + get: + responses: + 206: + description: Ok + content: + application/json: + schema: + $ref: '#/components/schemas/response' + 204: + description: No content + 400: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/response' + default: + description: Unknown + +components: + schemas: + response: + type: object + allOf: + - $ref: '#/components/schemas/paged_response' + properties: + data: + type: object + properties: + values: + type: array + items: + type: string + paged_response: + type: object + properties: + paging: + type: object + properties: + start: + type: integer + limit: + type: integer + total: + type: integer + numPages: + type: integer + links: + type: object + properties: + self: + $ref: '#/components/schemas/link' + first: + $ref: '#/components/schemas/link' + previous: + $ref: '#/components/schemas/link' + next: + $ref: '#/components/schemas/link' + last: + $ref: '#/components/schemas/link' + required: # Noncompliant {{OAR034: The following fields must be required: next, previous, self}} + - self + required: + - start + - limit + - links + link: + type: object + properties: + href: + type: string \ No newline at end of file diff --git a/src/test/resources/checks/v31/schemas/OAR034/without-pagination-required-fields.json b/src/test/resources/checks/v31/schemas/OAR034/without-pagination-required-fields.json new file mode 100644 index 00000000..b78c713c --- /dev/null +++ b/src/test/resources/checks/v31/schemas/OAR034/without-pagination-required-fields.json @@ -0,0 +1,116 @@ +{ + "openapi": "3.1.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/endpoint": { + "get": { + "responses": { + "206": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/response" + } + } + } + }, + "204": { + "description": "No content" + }, + "400": { + "description": "Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/response" + } + } + } + }, + "default": { + "description": "Unknown" + } + } + } + } + }, + "components": { + "schemas": { + "response": { + "type": "object", + "allOf": [ { + "$ref": "#/components/schemas/paged_response" + } ], + "properties": { + "data": { + "type": "object", + "properties": { + "values": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + }, + "paged_response": { + "type": "object", + "properties": { + "paging": { + "type": "object", + "properties": { + "start": { + "type": "integer" + }, + "limit": { + "type": "integer" + }, + "total": { + "type": "integer" + }, + "numPages": { + "type": "integer" + }, + "links": { + "type": "object", + "properties": { + "self": { + "$ref": "#/components/schemas/link" + }, + "first": { + "$ref": "#/components/schemas/link" + }, + "previous": { + "$ref": "#/components/schemas/link" + }, + "next": { + "$ref": "#/components/schemas/link" + }, + "last": { + "$ref": "#/components/schemas/link" + } + }, + "required": [ "self", "previous", "next" ] + } + }, + "required": [ "start" ] # Noncompliant {{OAR034: The following fields must be required: limit, links, start}} + } + } + }, + "link": { + "type": "object", + "properties": { + "href": { + "type": "string" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/schemas/OAR034/without-pagination-required-fields.yaml b/src/test/resources/checks/v31/schemas/OAR034/without-pagination-required-fields.yaml new file mode 100644 index 00000000..d5dd3512 --- /dev/null +++ b/src/test/resources/checks/v31/schemas/OAR034/without-pagination-required-fields.yaml @@ -0,0 +1,77 @@ +openapi: "3.1.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /endpoint: + get: + responses: + 206: + description: Ok + content: + application/json: + schema: + $ref: '#/components/schemas/response' + 204: + description: No content + 400: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/response' + default: + description: Unknown + +components: + schemas: + response: + type: object + allOf: + - $ref: '#/components/schemas/paged_response' + properties: + data: + type: object + properties: + values: + type: array + items: + type: string + paged_response: + type: object + properties: + paging: + type: object + properties: + start: + type: integer + limit: + type: integer + total: + type: integer + numPages: + type: integer + links: + type: object + properties: + self: + $ref: '#/components/schemas/link' + first: + $ref: '#/components/schemas/link' + previous: + $ref: '#/components/schemas/link' + next: + $ref: '#/components/schemas/link' + last: + $ref: '#/components/schemas/link' + required: + - self + - previous + - next + required: # Noncompliant {{OAR034: The following fields must be required: limit, links, start}} + - start + link: + type: object + properties: + href: + type: string \ No newline at end of file diff --git a/src/test/resources/checks/v31/schemas/OAR034/without-paging.json b/src/test/resources/checks/v31/schemas/OAR034/without-paging.json new file mode 100644 index 00000000..d7c3098f --- /dev/null +++ b/src/test/resources/checks/v31/schemas/OAR034/without-paging.json @@ -0,0 +1,61 @@ +{ + "openapi": "3.1.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/endpoint": { + "get": { + "responses": { + "206": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/response" + } + } + } + }, + "204": { + "description": "No content" + }, + "400": { + "description": "Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/response" + } + } + } + }, + "default": { + "description": "Unknown" + } + } + } + } + }, + "components": { + "schemas": { + "response": { # Noncompliant {{OAR034: 'paging' property is missing}} + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "values": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/schemas/OAR034/without-paging.yaml b/src/test/resources/checks/v31/schemas/OAR034/without-paging.yaml new file mode 100644 index 00000000..d2a7a218 --- /dev/null +++ b/src/test/resources/checks/v31/schemas/OAR034/without-paging.yaml @@ -0,0 +1,37 @@ +openapi: "3.1.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /endpoint: + get: + responses: + 206: + description: Ok + content: + application/json: + schema: + $ref: '#/components/schemas/response' + 204: + description: No content + 400: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/response' + default: + description: Unknown + +components: + schemas: + response: # Noncompliant {{OAR034: 'paging' property is missing}} + type: object + properties: + data: + type: object + properties: + values: + type: array + items: + type: string \ No newline at end of file diff --git a/src/test/resources/checks/v31/schemas/OAR080/empty-global-security.json b/src/test/resources/checks/v31/schemas/OAR080/empty-global-security.json index 81763b5c..82a2cdf3 100644 --- a/src/test/resources/checks/v31/schemas/OAR080/empty-global-security.json +++ b/src/test/resources/checks/v31/schemas/OAR080/empty-global-security.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "version": "1.0.0", "title": "Sample API" diff --git a/src/test/resources/checks/v31/schemas/OAR080/empty-global-security.yaml b/src/test/resources/checks/v31/schemas/OAR080/empty-global-security.yaml index 05fb3ba3..4dc29cee 100644 --- a/src/test/resources/checks/v31/schemas/OAR080/empty-global-security.yaml +++ b/src/test/resources/checks/v31/schemas/OAR080/empty-global-security.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.0 +openapi: "3.1.0" info: version: 1.0.0 title: Sample API diff --git a/src/test/resources/checks/v31/schemas/OAR080/empty-security.json b/src/test/resources/checks/v31/schemas/OAR080/empty-security.json index b7f31ef0..526e63cd 100644 --- a/src/test/resources/checks/v31/schemas/OAR080/empty-security.json +++ b/src/test/resources/checks/v31/schemas/OAR080/empty-security.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "version": "1.0.0", "title": "Sample API" diff --git a/src/test/resources/checks/v31/schemas/OAR080/empty-security.yaml b/src/test/resources/checks/v31/schemas/OAR080/empty-security.yaml index 8821cacf..eb3af992 100644 --- a/src/test/resources/checks/v31/schemas/OAR080/empty-security.yaml +++ b/src/test/resources/checks/v31/schemas/OAR080/empty-security.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.0 +openapi: "3.1.0" info: version: 1.0.0 title: Sample API diff --git a/src/test/resources/checks/v31/schemas/OAR080/global-security.json b/src/test/resources/checks/v31/schemas/OAR080/global-security.json index 645a4a88..690c60a8 100644 --- a/src/test/resources/checks/v31/schemas/OAR080/global-security.json +++ b/src/test/resources/checks/v31/schemas/OAR080/global-security.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "version": "1.0.0", "title": "Sample API" diff --git a/src/test/resources/checks/v31/schemas/OAR080/global-security.yaml b/src/test/resources/checks/v31/schemas/OAR080/global-security.yaml index 3205ed2a..d720f919 100644 --- a/src/test/resources/checks/v31/schemas/OAR080/global-security.yaml +++ b/src/test/resources/checks/v31/schemas/OAR080/global-security.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.0 +openapi: "3.1.0" info: version: 1.0.0 title: Sample API diff --git a/src/test/resources/checks/v31/schemas/OAR080/with-security.json b/src/test/resources/checks/v31/schemas/OAR080/with-security.json index 1157cab0..fab34158 100644 --- a/src/test/resources/checks/v31/schemas/OAR080/with-security.json +++ b/src/test/resources/checks/v31/schemas/OAR080/with-security.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "version": "1.0.0", "title": "Sample API" diff --git a/src/test/resources/checks/v31/schemas/OAR080/with-security.yaml b/src/test/resources/checks/v31/schemas/OAR080/with-security.yaml index de18bc04..2221d48e 100644 --- a/src/test/resources/checks/v31/schemas/OAR080/with-security.yaml +++ b/src/test/resources/checks/v31/schemas/OAR080/with-security.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.0 +openapi: "3.1.0" info: version: 1.0.0 title: Sample API diff --git a/src/test/resources/checks/v31/schemas/OAR080/without-security.json b/src/test/resources/checks/v31/schemas/OAR080/without-security.json index 82430d79..416403b8 100644 --- a/src/test/resources/checks/v31/schemas/OAR080/without-security.json +++ b/src/test/resources/checks/v31/schemas/OAR080/without-security.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "version": "1.0.0", "title": "Sample API" diff --git a/src/test/resources/checks/v31/schemas/OAR080/without-security.yaml b/src/test/resources/checks/v31/schemas/OAR080/without-security.yaml index 675f89b2..34e2dbe5 100644 --- a/src/test/resources/checks/v31/schemas/OAR080/without-security.yaml +++ b/src/test/resources/checks/v31/schemas/OAR080/without-security.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.0 +openapi: "3.1.0" info: version: 1.0.0 title: Sample API diff --git a/src/test/resources/checks/v31/schemas/OAR080/wrong-scheme.json b/src/test/resources/checks/v31/schemas/OAR080/wrong-scheme.json index b042b2b4..83789132 100644 --- a/src/test/resources/checks/v31/schemas/OAR080/wrong-scheme.json +++ b/src/test/resources/checks/v31/schemas/OAR080/wrong-scheme.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "version": "1.0.0", "title": "Sample API" diff --git a/src/test/resources/checks/v31/schemas/OAR080/wrong-scheme.yaml b/src/test/resources/checks/v31/schemas/OAR080/wrong-scheme.yaml index 86220d9f..ae5efffc 100644 --- a/src/test/resources/checks/v31/schemas/OAR080/wrong-scheme.yaml +++ b/src/test/resources/checks/v31/schemas/OAR080/wrong-scheme.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.0 +openapi: "3.1.0" info: version: 1.0.0 title: Sample API diff --git a/src/test/resources/checks/v31/schemas/OAR108/invalid.json b/src/test/resources/checks/v31/schemas/OAR108/invalid.json index 3ce871c6..cebe145c 100644 --- a/src/test/resources/checks/v31/schemas/OAR108/invalid.json +++ b/src/test/resources/checks/v31/schemas/OAR108/invalid.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "title": "Ejemplo de API", "version": "1.0.0" diff --git a/src/test/resources/checks/v31/schemas/OAR108/invalid.yaml b/src/test/resources/checks/v31/schemas/OAR108/invalid.yaml index 67c4fb32..d0e2a6a4 100644 --- a/src/test/resources/checks/v31/schemas/OAR108/invalid.yaml +++ b/src/test/resources/checks/v31/schemas/OAR108/invalid.yaml @@ -1,4 +1,4 @@ - openapi: 3.0.0 + openapi: "3.1.0" info: title: Ejemplo de API version: 1.0.0 diff --git a/src/test/resources/checks/v31/schemas/OAR108/valid.json b/src/test/resources/checks/v31/schemas/OAR108/valid.json index 6a922454..12cfcc38 100644 --- a/src/test/resources/checks/v31/schemas/OAR108/valid.json +++ b/src/test/resources/checks/v31/schemas/OAR108/valid.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "title": "Ejemplo de API", "version": "1.0.0" diff --git a/src/test/resources/checks/v31/schemas/OAR108/valid.yaml b/src/test/resources/checks/v31/schemas/OAR108/valid.yaml index 6c14d980..3575773c 100644 --- a/src/test/resources/checks/v31/schemas/OAR108/valid.yaml +++ b/src/test/resources/checks/v31/schemas/OAR108/valid.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.0 +openapi: "3.1.0" info: title: Ejemplo de API Ampliada version: 1.0.0 diff --git a/src/test/resources/checks/v31/security/OAR001/with-servers.json b/src/test/resources/checks/v31/security/OAR001/with-servers.json index 14fb615b..8c58ff7d 100644 --- a/src/test/resources/checks/v31/security/OAR001/with-servers.json +++ b/src/test/resources/checks/v31/security/OAR001/with-servers.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.1.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v31/security/OAR001/with-servers.yaml b/src/test/resources/checks/v31/security/OAR001/with-servers.yaml index 0827de6e..cad7330c 100644 --- a/src/test/resources/checks/v31/security/OAR001/with-servers.yaml +++ b/src/test/resources/checks/v31/security/OAR001/with-servers.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/security/OAR001/without-servers.json b/src/test/resources/checks/v31/security/OAR001/without-servers.json index 0bb90cf7..340f656c 100644 --- a/src/test/resources/checks/v31/security/OAR001/without-servers.json +++ b/src/test/resources/checks/v31/security/OAR001/without-servers.json @@ -1,5 +1,5 @@ { # Noncompliant {{OAR001: Define 'servers' is mandatory}} - "openapi" : "3.0.0", + "openapi" : "3.1.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v31/security/OAR001/without-servers.yaml b/src/test/resources/checks/v31/security/OAR001/without-servers.yaml index a4233292..c343548e 100644 --- a/src/test/resources/checks/v31/security/OAR001/without-servers.yaml +++ b/src/test/resources/checks/v31/security/OAR001/without-servers.yaml @@ -1,5 +1,5 @@ # Noncompliant {{OAR001: Define 'servers' is mandatory}} -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/security/OAR033/valid.json b/src/test/resources/checks/v31/security/OAR033/valid.json index 8315cce5..0084fa1b 100644 --- a/src/test/resources/checks/v31/security/OAR033/valid.json +++ b/src/test/resources/checks/v31/security/OAR033/valid.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v31/security/OAR033/valid.yaml b/src/test/resources/checks/v31/security/OAR033/valid.yaml index 87f75ec1..22323221 100644 --- a/src/test/resources/checks/v31/security/OAR033/valid.yaml +++ b/src/test/resources/checks/v31/security/OAR033/valid.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/security/OAR033/with-forbidden-params.json b/src/test/resources/checks/v31/security/OAR033/with-forbidden-params.json index ea0db738..a181f556 100644 --- a/src/test/resources/checks/v31/security/OAR033/with-forbidden-params.json +++ b/src/test/resources/checks/v31/security/OAR033/with-forbidden-params.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v31/security/OAR033/with-forbidden-params.yaml b/src/test/resources/checks/v31/security/OAR033/with-forbidden-params.yaml index 187dab95..8d3bdadb 100644 --- a/src/test/resources/checks/v31/security/OAR033/with-forbidden-params.yaml +++ b/src/test/resources/checks/v31/security/OAR033/with-forbidden-params.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/security/OAR033/without-required-params.json b/src/test/resources/checks/v31/security/OAR033/without-required-params.json index 27231df1..edfb56b3 100644 --- a/src/test/resources/checks/v31/security/OAR033/without-required-params.json +++ b/src/test/resources/checks/v31/security/OAR033/without-required-params.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v31/security/OAR033/without-required-params.yaml b/src/test/resources/checks/v31/security/OAR033/without-required-params.yaml index ff8b0fc6..0adc73ea 100644 --- a/src/test/resources/checks/v31/security/OAR033/without-required-params.yaml +++ b/src/test/resources/checks/v31/security/OAR033/without-required-params.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/security/OAR035/valid.json b/src/test/resources/checks/v31/security/OAR035/valid.json index c45fbe9a..09460094 100644 --- a/src/test/resources/checks/v31/security/OAR035/valid.json +++ b/src/test/resources/checks/v31/security/OAR035/valid.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v31/security/OAR035/valid.yaml b/src/test/resources/checks/v31/security/OAR035/valid.yaml index 4ada663f..ff056dea 100644 --- a/src/test/resources/checks/v31/security/OAR035/valid.yaml +++ b/src/test/resources/checks/v31/security/OAR035/valid.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/security/OAR035/without-authorization-responses.json b/src/test/resources/checks/v31/security/OAR035/without-authorization-responses.json index cf9d9e5c..6b76ce5b 100644 --- a/src/test/resources/checks/v31/security/OAR035/without-authorization-responses.json +++ b/src/test/resources/checks/v31/security/OAR035/without-authorization-responses.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v31/security/OAR035/without-authorization-responses.yaml b/src/test/resources/checks/v31/security/OAR035/without-authorization-responses.yaml index b03ad2df..dd06149a 100644 --- a/src/test/resources/checks/v31/security/OAR035/without-authorization-responses.yaml +++ b/src/test/resources/checks/v31/security/OAR035/without-authorization-responses.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/security/OAR036/valid.json b/src/test/resources/checks/v31/security/OAR036/valid.json index bead835f..e1cc4f56 100644 --- a/src/test/resources/checks/v31/security/OAR036/valid.json +++ b/src/test/resources/checks/v31/security/OAR036/valid.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v31/security/OAR036/valid.yaml b/src/test/resources/checks/v31/security/OAR036/valid.yaml index 23afab6a..b746cce4 100644 --- a/src/test/resources/checks/v31/security/OAR036/valid.yaml +++ b/src/test/resources/checks/v31/security/OAR036/valid.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/security/OAR036/with-cookie.json b/src/test/resources/checks/v31/security/OAR036/with-cookie.json index 9d79650a..a1bd49b1 100644 --- a/src/test/resources/checks/v31/security/OAR036/with-cookie.json +++ b/src/test/resources/checks/v31/security/OAR036/with-cookie.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v31/security/OAR036/with-cookie.yaml b/src/test/resources/checks/v31/security/OAR036/with-cookie.yaml index e6b279f4..02d7edd0 100644 --- a/src/test/resources/checks/v31/security/OAR036/with-cookie.yaml +++ b/src/test/resources/checks/v31/security/OAR036/with-cookie.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/security/OAR045/defined-response.json b/src/test/resources/checks/v31/security/OAR045/defined-response.json index f86d6ac4..b73d9c78 100644 --- a/src/test/resources/checks/v31/security/OAR045/defined-response.json +++ b/src/test/resources/checks/v31/security/OAR045/defined-response.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v31/security/OAR045/defined-response.yaml b/src/test/resources/checks/v31/security/OAR045/defined-response.yaml index 4370ac6c..6540560a 100644 --- a/src/test/resources/checks/v31/security/OAR045/defined-response.yaml +++ b/src/test/resources/checks/v31/security/OAR045/defined-response.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.0 +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/security/OAR049/no-content-in-204.json b/src/test/resources/checks/v31/security/OAR049/no-content-in-204.json new file mode 100644 index 00000000..dcfe19fe --- /dev/null +++ b/src/test/resources/checks/v31/security/OAR049/no-content-in-204.json @@ -0,0 +1,25 @@ +{ + "openapi" : "3.1.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/other-pets/{petId}" : { + "delete" : { + "responses" : { + "204" : { # Noncompliant {{OAR049: 204 No Content MUST NOT return anything}} + "description" : "delete pet", + "content" : { + "application/json" : { + "schema" : { + "type" : "object" + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/security/OAR049/no-content-in-204.yaml b/src/test/resources/checks/v31/security/OAR049/no-content-in-204.yaml new file mode 100644 index 00000000..2636d1eb --- /dev/null +++ b/src/test/resources/checks/v31/security/OAR049/no-content-in-204.yaml @@ -0,0 +1,14 @@ +openapi: "3.1.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /other-pets/{petId}: + delete: + responses: + '204': # Noncompliant {{OAR049: 204 No Content MUST NOT return anything}} + description: delete pet + content: + 'application/json': + schema: + type: object \ No newline at end of file diff --git a/src/test/resources/checks/v31/security/OAR053/valid.json b/src/test/resources/checks/v31/security/OAR053/valid.json index 774ea388..e82e1159 100644 --- a/src/test/resources/checks/v31/security/OAR053/valid.json +++ b/src/test/resources/checks/v31/security/OAR053/valid.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v31/security/OAR053/valid.yaml b/src/test/resources/checks/v31/security/OAR053/valid.yaml index bfda5f93..d37fcf08 100644 --- a/src/test/resources/checks/v31/security/OAR053/valid.yaml +++ b/src/test/resources/checks/v31/security/OAR053/valid.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/security/OAR054/valid.json b/src/test/resources/checks/v31/security/OAR054/valid.json index 2f45e288..dfcdbddf 100644 --- a/src/test/resources/checks/v31/security/OAR054/valid.json +++ b/src/test/resources/checks/v31/security/OAR054/valid.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v31/security/OAR054/valid.yaml b/src/test/resources/checks/v31/security/OAR054/valid.yaml index a87e4212..95609164 100644 --- a/src/test/resources/checks/v31/security/OAR054/valid.yaml +++ b/src/test/resources/checks/v31/security/OAR054/valid.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/security/OAR072/no-stack-trace.json b/src/test/resources/checks/v31/security/OAR072/no-stack-trace.json index 929b4279..112ec2a2 100644 --- a/src/test/resources/checks/v31/security/OAR072/no-stack-trace.json +++ b/src/test/resources/checks/v31/security/OAR072/no-stack-trace.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "title": "Compliant API", "version": "1.0.0" diff --git a/src/test/resources/checks/v31/security/OAR072/no-stack-trace.yaml b/src/test/resources/checks/v31/security/OAR072/no-stack-trace.yaml index 9c5c83f1..6ff881d8 100644 --- a/src/test/resources/checks/v31/security/OAR072/no-stack-trace.yaml +++ b/src/test/resources/checks/v31/security/OAR072/no-stack-trace.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.0 +openapi: "3.1.0" info: title: Sample API version: 1.0.0 diff --git a/src/test/resources/checks/v31/security/OAR072/with-stack-trace.json b/src/test/resources/checks/v31/security/OAR072/with-stack-trace.json index 35468a59..ea888ddf 100644 --- a/src/test/resources/checks/v31/security/OAR072/with-stack-trace.json +++ b/src/test/resources/checks/v31/security/OAR072/with-stack-trace.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "title": "Sample API", "version": "1.0.0" diff --git a/src/test/resources/checks/v31/security/OAR072/with-stack-trace.yaml b/src/test/resources/checks/v31/security/OAR072/with-stack-trace.yaml index 8d1fcadf..fd9a9085 100644 --- a/src/test/resources/checks/v31/security/OAR072/with-stack-trace.yaml +++ b/src/test/resources/checks/v31/security/OAR072/with-stack-trace.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.0 +openapi: "3.1.0" info: title: Sample API version: 1.0.0 diff --git a/src/test/resources/checks/v31/security/OAR074/no-restrictions.json b/src/test/resources/checks/v31/security/OAR074/no-restrictions.json index 4d6b726c..51348504 100644 --- a/src/test/resources/checks/v31/security/OAR074/no-restrictions.json +++ b/src/test/resources/checks/v31/security/OAR074/no-restrictions.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "version": "1.0.0", "title": "My API" diff --git a/src/test/resources/checks/v31/security/OAR074/no-restrictions.yaml b/src/test/resources/checks/v31/security/OAR074/no-restrictions.yaml index 91fea43c..09b65488 100644 --- a/src/test/resources/checks/v31/security/OAR074/no-restrictions.yaml +++ b/src/test/resources/checks/v31/security/OAR074/no-restrictions.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: My API diff --git a/src/test/resources/checks/v31/security/OAR074/with-restrictions.json b/src/test/resources/checks/v31/security/OAR074/with-restrictions.json index 02a94a5f..88390131 100644 --- a/src/test/resources/checks/v31/security/OAR074/with-restrictions.json +++ b/src/test/resources/checks/v31/security/OAR074/with-restrictions.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "version": "1.0.0", "title": "My API" diff --git a/src/test/resources/checks/v31/security/OAR074/with-restrictions.yaml b/src/test/resources/checks/v31/security/OAR074/with-restrictions.yaml index 65e43fea..cea2b841 100644 --- a/src/test/resources/checks/v31/security/OAR074/with-restrictions.yaml +++ b/src/test/resources/checks/v31/security/OAR074/with-restrictions.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: My API diff --git a/src/test/resources/checks/v31/security/OAR075/no-restrictions.json b/src/test/resources/checks/v31/security/OAR075/no-restrictions.json index 1c260f41..db317f9c 100644 --- a/src/test/resources/checks/v31/security/OAR075/no-restrictions.json +++ b/src/test/resources/checks/v31/security/OAR075/no-restrictions.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "title": "API sin restricciones", "version": "1.0.0" diff --git a/src/test/resources/checks/v31/security/OAR075/no-restrictions.yaml b/src/test/resources/checks/v31/security/OAR075/no-restrictions.yaml index 067bbe64..e995a772 100644 --- a/src/test/resources/checks/v31/security/OAR075/no-restrictions.yaml +++ b/src/test/resources/checks/v31/security/OAR075/no-restrictions.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.0 +openapi: "3.1.0" info: title: API sin restricciones version: 1.0.0 diff --git a/src/test/resources/checks/v31/security/OAR075/with-restrictions.json b/src/test/resources/checks/v31/security/OAR075/with-restrictions.json index b27eda32..0865c2c9 100644 --- a/src/test/resources/checks/v31/security/OAR075/with-restrictions.json +++ b/src/test/resources/checks/v31/security/OAR075/with-restrictions.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "title": "API con restricciones", "version": "1.0.0" diff --git a/src/test/resources/checks/v31/security/OAR075/with-restrictions.yaml b/src/test/resources/checks/v31/security/OAR075/with-restrictions.yaml index 69aadfff..bcea6995 100644 --- a/src/test/resources/checks/v31/security/OAR075/with-restrictions.yaml +++ b/src/test/resources/checks/v31/security/OAR075/with-restrictions.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.0 +openapi: "3.1.0" info: title: API con restricciones version: 1.0.0 diff --git a/src/test/resources/checks/v31/security/OAR076/nested.json b/src/test/resources/checks/v31/security/OAR076/nested.json index b02da78c..d42127d5 100644 --- a/src/test/resources/checks/v31/security/OAR076/nested.json +++ b/src/test/resources/checks/v31/security/OAR076/nested.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v31/security/OAR076/nested.yaml b/src/test/resources/checks/v31/security/OAR076/nested.yaml index f0607065..095dde98 100644 --- a/src/test/resources/checks/v31/security/OAR076/nested.yaml +++ b/src/test/resources/checks/v31/security/OAR076/nested.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/security/OAR076/plain.json b/src/test/resources/checks/v31/security/OAR076/plain.json index b41cd0e8..bca59f52 100644 --- a/src/test/resources/checks/v31/security/OAR076/plain.json +++ b/src/test/resources/checks/v31/security/OAR076/plain.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v31/security/OAR076/plain.yaml b/src/test/resources/checks/v31/security/OAR076/plain.yaml index 8128fb01..068162fb 100644 --- a/src/test/resources/checks/v31/security/OAR076/plain.yaml +++ b/src/test/resources/checks/v31/security/OAR076/plain.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/security/OAR076/with-$ref.json b/src/test/resources/checks/v31/security/OAR076/with-$ref.json index f2c2d7c8..fe3074fb 100644 --- a/src/test/resources/checks/v31/security/OAR076/with-$ref.json +++ b/src/test/resources/checks/v31/security/OAR076/with-$ref.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v31/security/OAR076/with-$ref.yaml b/src/test/resources/checks/v31/security/OAR076/with-$ref.yaml index 3f3e2db7..07c14a88 100644 --- a/src/test/resources/checks/v31/security/OAR076/with-$ref.yaml +++ b/src/test/resources/checks/v31/security/OAR076/with-$ref.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/security/OAR078/no-security.json b/src/test/resources/checks/v31/security/OAR078/no-security.json index 74770f90..6df09dc1 100644 --- a/src/test/resources/checks/v31/security/OAR078/no-security.json +++ b/src/test/resources/checks/v31/security/OAR078/no-security.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "version": "1.0.0", "title": "Sample API" diff --git a/src/test/resources/checks/v31/security/OAR078/no-security.yaml b/src/test/resources/checks/v31/security/OAR078/no-security.yaml index 005c2fbc..f97db470 100644 --- a/src/test/resources/checks/v31/security/OAR078/no-security.yaml +++ b/src/test/resources/checks/v31/security/OAR078/no-security.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.0 +openapi: "3.1.0" info: version: 1.0.0 title: Sample API diff --git a/src/test/resources/checks/v31/security/OAR078/with-security.json b/src/test/resources/checks/v31/security/OAR078/with-security.json index dd025133..1cb7ce1e 100644 --- a/src/test/resources/checks/v31/security/OAR078/with-security.json +++ b/src/test/resources/checks/v31/security/OAR078/with-security.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "version": "1.0.0", "title": "Sample API" diff --git a/src/test/resources/checks/v31/security/OAR078/with-security.yaml b/src/test/resources/checks/v31/security/OAR078/with-security.yaml index c591c997..83c4b9c4 100644 --- a/src/test/resources/checks/v31/security/OAR078/with-security.yaml +++ b/src/test/resources/checks/v31/security/OAR078/with-security.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.0 +openapi: "3.1.0" info: title: Sample API version: 1.0.0 diff --git a/src/test/resources/checks/v31/security/OAR079/bad-request404.json b/src/test/resources/checks/v31/security/OAR079/bad-request404.json index 751268d5..feffafed 100644 --- a/src/test/resources/checks/v31/security/OAR079/bad-request404.json +++ b/src/test/resources/checks/v31/security/OAR079/bad-request404.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.1.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v31/security/OAR079/bad-request404.yaml b/src/test/resources/checks/v31/security/OAR079/bad-request404.yaml index 53082801..a0d15464 100644 --- a/src/test/resources/checks/v31/security/OAR079/bad-request404.yaml +++ b/src/test/resources/checks/v31/security/OAR079/bad-request404.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/security/OAR079/no-bad-request404.json b/src/test/resources/checks/v31/security/OAR079/no-bad-request404.json index be422fe0..919bc0d2 100644 --- a/src/test/resources/checks/v31/security/OAR079/no-bad-request404.json +++ b/src/test/resources/checks/v31/security/OAR079/no-bad-request404.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.1.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v31/security/OAR079/no-bad-request404.yaml b/src/test/resources/checks/v31/security/OAR079/no-bad-request404.yaml index 0cbefaf9..b8dacb5d 100644 --- a/src/test/resources/checks/v31/security/OAR079/no-bad-request404.yaml +++ b/src/test/resources/checks/v31/security/OAR079/no-bad-request404.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/security/OAR079/no-parameters.json b/src/test/resources/checks/v31/security/OAR079/no-parameters.json index 9d39ba8a..ba173982 100644 --- a/src/test/resources/checks/v31/security/OAR079/no-parameters.json +++ b/src/test/resources/checks/v31/security/OAR079/no-parameters.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v31/security/OAR079/no-parameters.yaml b/src/test/resources/checks/v31/security/OAR079/no-parameters.yaml index f220c16c..8d492218 100644 --- a/src/test/resources/checks/v31/security/OAR079/no-parameters.yaml +++ b/src/test/resources/checks/v31/security/OAR079/no-parameters.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/security/OAR079/query-param-only.json b/src/test/resources/checks/v31/security/OAR079/query-param-only.json index ad428c6b..3fd4ba30 100644 --- a/src/test/resources/checks/v31/security/OAR079/query-param-only.json +++ b/src/test/resources/checks/v31/security/OAR079/query-param-only.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v31/security/OAR079/query-param-only.yaml b/src/test/resources/checks/v31/security/OAR079/query-param-only.yaml index d85cf1b8..1e21daa0 100644 --- a/src/test/resources/checks/v31/security/OAR079/query-param-only.yaml +++ b/src/test/resources/checks/v31/security/OAR079/query-param-only.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/security/OAR081/not-valid-password.json b/src/test/resources/checks/v31/security/OAR081/not-valid-password.json index eb626afe..db02d02d 100644 --- a/src/test/resources/checks/v31/security/OAR081/not-valid-password.json +++ b/src/test/resources/checks/v31/security/OAR081/not-valid-password.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v31/security/OAR081/not-valid-password.yaml b/src/test/resources/checks/v31/security/OAR081/not-valid-password.yaml index 4d7804fb..e4d17b72 100644 --- a/src/test/resources/checks/v31/security/OAR081/not-valid-password.yaml +++ b/src/test/resources/checks/v31/security/OAR081/not-valid-password.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/security/OAR081/valid-password.json b/src/test/resources/checks/v31/security/OAR081/valid-password.json index 1bc3a18d..57347217 100644 --- a/src/test/resources/checks/v31/security/OAR081/valid-password.json +++ b/src/test/resources/checks/v31/security/OAR081/valid-password.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v31/security/OAR081/valid-password.yaml b/src/test/resources/checks/v31/security/OAR081/valid-password.yaml index 2545f739..a63ab900 100644 --- a/src/test/resources/checks/v31/security/OAR081/valid-password.yaml +++ b/src/test/resources/checks/v31/security/OAR081/valid-password.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/security/OAR081/valid-with-components.json b/src/test/resources/checks/v31/security/OAR081/valid-with-components.json index 0ce1cdd6..87505e35 100644 --- a/src/test/resources/checks/v31/security/OAR081/valid-with-components.json +++ b/src/test/resources/checks/v31/security/OAR081/valid-with-components.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v31/security/OAR081/valid-with-components.yaml b/src/test/resources/checks/v31/security/OAR081/valid-with-components.yaml index 61c4d53c..716f4e5d 100644 --- a/src/test/resources/checks/v31/security/OAR081/valid-with-components.yaml +++ b/src/test/resources/checks/v31/security/OAR081/valid-with-components.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/security/OAR082/valid-format.json b/src/test/resources/checks/v31/security/OAR082/valid-format.json index 7423cb98..23251d95 100644 --- a/src/test/resources/checks/v31/security/OAR082/valid-format.json +++ b/src/test/resources/checks/v31/security/OAR082/valid-format.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v31/security/OAR082/valid-format.yaml b/src/test/resources/checks/v31/security/OAR082/valid-format.yaml index 626624e9..ec26b569 100644 --- a/src/test/resources/checks/v31/security/OAR082/valid-format.yaml +++ b/src/test/resources/checks/v31/security/OAR082/valid-format.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: "1.0.0" title: "Swagger Petstore" diff --git a/src/test/resources/checks/v31/security/OAR083/forbidden-query-params.json b/src/test/resources/checks/v31/security/OAR083/forbidden-query-params.json index b0519a8d..63ab440d 100644 --- a/src/test/resources/checks/v31/security/OAR083/forbidden-query-params.json +++ b/src/test/resources/checks/v31/security/OAR083/forbidden-query-params.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "version": "1.0.0", "title": "My API" diff --git a/src/test/resources/checks/v31/security/OAR083/forbidden-query-params.yaml b/src/test/resources/checks/v31/security/OAR083/forbidden-query-params.yaml index 1a6d9121..39c12f18 100644 --- a/src/test/resources/checks/v31/security/OAR083/forbidden-query-params.yaml +++ b/src/test/resources/checks/v31/security/OAR083/forbidden-query-params.yaml @@ -1,4 +1,4 @@ - openapi: "3.0.0" + openapi: "3.1.0" info: version: 1.0.0 title: My API diff --git a/src/test/resources/checks/v31/security/OAR083/no-parameters.json b/src/test/resources/checks/v31/security/OAR083/no-parameters.json index c4aee44f..35a232b1 100644 --- a/src/test/resources/checks/v31/security/OAR083/no-parameters.json +++ b/src/test/resources/checks/v31/security/OAR083/no-parameters.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "version": "1.0.0", "title": "My API" diff --git a/src/test/resources/checks/v31/security/OAR083/no-parameters.yaml b/src/test/resources/checks/v31/security/OAR083/no-parameters.yaml index cc4eaac0..54deb746 100644 --- a/src/test/resources/checks/v31/security/OAR083/no-parameters.yaml +++ b/src/test/resources/checks/v31/security/OAR083/no-parameters.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: My API diff --git a/src/test/resources/checks/v31/security/OAR083/null-name-param.json b/src/test/resources/checks/v31/security/OAR083/null-name-param.json index 467fc8c9..1495a5b1 100644 --- a/src/test/resources/checks/v31/security/OAR083/null-name-param.json +++ b/src/test/resources/checks/v31/security/OAR083/null-name-param.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "version": "1.0.0", "title": "My API" diff --git a/src/test/resources/checks/v31/security/OAR083/null-name-param.yaml b/src/test/resources/checks/v31/security/OAR083/null-name-param.yaml index 67ccaf06..54e5a255 100644 --- a/src/test/resources/checks/v31/security/OAR083/null-name-param.yaml +++ b/src/test/resources/checks/v31/security/OAR083/null-name-param.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: My API diff --git a/src/test/resources/checks/v31/security/OAR083/options-operation.json b/src/test/resources/checks/v31/security/OAR083/options-operation.json index f2471041..318fe28f 100644 --- a/src/test/resources/checks/v31/security/OAR083/options-operation.json +++ b/src/test/resources/checks/v31/security/OAR083/options-operation.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "version": "1.0.0", "title": "My API" diff --git a/src/test/resources/checks/v31/security/OAR083/options-operation.yaml b/src/test/resources/checks/v31/security/OAR083/options-operation.yaml index 02b2fada..c842d6c8 100644 --- a/src/test/resources/checks/v31/security/OAR083/options-operation.yaml +++ b/src/test/resources/checks/v31/security/OAR083/options-operation.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: My API diff --git a/src/test/resources/checks/v31/security/OAR083/valid-query-params.json b/src/test/resources/checks/v31/security/OAR083/valid-query-params.json index 9251c180..54fc86bd 100644 --- a/src/test/resources/checks/v31/security/OAR083/valid-query-params.json +++ b/src/test/resources/checks/v31/security/OAR083/valid-query-params.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "version": "1.0.0", "title": "My API" diff --git a/src/test/resources/checks/v31/security/OAR083/valid-query-params.yaml b/src/test/resources/checks/v31/security/OAR083/valid-query-params.yaml index 4347bb96..062797ee 100644 --- a/src/test/resources/checks/v31/security/OAR083/valid-query-params.yaml +++ b/src/test/resources/checks/v31/security/OAR083/valid-query-params.yaml @@ -1,4 +1,4 @@ - openapi: "3.0.0" + openapi: "3.1.0" info: version: 1.0.0 title: My API diff --git a/src/test/resources/checks/v31/security/OAR084/forbidden-query-formats.json b/src/test/resources/checks/v31/security/OAR084/forbidden-query-formats.json index 9b2e7f7b..16c82134 100644 --- a/src/test/resources/checks/v31/security/OAR084/forbidden-query-formats.json +++ b/src/test/resources/checks/v31/security/OAR084/forbidden-query-formats.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "version": "1.0.0", "title": "My API" diff --git a/src/test/resources/checks/v31/security/OAR084/forbidden-query-formats.yaml b/src/test/resources/checks/v31/security/OAR084/forbidden-query-formats.yaml index 892eaa69..c7369437 100644 --- a/src/test/resources/checks/v31/security/OAR084/forbidden-query-formats.yaml +++ b/src/test/resources/checks/v31/security/OAR084/forbidden-query-formats.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.0 +openapi: "3.1.0" info: version: 1.0.0 title: My API diff --git a/src/test/resources/checks/v31/security/OAR084/no-parameters.json b/src/test/resources/checks/v31/security/OAR084/no-parameters.json index dcdc8dd6..df629c67 100644 --- a/src/test/resources/checks/v31/security/OAR084/no-parameters.json +++ b/src/test/resources/checks/v31/security/OAR084/no-parameters.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "version": "1.0.0", "title": "My API" diff --git a/src/test/resources/checks/v31/security/OAR084/no-parameters.yaml b/src/test/resources/checks/v31/security/OAR084/no-parameters.yaml index cc4eaac0..54deb746 100644 --- a/src/test/resources/checks/v31/security/OAR084/no-parameters.yaml +++ b/src/test/resources/checks/v31/security/OAR084/no-parameters.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: My API diff --git a/src/test/resources/checks/v31/security/OAR084/non-query-param.json b/src/test/resources/checks/v31/security/OAR084/non-query-param.json index 2b52b6d3..386312cd 100644 --- a/src/test/resources/checks/v31/security/OAR084/non-query-param.json +++ b/src/test/resources/checks/v31/security/OAR084/non-query-param.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "version": "1.0.0", "title": "My API" diff --git a/src/test/resources/checks/v31/security/OAR084/non-query-param.yaml b/src/test/resources/checks/v31/security/OAR084/non-query-param.yaml index b9ec5900..73e94d4c 100644 --- a/src/test/resources/checks/v31/security/OAR084/non-query-param.yaml +++ b/src/test/resources/checks/v31/security/OAR084/non-query-param.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: My API diff --git a/src/test/resources/checks/v31/security/OAR084/null-format-param.json b/src/test/resources/checks/v31/security/OAR084/null-format-param.json index 8f760ba8..9f7982c8 100644 --- a/src/test/resources/checks/v31/security/OAR084/null-format-param.json +++ b/src/test/resources/checks/v31/security/OAR084/null-format-param.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "version": "1.0.0", "title": "My API" diff --git a/src/test/resources/checks/v31/security/OAR084/null-format-param.yaml b/src/test/resources/checks/v31/security/OAR084/null-format-param.yaml index dbdd4a21..20672afb 100644 --- a/src/test/resources/checks/v31/security/OAR084/null-format-param.yaml +++ b/src/test/resources/checks/v31/security/OAR084/null-format-param.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: My API diff --git a/src/test/resources/checks/v31/security/OAR084/valid-query-formats.json b/src/test/resources/checks/v31/security/OAR084/valid-query-formats.json index 9251c180..54fc86bd 100644 --- a/src/test/resources/checks/v31/security/OAR084/valid-query-formats.json +++ b/src/test/resources/checks/v31/security/OAR084/valid-query-formats.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "version": "1.0.0", "title": "My API" diff --git a/src/test/resources/checks/v31/security/OAR084/valid-query-formats.yaml b/src/test/resources/checks/v31/security/OAR084/valid-query-formats.yaml index 5a53854c..3bd175a2 100644 --- a/src/test/resources/checks/v31/security/OAR084/valid-query-formats.yaml +++ b/src/test/resources/checks/v31/security/OAR084/valid-query-formats.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.0 +openapi: "3.1.0" info: version: 1.0.0 title: My API diff --git a/src/test/resources/checks/v31/security/OAR085/invalid-openapi-version.json b/src/test/resources/checks/v31/security/OAR085/invalid-openapi-version.json index 88a6bbca..c7ccf855 100644 --- a/src/test/resources/checks/v31/security/OAR085/invalid-openapi-version.json +++ b/src/test/resources/checks/v31/security/OAR085/invalid-openapi-version.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.3", + "openapi" : "3.1.0", "info": { "title": "Sample API", "description": "This is a sample API.", diff --git a/src/test/resources/checks/v31/security/OAR085/invalid-openapi-version.yaml b/src/test/resources/checks/v31/security/OAR085/invalid-openapi-version.yaml index 9cfcd02d..a2a53635 100644 --- a/src/test/resources/checks/v31/security/OAR085/invalid-openapi-version.yaml +++ b/src/test/resources/checks/v31/security/OAR085/invalid-openapi-version.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.3 +openapi: "3.1.0" info: title: Sample API description: This is a sample API. diff --git a/src/test/resources/checks/v31/security/OAR085/valid-openapi-version.json b/src/test/resources/checks/v31/security/OAR085/valid-openapi-version.json index 0997875d..30220a58 100644 --- a/src/test/resources/checks/v31/security/OAR085/valid-openapi-version.json +++ b/src/test/resources/checks/v31/security/OAR085/valid-openapi-version.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "title": "Sample API", "description": "This is a sample API.", diff --git a/src/test/resources/checks/v31/security/OAR085/valid-openapi-version.yaml b/src/test/resources/checks/v31/security/OAR085/valid-openapi-version.yaml index ee95c7c0..a2a53635 100644 --- a/src/test/resources/checks/v31/security/OAR085/valid-openapi-version.yaml +++ b/src/test/resources/checks/v31/security/OAR085/valid-openapi-version.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.0 +openapi: "3.1.0" info: title: Sample API description: This is a sample API. diff --git a/src/test/resources/checks/v31/security/OAR096/valid.json b/src/test/resources/checks/v31/security/OAR096/valid.json index c45fbe9a..09460094 100644 --- a/src/test/resources/checks/v31/security/OAR096/valid.json +++ b/src/test/resources/checks/v31/security/OAR096/valid.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v31/security/OAR096/valid.yaml b/src/test/resources/checks/v31/security/OAR096/valid.yaml index 4ada663f..ff056dea 100644 --- a/src/test/resources/checks/v31/security/OAR096/valid.yaml +++ b/src/test/resources/checks/v31/security/OAR096/valid.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/security/OAR096/without-authorization-responses.json b/src/test/resources/checks/v31/security/OAR096/without-authorization-responses.json index 4fa2d839..eafd7b70 100644 --- a/src/test/resources/checks/v31/security/OAR096/without-authorization-responses.json +++ b/src/test/resources/checks/v31/security/OAR096/without-authorization-responses.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v31/security/OAR096/without-authorization-responses.yaml b/src/test/resources/checks/v31/security/OAR096/without-authorization-responses.yaml index 45b6d2e7..1c193c85 100644 --- a/src/test/resources/checks/v31/security/OAR096/without-authorization-responses.yaml +++ b/src/test/resources/checks/v31/security/OAR096/without-authorization-responses.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v31/security/OAR114/valid.json b/src/test/resources/checks/v31/security/OAR114/valid.json index 79d9c816..bb6c4fef 100644 --- a/src/test/resources/checks/v31/security/OAR114/valid.json +++ b/src/test/resources/checks/v31/security/OAR114/valid.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "title": "Valid Response Headers Test", "version": "1.0" diff --git a/src/test/resources/checks/v31/security/OAR114/valid.yaml b/src/test/resources/checks/v31/security/OAR114/valid.yaml index 8c936a19..ebf4dc89 100644 --- a/src/test/resources/checks/v31/security/OAR114/valid.yaml +++ b/src/test/resources/checks/v31/security/OAR114/valid.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.0 +openapi: "3.1.0" info: title: Valid Response Headers Test version: "1.0" diff --git a/src/test/resources/checks/v31/security/OAR114/with-forbidden-params.json b/src/test/resources/checks/v31/security/OAR114/with-forbidden-params.json index 975318bc..ce5661ff 100644 --- a/src/test/resources/checks/v31/security/OAR114/with-forbidden-params.json +++ b/src/test/resources/checks/v31/security/OAR114/with-forbidden-params.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "title": "Forbidden Header Test", "version": "1.0" diff --git a/src/test/resources/checks/v31/security/OAR114/with-forbidden-params.yaml b/src/test/resources/checks/v31/security/OAR114/with-forbidden-params.yaml index 4f2c2bc7..0922909e 100644 --- a/src/test/resources/checks/v31/security/OAR114/with-forbidden-params.yaml +++ b/src/test/resources/checks/v31/security/OAR114/with-forbidden-params.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.0 +openapi: "3.1.0" info: title: Forbidden Header Test version: "1.0" diff --git a/src/test/resources/checks/v31/security/OAR114/without-required-params.json b/src/test/resources/checks/v31/security/OAR114/without-required-params.json index 876746f3..f765239e 100644 --- a/src/test/resources/checks/v31/security/OAR114/without-required-params.json +++ b/src/test/resources/checks/v31/security/OAR114/without-required-params.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.1.0", "info": { "title": "Missing Mandatory Header Test", "version": "1.0" diff --git a/src/test/resources/checks/v31/security/OAR114/without-required-params.yaml b/src/test/resources/checks/v31/security/OAR114/without-required-params.yaml index 5603c561..b06bf009 100644 --- a/src/test/resources/checks/v31/security/OAR114/without-required-params.yaml +++ b/src/test/resources/checks/v31/security/OAR114/without-required-params.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.0 +openapi: "3.1.0" info: title: Missing Mandatory Header Test version: "1.0" diff --git a/src/test/resources/checks/v32/apim/OAR002/with-empty-scopes.json b/src/test/resources/checks/v32/apim/OAR002/with-empty-scopes.json new file mode 100644 index 00000000..6d641114 --- /dev/null +++ b/src/test/resources/checks/v32/apim/OAR002/with-empty-scopes.json @@ -0,0 +1,15 @@ +{ + "openapi" : "3.2.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/pets" : { } + }, + "x-wso2-security" : { + "apim" : { + "x-wso2-scopes" : [ ] # Noncompliant {{OAR002: WSO2 scopes definition is wrong}} + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/apim/OAR002/with-empty-scopes.yaml b/src/test/resources/checks/v32/apim/OAR002/with-empty-scopes.yaml new file mode 100644 index 00000000..ba7361a2 --- /dev/null +++ b/src/test/resources/checks/v32/apim/OAR002/with-empty-scopes.yaml @@ -0,0 +1,10 @@ +openapi: "3.2.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: {} + +x-wso2-security: + apim: + x-wso2-scopes: [] # Noncompliant {{OAR002: WSO2 scopes definition is wrong}} \ No newline at end of file diff --git a/src/test/resources/checks/v32/apim/OAR002/with-null-scopes.json b/src/test/resources/checks/v32/apim/OAR002/with-null-scopes.json new file mode 100644 index 00000000..908f4d15 --- /dev/null +++ b/src/test/resources/checks/v32/apim/OAR002/with-null-scopes.json @@ -0,0 +1,15 @@ +{ + "openapi" : "3.2.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/pets" : { } + }, + "x-wso2-security" : { + "apim" : { + "x-wso2-scopes" : null # Noncompliant {{OAR002: WSO2 scopes definition is wrong}} + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/apim/OAR002/with-null-scopes.yaml b/src/test/resources/checks/v32/apim/OAR002/with-null-scopes.yaml new file mode 100644 index 00000000..7a4f6a37 --- /dev/null +++ b/src/test/resources/checks/v32/apim/OAR002/with-null-scopes.yaml @@ -0,0 +1,10 @@ +openapi: "3.2.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: {} + +x-wso2-security: + apim: + x-wso2-scopes: null # Noncompliant {{OAR002: WSO2 scopes definition is wrong}} \ No newline at end of file diff --git a/src/test/resources/checks/v32/apim/OAR002/with-scopes.json b/src/test/resources/checks/v32/apim/OAR002/with-scopes.json new file mode 100644 index 00000000..b5574cef --- /dev/null +++ b/src/test/resources/checks/v32/apim/OAR002/with-scopes.json @@ -0,0 +1,36 @@ +{ + "openapi" : "3.2.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/pets" : { } + }, + "x-wso2-security" : { + "apim" : { + "x-wso2-scopes" : [ { # Noncompliant {{OAR002: WSO2 scope 'key' is required}} + "name" : "read", + "roles" : "ROLE_READ" + }, { # Noncompliant {{OAR002: WSO2 scope 'roles' is required}} + "name" : "write", + "key" : "write" + }, { # Noncompliant {{OAR002: WSO2 scope 'name' is required}} + "key" : "view", + "roles" : "ROLE_VIEW" + }, { + "name" : "read2", + "roles" : "ROLE_READ_2", + "key" : null # Noncompliant {{OAR002: WSO2 scope 'key' is required}} + }, { + "name" : "write2", + "key" : "write2", + "roles" : null # Noncompliant {{OAR002: WSO2 scope 'roles' is required}} + }, { + "key" : "view2", + "roles" : "ROLE_VIEW_2", + "name" : null # Noncompliant {{OAR002: WSO2 scope 'name' is required}} + } ] + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/apim/OAR002/with-scopes.yaml b/src/test/resources/checks/v32/apim/OAR002/with-scopes.yaml new file mode 100644 index 00000000..c853ee55 --- /dev/null +++ b/src/test/resources/checks/v32/apim/OAR002/with-scopes.yaml @@ -0,0 +1,25 @@ +openapi: "3.2.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: {} + +x-wso2-security: + apim: + x-wso2-scopes: + - name: read # Noncompliant {{OAR002: WSO2 scope 'key' is required}} + roles: ROLE_READ + - name: write # Noncompliant {{OAR002: WSO2 scope 'roles' is required}} + key: write + - key: view # Noncompliant {{OAR002: WSO2 scope 'name' is required}} + roles: ROLE_VIEW + - name: read2 + roles: ROLE_READ_2 + key: null # Noncompliant {{OAR002: WSO2 scope 'key' is required}} + - name: write2 + key: write2 + roles: null # Noncompliant {{OAR002: WSO2 scope 'roles' is required}} + - key: view2 + roles: ROLE_VIEW_2 + name: null # Noncompliant {{OAR002: WSO2 scope 'name' is required}} \ No newline at end of file diff --git a/src/test/resources/checks/v32/apim/OAR002/without-scopes.json b/src/test/resources/checks/v32/apim/OAR002/without-scopes.json new file mode 100644 index 00000000..56132180 --- /dev/null +++ b/src/test/resources/checks/v32/apim/OAR002/without-scopes.json @@ -0,0 +1,13 @@ +{ + "openapi" : "3.2.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/pets" : { } + }, + "x-wso2-security" : { + "apim" : null + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/apim/OAR002/without-scopes.yaml b/src/test/resources/checks/v32/apim/OAR002/without-scopes.yaml new file mode 100644 index 00000000..75f25193 --- /dev/null +++ b/src/test/resources/checks/v32/apim/OAR002/without-scopes.yaml @@ -0,0 +1,9 @@ +openapi: "3.2.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: {} + +x-wso2-security: + apim: null \ No newline at end of file diff --git a/src/test/resources/checks/v32/apim/OAR002/without-security.json b/src/test/resources/checks/v32/apim/OAR002/without-security.json new file mode 100644 index 00000000..8e69c573 --- /dev/null +++ b/src/test/resources/checks/v32/apim/OAR002/without-security.json @@ -0,0 +1,10 @@ +{ + "openapi" : "3.2.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/pets" : { } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/apim/OAR002/without-security.yaml b/src/test/resources/checks/v32/apim/OAR002/without-security.yaml new file mode 100644 index 00000000..79b0852a --- /dev/null +++ b/src/test/resources/checks/v32/apim/OAR002/without-security.yaml @@ -0,0 +1,6 @@ +openapi: "3.2.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: {} \ No newline at end of file diff --git a/src/test/resources/checks/v32/apim/OAR003/with-description.json b/src/test/resources/checks/v32/apim/OAR003/with-description.json new file mode 100644 index 00000000..2af641e7 --- /dev/null +++ b/src/test/resources/checks/v32/apim/OAR003/with-description.json @@ -0,0 +1,20 @@ +{ + "openapi" : "3.2.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/pets" : { } + }, + "x-wso2-security" : { + "apim" : { + "x-wso2-scopes" : [ { + "name" : "read", + "key" : "read", + "roles" : "ROLE_READ", + "description" : "Allows users to read records" + } ] + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/apim/OAR003/with-description.yaml b/src/test/resources/checks/v32/apim/OAR003/with-description.yaml new file mode 100644 index 00000000..7b9e69d6 --- /dev/null +++ b/src/test/resources/checks/v32/apim/OAR003/with-description.yaml @@ -0,0 +1,14 @@ +openapi: "3.2.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: {} + +x-wso2-security: + apim: + x-wso2-scopes: + - name: read + key: read + roles: ROLE_READ + description: Allows users to read records \ No newline at end of file diff --git a/src/test/resources/checks/v32/apim/OAR003/with-null-description.json b/src/test/resources/checks/v32/apim/OAR003/with-null-description.json new file mode 100644 index 00000000..5c8b8501 --- /dev/null +++ b/src/test/resources/checks/v32/apim/OAR003/with-null-description.json @@ -0,0 +1,20 @@ +{ + "openapi" : "3.2.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/pets" : { } + }, + "x-wso2-security" : { + "apim" : { + "x-wso2-scopes" : [ { + "name" : "read", + "key" : "read", + "roles" : "ROLE_READ", + "description" : null # Noncompliant {{OAR003: WSO2 scope 'description' is recommended}} + } ] + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/apim/OAR003/with-null-description.yaml b/src/test/resources/checks/v32/apim/OAR003/with-null-description.yaml new file mode 100644 index 00000000..74460897 --- /dev/null +++ b/src/test/resources/checks/v32/apim/OAR003/with-null-description.yaml @@ -0,0 +1,14 @@ +openapi: "3.2.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: {} + +x-wso2-security: + apim: + x-wso2-scopes: + - name: read + key: read + roles: ROLE_READ + description: null # Noncompliant {{OAR003: WSO2 scope 'description' is recommended}} \ No newline at end of file diff --git a/src/test/resources/checks/v32/apim/OAR003/without-description.json b/src/test/resources/checks/v32/apim/OAR003/without-description.json new file mode 100644 index 00000000..5e529018 --- /dev/null +++ b/src/test/resources/checks/v32/apim/OAR003/without-description.json @@ -0,0 +1,19 @@ +{ + "openapi" : "3.2.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/pets" : { } + }, + "x-wso2-security" : { + "apim" : { + "x-wso2-scopes" : [ { # Noncompliant {{OAR003: WSO2 scope 'description' is recommended}} + "name" : "read", + "key" : "read", + "roles" : "ROLE_READ" + } ] + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/apim/OAR003/without-description.yaml b/src/test/resources/checks/v32/apim/OAR003/without-description.yaml new file mode 100644 index 00000000..66f7ac73 --- /dev/null +++ b/src/test/resources/checks/v32/apim/OAR003/without-description.yaml @@ -0,0 +1,13 @@ +openapi: "3.2.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: {} + +x-wso2-security: + apim: + x-wso2-scopes: + - name: read # Noncompliant {{OAR003: WSO2 scope 'description' is recommended}} + key: read + roles: ROLE_READ \ No newline at end of file diff --git a/src/test/resources/checks/v32/apim/OAR004/with-invalid-roles.json b/src/test/resources/checks/v32/apim/OAR004/with-invalid-roles.json new file mode 100644 index 00000000..629afce2 --- /dev/null +++ b/src/test/resources/checks/v32/apim/OAR004/with-invalid-roles.json @@ -0,0 +1,20 @@ +{ + "openapi" : "3.2.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/pets" : { } + }, + "x-wso2-security" : { + "apim" : { + "x-wso2-scopes" : [ { + "name" : "read", + "key" : "read", + "roles" : "ROLE_READ, ROL€_V¡€U", # Noncompliant {{OAR004: WSO2 scope roles value is not valid}} + "description" : "Allows users to read records" + } ] + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/apim/OAR004/with-invalid-roles.yaml b/src/test/resources/checks/v32/apim/OAR004/with-invalid-roles.yaml new file mode 100644 index 00000000..e768acea --- /dev/null +++ b/src/test/resources/checks/v32/apim/OAR004/with-invalid-roles.yaml @@ -0,0 +1,14 @@ +openapi: "3.2.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: {} + +x-wso2-security: + apim: + x-wso2-scopes: + - name: read + key: read + roles: ROLE_READ, ROL€_V¡€U # Noncompliant {{OAR004: WSO2 scope roles value is not valid}} + description: Allows users to read records \ No newline at end of file diff --git a/src/test/resources/checks/v32/apim/OAR004/with-valid-roles.json b/src/test/resources/checks/v32/apim/OAR004/with-valid-roles.json new file mode 100644 index 00000000..4529ea9c --- /dev/null +++ b/src/test/resources/checks/v32/apim/OAR004/with-valid-roles.json @@ -0,0 +1,20 @@ +{ + "openapi" : "3.2.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/pets" : { } + }, + "x-wso2-security" : { + "apim" : { + "x-wso2-scopes" : [ { + "name" : "read", + "key" : "read", + "roles" : "ROLE_READ, ROLE_VIEW", + "description" : "Allows users to read records" + } ] + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/apim/OAR004/with-valid-roles.yaml b/src/test/resources/checks/v32/apim/OAR004/with-valid-roles.yaml new file mode 100644 index 00000000..d53bf3ed --- /dev/null +++ b/src/test/resources/checks/v32/apim/OAR004/with-valid-roles.yaml @@ -0,0 +1,14 @@ +openapi: "3.2.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: {} + +x-wso2-security: + apim: + x-wso2-scopes: + - name: read + key: read + roles: ROLE_READ, ROLE_VIEW + description: Allows users to read records \ No newline at end of file diff --git a/src/test/resources/checks/v32/apim/OAR005/with-correct-operation-scope.json b/src/test/resources/checks/v32/apim/OAR005/with-correct-operation-scope.json new file mode 100644 index 00000000..577f79bb --- /dev/null +++ b/src/test/resources/checks/v32/apim/OAR005/with-correct-operation-scope.json @@ -0,0 +1,34 @@ +{ + "openapi" : "3.2.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/pets" : { + "get" : { + "responses" : { + "200" : { + "description" : "Ok" + } + }, + "x-scope" : "scope_two" + } + } + }, + "x-wso2-security" : { + "apim" : { + "x-wso2-scopes" : [ { + "name" : "scope_one", + "description" : "scope_one", + "key" : "scope_one", + "roles" : "role_one" + }, { + "name" : "scope_two", + "description" : "scope_two", + "key" : "scope_two", + "roles" : "role_two" + } ] + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/apim/OAR005/with-correct-operation-scope.yaml b/src/test/resources/checks/v32/apim/OAR005/with-correct-operation-scope.yaml new file mode 100644 index 00000000..76ddb4b8 --- /dev/null +++ b/src/test/resources/checks/v32/apim/OAR005/with-correct-operation-scope.yaml @@ -0,0 +1,23 @@ +openapi: "3.2.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: + get: + responses: + 200: + description: Ok + x-scope: scope_two + +x-wso2-security: + apim: + x-wso2-scopes: + - name: scope_one + description: scope_one + key: scope_one + roles: role_one + - name: scope_two + description: scope_two + key: scope_two + roles: role_two \ No newline at end of file diff --git a/src/test/resources/checks/v32/apim/OAR005/with-null-operation-scope.json b/src/test/resources/checks/v32/apim/OAR005/with-null-operation-scope.json new file mode 100644 index 00000000..67db4f6a --- /dev/null +++ b/src/test/resources/checks/v32/apim/OAR005/with-null-operation-scope.json @@ -0,0 +1,34 @@ +{ + "openapi" : "3.2.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/pets" : { + "get" : { + "responses" : { + "200" : { + "description" : "Ok" + } + }, + "x-scope" : null # Noncompliant {{OAR005: WSO2 scope definition does not exists}} + } + } + }, + "x-wso2-security" : { + "apim" : { + "x-wso2-scopes" : [ { + "name" : "scope_one", + "description" : "scope_one", + "key" : "scope_one", + "roles" : "role_one" + }, { + "name" : "scope_two", + "description" : "scope_two", + "key" : "scope_two", + "roles" : "role_two" + } ] + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/apim/OAR005/with-null-operation-scope.yaml b/src/test/resources/checks/v32/apim/OAR005/with-null-operation-scope.yaml new file mode 100644 index 00000000..90fcef4d --- /dev/null +++ b/src/test/resources/checks/v32/apim/OAR005/with-null-operation-scope.yaml @@ -0,0 +1,23 @@ +openapi: "3.2.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: + get: + responses: + 200: + description: Ok + x-scope: null # Noncompliant {{OAR005: WSO2 scope definition does not exists}} + +x-wso2-security: + apim: + x-wso2-scopes: + - name: scope_one + description: scope_one + key: scope_one + roles: role_one + - name: scope_two + description: scope_two + key: scope_two + roles: role_two \ No newline at end of file diff --git a/src/test/resources/checks/v32/apim/OAR005/with-wrong-operation-scope.json b/src/test/resources/checks/v32/apim/OAR005/with-wrong-operation-scope.json new file mode 100644 index 00000000..b65690cf --- /dev/null +++ b/src/test/resources/checks/v32/apim/OAR005/with-wrong-operation-scope.json @@ -0,0 +1,34 @@ +{ + "openapi" : "3.2.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/pets" : { + "get" : { + "responses" : { + "200" : { + "description" : "Ok" + } + }, + "x-scope" : "scope_five" # Noncompliant {{OAR005: WSO2 scope definition does not exists}} + } + } + }, + "x-wso2-security" : { + "apim" : { + "x-wso2-scopes" : [ { + "name" : "scope_one", + "description" : "scope_one", + "key" : "scope_one", + "roles" : "role_one" + }, { + "name" : "scope_two", + "description" : "scope_two", + "key" : "scope_two", + "roles" : "role_two, role_x" + } ] + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/apim/OAR005/with-wrong-operation-scope.yaml b/src/test/resources/checks/v32/apim/OAR005/with-wrong-operation-scope.yaml new file mode 100644 index 00000000..fe9139f5 --- /dev/null +++ b/src/test/resources/checks/v32/apim/OAR005/with-wrong-operation-scope.yaml @@ -0,0 +1,23 @@ +openapi: "3.2.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: + get: + responses: + 200: + description: Ok + x-scope: scope_five # Noncompliant {{OAR005: WSO2 scope definition does not exists}} + +x-wso2-security: + apim: + x-wso2-scopes: + - name: scope_one + description: scope_one + key: scope_one + roles: role_one + - name: scope_two + description: scope_two + key: scope_two + roles: role_two, role_x \ No newline at end of file diff --git a/src/test/resources/checks/v32/apim/OAR040/invalid.json b/src/test/resources/checks/v32/apim/OAR040/invalid.json new file mode 100644 index 00000000..2f56af18 --- /dev/null +++ b/src/test/resources/checks/v32/apim/OAR040/invalid.json @@ -0,0 +1,23 @@ +{ + "openapi" : "3.2.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/pets" : { } + }, + "x-wso2-security" : { + "apim" : { + "x-wso2-scopes" : [ { + "name" : "app" # Noncompliant {{OAR040: WSO2 scope name value is non compliant with the standard}} + }, { + "name" : "app1_sc_ran" # Noncompliant {{OAR040: WSO2 scope name value is non compliant with the standard}} + }, { + "name" : "GENE_Sc_ran" # Noncompliant {{OAR040: WSO2 scope name value is non compliant with the standard}} + }, { + "name" : "X_SC_A" # Noncompliant {{OAR040: WSO2 scope name value is non compliant with the standard}} + } ] + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/apim/OAR040/invalid.yaml b/src/test/resources/checks/v32/apim/OAR040/invalid.yaml new file mode 100644 index 00000000..177ea034 --- /dev/null +++ b/src/test/resources/checks/v32/apim/OAR040/invalid.yaml @@ -0,0 +1,14 @@ +openapi: "3.2.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: {} + +x-wso2-security: + apim: + x-wso2-scopes: + - name: app # Noncompliant {{OAR040: WSO2 scope name value is non compliant with the standard}} + - name: app1_sc_ran # Noncompliant {{OAR040: WSO2 scope name value is non compliant with the standard}} + - name: GENE_Sc_ran # Noncompliant {{OAR040: WSO2 scope name value is non compliant with the standard}} + - name: X_SC_A # Noncompliant {{OAR040: WSO2 scope name value is non compliant with the standard}} \ No newline at end of file diff --git a/src/test/resources/checks/v32/apim/OAR040/valid.json b/src/test/resources/checks/v32/apim/OAR040/valid.json new file mode 100644 index 00000000..05949043 --- /dev/null +++ b/src/test/resources/checks/v32/apim/OAR040/valid.json @@ -0,0 +1,19 @@ +{ + "openapi" : "3.2.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/pets" : { } + }, + "x-wso2-security" : { + "apim" : { + "x-wso2-scopes" : [ { + "name" : "xfcn_sc_1" + }, { + "name" : "GENGA_SC_RE1" + } ] + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/apim/OAR040/valid.yaml b/src/test/resources/checks/v32/apim/OAR040/valid.yaml new file mode 100644 index 00000000..58747996 --- /dev/null +++ b/src/test/resources/checks/v32/apim/OAR040/valid.yaml @@ -0,0 +1,12 @@ +openapi: "3.2.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: {} + +x-wso2-security: + apim: + x-wso2-scopes: + - name: xfcn_sc_1 + - name: GENGA_SC_RE1 \ No newline at end of file diff --git a/src/test/resources/checks/v32/apim/OAR041/with-scope-and-auth.json b/src/test/resources/checks/v32/apim/OAR041/with-scope-and-auth.json new file mode 100644 index 00000000..5eb6d369 --- /dev/null +++ b/src/test/resources/checks/v32/apim/OAR041/with-scope-and-auth.json @@ -0,0 +1,35 @@ +{ + "openapi" : "3.2.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/pets" : { + "get" : { + "responses" : { + "200" : { + "description" : "Ok" + } + }, + "x-scope" : "scope_two", + "x-auth-type" : "Application" + } + } + }, + "x-wso2-security" : { + "apim" : { + "x-wso2-scopes" : [ { + "name" : "scope_one", + "description" : "scope_one", + "key" : "scope_one", + "roles" : "role_one" + }, { + "name" : "scope_two", + "description" : "scope_two", + "key" : "scope_two", + "roles" : "role_two" + } ] + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/apim/OAR041/with-scope-and-auth.yaml b/src/test/resources/checks/v32/apim/OAR041/with-scope-and-auth.yaml new file mode 100644 index 00000000..75d6f9f9 --- /dev/null +++ b/src/test/resources/checks/v32/apim/OAR041/with-scope-and-auth.yaml @@ -0,0 +1,24 @@ +openapi: "3.2.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: + get: + responses: + 200: + description: Ok + x-scope: scope_two + x-auth-type: "Application" + +x-wso2-security: + apim: + x-wso2-scopes: + - name: scope_one + description: scope_one + key: scope_one + roles: role_one + - name: scope_two + description: scope_two + key: scope_two + roles: role_two \ No newline at end of file diff --git a/src/test/resources/checks/v32/apim/OAR041/with-scope-without-auth.json b/src/test/resources/checks/v32/apim/OAR041/with-scope-without-auth.json new file mode 100644 index 00000000..8b8048e4 --- /dev/null +++ b/src/test/resources/checks/v32/apim/OAR041/with-scope-without-auth.json @@ -0,0 +1,34 @@ +{ + "openapi" : "3.2.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/pets" : { + "get" : { + "responses" : { + "200" : { + "description" : "Ok" + } + }, + "x-scope" : "scope_two" # Noncompliant {{OAR041: WSO2 x-scope requires x-auth-type definition}} + } + } + }, + "x-wso2-security" : { + "apim" : { + "x-wso2-scopes" : [ { + "name" : "scope_one", + "description" : "scope_one", + "key" : "scope_one", + "roles" : "role_one" + }, { + "name" : "scope_two", + "description" : "scope_two", + "key" : "scope_two", + "roles" : "role_two" + } ] + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/apim/OAR041/with-scope-without-auth.yaml b/src/test/resources/checks/v32/apim/OAR041/with-scope-without-auth.yaml new file mode 100644 index 00000000..da723b86 --- /dev/null +++ b/src/test/resources/checks/v32/apim/OAR041/with-scope-without-auth.yaml @@ -0,0 +1,23 @@ +openapi: "3.2.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: + get: + responses: + 200: + description: Ok + x-scope: scope_two # Noncompliant {{OAR041: WSO2 x-scope requires x-auth-type definition}} + +x-wso2-security: + apim: + x-wso2-scopes: + - name: scope_one + description: scope_one + key: scope_one + roles: role_one + - name: scope_two + description: scope_two + key: scope_two + roles: role_two \ No newline at end of file diff --git a/src/test/resources/checks/v32/apim/OAR041/without-scope-and-auth.json b/src/test/resources/checks/v32/apim/OAR041/without-scope-and-auth.json new file mode 100644 index 00000000..c362314d --- /dev/null +++ b/src/test/resources/checks/v32/apim/OAR041/without-scope-and-auth.json @@ -0,0 +1,33 @@ +{ + "openapi" : "3.2.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/pets" : { + "get" : { + "responses" : { + "200" : { + "description" : "Ok" + } + } + } + } + }, + "x-wso2-security" : { + "apim" : { + "x-wso2-scopes" : [ { + "name" : "scope_one", + "description" : "scope_one", + "key" : "scope_one", + "roles" : "role_one" + }, { + "name" : "scope_two", + "description" : "scope_two", + "key" : "scope_two", + "roles" : "role_two" + } ] + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/apim/OAR041/without-scope-and-auth.yaml b/src/test/resources/checks/v32/apim/OAR041/without-scope-and-auth.yaml new file mode 100644 index 00000000..587a48e8 --- /dev/null +++ b/src/test/resources/checks/v32/apim/OAR041/without-scope-and-auth.yaml @@ -0,0 +1,22 @@ +openapi: "3.2.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: + get: + responses: + 200: + description: Ok + +x-wso2-security: + apim: + x-wso2-scopes: + - name: scope_one + description: scope_one + key: scope_one + roles: role_one + - name: scope_two + description: scope_two + key: scope_two + roles: role_two \ No newline at end of file diff --git a/src/test/resources/checks/v32/core/OAR044/media-type.json b/src/test/resources/checks/v32/core/OAR044/media-type.json index 992ea7bd..517db4d8 100644 --- a/src/test/resources/checks/v32/core/OAR044/media-type.json +++ b/src/test/resources/checks/v32/core/OAR044/media-type.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.1", + "openapi" : "3.2.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v32/core/OAR044/media-type.yaml b/src/test/resources/checks/v32/core/OAR044/media-type.yaml index 80aba718..22b32de1 100644 --- a/src/test/resources/checks/v32/core/OAR044/media-type.yaml +++ b/src/test/resources/checks/v32/core/OAR044/media-type.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.1" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/core/OAR045/defined-response.json b/src/test/resources/checks/v32/core/OAR045/defined-response.json index f86d6ac4..b19ef64b 100644 --- a/src/test/resources/checks/v32/core/OAR045/defined-response.json +++ b/src/test/resources/checks/v32/core/OAR045/defined-response.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v32/core/OAR045/defined-response.yaml b/src/test/resources/checks/v32/core/OAR045/defined-response.yaml index 4370ac6c..14f08cea 100644 --- a/src/test/resources/checks/v32/core/OAR045/defined-response.yaml +++ b/src/test/resources/checks/v32/core/OAR045/defined-response.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.0 +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/core/OAR046/declared-tag.json b/src/test/resources/checks/v32/core/OAR046/declared-tag.json index 82549a89..e21e1581 100644 --- a/src/test/resources/checks/v32/core/OAR046/declared-tag.json +++ b/src/test/resources/checks/v32/core/OAR046/declared-tag.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.1", + "openapi" : "3.2.0", "tags" : [ { "name" : "used-tag", "description" : "a tag referenced in the operations" diff --git a/src/test/resources/checks/v32/core/OAR046/declared-tag.yaml b/src/test/resources/checks/v32/core/OAR046/declared-tag.yaml index 2bf092e6..060d6d42 100644 --- a/src/test/resources/checks/v32/core/OAR046/declared-tag.yaml +++ b/src/test/resources/checks/v32/core/OAR046/declared-tag.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.1" +openapi: "3.2.0" tags: - name: used-tag description: a tag referenced in the operations diff --git a/src/test/resources/checks/v32/core/OAR047/documented-tag.json b/src/test/resources/checks/v32/core/OAR047/documented-tag.json index 12326a3a..cf201de0 100644 --- a/src/test/resources/checks/v32/core/OAR047/documented-tag.json +++ b/src/test/resources/checks/v32/core/OAR047/documented-tag.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.1", + "openapi" : "3.2.0", "tags" : [ { "name" : "used-tag", "description" : "a tag referenced in the operations" diff --git a/src/test/resources/checks/v32/core/OAR047/documented-tag.yaml b/src/test/resources/checks/v32/core/OAR047/documented-tag.yaml index 197ffd50..dff72922 100644 --- a/src/test/resources/checks/v32/core/OAR047/documented-tag.yaml +++ b/src/test/resources/checks/v32/core/OAR047/documented-tag.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.1" +openapi: "3.2.0" tags: - name: used-tag description: a tag referenced in the operations diff --git a/src/test/resources/checks/v32/core/OAR049/no-content-in-204.json b/src/test/resources/checks/v32/core/OAR049/no-content-in-204.json index c27c9ad6..a8697a7e 100644 --- a/src/test/resources/checks/v32/core/OAR049/no-content-in-204.json +++ b/src/test/resources/checks/v32/core/OAR049/no-content-in-204.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.1", + "openapi" : "3.2.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v32/core/OAR049/no-content-in-204.yaml b/src/test/resources/checks/v32/core/OAR049/no-content-in-204.yaml index 8567c679..a88e34a7 100644 --- a/src/test/resources/checks/v32/core/OAR049/no-content-in-204.yaml +++ b/src/test/resources/checks/v32/core/OAR049/no-content-in-204.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.1" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/core/OAR050/provide-summary.json b/src/test/resources/checks/v32/core/OAR050/provide-summary.json index a5b45a2a..c1387e0c 100644 --- a/src/test/resources/checks/v32/core/OAR050/provide-summary.json +++ b/src/test/resources/checks/v32/core/OAR050/provide-summary.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.1", + "openapi" : "3.2.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v32/core/OAR050/provide-summary.yaml b/src/test/resources/checks/v32/core/OAR050/provide-summary.yaml index 8d19ba90..62b1a87e 100644 --- a/src/test/resources/checks/v32/core/OAR050/provide-summary.yaml +++ b/src/test/resources/checks/v32/core/OAR050/provide-summary.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.1" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/core/OAR051/different-description.json b/src/test/resources/checks/v32/core/OAR051/different-description.json index 784c6b8b..652c891f 100644 --- a/src/test/resources/checks/v32/core/OAR051/different-description.json +++ b/src/test/resources/checks/v32/core/OAR051/different-description.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.1", + "openapi" : "3.2.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v32/core/OAR051/different-description.yaml b/src/test/resources/checks/v32/core/OAR051/different-description.yaml index 600efaff..645dfc1f 100644 --- a/src/test/resources/checks/v32/core/OAR051/different-description.yaml +++ b/src/test/resources/checks/v32/core/OAR051/different-description.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.1" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/examples/OAR031/externalref.yaml b/src/test/resources/checks/v32/examples/OAR031/externalref.yaml new file mode 100644 index 00000000..126feb8a --- /dev/null +++ b/src/test/resources/checks/v32/examples/OAR031/externalref.yaml @@ -0,0 +1,68 @@ +openapi: "3.2.0" +info: + title: Example API + description: This is a basic example of an OpenAPI document. + version: 1.0.0 +servers: + - url: https://api.example.com/v1 + description: Main (production) server + - url: https://api.staging.example.com + description: Staging server +paths: + /users: + get: + summary: Get all users + description: Returns a list of users. + responses: + '200': + description: A JSON array of user objects + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/User' + '400': + $ref: >- # Noncompliant {{OAR031: Responses must have one or more examples defined}} + http://localhost:18089/OAR031.yaml#/components/responses/server_error_response + /users/{userId}: + get: + summary: Get a user by ID + description: Returns a single user. + parameters: + - name: userId + in: path + required: true + description: The ID of the user to retrieve + schema: + type: string + example: + name: Puppy + type: dog + responses: + '200': + description: A single user object + content: + application/json: + schema: + $ref: '#/components/schemas/User' + '400': + $ref: >- # Noncompliant {{OAR031: Responses must have one or more examples defined}} + http://localhost:18089/OAR031.yaml#/components/responses/server_error_response +components: + schemas: + User: + type: object + required: + - id + - name + properties: + id: + type: string + example: '12345' + name: + type: string + example: 'John Doe' + email: + type: string + example: 'john.doe@example.com' diff --git a/src/test/resources/checks/v32/examples/OAR031/nested-properties-examples.yaml b/src/test/resources/checks/v32/examples/OAR031/nested-properties-examples.yaml new file mode 100644 index 00000000..34233555 --- /dev/null +++ b/src/test/resources/checks/v32/examples/OAR031/nested-properties-examples.yaml @@ -0,0 +1,39 @@ +openapi: "3.2.0" +info: + title: OAR031 Nested Examples + version: 1.0.0 +paths: + /profile: + put: + summary: Update user profile + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + email: + type: string + example: "apellido@madrid.org" + telefono_fijo: + type: string + example: "600345345" + direccion: + type: object + properties: + calle: + type: string + example: "Calle Indeterminada, 18" + localidad: + type: string + example: "Madrid" + provincia: + type: string + example: "Madrid" + codigo_postal: + type: string + example: "28001" + responses: + '200': # Noncompliant {{OAR031: Responses must have one or more examples defined}} + description: OK \ No newline at end of file diff --git a/src/test/resources/checks/v32/examples/OAR031/valid.json b/src/test/resources/checks/v32/examples/OAR031/valid.json new file mode 100644 index 00000000..a63ef7d1 --- /dev/null +++ b/src/test/resources/checks/v32/examples/OAR031/valid.json @@ -0,0 +1,170 @@ +{ + "openapi": "3.2.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/pets": { + "post": { + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/pet" + }, + "example": { + "name": "Puppy", + "type": "dog" + } + } + } + }, + "responses": { + "201": { + "description": "Pet list", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/pet" + }, + "example": { + "name": "Puppy", + "type": "dog" + } + } + } + }, + "default": { + "$ref": "#/components/responses/server_error_response" + } + } + }, + "get": { + "responses": { + "206": { + "description": "Pet created", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/pets" + }, + "example": { + "size": 2, + "pets": [ + { + "name": "Fluffy", + "type": "cat" + }, + { + "name": "Sparky", + "type": "dog" + } + ] + } + } + } + }, + "default": { + "$ref": "#/components/responses/server_error_response" + } + } + } + }, + "/pets/{id}": { + "get": { + "parameters": [ + { + "$ref": "#/components/parameters/id" + } + ], + "responses": { + "200": { + "description": "One pet", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/pet" + }, + "example": { + "name": "Fluffy", + "type": "cat" + } + } + } + }, + "default": { + "$ref": "#/components/responses/server_error_response" + } + } + } + } + }, + "components": { + "parameters": { + "id": { + "in": "path", + "name": "id", + "schema": { + "type": "integer", + "format": "int64", + "maxLength": 22 + }, + "description": "Identificador del tipo de centro a obtener, actualizar o eliminar.", + "required": true, + "example": 513168138 + } + }, + "schemas": { + "pet": { + "type": "object", + "properties": { + "name": { + "type": "string", + "example": "Snow" + }, + "type": { + "type": "string", + "example": "dog" + } + } + }, + "pets": { + "type": "object", + "properties": { + "size": { + "type": "integer", + "example": 1 + }, + "pets": { + "type": "array", + "items": { + "$ref": "#/components/schemas/pet" + } + } + } + } + }, + "responses": { + "server_error_response": { + "description": "Default error response", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "example": "Server error" + } + } + }, + "example": { + "error": "Server error" + } + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/examples/OAR031/valid.yaml b/src/test/resources/checks/v32/examples/OAR031/valid.yaml new file mode 100644 index 00000000..5dc80af7 --- /dev/null +++ b/src/test/resources/checks/v32/examples/OAR031/valid.yaml @@ -0,0 +1,113 @@ +openapi: "3.2.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: + post: + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/pet" + example: + name: Puppy + type: dog + responses: + 201: + description: Pet list + content: + application/json: + schema: + $ref: '#/components/schemas/pet' + example: + name: Puppy + type: dog + 204: + description: No content + default: + $ref: "#/components/responses/server_error_response" + get: + responses: + 204: + description: No content + 206: + description: Pet created + content: + application/json: + schema: + $ref: '#/components/schemas/pets' + example: + size: 2 + pets: + - name: Fluffy + type: cat + - name: Sparky + type: dog + default: + $ref: "#/components/responses/server_error_response" + /pets/{id}: + get: + parameters: + - $ref: "#/components/parameters/id" + responses: + 200: + description: One pet + content: + application/json: + schema: + $ref: "#/components/schemas/pet" + example: + name: Fluffy + type: cat + 204: + description: No content + default: + $ref: "#/components/responses/server_error_response" + +components: + parameters: + id: + in: path + name: id + schema: + type: integer + format: int64 + maxLength: 22 + example: 513168138 + description: Identificador del tipo de centro a obtener, actualizar o eliminar. + required: true + + schemas: + pet: + type: object + properties: + name: + type: string + example: "Snow" + type: + type: string + example: "dog" + pets: + type: object + properties: + size: + type: integer + example: 1 + pets: + type: array + items: + $ref: '#/components/schemas/pet' + responses: + server_error_response: + description: Default error response + content: + application/json: + schema: + type: object + properties: + error: + type: string + example: "Server error" + example: + error: "Server error" \ No newline at end of file diff --git a/src/test/resources/checks/v32/examples/OAR031/without-examples.json b/src/test/resources/checks/v32/examples/OAR031/without-examples.json new file mode 100644 index 00000000..e125ca1a --- /dev/null +++ b/src/test/resources/checks/v32/examples/OAR031/without-examples.json @@ -0,0 +1,120 @@ +{ + "openapi": "3.2.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/pets": { + "get": { + "responses": { + "206": { # Noncompliant {{OAR031: Responses must have one or more examples defined}} + "description": "Pet list", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/pets" + } + } + } + }, + "default": { + "$ref": "#/components/responses/server_error_response" + } + } + } + }, + "/pets/{id}": { + "parameters": [ + { # Noncompliant {{OAR031: Parameters must have one or more examples defined}} + "in": "query", + "name": "$start", + "schema": { + "type": "integer" + } + } + ], + "get": { + "parameters": [ + { + "$ref": "#/components/parameters/id" + } + ], + "responses": { + "200": { # Noncompliant {{OAR031: Responses must have one or more examples defined}} + "description": "One pet", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/pet" + } + } + } + }, + "default": { + "$ref": "#/components/responses/server_error_response" + } + } + } + } + }, + "components": { + "parameters": { + "id": { # Noncompliant {{OAR031: Parameters must have one or more examples defined}} + "in": "path", + "name": "id", + "schema": { + "type": "integer", + "format": "int64", + "maxLength": 22 + }, + "description": "Identificador del tipo de centro a obtener, actualizar o eliminar.", + "required": true + } + }, + "schemas": { + "pet": { + "type": "object", + "properties": { + "name": { # Noncompliant {{OAR031: Properties must have an example defined}} + "type": "string" + }, + "type": { # Noncompliant {{OAR031: Properties must have an example defined}} + "type": "string" + } + } + }, + "pets": { + "type": "object", + "properties": { + "size": { # Noncompliant {{OAR031: Properties must have an example defined}} + "type": "integer" + }, + "pets": { + "type": "array", + "items": { + "$ref": "#/components/schemas/pet" + } + } + } + } + }, + "responses": { + "server_error_response": { # Noncompliant {{OAR031: Responses must have one or more examples defined}} + "description": "Default error response", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "error": { # Noncompliant {{OAR031: Properties must have an example defined}} + "type": "string" + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/examples/OAR031/without-examples.yaml b/src/test/resources/checks/v32/examples/OAR031/without-examples.yaml new file mode 100644 index 00000000..9f62c796 --- /dev/null +++ b/src/test/resources/checks/v32/examples/OAR031/without-examples.yaml @@ -0,0 +1,73 @@ +openapi: "3.2.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: + get: + responses: + 206: # Noncompliant {{OAR031: Responses must have one or more examples defined}} + description: Pet list + content: + application/json: + schema: + $ref: '#/components/schemas/pets' + default: + $ref: "#/components/responses/server_error_response" + /pets/{id}: + parameters: + - in: query # Noncompliant {{OAR031: Parameters must have one or more examples defined}} + name: $start + schema: + type: integer + get: + parameters: + - $ref: "#/components/parameters/id" + responses: + 200: # Noncompliant {{OAR031: Responses must have one or more examples defined}} + description: One pet + content: + application/json: + schema: + $ref: "#/components/schemas/pet" + default: + $ref: "#/components/responses/server_error_response" + +components: + parameters: + id: + in: path # Noncompliant {{OAR031: Parameters must have one or more examples defined}} + name: id + schema: + type: integer + format: int64 + maxLength: 22 + description: Identificador del tipo de centro a obtener, actualizar o eliminar. + required: true + schemas: + pet: + type: object + properties: + name: # Noncompliant {{OAR031: Properties must have an example defined}} + type: string + type: # Noncompliant {{OAR031: Properties must have an example defined}} + type: string + pets: + type: object + properties: + size: # Noncompliant {{OAR031: Properties must have an example defined}} + type: integer + pets: + type: array + items: + $ref: '#/components/schemas/pet' + responses: + server_error_response: # Noncompliant {{OAR031: Responses must have one or more examples defined}} + description: Default error response + content: + application/json: + schema: + type: object + properties: + error: # Noncompliant {{OAR031: Properties must have an example defined}} + type: string \ No newline at end of file diff --git a/src/test/resources/checks/v32/examples/OAR094/externalref.yaml b/src/test/resources/checks/v32/examples/OAR094/externalref.yaml index d750e57a..5acf5c5b 100644 --- a/src/test/resources/checks/v32/examples/OAR094/externalref.yaml +++ b/src/test/resources/checks/v32/examples/OAR094/externalref.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.1 +openapi: "3.2.0" info: title: Sample-API_efc2b9f76813_V contact: diff --git a/src/test/resources/checks/v32/examples/OAR094/invalid-example.json b/src/test/resources/checks/v32/examples/OAR094/invalid-example.json index 70dc0305..0ea37ff9 100644 --- a/src/test/resources/checks/v32/examples/OAR094/invalid-example.json +++ b/src/test/resources/checks/v32/examples/OAR094/invalid-example.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "title": "API con Example", "version": "1.0.0" diff --git a/src/test/resources/checks/v32/examples/OAR094/invalid-example.yaml b/src/test/resources/checks/v32/examples/OAR094/invalid-example.yaml index 31628bcd..d9522a84 100644 --- a/src/test/resources/checks/v32/examples/OAR094/invalid-example.yaml +++ b/src/test/resources/checks/v32/examples/OAR094/invalid-example.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.0 +openapi: "3.2.0" info: title: API con Example version: 1.0.0 diff --git a/src/test/resources/checks/v32/examples/OAR094/valid-example.json b/src/test/resources/checks/v32/examples/OAR094/valid-example.json index c1cc5b38..6a7b00f2 100644 --- a/src/test/resources/checks/v32/examples/OAR094/valid-example.json +++ b/src/test/resources/checks/v32/examples/OAR094/valid-example.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "title": "API con Examples", "version": "1.0.0" diff --git a/src/test/resources/checks/v32/examples/OAR094/valid-example.yaml b/src/test/resources/checks/v32/examples/OAR094/valid-example.yaml index ab2b5d5a..886cbd6c 100644 --- a/src/test/resources/checks/v32/examples/OAR094/valid-example.yaml +++ b/src/test/resources/checks/v32/examples/OAR094/valid-example.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.0 +openapi: "3.2.0" info: title: API con Examples version: 1.0.0 diff --git a/src/test/resources/checks/v32/format/OAR006/without-anything.json b/src/test/resources/checks/v32/format/OAR006/without-anything.json index e7eb8518..50955fd1 100644 --- a/src/test/resources/checks/v32/format/OAR006/without-anything.json +++ b/src/test/resources/checks/v32/format/OAR006/without-anything.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v32/format/OAR006/without-anything.yaml b/src/test/resources/checks/v32/format/OAR006/without-anything.yaml index 88d684f0..bc9fd61a 100644 --- a/src/test/resources/checks/v32/format/OAR006/without-anything.yaml +++ b/src/test/resources/checks/v32/format/OAR006/without-anything.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.0 +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/format/OAR007/without-anything.json b/src/test/resources/checks/v32/format/OAR007/without-anything.json index 805f9d37..966f50d5 100644 --- a/src/test/resources/checks/v32/format/OAR007/without-anything.json +++ b/src/test/resources/checks/v32/format/OAR007/without-anything.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v32/format/OAR007/without-anything.yaml b/src/test/resources/checks/v32/format/OAR007/without-anything.yaml index ad6533a3..371c1c66 100644 --- a/src/test/resources/checks/v32/format/OAR007/without-anything.yaml +++ b/src/test/resources/checks/v32/format/OAR007/without-anything.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/format/OAR009/operation-not-allows-request-body.json b/src/test/resources/checks/v32/format/OAR009/operation-not-allows-request-body.json index 87c3e35c..8e2f6bfb 100644 --- a/src/test/resources/checks/v32/format/OAR009/operation-not-allows-request-body.json +++ b/src/test/resources/checks/v32/format/OAR009/operation-not-allows-request-body.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v32/format/OAR009/operation-not-allows-request-body.yaml b/src/test/resources/checks/v32/format/OAR009/operation-not-allows-request-body.yaml index 7a0f59fa..f4f4a3d9 100644 --- a/src/test/resources/checks/v32/format/OAR009/operation-not-allows-request-body.yaml +++ b/src/test/resources/checks/v32/format/OAR009/operation-not-allows-request-body.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/format/OAR009/with-default-and-$ref.json b/src/test/resources/checks/v32/format/OAR009/with-default-and-$ref.json index 55f22b21..4c489b99 100644 --- a/src/test/resources/checks/v32/format/OAR009/with-default-and-$ref.json +++ b/src/test/resources/checks/v32/format/OAR009/with-default-and-$ref.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v32/format/OAR009/with-default-and-$ref.yaml b/src/test/resources/checks/v32/format/OAR009/with-default-and-$ref.yaml index 19eb54b9..941a5847 100644 --- a/src/test/resources/checks/v32/format/OAR009/with-default-and-$ref.yaml +++ b/src/test/resources/checks/v32/format/OAR009/with-default-and-$ref.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/format/OAR009/with-default-and-specific.json b/src/test/resources/checks/v32/format/OAR009/with-default-and-specific.json index 5c1ec6af..5ba4bfd6 100644 --- a/src/test/resources/checks/v32/format/OAR009/with-default-and-specific.json +++ b/src/test/resources/checks/v32/format/OAR009/with-default-and-specific.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v32/format/OAR009/with-default-and-specific.yaml b/src/test/resources/checks/v32/format/OAR009/with-default-and-specific.yaml index 7cb1533a..286b32cb 100644 --- a/src/test/resources/checks/v32/format/OAR009/with-default-and-specific.yaml +++ b/src/test/resources/checks/v32/format/OAR009/with-default-and-specific.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/format/OAR009/with-specific.json b/src/test/resources/checks/v32/format/OAR009/with-specific.json index e2f86e06..d364446d 100644 --- a/src/test/resources/checks/v32/format/OAR009/with-specific.json +++ b/src/test/resources/checks/v32/format/OAR009/with-specific.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v32/format/OAR009/with-specific.yaml b/src/test/resources/checks/v32/format/OAR009/with-specific.yaml index 8275c170..62f5e19c 100644 --- a/src/test/resources/checks/v32/format/OAR009/with-specific.yaml +++ b/src/test/resources/checks/v32/format/OAR009/with-specific.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/format/OAR009/with-wrong-default-and-specific.json b/src/test/resources/checks/v32/format/OAR009/with-wrong-default-and-specific.json index 717e2ce1..bff8ff05 100644 --- a/src/test/resources/checks/v32/format/OAR009/with-wrong-default-and-specific.json +++ b/src/test/resources/checks/v32/format/OAR009/with-wrong-default-and-specific.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v32/format/OAR009/with-wrong-default-and-specific.yaml b/src/test/resources/checks/v32/format/OAR009/with-wrong-default-and-specific.yaml index 5f5a2c42..a36602b8 100644 --- a/src/test/resources/checks/v32/format/OAR009/with-wrong-default-and-specific.yaml +++ b/src/test/resources/checks/v32/format/OAR009/with-wrong-default-and-specific.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/format/OAR009/with-wrong-default.json b/src/test/resources/checks/v32/format/OAR009/with-wrong-default.json index 8858d3f7..9ff912b3 100644 --- a/src/test/resources/checks/v32/format/OAR009/with-wrong-default.json +++ b/src/test/resources/checks/v32/format/OAR009/with-wrong-default.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v32/format/OAR009/with-wrong-default.yaml b/src/test/resources/checks/v32/format/OAR009/with-wrong-default.yaml index d318d68c..d3f04542 100644 --- a/src/test/resources/checks/v32/format/OAR009/with-wrong-default.yaml +++ b/src/test/resources/checks/v32/format/OAR009/with-wrong-default.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/format/OAR009/without-anything.json b/src/test/resources/checks/v32/format/OAR009/without-anything.json index 75ad9f22..87719536 100644 --- a/src/test/resources/checks/v32/format/OAR009/without-anything.json +++ b/src/test/resources/checks/v32/format/OAR009/without-anything.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v32/format/OAR009/without-anything.yaml b/src/test/resources/checks/v32/format/OAR009/without-anything.yaml index a7e26847..91bac1df 100644 --- a/src/test/resources/checks/v32/format/OAR009/without-anything.yaml +++ b/src/test/resources/checks/v32/format/OAR009/without-anything.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/format/OAR010/with-default-and-$ref.json b/src/test/resources/checks/v32/format/OAR010/with-default-and-$ref.json index 93c56075..85e2130a 100644 --- a/src/test/resources/checks/v32/format/OAR010/with-default-and-$ref.json +++ b/src/test/resources/checks/v32/format/OAR010/with-default-and-$ref.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v32/format/OAR010/with-default-and-$ref.yaml b/src/test/resources/checks/v32/format/OAR010/with-default-and-$ref.yaml index 37260cd9..664d6ac5 100644 --- a/src/test/resources/checks/v32/format/OAR010/with-default-and-$ref.yaml +++ b/src/test/resources/checks/v32/format/OAR010/with-default-and-$ref.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.0 +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/format/OAR010/with-default-and-specific.json b/src/test/resources/checks/v32/format/OAR010/with-default-and-specific.json index 714dc3e9..37caf1ca 100644 --- a/src/test/resources/checks/v32/format/OAR010/with-default-and-specific.json +++ b/src/test/resources/checks/v32/format/OAR010/with-default-and-specific.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v32/format/OAR010/with-default-and-specific.yaml b/src/test/resources/checks/v32/format/OAR010/with-default-and-specific.yaml index 1059a75d..27bf971a 100644 --- a/src/test/resources/checks/v32/format/OAR010/with-default-and-specific.yaml +++ b/src/test/resources/checks/v32/format/OAR010/with-default-and-specific.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.0 +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/format/OAR010/with-specific.json b/src/test/resources/checks/v32/format/OAR010/with-specific.json index 59a2ee24..f2b6fe75 100644 --- a/src/test/resources/checks/v32/format/OAR010/with-specific.json +++ b/src/test/resources/checks/v32/format/OAR010/with-specific.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v32/format/OAR010/with-specific.yaml b/src/test/resources/checks/v32/format/OAR010/with-specific.yaml index 0026c70d..2fe548f8 100644 --- a/src/test/resources/checks/v32/format/OAR010/with-specific.yaml +++ b/src/test/resources/checks/v32/format/OAR010/with-specific.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/format/OAR010/with-wrong-default-and-specific.json b/src/test/resources/checks/v32/format/OAR010/with-wrong-default-and-specific.json index fb05f275..d5e1eee5 100644 --- a/src/test/resources/checks/v32/format/OAR010/with-wrong-default-and-specific.json +++ b/src/test/resources/checks/v32/format/OAR010/with-wrong-default-and-specific.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v32/format/OAR010/with-wrong-default-and-specific.yaml b/src/test/resources/checks/v32/format/OAR010/with-wrong-default-and-specific.yaml index 561511e4..1bf7e848 100644 --- a/src/test/resources/checks/v32/format/OAR010/with-wrong-default-and-specific.yaml +++ b/src/test/resources/checks/v32/format/OAR010/with-wrong-default-and-specific.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.0 +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/format/OAR010/with-wrong-default.json b/src/test/resources/checks/v32/format/OAR010/with-wrong-default.json index 345e4ba0..ce1531e6 100644 --- a/src/test/resources/checks/v32/format/OAR010/with-wrong-default.json +++ b/src/test/resources/checks/v32/format/OAR010/with-wrong-default.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v32/format/OAR010/with-wrong-default.yaml b/src/test/resources/checks/v32/format/OAR010/with-wrong-default.yaml index d0513d3e..d6eb5bc1 100644 --- a/src/test/resources/checks/v32/format/OAR010/with-wrong-default.yaml +++ b/src/test/resources/checks/v32/format/OAR010/with-wrong-default.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.0 +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/format/OAR010/without-anything.json b/src/test/resources/checks/v32/format/OAR010/without-anything.json index fe401526..367c5855 100644 --- a/src/test/resources/checks/v32/format/OAR010/without-anything.json +++ b/src/test/resources/checks/v32/format/OAR010/without-anything.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v32/format/OAR010/without-anything.yaml b/src/test/resources/checks/v32/format/OAR010/without-anything.yaml index 2a4bf55e..f0c65240 100644 --- a/src/test/resources/checks/v32/format/OAR010/without-anything.yaml +++ b/src/test/resources/checks/v32/format/OAR010/without-anything.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/format/OAR011/base-path-ok.json b/src/test/resources/checks/v32/format/OAR011/base-path-ok.json index 56dd4fa1..3d1242d2 100644 --- a/src/test/resources/checks/v32/format/OAR011/base-path-ok.json +++ b/src/test/resources/checks/v32/format/OAR011/base-path-ok.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v32/format/OAR011/base-path-ok.yaml b/src/test/resources/checks/v32/format/OAR011/base-path-ok.yaml index 6e24d7c7..5bf30cf7 100644 --- a/src/test/resources/checks/v32/format/OAR011/base-path-ok.yaml +++ b/src/test/resources/checks/v32/format/OAR011/base-path-ok.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/format/OAR011/base-path-wrong.json b/src/test/resources/checks/v32/format/OAR011/base-path-wrong.json index 535e82b4..bfdb7a35 100644 --- a/src/test/resources/checks/v32/format/OAR011/base-path-wrong.json +++ b/src/test/resources/checks/v32/format/OAR011/base-path-wrong.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v32/format/OAR011/base-path-wrong.yaml b/src/test/resources/checks/v32/format/OAR011/base-path-wrong.yaml index 6833d3fc..4b75076f 100644 --- a/src/test/resources/checks/v32/format/OAR011/base-path-wrong.yaml +++ b/src/test/resources/checks/v32/format/OAR011/base-path-wrong.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/format/OAR011/plain.json b/src/test/resources/checks/v32/format/OAR011/plain.json index cf5279d9..677c41b5 100644 --- a/src/test/resources/checks/v32/format/OAR011/plain.json +++ b/src/test/resources/checks/v32/format/OAR011/plain.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v32/format/OAR011/plain.yaml b/src/test/resources/checks/v32/format/OAR011/plain.yaml index 7b13396a..a0f12431 100644 --- a/src/test/resources/checks/v32/format/OAR011/plain.yaml +++ b/src/test/resources/checks/v32/format/OAR011/plain.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/format/OAR012/camel-case-plain.json b/src/test/resources/checks/v32/format/OAR012/camel-case-plain.json index bb26e131..1bc9c4c0 100644 --- a/src/test/resources/checks/v32/format/OAR012/camel-case-plain.json +++ b/src/test/resources/checks/v32/format/OAR012/camel-case-plain.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v32/format/OAR012/camel-case-plain.yaml b/src/test/resources/checks/v32/format/OAR012/camel-case-plain.yaml index ccbabec1..efa4e09a 100644 --- a/src/test/resources/checks/v32/format/OAR012/camel-case-plain.yaml +++ b/src/test/resources/checks/v32/format/OAR012/camel-case-plain.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/format/OAR012/camel-case-with-$ref.json b/src/test/resources/checks/v32/format/OAR012/camel-case-with-$ref.json index 8a695818..7a034d36 100644 --- a/src/test/resources/checks/v32/format/OAR012/camel-case-with-$ref.json +++ b/src/test/resources/checks/v32/format/OAR012/camel-case-with-$ref.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v32/format/OAR012/camel-case-with-$ref.yaml b/src/test/resources/checks/v32/format/OAR012/camel-case-with-$ref.yaml index 7cca23f2..e01fdd5a 100644 --- a/src/test/resources/checks/v32/format/OAR012/camel-case-with-$ref.yaml +++ b/src/test/resources/checks/v32/format/OAR012/camel-case-with-$ref.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/format/OAR012/kebab-case-plain.json b/src/test/resources/checks/v32/format/OAR012/kebab-case-plain.json index 8d726a20..c093ed08 100644 --- a/src/test/resources/checks/v32/format/OAR012/kebab-case-plain.json +++ b/src/test/resources/checks/v32/format/OAR012/kebab-case-plain.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v32/format/OAR012/kebab-case-plain.yaml b/src/test/resources/checks/v32/format/OAR012/kebab-case-plain.yaml index a1b924e6..0db93daa 100644 --- a/src/test/resources/checks/v32/format/OAR012/kebab-case-plain.yaml +++ b/src/test/resources/checks/v32/format/OAR012/kebab-case-plain.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/format/OAR012/kebab-case-with-$ref.json b/src/test/resources/checks/v32/format/OAR012/kebab-case-with-$ref.json index bedb4b36..711c1557 100644 --- a/src/test/resources/checks/v32/format/OAR012/kebab-case-with-$ref.json +++ b/src/test/resources/checks/v32/format/OAR012/kebab-case-with-$ref.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v32/format/OAR012/kebab-case-with-$ref.yaml b/src/test/resources/checks/v32/format/OAR012/kebab-case-with-$ref.yaml index 73975f4f..b5ce1f58 100644 --- a/src/test/resources/checks/v32/format/OAR012/kebab-case-with-$ref.yaml +++ b/src/test/resources/checks/v32/format/OAR012/kebab-case-with-$ref.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/format/OAR012/snake-case-plain.json b/src/test/resources/checks/v32/format/OAR012/snake-case-plain.json index 48e07f45..81c68011 100644 --- a/src/test/resources/checks/v32/format/OAR012/snake-case-plain.json +++ b/src/test/resources/checks/v32/format/OAR012/snake-case-plain.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v32/format/OAR012/snake-case-plain.yaml b/src/test/resources/checks/v32/format/OAR012/snake-case-plain.yaml index 20bfa7f7..a12a75cc 100644 --- a/src/test/resources/checks/v32/format/OAR012/snake-case-plain.yaml +++ b/src/test/resources/checks/v32/format/OAR012/snake-case-plain.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/format/OAR012/snake-case-with-$ref.json b/src/test/resources/checks/v32/format/OAR012/snake-case-with-$ref.json index 21c21650..9ea66ba2 100644 --- a/src/test/resources/checks/v32/format/OAR012/snake-case-with-$ref.json +++ b/src/test/resources/checks/v32/format/OAR012/snake-case-with-$ref.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v32/format/OAR012/snake-case-with-$ref.yaml b/src/test/resources/checks/v32/format/OAR012/snake-case-with-$ref.yaml index c453758f..59498c29 100644 --- a/src/test/resources/checks/v32/format/OAR012/snake-case-with-$ref.yaml +++ b/src/test/resources/checks/v32/format/OAR012/snake-case-with-$ref.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/format/OAR016/nested.json b/src/test/resources/checks/v32/format/OAR016/nested.json index 3e10ecf6..175e2dcf 100644 --- a/src/test/resources/checks/v32/format/OAR016/nested.json +++ b/src/test/resources/checks/v32/format/OAR016/nested.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v32/format/OAR016/nested.yaml b/src/test/resources/checks/v32/format/OAR016/nested.yaml index 99858ae1..e18ef182 100644 --- a/src/test/resources/checks/v32/format/OAR016/nested.yaml +++ b/src/test/resources/checks/v32/format/OAR016/nested.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/format/OAR016/plain.json b/src/test/resources/checks/v32/format/OAR016/plain.json index d49aef02..95dc5876 100644 --- a/src/test/resources/checks/v32/format/OAR016/plain.json +++ b/src/test/resources/checks/v32/format/OAR016/plain.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v32/format/OAR016/plain.yaml b/src/test/resources/checks/v32/format/OAR016/plain.yaml index 004e61d7..6cebec67 100644 --- a/src/test/resources/checks/v32/format/OAR016/plain.yaml +++ b/src/test/resources/checks/v32/format/OAR016/plain.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/format/OAR016/with-$ref.json b/src/test/resources/checks/v32/format/OAR016/with-$ref.json index 44d77260..ffcb0988 100644 --- a/src/test/resources/checks/v32/format/OAR016/with-$ref.json +++ b/src/test/resources/checks/v32/format/OAR016/with-$ref.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v32/format/OAR016/with-$ref.yaml b/src/test/resources/checks/v32/format/OAR016/with-$ref.yaml index 32be02fd..0b7a5913 100644 --- a/src/test/resources/checks/v32/format/OAR016/with-$ref.yaml +++ b/src/test/resources/checks/v32/format/OAR016/with-$ref.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/format/OAR037/complete.json b/src/test/resources/checks/v32/format/OAR037/complete.json index dfefdf0b..509a1a44 100644 --- a/src/test/resources/checks/v32/format/OAR037/complete.json +++ b/src/test/resources/checks/v32/format/OAR037/complete.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v32/format/OAR037/complete.yaml b/src/test/resources/checks/v32/format/OAR037/complete.yaml index 2e7b6f3f..f66402b0 100644 --- a/src/test/resources/checks/v32/format/OAR037/complete.yaml +++ b/src/test/resources/checks/v32/format/OAR037/complete.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/format/OAR037/nested.json b/src/test/resources/checks/v32/format/OAR037/nested.json index 4b6316e6..08aa7e31 100644 --- a/src/test/resources/checks/v32/format/OAR037/nested.json +++ b/src/test/resources/checks/v32/format/OAR037/nested.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v32/format/OAR037/nested.yaml b/src/test/resources/checks/v32/format/OAR037/nested.yaml index e2ba0a91..8a2d2c6b 100644 --- a/src/test/resources/checks/v32/format/OAR037/nested.yaml +++ b/src/test/resources/checks/v32/format/OAR037/nested.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/format/OAR037/with-$ref.json b/src/test/resources/checks/v32/format/OAR037/with-$ref.json index 5707bfcb..d88ad1bc 100644 --- a/src/test/resources/checks/v32/format/OAR037/with-$ref.json +++ b/src/test/resources/checks/v32/format/OAR037/with-$ref.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v32/format/OAR037/with-$ref.yaml b/src/test/resources/checks/v32/format/OAR037/with-$ref.yaml index c7d2f1f4..40f2fc10 100644 --- a/src/test/resources/checks/v32/format/OAR037/with-$ref.yaml +++ b/src/test/resources/checks/v32/format/OAR037/with-$ref.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/format/OAR042/incorrect-version.json b/src/test/resources/checks/v32/format/OAR042/incorrect-version.json index 74006c75..544738f8 100644 --- a/src/test/resources/checks/v32/format/OAR042/incorrect-version.json +++ b/src/test/resources/checks/v32/format/OAR042/incorrect-version.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.2.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v32/format/OAR042/incorrect-version.yaml b/src/test/resources/checks/v32/format/OAR042/incorrect-version.yaml index 1a3a569a..cb41fe1a 100644 --- a/src/test/resources/checks/v32/format/OAR042/incorrect-version.yaml +++ b/src/test/resources/checks/v32/format/OAR042/incorrect-version.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/format/OAR042/too-long.json b/src/test/resources/checks/v32/format/OAR042/too-long.json index 8e22a1a2..decdde62 100644 --- a/src/test/resources/checks/v32/format/OAR042/too-long.json +++ b/src/test/resources/checks/v32/format/OAR042/too-long.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.2.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v32/format/OAR042/too-long.yaml b/src/test/resources/checks/v32/format/OAR042/too-long.yaml index a8df7af5..3a05ede8 100644 --- a/src/test/resources/checks/v32/format/OAR042/too-long.yaml +++ b/src/test/resources/checks/v32/format/OAR042/too-long.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/format/OAR042/too-short.json b/src/test/resources/checks/v32/format/OAR042/too-short.json index 9f25cf4a..b05c3f83 100644 --- a/src/test/resources/checks/v32/format/OAR042/too-short.json +++ b/src/test/resources/checks/v32/format/OAR042/too-short.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.2.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v32/format/OAR042/too-short.yaml b/src/test/resources/checks/v32/format/OAR042/too-short.yaml index cb29e522..5cd5092b 100644 --- a/src/test/resources/checks/v32/format/OAR042/too-short.yaml +++ b/src/test/resources/checks/v32/format/OAR042/too-short.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/format/OAR042/valid.json b/src/test/resources/checks/v32/format/OAR042/valid.json index 6d48f8b4..5a669947 100644 --- a/src/test/resources/checks/v32/format/OAR042/valid.json +++ b/src/test/resources/checks/v32/format/OAR042/valid.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v32/format/OAR042/valid.yaml b/src/test/resources/checks/v32/format/OAR042/valid.yaml index 89bfccfb..10318c6a 100644 --- a/src/test/resources/checks/v32/format/OAR042/valid.yaml +++ b/src/test/resources/checks/v32/format/OAR042/valid.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/format/OAR042/without-api-prefix.json b/src/test/resources/checks/v32/format/OAR042/without-api-prefix.json index 0f7cf628..f76cd0f7 100644 --- a/src/test/resources/checks/v32/format/OAR042/without-api-prefix.json +++ b/src/test/resources/checks/v32/format/OAR042/without-api-prefix.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.2.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v32/format/OAR042/without-api-prefix.yaml b/src/test/resources/checks/v32/format/OAR042/without-api-prefix.yaml index e026b5a3..fabaeb38 100644 --- a/src/test/resources/checks/v32/format/OAR042/without-api-prefix.yaml +++ b/src/test/resources/checks/v32/format/OAR042/without-api-prefix.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/format/OAR044/media-type.json b/src/test/resources/checks/v32/format/OAR044/media-type.json new file mode 100644 index 00000000..a37e77ee --- /dev/null +++ b/src/test/resources/checks/v32/format/OAR044/media-type.json @@ -0,0 +1,46 @@ +{ + "openapi" : "3.2.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/pets" : { + "get" : { + "responses" : { + "200" : { + "description" : "some operation", + "content" : { + "application" : { } # Noncompliant {{OAR044: Declared media type range should conform to RFC7231}} + } + } + }, + "parameters" : [ { + "name" : "someParam", + "in" : "query", + "content" : { + "application" : { }, # Noncompliant {{OAR044: Declared mime type should conform to RFC6838}} + "text/plain" : { } + } + }, + { + "name" : "otherParam", + "in" : "path" + } ] + }, + "post" : { + "requestBody" : { + "content" : { + "application" : { }, # Noncompliant {{OAR044: Declared media type range should conform to RFC7231}} + "text/*" : { } + } + }, + "responses" : { + "200" : { + "description" : "some operation" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/format/OAR044/media-type.yaml b/src/test/resources/checks/v32/format/OAR044/media-type.yaml new file mode 100644 index 00000000..4dc3378b --- /dev/null +++ b/src/test/resources/checks/v32/format/OAR044/media-type.yaml @@ -0,0 +1,28 @@ +openapi: "3.2.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: + get: + responses: + '200': + description: some operation + content: + 'application': {} # Noncompliant {{OAR044: Declared media type range should conform to RFC7231}} + parameters: + - name: someParam + in: query + content: + 'application': {} # Noncompliant {{OAR044: Declared mime type should conform to RFC6838}} + 'text/plain': {} # invalid (only 1 content allowed by spec), but should not be caught by this rule + - name: otherParam + in: path + post: + requestBody: + content: + 'application': { } # Noncompliant {{OAR044: Declared media type range should conform to RFC7231}} + 'text/*': { } + responses: + '200': + description: some operation diff --git a/src/test/resources/checks/v32/format/OAR050/provide-summary.json b/src/test/resources/checks/v32/format/OAR050/provide-summary.json new file mode 100644 index 00000000..c1387e0c --- /dev/null +++ b/src/test/resources/checks/v32/format/OAR050/provide-summary.json @@ -0,0 +1,26 @@ +{ + "openapi" : "3.2.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/pets" : { + "post" : { # Noncompliant {{OAR050: Provide a summary for each operation}} + "responses" : { + "default" : { + "description" : "the default response" + } + } + }, + "get" : { + "summary" : "list all pets", + "responses" : { + "default" : { + "description" : "the default response" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/format/OAR050/provide-summary.yaml b/src/test/resources/checks/v32/format/OAR050/provide-summary.yaml new file mode 100644 index 00000000..62b1a87e --- /dev/null +++ b/src/test/resources/checks/v32/format/OAR050/provide-summary.yaml @@ -0,0 +1,15 @@ +openapi: "3.2.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: + post: # Noncompliant {{OAR050: Provide a summary for each operation}} + responses: + default: + description: the default response + get: + summary: list all pets + responses: + default: + description: the default response \ No newline at end of file diff --git a/src/test/resources/checks/v32/format/OAR051/different-description.json b/src/test/resources/checks/v32/format/OAR051/different-description.json new file mode 100644 index 00000000..652c891f --- /dev/null +++ b/src/test/resources/checks/v32/format/OAR051/different-description.json @@ -0,0 +1,30 @@ +{ + "openapi" : "3.2.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/pets" : { + "post" : { + "summary" : "create a pet", + "description" : "Create a new pet. The pet type is assigned a new unique ID, and can then be referenced in other operations.", + "responses" : { + "default" : { + "description" : "the default response" + } + } + }, + "get" : { + "summary" : "list all pets", + # Noncompliant@+1 {{OAR051: Description must differ from summary}} + "description" : "List all pets", + "responses" : { + "default" : { + "description" : "the default response" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/format/OAR051/different-description.yaml b/src/test/resources/checks/v32/format/OAR051/different-description.yaml new file mode 100644 index 00000000..645dfc1f --- /dev/null +++ b/src/test/resources/checks/v32/format/OAR051/different-description.yaml @@ -0,0 +1,21 @@ +openapi: "3.2.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: + post: + summary: create a pet + description: Create a new pet. The pet type is assigned a new unique ID, and can then be referenced in other + operations. + responses: + default: + description: the default response + get: + summary: list all pets + # Noncompliant@+1 {{OAR051: Description must differ from summary}} + description: List all pets +# ^^^^^^^^^^^ + responses: + default: + description: the default response \ No newline at end of file diff --git a/src/test/resources/checks/v32/format/OAR052/nested.json b/src/test/resources/checks/v32/format/OAR052/nested.json index 42d01c17..c637a9e3 100644 --- a/src/test/resources/checks/v32/format/OAR052/nested.json +++ b/src/test/resources/checks/v32/format/OAR052/nested.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v32/format/OAR052/nested.yaml b/src/test/resources/checks/v32/format/OAR052/nested.yaml index 9d3b88ee..237c46ed 100644 --- a/src/test/resources/checks/v32/format/OAR052/nested.yaml +++ b/src/test/resources/checks/v32/format/OAR052/nested.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.0 +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/format/OAR052/plain.json b/src/test/resources/checks/v32/format/OAR052/plain.json index e1189a6e..414171b9 100644 --- a/src/test/resources/checks/v32/format/OAR052/plain.json +++ b/src/test/resources/checks/v32/format/OAR052/plain.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v32/format/OAR052/plain.yaml b/src/test/resources/checks/v32/format/OAR052/plain.yaml index 498442a5..8c858f7a 100644 --- a/src/test/resources/checks/v32/format/OAR052/plain.yaml +++ b/src/test/resources/checks/v32/format/OAR052/plain.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.0 +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/format/OAR052/with-$ref.json b/src/test/resources/checks/v32/format/OAR052/with-$ref.json index f6d48586..81be7790 100644 --- a/src/test/resources/checks/v32/format/OAR052/with-$ref.json +++ b/src/test/resources/checks/v32/format/OAR052/with-$ref.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v32/format/OAR052/with-$ref.yaml b/src/test/resources/checks/v32/format/OAR052/with-$ref.yaml index 5db4e652..44697311 100644 --- a/src/test/resources/checks/v32/format/OAR052/with-$ref.yaml +++ b/src/test/resources/checks/v32/format/OAR052/with-$ref.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.0 +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/format/OAR066/snake-case-error.json b/src/test/resources/checks/v32/format/OAR066/snake-case-error.json index 5362c7f2..efc8ce35 100644 --- a/src/test/resources/checks/v32/format/OAR066/snake-case-error.json +++ b/src/test/resources/checks/v32/format/OAR066/snake-case-error.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v32/format/OAR066/snake-case-error.yaml b/src/test/resources/checks/v32/format/OAR066/snake-case-error.yaml index 6bf327fb..aa7017af 100644 --- a/src/test/resources/checks/v32/format/OAR066/snake-case-error.yaml +++ b/src/test/resources/checks/v32/format/OAR066/snake-case-error.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.0 +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/format/OAR066/valid.json b/src/test/resources/checks/v32/format/OAR066/valid.json index 67217b92..7626b513 100644 --- a/src/test/resources/checks/v32/format/OAR066/valid.json +++ b/src/test/resources/checks/v32/format/OAR066/valid.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v32/format/OAR066/valid.yaml b/src/test/resources/checks/v32/format/OAR066/valid.yaml index 04c50530..f0f26121 100644 --- a/src/test/resources/checks/v32/format/OAR066/valid.yaml +++ b/src/test/resources/checks/v32/format/OAR066/valid.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.0 +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/format/OAR067/camel-case-error.json b/src/test/resources/checks/v32/format/OAR067/camel-case-error.json index 4307fccb..8d03aea9 100644 --- a/src/test/resources/checks/v32/format/OAR067/camel-case-error.json +++ b/src/test/resources/checks/v32/format/OAR067/camel-case-error.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v32/format/OAR067/camel-case-error.yaml b/src/test/resources/checks/v32/format/OAR067/camel-case-error.yaml index ff6ba5c0..2c5a399c 100644 --- a/src/test/resources/checks/v32/format/OAR067/camel-case-error.yaml +++ b/src/test/resources/checks/v32/format/OAR067/camel-case-error.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.0 +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/format/OAR067/valid.json b/src/test/resources/checks/v32/format/OAR067/valid.json index 337a2f9b..91b29b66 100644 --- a/src/test/resources/checks/v32/format/OAR067/valid.json +++ b/src/test/resources/checks/v32/format/OAR067/valid.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v32/format/OAR067/valid.yaml b/src/test/resources/checks/v32/format/OAR067/valid.yaml index 8c80f35d..3f1ecb6a 100644 --- a/src/test/resources/checks/v32/format/OAR067/valid.yaml +++ b/src/test/resources/checks/v32/format/OAR067/valid.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.0 +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/format/OAR068/externalref.yaml b/src/test/resources/checks/v32/format/OAR068/externalref.yaml index 5035f52c..fa8fd5a1 100644 --- a/src/test/resources/checks/v32/format/OAR068/externalref.yaml +++ b/src/test/resources/checks/v32/format/OAR068/externalref.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.1 +openapi: "3.2.0" info: title: Sample-API_efc2b9f76813_V contact: diff --git a/src/test/resources/checks/v32/format/OAR068/pascal-case-error.json b/src/test/resources/checks/v32/format/OAR068/pascal-case-error.json index b5f9521e..a7044352 100644 --- a/src/test/resources/checks/v32/format/OAR068/pascal-case-error.json +++ b/src/test/resources/checks/v32/format/OAR068/pascal-case-error.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v32/format/OAR068/pascal-case-error.yaml b/src/test/resources/checks/v32/format/OAR068/pascal-case-error.yaml index eed1491d..daa457aa 100644 --- a/src/test/resources/checks/v32/format/OAR068/pascal-case-error.yaml +++ b/src/test/resources/checks/v32/format/OAR068/pascal-case-error.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.0 +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/format/OAR068/valid.json b/src/test/resources/checks/v32/format/OAR068/valid.json index f6204f15..b8103285 100644 --- a/src/test/resources/checks/v32/format/OAR068/valid.json +++ b/src/test/resources/checks/v32/format/OAR068/valid.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v32/format/OAR068/valid.yaml b/src/test/resources/checks/v32/format/OAR068/valid.yaml index b99b3dcc..afbc1cba 100644 --- a/src/test/resources/checks/v32/format/OAR068/valid.yaml +++ b/src/test/resources/checks/v32/format/OAR068/valid.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.0 +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/format/OAR077/not-valid-in-query.json b/src/test/resources/checks/v32/format/OAR077/not-valid-in-query.json index 29dddea3..f5c68809 100644 --- a/src/test/resources/checks/v32/format/OAR077/not-valid-in-query.json +++ b/src/test/resources/checks/v32/format/OAR077/not-valid-in-query.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "version": "1.0.0", "title": "API que cumple" diff --git a/src/test/resources/checks/v32/format/OAR077/not-valid-in-query.yaml b/src/test/resources/checks/v32/format/OAR077/not-valid-in-query.yaml index 6c43154d..25a7d9a9 100644 --- a/src/test/resources/checks/v32/format/OAR077/not-valid-in-query.yaml +++ b/src/test/resources/checks/v32/format/OAR077/not-valid-in-query.yaml @@ -1,4 +1,4 @@ - openapi: "3.0.0" + openapi: "3.2.0" info: version: "1.0.0" title: "API que cumple" diff --git a/src/test/resources/checks/v32/format/OAR077/valid-in-query.json b/src/test/resources/checks/v32/format/OAR077/valid-in-query.json index bd383fd9..a887b7ca 100644 --- a/src/test/resources/checks/v32/format/OAR077/valid-in-query.json +++ b/src/test/resources/checks/v32/format/OAR077/valid-in-query.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "version": "1.0.0", "title": "API que cumple" diff --git a/src/test/resources/checks/v32/format/OAR077/valid-in-query.yaml b/src/test/resources/checks/v32/format/OAR077/valid-in-query.yaml index 286bf500..e23c77c4 100644 --- a/src/test/resources/checks/v32/format/OAR077/valid-in-query.yaml +++ b/src/test/resources/checks/v32/format/OAR077/valid-in-query.yaml @@ -1,4 +1,4 @@ - openapi: "3.0.0" + openapi: "3.2.0" info: version: "1.0.0" title: "API que cumple" diff --git a/src/test/resources/checks/v32/format/OAR086/external-refexample.yaml b/src/test/resources/checks/v32/format/OAR086/external-refexample.yaml index 942a056b..812162a6 100644 --- a/src/test/resources/checks/v32/format/OAR086/external-refexample.yaml +++ b/src/test/resources/checks/v32/format/OAR086/external-refexample.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.1 +openapi: "3.2.0" info: title: Sample-API_efc2b9f76813_V contact: diff --git a/src/test/resources/checks/v32/format/OAR086/internal-refexample.yaml b/src/test/resources/checks/v32/format/OAR086/internal-refexample.yaml index 940aa7ce..869b12c6 100644 --- a/src/test/resources/checks/v32/format/OAR086/internal-refexample.yaml +++ b/src/test/resources/checks/v32/format/OAR086/internal-refexample.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.1 +openapi: "3.2.0" info: title: Sample-API_efc2b9f76813_V contact: diff --git a/src/test/resources/checks/v32/format/OAR086/invalid-example.json b/src/test/resources/checks/v32/format/OAR086/invalid-example.json index 8321f08a..6384577b 100644 --- a/src/test/resources/checks/v32/format/OAR086/invalid-example.json +++ b/src/test/resources/checks/v32/format/OAR086/invalid-example.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "title": "Sample API", "version": "1.0.0", diff --git a/src/test/resources/checks/v32/format/OAR086/invalid-example.yaml b/src/test/resources/checks/v32/format/OAR086/invalid-example.yaml index 6c04e09d..4b98ce79 100644 --- a/src/test/resources/checks/v32/format/OAR086/invalid-example.yaml +++ b/src/test/resources/checks/v32/format/OAR086/invalid-example.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.0 +openapi: "3.2.0" info: title: Sample API version: 1.0.0 diff --git a/src/test/resources/checks/v32/format/OAR086/valid-example.json b/src/test/resources/checks/v32/format/OAR086/valid-example.json index 01e82101..c103ae8b 100644 --- a/src/test/resources/checks/v32/format/OAR086/valid-example.json +++ b/src/test/resources/checks/v32/format/OAR086/valid-example.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "title": "Sample API", "version": "1.0.0", diff --git a/src/test/resources/checks/v32/format/OAR086/valid-example.yaml b/src/test/resources/checks/v32/format/OAR086/valid-example.yaml index ef4ed2a8..504d7b60 100644 --- a/src/test/resources/checks/v32/format/OAR086/valid-example.yaml +++ b/src/test/resources/checks/v32/format/OAR086/valid-example.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.1 +openapi: "3.2.0" info: title: Sample-API_efc2b9f76813_V description: API de ejemplo para pruebas. diff --git a/src/test/resources/checks/v32/format/OAR087/invalid-example.json b/src/test/resources/checks/v32/format/OAR087/invalid-example.json index afcb9b95..6832ca85 100644 --- a/src/test/resources/checks/v32/format/OAR087/invalid-example.json +++ b/src/test/resources/checks/v32/format/OAR087/invalid-example.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "title": "Sample API", "version": "1.0.0", diff --git a/src/test/resources/checks/v32/format/OAR087/invalid-example.yaml b/src/test/resources/checks/v32/format/OAR087/invalid-example.yaml index 32d303bf..a0d5e7b0 100644 --- a/src/test/resources/checks/v32/format/OAR087/invalid-example.yaml +++ b/src/test/resources/checks/v32/format/OAR087/invalid-example.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.0 +openapi: "3.2.0" info: title: Sample API version: 1.0.0 diff --git a/src/test/resources/checks/v32/format/OAR087/valid-example.json b/src/test/resources/checks/v32/format/OAR087/valid-example.json index e5974b79..e9b8abd6 100644 --- a/src/test/resources/checks/v32/format/OAR087/valid-example.json +++ b/src/test/resources/checks/v32/format/OAR087/valid-example.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "title": "Sample API", "version": "1.0.0", diff --git a/src/test/resources/checks/v32/format/OAR087/valid-example.yaml b/src/test/resources/checks/v32/format/OAR087/valid-example.yaml index 640a360c..3c9fb947 100644 --- a/src/test/resources/checks/v32/format/OAR087/valid-example.yaml +++ b/src/test/resources/checks/v32/format/OAR087/valid-example.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.0 +openapi: "3.2.0" info: title: Sample API version: 1.0.0 diff --git a/src/test/resources/checks/v32/format/OAR088/invalid-ref.json b/src/test/resources/checks/v32/format/OAR088/invalid-ref.json index 0c64ff1b..5182f1a3 100644 --- a/src/test/resources/checks/v32/format/OAR088/invalid-ref.json +++ b/src/test/resources/checks/v32/format/OAR088/invalid-ref.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "title": "API de ejemplo", "version": "1.0" diff --git a/src/test/resources/checks/v32/format/OAR088/invalid-ref.yaml b/src/test/resources/checks/v32/format/OAR088/invalid-ref.yaml index 1fcb570d..27b0a708 100644 --- a/src/test/resources/checks/v32/format/OAR088/invalid-ref.yaml +++ b/src/test/resources/checks/v32/format/OAR088/invalid-ref.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.0 +openapi: "3.2.0" info: title: API de ejemplo version: "1.0" diff --git a/src/test/resources/checks/v32/format/OAR088/valid-ref.json b/src/test/resources/checks/v32/format/OAR088/valid-ref.json index c113399f..3043f61b 100644 --- a/src/test/resources/checks/v32/format/OAR088/valid-ref.json +++ b/src/test/resources/checks/v32/format/OAR088/valid-ref.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "title": "API de ejemplo", "version": "1.0" diff --git a/src/test/resources/checks/v32/format/OAR088/valid-ref.yaml b/src/test/resources/checks/v32/format/OAR088/valid-ref.yaml index 3a2d8abe..56f31b68 100644 --- a/src/test/resources/checks/v32/format/OAR088/valid-ref.yaml +++ b/src/test/resources/checks/v32/format/OAR088/valid-ref.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.0 +openapi: "3.2.0" info: title: API de ejemplo version: "1.0" diff --git a/src/test/resources/checks/v32/format/OAR089/invalid-ref.json b/src/test/resources/checks/v32/format/OAR089/invalid-ref.json index 9c316602..f0cdf3eb 100644 --- a/src/test/resources/checks/v32/format/OAR089/invalid-ref.json +++ b/src/test/resources/checks/v32/format/OAR089/invalid-ref.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "title": "API Sample", "version": "1.0.0" diff --git a/src/test/resources/checks/v32/format/OAR089/invalid-ref.yaml b/src/test/resources/checks/v32/format/OAR089/invalid-ref.yaml index 21fe46df..e02672f1 100644 --- a/src/test/resources/checks/v32/format/OAR089/invalid-ref.yaml +++ b/src/test/resources/checks/v32/format/OAR089/invalid-ref.yaml @@ -1,4 +1,4 @@ -openapi: '3.0.0' +openapi: '3.2.0' info: title: API Sample version: '1.0.0' diff --git a/src/test/resources/checks/v32/format/OAR089/valid-ref.json b/src/test/resources/checks/v32/format/OAR089/valid-ref.json index 0dcbcfa9..53176b27 100644 --- a/src/test/resources/checks/v32/format/OAR089/valid-ref.json +++ b/src/test/resources/checks/v32/format/OAR089/valid-ref.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "title": "API Sample", "version": "1.0.0" diff --git a/src/test/resources/checks/v32/format/OAR089/valid-ref.yaml b/src/test/resources/checks/v32/format/OAR089/valid-ref.yaml index df379934..ea91c96b 100644 --- a/src/test/resources/checks/v32/format/OAR089/valid-ref.yaml +++ b/src/test/resources/checks/v32/format/OAR089/valid-ref.yaml @@ -1,4 +1,4 @@ -openapi: '3.0.0' +openapi: '3.2.0' info: title: API Sample version: '1.0.0' diff --git a/src/test/resources/checks/v32/format/OAR090/invalid-ref.json b/src/test/resources/checks/v32/format/OAR090/invalid-ref.json index 497987b9..157bd9ba 100644 --- a/src/test/resources/checks/v32/format/OAR090/invalid-ref.json +++ b/src/test/resources/checks/v32/format/OAR090/invalid-ref.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "title": "Sample API", "version": "1.0.0" diff --git a/src/test/resources/checks/v32/format/OAR090/invalid-ref.yaml b/src/test/resources/checks/v32/format/OAR090/invalid-ref.yaml index 8bcdbea7..988e30e4 100644 --- a/src/test/resources/checks/v32/format/OAR090/invalid-ref.yaml +++ b/src/test/resources/checks/v32/format/OAR090/invalid-ref.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.0 +openapi: "3.2.0" info: title: Sample API version: 1.0.0 diff --git a/src/test/resources/checks/v32/format/OAR090/valid-ref.json b/src/test/resources/checks/v32/format/OAR090/valid-ref.json index 304be99f..befd45c0 100644 --- a/src/test/resources/checks/v32/format/OAR090/valid-ref.json +++ b/src/test/resources/checks/v32/format/OAR090/valid-ref.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "title": "Sample API", "version": "1.0.0" diff --git a/src/test/resources/checks/v32/format/OAR090/valid-ref.yaml b/src/test/resources/checks/v32/format/OAR090/valid-ref.yaml index a93e0313..d69d7bf7 100644 --- a/src/test/resources/checks/v32/format/OAR090/valid-ref.yaml +++ b/src/test/resources/checks/v32/format/OAR090/valid-ref.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.0 +openapi: "3.2.0" info: title: Sample API version: 1.0.0 diff --git a/src/test/resources/checks/v32/format/OAR097/too-short.json b/src/test/resources/checks/v32/format/OAR097/too-short.json index aefcb581..e843f4a8 100644 --- a/src/test/resources/checks/v32/format/OAR097/too-short.json +++ b/src/test/resources/checks/v32/format/OAR097/too-short.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.2.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v32/format/OAR097/too-short.yaml b/src/test/resources/checks/v32/format/OAR097/too-short.yaml index 8ace3d73..8a0eefd6 100644 --- a/src/test/resources/checks/v32/format/OAR097/too-short.yaml +++ b/src/test/resources/checks/v32/format/OAR097/too-short.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/format/OAR097/valid.json b/src/test/resources/checks/v32/format/OAR097/valid.json index 6d48f8b4..5a669947 100644 --- a/src/test/resources/checks/v32/format/OAR097/valid.json +++ b/src/test/resources/checks/v32/format/OAR097/valid.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v32/format/OAR097/valid.yaml b/src/test/resources/checks/v32/format/OAR097/valid.yaml index 89bfccfb..10318c6a 100644 --- a/src/test/resources/checks/v32/format/OAR097/valid.yaml +++ b/src/test/resources/checks/v32/format/OAR097/valid.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/format/OAR098/too-long.json b/src/test/resources/checks/v32/format/OAR098/too-long.json index c142c217..ae50a57c 100644 --- a/src/test/resources/checks/v32/format/OAR098/too-long.json +++ b/src/test/resources/checks/v32/format/OAR098/too-long.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.2.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v32/format/OAR098/too-long.yaml b/src/test/resources/checks/v32/format/OAR098/too-long.yaml index a24776c2..27153a6b 100644 --- a/src/test/resources/checks/v32/format/OAR098/too-long.yaml +++ b/src/test/resources/checks/v32/format/OAR098/too-long.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/format/OAR098/valid.json b/src/test/resources/checks/v32/format/OAR098/valid.json index 6d48f8b4..5a669947 100644 --- a/src/test/resources/checks/v32/format/OAR098/valid.json +++ b/src/test/resources/checks/v32/format/OAR098/valid.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v32/format/OAR098/valid.yaml b/src/test/resources/checks/v32/format/OAR098/valid.yaml index 89bfccfb..10318c6a 100644 --- a/src/test/resources/checks/v32/format/OAR098/valid.yaml +++ b/src/test/resources/checks/v32/format/OAR098/valid.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/format/OAR099/valid.json b/src/test/resources/checks/v32/format/OAR099/valid.json index 6d48f8b4..5a669947 100644 --- a/src/test/resources/checks/v32/format/OAR099/valid.json +++ b/src/test/resources/checks/v32/format/OAR099/valid.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v32/format/OAR099/valid.yaml b/src/test/resources/checks/v32/format/OAR099/valid.yaml index 89bfccfb..10318c6a 100644 --- a/src/test/resources/checks/v32/format/OAR099/valid.yaml +++ b/src/test/resources/checks/v32/format/OAR099/valid.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/format/OAR099/without-api-prefix.json b/src/test/resources/checks/v32/format/OAR099/without-api-prefix.json index f3940f84..fef3e1f3 100644 --- a/src/test/resources/checks/v32/format/OAR099/without-api-prefix.json +++ b/src/test/resources/checks/v32/format/OAR099/without-api-prefix.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.2.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v32/format/OAR099/without-api-prefix.yaml b/src/test/resources/checks/v32/format/OAR099/without-api-prefix.yaml index f774c12e..8566af68 100644 --- a/src/test/resources/checks/v32/format/OAR099/without-api-prefix.yaml +++ b/src/test/resources/checks/v32/format/OAR099/without-api-prefix.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/format/OAR100/incorrect-version.json b/src/test/resources/checks/v32/format/OAR100/incorrect-version.json index c2673393..9b1a1964 100644 --- a/src/test/resources/checks/v32/format/OAR100/incorrect-version.json +++ b/src/test/resources/checks/v32/format/OAR100/incorrect-version.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.2.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v32/format/OAR100/incorrect-version.yaml b/src/test/resources/checks/v32/format/OAR100/incorrect-version.yaml index 9c20380c..b48f6138 100644 --- a/src/test/resources/checks/v32/format/OAR100/incorrect-version.yaml +++ b/src/test/resources/checks/v32/format/OAR100/incorrect-version.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/format/OAR100/valid.json b/src/test/resources/checks/v32/format/OAR100/valid.json index 6d48f8b4..5a669947 100644 --- a/src/test/resources/checks/v32/format/OAR100/valid.json +++ b/src/test/resources/checks/v32/format/OAR100/valid.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v32/format/OAR100/valid.yaml b/src/test/resources/checks/v32/format/OAR100/valid.yaml index 89bfccfb..10318c6a 100644 --- a/src/test/resources/checks/v32/format/OAR100/valid.yaml +++ b/src/test/resources/checks/v32/format/OAR100/valid.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/format/OAR101/empty-path.json b/src/test/resources/checks/v32/format/OAR101/empty-path.json index 6341fc10..51ebd431 100644 --- a/src/test/resources/checks/v32/format/OAR101/empty-path.json +++ b/src/test/resources/checks/v32/format/OAR101/empty-path.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v32/format/OAR101/empty-path.yaml b/src/test/resources/checks/v32/format/OAR101/empty-path.yaml index 8925b6e8..941d6abf 100644 --- a/src/test/resources/checks/v32/format/OAR101/empty-path.yaml +++ b/src/test/resources/checks/v32/format/OAR101/empty-path.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/format/OAR101/invalid.json b/src/test/resources/checks/v32/format/OAR101/invalid.json index 0ab8f8ab..8cb6efa5 100644 --- a/src/test/resources/checks/v32/format/OAR101/invalid.json +++ b/src/test/resources/checks/v32/format/OAR101/invalid.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v32/format/OAR101/invalid.yaml b/src/test/resources/checks/v32/format/OAR101/invalid.yaml index d06571ea..3f982cae 100644 --- a/src/test/resources/checks/v32/format/OAR101/invalid.yaml +++ b/src/test/resources/checks/v32/format/OAR101/invalid.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/format/OAR101/valid-with-values.json b/src/test/resources/checks/v32/format/OAR101/valid-with-values.json index 3ea07fc5..729bab18 100644 --- a/src/test/resources/checks/v32/format/OAR101/valid-with-values.json +++ b/src/test/resources/checks/v32/format/OAR101/valid-with-values.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v32/format/OAR101/valid-with-values.yaml b/src/test/resources/checks/v32/format/OAR101/valid-with-values.yaml index 89bfccfb..10318c6a 100644 --- a/src/test/resources/checks/v32/format/OAR101/valid-with-values.yaml +++ b/src/test/resources/checks/v32/format/OAR101/valid-with-values.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/format/OAR101/valid.json b/src/test/resources/checks/v32/format/OAR101/valid.json index 6d48f8b4..5a669947 100644 --- a/src/test/resources/checks/v32/format/OAR101/valid.json +++ b/src/test/resources/checks/v32/format/OAR101/valid.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v32/format/OAR101/valid.yaml b/src/test/resources/checks/v32/format/OAR101/valid.yaml index 89bfccfb..10318c6a 100644 --- a/src/test/resources/checks/v32/format/OAR101/valid.yaml +++ b/src/test/resources/checks/v32/format/OAR101/valid.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/format/OAR102/invalid.json b/src/test/resources/checks/v32/format/OAR102/invalid.json index ee51dd65..cf40e75b 100644 --- a/src/test/resources/checks/v32/format/OAR102/invalid.json +++ b/src/test/resources/checks/v32/format/OAR102/invalid.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v32/format/OAR102/invalid.yaml b/src/test/resources/checks/v32/format/OAR102/invalid.yaml index ca2c1240..88d34c44 100644 --- a/src/test/resources/checks/v32/format/OAR102/invalid.yaml +++ b/src/test/resources/checks/v32/format/OAR102/invalid.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/format/OAR102/one-part-path.json b/src/test/resources/checks/v32/format/OAR102/one-part-path.json index 3679b681..c9e505e8 100644 --- a/src/test/resources/checks/v32/format/OAR102/one-part-path.json +++ b/src/test/resources/checks/v32/format/OAR102/one-part-path.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v32/format/OAR102/one-part-path.yaml b/src/test/resources/checks/v32/format/OAR102/one-part-path.yaml index 84c7df71..ba1fcf71 100644 --- a/src/test/resources/checks/v32/format/OAR102/one-part-path.yaml +++ b/src/test/resources/checks/v32/format/OAR102/one-part-path.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/format/OAR102/valid-with-values.json b/src/test/resources/checks/v32/format/OAR102/valid-with-values.json index 3ea07fc5..729bab18 100644 --- a/src/test/resources/checks/v32/format/OAR102/valid-with-values.json +++ b/src/test/resources/checks/v32/format/OAR102/valid-with-values.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v32/format/OAR102/valid-with-values.yaml b/src/test/resources/checks/v32/format/OAR102/valid-with-values.yaml index 89bfccfb..10318c6a 100644 --- a/src/test/resources/checks/v32/format/OAR102/valid-with-values.yaml +++ b/src/test/resources/checks/v32/format/OAR102/valid-with-values.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/format/OAR102/valid.json b/src/test/resources/checks/v32/format/OAR102/valid.json index 6d48f8b4..5a669947 100644 --- a/src/test/resources/checks/v32/format/OAR102/valid.json +++ b/src/test/resources/checks/v32/format/OAR102/valid.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v32/format/OAR102/valid.yaml b/src/test/resources/checks/v32/format/OAR102/valid.yaml index 89bfccfb..10318c6a 100644 --- a/src/test/resources/checks/v32/format/OAR102/valid.yaml +++ b/src/test/resources/checks/v32/format/OAR102/valid.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/format/OAR110/valid.json b/src/test/resources/checks/v32/format/OAR110/valid.json index 0828cc2f..5e41a801 100644 --- a/src/test/resources/checks/v32/format/OAR110/valid.json +++ b/src/test/resources/checks/v32/format/OAR110/valid.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "title": "API de Ejemplo", "version": "1.0.0", diff --git a/src/test/resources/checks/v32/format/OAR110/valid.yaml b/src/test/resources/checks/v32/format/OAR110/valid.yaml index 0185cb17..a81c6c5b 100644 --- a/src/test/resources/checks/v32/format/OAR110/valid.yaml +++ b/src/test/resources/checks/v32/format/OAR110/valid.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.0 +openapi: "3.2.0" info: title: API de Ejemplo version: 1.0.0 diff --git a/src/test/resources/checks/v32/format/OAR111/valid.json b/src/test/resources/checks/v32/format/OAR111/valid.json index 0828cc2f..5e41a801 100644 --- a/src/test/resources/checks/v32/format/OAR111/valid.json +++ b/src/test/resources/checks/v32/format/OAR111/valid.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "title": "API de Ejemplo", "version": "1.0.0", diff --git a/src/test/resources/checks/v32/format/OAR111/valid.yaml b/src/test/resources/checks/v32/format/OAR111/valid.yaml index 5b95c019..821ebee0 100644 --- a/src/test/resources/checks/v32/format/OAR111/valid.yaml +++ b/src/test/resources/checks/v32/format/OAR111/valid.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.0 +openapi: "3.2.0" info: title: API de Ejemplo version: 1.0.0 diff --git a/src/test/resources/checks/v32/format/OAR113/invalid.json b/src/test/resources/checks/v32/format/OAR113/invalid.json index 8fc8181f..f0d896b5 100644 --- a/src/test/resources/checks/v32/format/OAR113/invalid.json +++ b/src/test/resources/checks/v32/format/OAR113/invalid.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "version": "1.0.0", "title": "Sample API" diff --git a/src/test/resources/checks/v32/format/OAR113/invalid.yaml b/src/test/resources/checks/v32/format/OAR113/invalid.yaml index eaab54bb..fbbcf36d 100644 --- a/src/test/resources/checks/v32/format/OAR113/invalid.yaml +++ b/src/test/resources/checks/v32/format/OAR113/invalid.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: "1.0.0" title: "Sample API" diff --git a/src/test/resources/checks/v32/format/OAR113/valid.json b/src/test/resources/checks/v32/format/OAR113/valid.json index 3c078dc6..8b6196fe 100644 --- a/src/test/resources/checks/v32/format/OAR113/valid.json +++ b/src/test/resources/checks/v32/format/OAR113/valid.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "version": "1.0.0", "title": "Sample API", diff --git a/src/test/resources/checks/v32/format/OAR113/valid.yaml b/src/test/resources/checks/v32/format/OAR113/valid.yaml index be171009..e001ed7c 100644 --- a/src/test/resources/checks/v32/format/OAR113/valid.yaml +++ b/src/test/resources/checks/v32/format/OAR113/valid.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: "1.0.0" title: "Sample API" diff --git a/src/test/resources/checks/v32/format/OAR115/invalid.json b/src/test/resources/checks/v32/format/OAR115/invalid.json index 5b686976..c34c0872 100644 --- a/src/test/resources/checks/v32/format/OAR115/invalid.json +++ b/src/test/resources/checks/v32/format/OAR115/invalid.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "title": "API de ejemplo", "version": "1.0.0" diff --git a/src/test/resources/checks/v32/format/OAR115/invalid.yaml b/src/test/resources/checks/v32/format/OAR115/invalid.yaml index 5f3876b2..145f315e 100644 --- a/src/test/resources/checks/v32/format/OAR115/invalid.yaml +++ b/src/test/resources/checks/v32/format/OAR115/invalid.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.0 +openapi: "3.2.0" info: title: API de ejemplo version: "1.0.0" diff --git a/src/test/resources/checks/v32/format/OAR115/valid.json b/src/test/resources/checks/v32/format/OAR115/valid.json index 1574947e..aee39dd5 100644 --- a/src/test/resources/checks/v32/format/OAR115/valid.json +++ b/src/test/resources/checks/v32/format/OAR115/valid.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "title": "API de ejemplo", "version": "1.0.0" diff --git a/src/test/resources/checks/v32/format/OAR115/valid.yaml b/src/test/resources/checks/v32/format/OAR115/valid.yaml index c97cfb50..0186f450 100644 --- a/src/test/resources/checks/v32/format/OAR115/valid.yaml +++ b/src/test/resources/checks/v32/format/OAR115/valid.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.0 +openapi: "3.2.0" info: title: API de ejemplo version: "1.0.0" diff --git a/src/test/resources/checks/v32/operations/OAR008/plain.json b/src/test/resources/checks/v32/operations/OAR008/plain.json index 872d387f..132f56e4 100644 --- a/src/test/resources/checks/v32/operations/OAR008/plain.json +++ b/src/test/resources/checks/v32/operations/OAR008/plain.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.2.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v32/operations/OAR008/plain.yaml b/src/test/resources/checks/v32/operations/OAR008/plain.yaml index 97f9dab8..9b363ccb 100644 --- a/src/test/resources/checks/v32/operations/OAR008/plain.yaml +++ b/src/test/resources/checks/v32/operations/OAR008/plain.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/operations/OAR013/plain.json b/src/test/resources/checks/v32/operations/OAR013/plain.json new file mode 100644 index 00000000..f01ecf15 --- /dev/null +++ b/src/test/resources/checks/v32/operations/OAR013/plain.json @@ -0,0 +1,25 @@ +{ + "openapi" : "3.2.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/pets" : { + "get" : { + "responses" : { # Noncompliant {{OAR013: Default response is required}} + "200" : { + "description" : "Ok" + } + } + }, + "post" : { + "responses" : { + "default" : { + "description" : "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/operations/OAR013/plain.yaml b/src/test/resources/checks/v32/operations/OAR013/plain.yaml new file mode 100644 index 00000000..1c93c05c --- /dev/null +++ b/src/test/resources/checks/v32/operations/OAR013/plain.yaml @@ -0,0 +1,14 @@ +openapi: "3.2.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: + get: + responses: # Noncompliant {{OAR013: Default response is required}} + 200: + description: Ok + post: + responses: + default: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v32/operations/OAR014/plain.json b/src/test/resources/checks/v32/operations/OAR014/plain.json new file mode 100644 index 00000000..e5976e87 --- /dev/null +++ b/src/test/resources/checks/v32/operations/OAR014/plain.json @@ -0,0 +1,54 @@ +{ + "openapi": "3.2.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/one": { + "get": { + "responses": { + "default": { + "description": "Ok" + } + } + } + }, + "/one/two": { + "get": { + "responses": { + "default": { + "description": "Ok" + } + } + } + }, + "/one/two/three": { + "get": { + "responses": { + "default": { + "description": "Ok" + } + } + } + }, + "/one/two/three/four": { # Noncompliant {{OAR014: Resources depth level should be smaller}} + "get": { + "responses": { + "default": { + "description": "Ok" + } + } + } + }, + "/one/two/three/four/five": { # Noncompliant {{OAR014: Resources depth level should be smaller}} + "get": { + "responses": { + "default": { + "description": "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/operations/OAR014/plain.yaml b/src/test/resources/checks/v32/operations/OAR014/plain.yaml new file mode 100644 index 00000000..a5037c89 --- /dev/null +++ b/src/test/resources/checks/v32/operations/OAR014/plain.yaml @@ -0,0 +1,30 @@ +openapi: "3.2.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /one: + get: + responses: + default: + description: Ok + /one/two: + get: + responses: + default: + description: Ok + /one/two/three: + get: + responses: + default: + description: Ok + /one/two/three/four: # Noncompliant {{OAR014: Resources depth level should be smaller}} + get: + responses: + default: + description: Ok + /one/two/three/four/five: # Noncompliant {{OAR014: Resources depth level should be smaller}} + get: + responses: + default: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v32/operations/OAR015/plain.json b/src/test/resources/checks/v32/operations/OAR015/plain.json new file mode 100644 index 00000000..97cb52fe --- /dev/null +++ b/src/test/resources/checks/v32/operations/OAR015/plain.json @@ -0,0 +1,72 @@ +{ + "openapi": "3.2.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/one": { + "get": { + "responses": { + "default": { + "description": "Ok" + } + } + } + }, + "/one/two": { + "get": { + "responses": { + "default": { + "description": "Ok" + } + } + } + }, + "/one/two/three": { + "get": { + "responses": { + "default": { + "description": "Ok" + } + } + } + }, + "/one/two/three/four": { + "get": { + "responses": { + "default": { + "description": "Ok" + } + } + } + }, + "/one/two/three/four/five": { + "get": { + "responses": { + "default": { + "description": "Ok" + } + } + } + }, + "/one/two/three/four/five/six": { # Noncompliant {{OAR015: Resources depth level should be smaller}} + "get": { + "responses": { + "default": { + "description": "Ok" + } + } + } + }, + "/one/two/three/four/five/six/seven": { # Noncompliant {{OAR015: Resources depth level should be smaller}} + "get": { + "responses": { + "default": { + "description": "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/operations/OAR015/plain.yaml b/src/test/resources/checks/v32/operations/OAR015/plain.yaml new file mode 100644 index 00000000..f29ada81 --- /dev/null +++ b/src/test/resources/checks/v32/operations/OAR015/plain.yaml @@ -0,0 +1,40 @@ +openapi: "3.2.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /one: + get: + responses: + default: + description: Ok + /one/two: + get: + responses: + default: + description: Ok + /one/two/three: + get: + responses: + default: + description: Ok + /one/two/three/four: + get: + responses: + default: + description: Ok + /one/two/three/four/five: + get: + responses: + default: + description: Ok + /one/two/three/four/five/six: # Noncompliant {{OAR015: Resources depth level should be smaller}} + get: + responses: + default: + description: Ok + /one/two/three/four/five/six/seven: # Noncompliant {{OAR015: Resources depth level should be smaller}} + get: + responses: + default: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v32/operations/OAR017/plain.json b/src/test/resources/checks/v32/operations/OAR017/plain.json new file mode 100644 index 00000000..96a1b033 --- /dev/null +++ b/src/test/resources/checks/v32/operations/OAR017/plain.json @@ -0,0 +1,54 @@ +{ + "openapi" : "3.2.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/one/me" : { # Noncompliant {{OAR017: Pattern 'me' not allowed}} + "get" : { + "responses" : { + "200" : { + "description" : "Ok" + } + } + } + }, + "/{one}" : { + "get" : { + "responses" : { + "200" : { + "description" : "Ok" + } + } + } + }, + "/one/two" : { + "get" : { + "responses" : { + "200" : { + "description" : "Ok" + } + } + } + }, + "/one/{two}" : { + "get" : { + "responses" : { + "200" : { + "description" : "Ok" + } + } + } + }, + "/one/{two}/three" : { + "get" : { + "responses" : { + "200" : { + "description" : "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/operations/OAR017/plain.yaml b/src/test/resources/checks/v32/operations/OAR017/plain.yaml new file mode 100644 index 00000000..bbf9a02a --- /dev/null +++ b/src/test/resources/checks/v32/operations/OAR017/plain.yaml @@ -0,0 +1,30 @@ +openapi: "3.2.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /one/me: # Noncompliant {{OAR017: Pattern 'me' not allowed}} + get: + responses: + 200: + description: Ok + /{one}: + get: + responses: + 200: + description: Ok + /one/two: + get: + responses: + 200: + description: Ok + /one/{two}: + get: + responses: + 200: + description: Ok + /one/{two}/three: + get: + responses: + 200: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v32/operations/OAR018/plain.json b/src/test/resources/checks/v32/operations/OAR018/plain.json new file mode 100644 index 00000000..470ce80b --- /dev/null +++ b/src/test/resources/checks/v32/operations/OAR018/plain.json @@ -0,0 +1,194 @@ +{ + "openapi": "3.2.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/resources": { + "get": { + "responses": { + "200": { + "description": "Ok" + } + } + }, + "post": { + "responses": { + "200": { + "description": "Ok" + } + } + }, + "put": { # Noncompliant {{OAR018: Operation not recommended for resource path: /resources}} + "responses": { + "200": { + "description": "Ok" + } + } + }, + "patch": { # Noncompliant {{OAR018: Operation not recommended for resource path: /resources}} + "responses": { + "200": { + "description": "Ok" + } + } + }, + "delete": { # Noncompliant {{OAR018: Operation not recommended for resource path: /resources}} + "responses": { + "200": { + "description": "Ok" + } + } + } + }, + "/resources/{r_id}": { + "get": { + "responses": { + "200": { + "description": "Ok" + } + } + }, + "post": { # Noncompliant {{OAR018: Operation not recommended for resource path: /resources/{r_id}}} + "responses": { + "200": { + "description": "Ok" + } + } + }, + "put": { + "responses": { + "200": { + "description": "Ok" + } + } + }, + "patch": { + "responses": { + "200": { + "description": "Ok" + } + } + }, + "delete": { + "responses": { + "200": { + "description": "Ok" + } + } + } + }, + "/resources/get": { + "get": { # Noncompliant {{OAR018: Operation not recommended for resource path: /resources/get}} + "responses": { + "200": { + "description": "Ok" + } + } + }, + "post": { + "responses": { + "200": { + "description": "Ok" + } + } + }, + "put": { # Noncompliant {{OAR018: Operation not recommended for resource path: /resources/get}} + "responses": { + "200": { + "description": "Ok" + } + } + }, + "patch": { # Noncompliant {{OAR018: Operation not recommended for resource path: /resources/get}} + "responses": { + "200": { + "description": "Ok" + } + } + }, + "delete": { # Noncompliant {{OAR018: Operation not recommended for resource path: /resources/get}} + "responses": { + "200": { + "description": "Ok" + } + } + } + }, + "/resources/delete": { + "get": { # Noncompliant {{OAR018: Operation not recommended for resource path: /resources/delete}} + "responses": { + "200": { + "description": "Ok" + } + } + }, + "post": { + "responses": { + "200": { + "description": "Ok" + } + } + }, + "put": { # Noncompliant {{OAR018: Operation not recommended for resource path: /resources/delete}} + "responses": { + "200": { + "description": "Ok" + } + } + }, + "patch": { # Noncompliant {{OAR018: Operation not recommended for resource path: /resources/delete}} + "responses": { + "200": { + "description": "Ok" + } + } + }, + "delete": { # Noncompliant {{OAR018: Operation not recommended for resource path: /resources/delete}} + "responses": { + "200": { + "description": "Ok" + } + } + } + }, + "/resources/{r_id}/other": { + "get": { + "responses": { + "200": { + "description": "Ok" + } + } + }, + "post": { + "responses": { + "200": { + "description": "Ok" + } + } + }, + "put": { # Noncompliant {{OAR018: Operation not recommended for resource path: /resources/{r_id}/other}} + "responses": { + "200": { + "description": "Ok" + } + } + }, + "patch": { # Noncompliant {{OAR018: Operation not recommended for resource path: /resources/{r_id}/other}} + "responses": { + "200": { + "description": "Ok" + } + } + }, + "delete": { # Noncompliant {{OAR018: Operation not recommended for resource path: /resources/{r_id}/other}} + "responses": { + "200": { + "description": "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/operations/OAR018/plain.yaml b/src/test/resources/checks/v32/operations/OAR018/plain.yaml new file mode 100644 index 00000000..aed8616a --- /dev/null +++ b/src/test/resources/checks/v32/operations/OAR018/plain.yaml @@ -0,0 +1,114 @@ +openapi: "3.2.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /resources: + get: + responses: + 200: + description: Ok + post: + responses: + 200: + description: Ok + put: # Noncompliant {{OAR018: Operation not recommended for resource path: /resources}} + responses: + 200: + description: Ok + patch: # Noncompliant {{OAR018: Operation not recommended for resource path: /resources}} + responses: + 200: + description: Ok + delete: # Noncompliant {{OAR018: Operation not recommended for resource path: /resources}} + responses: + 200: + description: Ok + + /resources/{r_id}: + get: + responses: + 200: + description: Ok + post: # Noncompliant {{OAR018: Operation not recommended for resource path: /resources/{r_id}}} + responses: + 200: + description: Ok + put: + responses: + 200: + description: Ok + patch: + responses: + 200: + description: Ok + delete: + responses: + 200: + description: Ok + + /resources/get: + get: # Noncompliant {{OAR018: Operation not recommended for resource path: /resources/get}} + responses: + 200: + description: Ok + post: + responses: + 200: + description: Ok + put: # Noncompliant {{OAR018: Operation not recommended for resource path: /resources/get}} + responses: + 200: + description: Ok + patch: # Noncompliant {{OAR018: Operation not recommended for resource path: /resources/get}} + responses: + 200: + description: Ok + delete: # Noncompliant {{OAR018: Operation not recommended for resource path: /resources/get}} + responses: + 200: + description: Ok + + /resources/delete: + get: # Noncompliant {{OAR018: Operation not recommended for resource path: /resources/delete}} + responses: + 200: + description: Ok + post: + responses: + 200: + description: Ok + put: # Noncompliant {{OAR018: Operation not recommended for resource path: /resources/delete}} + responses: + 200: + description: Ok + patch: # Noncompliant {{OAR018: Operation not recommended for resource path: /resources/delete}} + responses: + 200: + description: Ok + delete: # Noncompliant {{OAR018: Operation not recommended for resource path: /resources/delete}} + responses: + 200: + description: Ok + + /resources/{r_id}/other: + get: + responses: + 200: + description: Ok + post: + responses: + 200: + description: Ok + put: # Noncompliant {{OAR018: Operation not recommended for resource path: /resources/{r_id}/other}} + responses: + 200: + description: Ok + patch: # Noncompliant {{OAR018: Operation not recommended for resource path: /resources/{r_id}/other}} + responses: + 200: + description: Ok + delete: # Noncompliant {{OAR018: Operation not recommended for resource path: /resources/{r_id}/other}} + responses: + 200: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v32/operations/OAR027/no-post.json b/src/test/resources/checks/v32/operations/OAR027/no-post.json new file mode 100644 index 00000000..b0d8cd88 --- /dev/null +++ b/src/test/resources/checks/v32/operations/OAR027/no-post.json @@ -0,0 +1,18 @@ +{ + "openapi" : "3.2.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/pets" : { + "get" : { + "responses" : { + "201" : { + "description" : "Found" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/operations/OAR027/no-post.yaml b/src/test/resources/checks/v32/operations/OAR027/no-post.yaml new file mode 100644 index 00000000..430d9384 --- /dev/null +++ b/src/test/resources/checks/v32/operations/OAR027/no-post.yaml @@ -0,0 +1,10 @@ +openapi: "3.2.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: + get: + responses: + 201: + description: Found \ No newline at end of file diff --git a/src/test/resources/checks/v32/operations/OAR027/post-201-with-location.json b/src/test/resources/checks/v32/operations/OAR027/post-201-with-location.json new file mode 100644 index 00000000..d0a66815 --- /dev/null +++ b/src/test/resources/checks/v32/operations/OAR027/post-201-with-location.json @@ -0,0 +1,25 @@ +{ + "openapi" : "3.2.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/pets/" : { + "post" : { + "responses" : { + "201" : { + "description" : "Created", + "headers" : { + "Location" : { + "schema": { + "type" : "string" + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/operations/OAR027/post-201-with-location.yaml b/src/test/resources/checks/v32/operations/OAR027/post-201-with-location.yaml new file mode 100644 index 00000000..8a83e03c --- /dev/null +++ b/src/test/resources/checks/v32/operations/OAR027/post-201-with-location.yaml @@ -0,0 +1,14 @@ +openapi: "3.2.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets/: + post: + responses: + 201: + description: Created + headers: + Location: + schema: + type: string \ No newline at end of file diff --git a/src/test/resources/checks/v32/operations/OAR027/post-201-with-other-headers.json b/src/test/resources/checks/v32/operations/OAR027/post-201-with-other-headers.json new file mode 100644 index 00000000..c8fd6785 --- /dev/null +++ b/src/test/resources/checks/v32/operations/OAR027/post-201-with-other-headers.json @@ -0,0 +1,25 @@ +{ + "openapi" : "3.2.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/pets/" : { + "post" : { + "responses" : { + "201" : { + "description" : "Created", + "headers" : { # Noncompliant {{OAR027: Location header is required in responses with code 201 from POST operations}} + "X-Location" : { + "schema": { + "type" : "string" + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/operations/OAR027/post-201-with-other-headers.yaml b/src/test/resources/checks/v32/operations/OAR027/post-201-with-other-headers.yaml new file mode 100644 index 00000000..74e0450a --- /dev/null +++ b/src/test/resources/checks/v32/operations/OAR027/post-201-with-other-headers.yaml @@ -0,0 +1,14 @@ +openapi: "3.2.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets/: + post: + responses: + 201: + description: Created + headers: # Noncompliant {{OAR027: Location header is required in responses with code 201 from POST operations}} + X-Location: + schema: + type: string \ No newline at end of file diff --git a/src/test/resources/checks/v32/operations/OAR027/post-201-without-location.json b/src/test/resources/checks/v32/operations/OAR027/post-201-without-location.json new file mode 100644 index 00000000..d5c533f8 --- /dev/null +++ b/src/test/resources/checks/v32/operations/OAR027/post-201-without-location.json @@ -0,0 +1,18 @@ +{ + "openapi" : "3.2.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/pets" : { + "post" : { + "responses" : { + "201" : { # Noncompliant {{OAR027: Location header is required in responses with code 201 from POST operations}} + "description" : "Created" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/operations/OAR027/post-201-without-location.yaml b/src/test/resources/checks/v32/operations/OAR027/post-201-without-location.yaml new file mode 100644 index 00000000..4b5ba620 --- /dev/null +++ b/src/test/resources/checks/v32/operations/OAR027/post-201-without-location.yaml @@ -0,0 +1,10 @@ +openapi: "3.2.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: + post: + responses: + 201: # Noncompliant {{OAR027: Location header is required in responses with code 201 from POST operations}} + description: Created \ No newline at end of file diff --git a/src/test/resources/checks/v32/operations/OAR027/post-no-201.json b/src/test/resources/checks/v32/operations/OAR027/post-no-201.json new file mode 100644 index 00000000..af7a2bf5 --- /dev/null +++ b/src/test/resources/checks/v32/operations/OAR027/post-no-201.json @@ -0,0 +1,18 @@ +{ + "openapi" : "3.2.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/pets" : { + "post" : { + "responses" : { + "200" : { + "description" : "OK" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/operations/OAR027/post-no-201.yaml b/src/test/resources/checks/v32/operations/OAR027/post-no-201.yaml new file mode 100644 index 00000000..89cbdd7a --- /dev/null +++ b/src/test/resources/checks/v32/operations/OAR027/post-no-201.yaml @@ -0,0 +1,10 @@ +openapi: "3.2.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: + post: + responses: + 200: + description: OK \ No newline at end of file diff --git a/src/test/resources/checks/v32/operations/OAR030/valid.json b/src/test/resources/checks/v32/operations/OAR030/valid.json new file mode 100644 index 00000000..9fb64210 --- /dev/null +++ b/src/test/resources/checks/v32/operations/OAR030/valid.json @@ -0,0 +1,27 @@ +{ + "openapi" : "3.2.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/status" : { + "get" : { + "responses" : { + "200" : { + "description" : "Ok" + } + } + } + }, + "/other" : { + "get" : { + "responses" : { + "200" : { + "description" : "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/operations/OAR030/valid.yaml b/src/test/resources/checks/v32/operations/OAR030/valid.yaml new file mode 100644 index 00000000..b084d2f4 --- /dev/null +++ b/src/test/resources/checks/v32/operations/OAR030/valid.yaml @@ -0,0 +1,15 @@ +openapi: "3.2.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /status: + get: + responses: + 200: + description: Ok + /other: + get: + responses: + 200: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v32/operations/OAR030/with-status-without-get.json b/src/test/resources/checks/v32/operations/OAR030/with-status-without-get.json new file mode 100644 index 00000000..de85e0af --- /dev/null +++ b/src/test/resources/checks/v32/operations/OAR030/with-status-without-get.json @@ -0,0 +1,27 @@ +{ + "openapi" : "3.2.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/status" : { # Noncompliant {{OAR030: Method get must be declared}} + "post" : { + "responses" : { + "200" : { + "description" : "Ok" + } + } + } + }, + "/other" : { + "get" : { + "responses" : { + "200" : { + "description" : "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/operations/OAR030/with-status-without-get.yaml b/src/test/resources/checks/v32/operations/OAR030/with-status-without-get.yaml new file mode 100644 index 00000000..c5b262df --- /dev/null +++ b/src/test/resources/checks/v32/operations/OAR030/with-status-without-get.yaml @@ -0,0 +1,15 @@ +openapi: "3.2.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /status: # Noncompliant {{OAR030: Method get must be declared}} + post: + responses: + 200: + description: Ok + /other: + get: + responses: + 200: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v32/operations/OAR030/without-status.json b/src/test/resources/checks/v32/operations/OAR030/without-status.json new file mode 100644 index 00000000..15d69e15 --- /dev/null +++ b/src/test/resources/checks/v32/operations/OAR030/without-status.json @@ -0,0 +1,18 @@ +{ + "openapi" : "3.2.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { # Noncompliant {{OAR030: The path '/status' must be declared}} + "/other" : { + "get" : { + "responses" : { + "200" : { + "description" : "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/operations/OAR030/without-status.yaml b/src/test/resources/checks/v32/operations/OAR030/without-status.yaml new file mode 100644 index 00000000..1c969a70 --- /dev/null +++ b/src/test/resources/checks/v32/operations/OAR030/without-status.yaml @@ -0,0 +1,10 @@ +openapi: "3.2.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: # Noncompliant {{OAR030: The path '/status' must be declared}} + /other: + get: + responses: + 200: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v32/operations/OAR032/forbidden-names.json b/src/test/resources/checks/v32/operations/OAR032/forbidden-names.json new file mode 100644 index 00000000..e0a00540 --- /dev/null +++ b/src/test/resources/checks/v32/operations/OAR032/forbidden-names.json @@ -0,0 +1,36 @@ +{ + "openapi" : "3.2.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/elements" : { # Noncompliant {{OAR032: Ambiguous path parts not encouraged: elements}} + "get" : { + "responses" : { + "200" : { + "description" : "Ok" + } + } + } + }, + "/a/nested/items" : { # Noncompliant {{OAR032: Ambiguous path parts not encouraged: items}} + "get" : { + "responses" : { + "200" : { + "description" : "Ok" + } + } + } + }, + "/another/{param}/with/valores" : { # Noncompliant {{OAR032: Ambiguous path parts not encouraged: valores}} + "get" : { + "responses" : { + "200" : { + "description" : "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/operations/OAR032/forbidden-names.yaml b/src/test/resources/checks/v32/operations/OAR032/forbidden-names.yaml new file mode 100644 index 00000000..babefe4b --- /dev/null +++ b/src/test/resources/checks/v32/operations/OAR032/forbidden-names.yaml @@ -0,0 +1,20 @@ +openapi: "3.2.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /elements: # Noncompliant {{OAR032: Ambiguous path parts not encouraged: elements}} + get: + responses: + 200: + description: Ok + /a/nested/items: # Noncompliant {{OAR032: Ambiguous path parts not encouraged: items}} + get: + responses: + 200: + description: Ok + /another/{param}/with/valores: # Noncompliant {{OAR032: Ambiguous path parts not encouraged: valores}} + get: + responses: + 200: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v32/operations/OAR032/valid.json b/src/test/resources/checks/v32/operations/OAR032/valid.json new file mode 100644 index 00000000..6360b965 --- /dev/null +++ b/src/test/resources/checks/v32/operations/OAR032/valid.json @@ -0,0 +1,27 @@ +{ + "openapi" : "3.2.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/pets" : { + "get" : { + "responses" : { + "200" : { + "description" : "Ok" + } + } + } + }, + "/pets/{elements}" : { + "get" : { + "responses" : { + "200" : { + "description" : "Ok" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/operations/OAR032/valid.yaml b/src/test/resources/checks/v32/operations/OAR032/valid.yaml new file mode 100644 index 00000000..2b13ba92 --- /dev/null +++ b/src/test/resources/checks/v32/operations/OAR032/valid.yaml @@ -0,0 +1,15 @@ +openapi: "3.2.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: + get: + responses: + 200: + description: Ok + /pets/{elements}: + get: + responses: + 200: + description: Ok \ No newline at end of file diff --git a/src/test/resources/checks/v32/operations/OAR038/valid-multiple-properties.json b/src/test/resources/checks/v32/operations/OAR038/valid-multiple-properties.json new file mode 100644 index 00000000..12fc95b7 --- /dev/null +++ b/src/test/resources/checks/v32/operations/OAR038/valid-multiple-properties.json @@ -0,0 +1,48 @@ +{ + "openapi" : "3.2.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/endpoint" : { + "post" : { + "responses" : { + "201" : { + "description" : "Ok", + "content": { + "application/json":{ + "schema" : { + "$ref" : "#/components/schemas/response" + } + } + } + }, + "204" : { + "description" : "No content" + } + } + } + } + }, + "components": { + "schemas": { + "response" : { + "type" : "object", + "properties" : { + "data" : { + "type" : "object", + "properties" : { + "id" : { + "type" : "string" + }, + "name" : { + "type" : "string" + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/operations/OAR038/valid-multiple-properties.yaml b/src/test/resources/checks/v32/operations/OAR038/valid-multiple-properties.yaml new file mode 100644 index 00000000..d5abbc7b --- /dev/null +++ b/src/test/resources/checks/v32/operations/OAR038/valid-multiple-properties.yaml @@ -0,0 +1,29 @@ +openapi: "3.2.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /endpoint: + post: + responses: + 201: + description: Ok + content: + application/json: + schema: + $ref: '#/components/schemas/response' + 204: + description: No content + +components: + schemas: + response: + type: object + properties: + data: + type: object + properties: + id: + type: string + name: + type: string diff --git a/src/test/resources/checks/v32/operations/OAR038/valid-one-property.json b/src/test/resources/checks/v32/operations/OAR038/valid-one-property.json new file mode 100644 index 00000000..2962b123 --- /dev/null +++ b/src/test/resources/checks/v32/operations/OAR038/valid-one-property.json @@ -0,0 +1,45 @@ +{ + "openapi" : "3.2.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/endpoint" : { + "post" : { + "responses" : { + "201" : { + "description" : "Ok", + "content": { + "application/json":{ + "schema" : { + "$ref" : "#/components/schemas/response" + } + } + } + }, + "204" : { + "description" : "No content" + } + } + } + } + }, + "components": { + "schemas": { + "response" : { + "type" : "object", + "properties" : { + "data" : { + "type" : "object", + "properties" : { + "id" : { + "type" : "string" + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/operations/OAR038/valid-one-property.yaml b/src/test/resources/checks/v32/operations/OAR038/valid-one-property.yaml new file mode 100644 index 00000000..64779efd --- /dev/null +++ b/src/test/resources/checks/v32/operations/OAR038/valid-one-property.yaml @@ -0,0 +1,27 @@ +openapi: "3.2.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /endpoint: + post: + responses: + 201: + description: Ok + content: + application/json: + schema: + $ref: '#/components/schemas/response' + 204: + description: No content + +components: + schemas: + response: + type: object + properties: + data: + type: object + properties: + id: + type: string diff --git a/src/test/resources/checks/v32/operations/OAR038/with-properties-empty.json b/src/test/resources/checks/v32/operations/OAR038/with-properties-empty.json new file mode 100644 index 00000000..d8e8fe72 --- /dev/null +++ b/src/test/resources/checks/v32/operations/OAR038/with-properties-empty.json @@ -0,0 +1,41 @@ +{ + "openapi" : "3.2.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/endpoint" : { + "post" : { + "responses" : { + "201" : { + "description" : "Ok", + "content": { + "application/json":{ + "schema" : { + "$ref" : "#/components/schemas/response" + } + } + } + }, + "204" : { + "description" : "No content" + } + } + } + } + }, + "components": { + "schemas": { + "response" : { + "type" : "object", + "properties" : { + "data" : { # Noncompliant {{OAR038: At least you have to define the identifier property}} + "type" : "object", + "properties" : { } + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/operations/OAR038/with-properties-empty.yaml b/src/test/resources/checks/v32/operations/OAR038/with-properties-empty.yaml new file mode 100644 index 00000000..853cc923 --- /dev/null +++ b/src/test/resources/checks/v32/operations/OAR038/with-properties-empty.yaml @@ -0,0 +1,25 @@ +openapi: "3.2.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /endpoint: + post: + responses: + 201: + description: Ok + content: + application/json: + schema: + $ref: '#/components/schemas/response' + 204: + description: No content + +components: + schemas: + response: + type: object + properties: + data: # Noncompliant {{OAR038: At least you have to define the identifier property}} + type: object + properties: {} diff --git a/src/test/resources/checks/v32/operations/OAR038/without-data.json b/src/test/resources/checks/v32/operations/OAR038/without-data.json new file mode 100644 index 00000000..9a51222d --- /dev/null +++ b/src/test/resources/checks/v32/operations/OAR038/without-data.json @@ -0,0 +1,35 @@ +{ + "openapi" : "3.2.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/endpoint" : { + "post" : { + "responses" : { + "201" : { + "description" : "Ok", + "content": { + "application/json":{ + "schema" : { + "$ref" : "#/components/schemas/response" + } + } + } + }, + "204" : { + "description" : "No content" + } + } + } + } + }, + "components": { + "schemas" : { + "response" : { # Noncompliant {{OAR038: 'data' property is missing}} + "type" : "object" + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/operations/OAR038/without-data.yaml b/src/test/resources/checks/v32/operations/OAR038/without-data.yaml new file mode 100644 index 00000000..47934fe1 --- /dev/null +++ b/src/test/resources/checks/v32/operations/OAR038/without-data.yaml @@ -0,0 +1,21 @@ +openapi: "3.2.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /endpoint: + post: + responses: + 201: + description: Ok + content: + application/json: + schema: + $ref: '#/components/schemas/response' + 204: + description: No content + +components: + schemas: + response: # Noncompliant {{OAR038: 'data' property is missing}} + type: object \ No newline at end of file diff --git a/src/test/resources/checks/v32/operations/OAR038/without-properties.json b/src/test/resources/checks/v32/operations/OAR038/without-properties.json new file mode 100644 index 00000000..821d557a --- /dev/null +++ b/src/test/resources/checks/v32/operations/OAR038/without-properties.json @@ -0,0 +1,53 @@ +{ + "openapi": "3.2.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/endpoint": { + "post": { + "responses": { + "201": { + "$ref": "#/components/responses/createResponse" + }, + "204": { + "description": "No content" + } + } + } + } + }, + "components": { + "schemas": { + "response": { + "type": "object", + "allOf": [ + { + "$ref": "#/components/schemas/post_response" + } + ] + }, + "post_response": { + "type": "object", + "properties": { + "data": { # Noncompliant {{OAR038: At least you have to define the identifier property}} + "type": "object" + } + } + } + }, + "responses": { + "createResponse": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/response" + } + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/operations/OAR038/without-properties.yaml b/src/test/resources/checks/v32/operations/OAR038/without-properties.yaml new file mode 100644 index 00000000..ab65b6ae --- /dev/null +++ b/src/test/resources/checks/v32/operations/OAR038/without-properties.yaml @@ -0,0 +1,33 @@ +openapi: "3.2.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /endpoint: + post: + responses: + 201: + $ref: '#/components/responses/createResponse' + 204: + description: No content + +components: + schemas: + response: + type: object + allOf: + - $ref: '#/components/schemas/post_response' + + post_response: + type: object + properties: + data: # Noncompliant {{OAR038: At least you have to define the identifier property}} + type: object + + responses: + createResponse: + description: Ok + content: + application/json: + schema: + $ref: '#/components/schemas/response' \ No newline at end of file diff --git a/src/test/resources/checks/v32/operations/OAR038/without-schema.json b/src/test/resources/checks/v32/operations/OAR038/without-schema.json new file mode 100644 index 00000000..4e661996 --- /dev/null +++ b/src/test/resources/checks/v32/operations/OAR038/without-schema.json @@ -0,0 +1,21 @@ +{ + "openapi" : "3.2.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/endpoint" : { + "post" : { + "responses" : { + "201" : { # Noncompliant {{OAR038: Response schema is required}} + "description" : "Ok" + }, + "204" : { + "description" : "No content" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/operations/OAR038/without-schema.yaml b/src/test/resources/checks/v32/operations/OAR038/without-schema.yaml new file mode 100644 index 00000000..6d2d9070 --- /dev/null +++ b/src/test/resources/checks/v32/operations/OAR038/without-schema.yaml @@ -0,0 +1,12 @@ +openapi: "3.2.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /endpoint: + post: + responses: + 201: # Noncompliant {{OAR038: Response schema is required}} + description: Ok + 204: + description: No content \ No newline at end of file diff --git a/src/test/resources/checks/v32/operations/OAR039/missing-codes.json b/src/test/resources/checks/v32/operations/OAR039/missing-codes.json new file mode 100644 index 00000000..0a97606f --- /dev/null +++ b/src/test/resources/checks/v32/operations/OAR039/missing-codes.json @@ -0,0 +1,109 @@ +{ + "openapi" : "3.2.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths": { + "/pets": { + "get": { + "responses": { # Noncompliant {{OAR039: Response code 200 or 206 must be defined}} {{OAR039: Response code 400 must be defined}} {{OAR039: Response code 500 must be defined}} {{OAR039: Response code 503 must be defined}} + "default": { + "description": "Unexpected error" + } + } + }, + "post": { + "responses": { # Noncompliant {{OAR039: Response code 200 or 201 or 202 must be defined}} {{OAR039: Response code 400 must be defined}} {{OAR039: Response code 415 must be defined}} {{OAR039: Response code 500 must be defined}} {{OAR039: Response code 503 must be defined}} + "default": { + "description": "Unexpected error" + } + } + } + }, + "/pets/get": { + "post": { + "responses": { # Noncompliant {{OAR039: Response code 200 must be defined}} {{OAR039: Response code 400 must be defined}} {{OAR039: Response code 404 must be defined}} {{OAR039: Response code 415 must be defined}} {{OAR039: Response code 500 must be defined}} {{OAR039: Response code 503 must be defined}} + "default": { + "description": "Unexpected error" + } + } + } + }, + "/pets/delete": { + "post": { + "responses": { # Noncompliant {{OAR039: Response code 200 must be defined}} {{OAR039: Response code 400 must be defined}} {{OAR039: Response code 404 must be defined}} {{OAR039: Response code 415 must be defined}} {{OAR039: Response code 500 must be defined}} {{OAR039: Response code 503 must be defined}} + "default": { + "description": "Unexpected error" + } + } + } + }, + "/pets/{id}": { + "get": { + "responses": { # Noncompliant {{OAR039: Response code 200 must be defined}} {{OAR039: Response code 400 must be defined}} {{OAR039: Response code 404 must be defined}} {{OAR039: Response code 500 must be defined}} {{OAR039: Response code 503 must be defined}} + "default": { + "description": "Unexpected error" + } + } + }, + "put": { + "responses": { # Noncompliant {{OAR039: Response code 200 must be defined}} {{OAR039: Response code 400 must be defined}} {{OAR039: Response code 404 must be defined}} {{OAR039: Response code 415 must be defined}} {{OAR039: Response code 500 must be defined}} {{OAR039: Response code 503 must be defined}} + "default": { + "description": "Unexpected error" + } + } + }, + "patch": { + "responses": { # Noncompliant {{OAR039: Response code 200 must be defined}} {{OAR039: Response code 400 must be defined}} {{OAR039: Response code 404 must be defined}} {{OAR039: Response code 415 must be defined}} {{OAR039: Response code 500 must be defined}} {{OAR039: Response code 503 must be defined}} + "default": { + "description": "Unexpected error" + } + } + }, + "delete": { + "responses": { # Noncompliant {{OAR039: Response code 200 must be defined}} {{OAR039: Response code 400 must be defined}} {{OAR039: Response code 404 must be defined}} {{OAR039: Response code 500 must be defined}} {{OAR039: Response code 503 must be defined}} + "default": { + "description": "Unexpected error" + } + } + } + }, + "/pets/{id}/owner": { + "post": { + "responses": { # Noncompliant {{OAR039: Response code 200 or 201 or 202 must be defined}} {{OAR039: Response code 400 must be defined}} {{OAR039: Response code 404 must be defined}} {{OAR039: Response code 415 must be defined}} {{OAR039: Response code 500 must be defined}} {{OAR039: Response code 503 must be defined}} + "default": { + "description": "Unexpected error" + } + } + } + }, + "/pets/{id}/owner/get": { + "post": { + "responses": { # Noncompliant {{OAR039: Response code 200 must be defined}} {{OAR039: Response code 400 must be defined}} {{OAR039: Response code 404 must be defined}} {{OAR039: Response code 415 must be defined}} {{OAR039: Response code 500 must be defined}} {{OAR039: Response code 503 must be defined}} + "default": { + "description": "Unexpected error" + } + } + } + }, + "/pets/{id}/owner/delete": { + "post": { + "responses": { # Noncompliant {{OAR039: Response code 200 must be defined}} {{OAR039: Response code 400 must be defined}} {{OAR039: Response code 404 must be defined}} {{OAR039: Response code 415 must be defined}} {{OAR039: Response code 500 must be defined}} {{OAR039: Response code 503 must be defined}} + "default": { + "description": "Unexpected error" + } + } + } + }, + "/status": { + "get": { + "responses": { + "default": { + "description": "Unexpected error" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/operations/OAR039/missing-codes.yaml b/src/test/resources/checks/v32/operations/OAR039/missing-codes.yaml new file mode 100644 index 00000000..a3761ff4 --- /dev/null +++ b/src/test/resources/checks/v32/operations/OAR039/missing-codes.yaml @@ -0,0 +1,68 @@ +openapi: "3.2.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: + get: + responses: # Noncompliant {{OAR039: Response code 200 or 206 must be defined}} {{OAR039: Response code 400 must be defined}} {{OAR039: Response code 500 must be defined}} {{OAR039: Response code 503 must be defined}} + default: + description: Unexpected error + post: + responses: # Noncompliant {{OAR039: Response code 200 or 201 or 202 must be defined}} {{OAR039: Response code 400 must be defined}} {{OAR039: Response code 415 must be defined}} {{OAR039: Response code 500 must be defined}} {{OAR039: Response code 503 must be defined}} + default: + description: Unexpected error + + /pets/get: + post: + responses: # Noncompliant {{OAR039: Response code 200 must be defined}} {{OAR039: Response code 400 must be defined}} {{OAR039: Response code 404 must be defined}} {{OAR039: Response code 415 must be defined}} {{OAR039: Response code 500 must be defined}} {{OAR039: Response code 503 must be defined}} + default: + description: Unexpected error + + /pets/delete: + post: + responses: # Noncompliant {{OAR039: Response code 200 must be defined}} {{OAR039: Response code 400 must be defined}} {{OAR039: Response code 404 must be defined}} {{OAR039: Response code 415 must be defined}} {{OAR039: Response code 500 must be defined}} {{OAR039: Response code 503 must be defined}} + default: + description: Unexpected error + + /pets/{id}: + get: + responses: # Noncompliant {{OAR039: Response code 200 must be defined}} {{OAR039: Response code 400 must be defined}} {{OAR039: Response code 404 must be defined}} {{OAR039: Response code 500 must be defined}} {{OAR039: Response code 503 must be defined}} + default: + description: Unexpected error + put: + responses: # Noncompliant {{OAR039: Response code 200 must be defined}} {{OAR039: Response code 400 must be defined}} {{OAR039: Response code 404 must be defined}} {{OAR039: Response code 415 must be defined}} {{OAR039: Response code 500 must be defined}} {{OAR039: Response code 503 must be defined}} + default: + description: Unexpected error + patch: + responses: # Noncompliant {{OAR039: Response code 200 must be defined}} {{OAR039: Response code 400 must be defined}} {{OAR039: Response code 404 must be defined}} {{OAR039: Response code 415 must be defined}} {{OAR039: Response code 500 must be defined}} {{OAR039: Response code 503 must be defined}} + default: + description: Unexpected error + delete: + responses: # Noncompliant {{OAR039: Response code 200 must be defined}} {{OAR039: Response code 400 must be defined}} {{OAR039: Response code 404 must be defined}} {{OAR039: Response code 500 must be defined}} {{OAR039: Response code 503 must be defined}} + default: + description: Unexpected error + + /pets/{id}/owner: + post: + responses: # Noncompliant {{OAR039: Response code 200 or 201 or 202 must be defined}} {{OAR039: Response code 400 must be defined}} {{OAR039: Response code 404 must be defined}} {{OAR039: Response code 415 must be defined}} {{OAR039: Response code 500 must be defined}} {{OAR039: Response code 503 must be defined}} + default: + description: Unexpected error + + /pets/{id}/owner/get: + post: + responses: # Noncompliant {{OAR039: Response code 200 must be defined}} {{OAR039: Response code 400 must be defined}} {{OAR039: Response code 404 must be defined}} {{OAR039: Response code 415 must be defined}} {{OAR039: Response code 500 must be defined}} {{OAR039: Response code 503 must be defined}} + default: + description: Unexpected error + + /pets/{id}/owner/delete: + post: + responses: # Noncompliant {{OAR039: Response code 200 must be defined}} {{OAR039: Response code 400 must be defined}} {{OAR039: Response code 404 must be defined}} {{OAR039: Response code 415 must be defined}} {{OAR039: Response code 500 must be defined}} {{OAR039: Response code 503 must be defined}} + default: + description: Unexpected error + + /status: + get: + responses: + default: + description: Unexpected error \ No newline at end of file diff --git a/src/test/resources/checks/v32/operations/OAR039/valid.json b/src/test/resources/checks/v32/operations/OAR039/valid.json new file mode 100644 index 00000000..e0abd6e0 --- /dev/null +++ b/src/test/resources/checks/v32/operations/OAR039/valid.json @@ -0,0 +1,283 @@ +{ + "openapi" : "3.2.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths": { + "/pets": { + "get": { + "responses": { + "206": { + "description": "Partial collection" + }, + "400": { + "description": "Bad request" + }, + "500": { + "description": "Internal server error" + }, + "503": { + "description": "Service unavailable" + } + } + }, + "post": { + "responses": { + "201": { + "description": "Created" + }, + "400": { + "description": "Bad request" + }, + "413": { + "description": "Payload too large" + }, + "415": { + "description": "Unsupported media type" + }, + "500": { + "description": "Internal server error" + }, + "503": { + "description": "Service unavailable" + } + } + } + }, + "/pets/get": { + "post": { + "responses": { + "200": { + "description": "Ok" + }, + "400": { + "description": "Bad request" + }, + "404": { + "description": "Not found" + }, + "413": { + "description": "Payload too large" + }, + "415": { + "description": "Unsupported media type" + }, + "500": { + "description": "Internal server error" + }, + "503": { + "description": "Service unavailable" + } + } + } + }, + "/pets/delete": { + "post": { + "responses": { + "200": { + "description": "Ok" + }, + "400": { + "description": "Bad request" + }, + "404": { + "description": "Not found" + }, + "413": { + "description": "Payload too large" + }, + "415": { + "description": "Unsupported media type" + }, + "500": { + "description": "Internal server error" + }, + "503": { + "description": "Service unavailable" + } + } + } + }, + "/pets/{id}": { + "get": { + "responses": { + "200": { + "description": "Ok" + }, + "400": { + "description": "Bad request" + }, + "404": { + "description": "Not found" + }, + "500": { + "description": "Internal server error" + }, + "503": { + "description": "Service unavailable" + } + } + }, + "put": { + "responses": { + "200": { + "description": "Ok" + }, + "400": { + "description": "Bad request" + }, + "404": { + "description": "Not found" + }, + "413": { + "description": "Payload too large" + }, + "415": { + "description": "Unsupported media type" + }, + "500": { + "description": "Internal server error" + }, + "503": { + "description": "Service unavailable" + } + } + }, + "patch": { + "responses": { + "200": { + "description": "Ok" + }, + "400": { + "description": "Bad request" + }, + "404": { + "description": "Not found" + }, + "413": { + "description": "Payload too large" + }, + "415": { + "description": "Unsupported media type" + }, + "500": { + "description": "Internal server error" + }, + "503": { + "description": "Service unavailable" + } + } + }, + "delete": { + "responses": { + "200": { + "description": "Ok" + }, + "400": { + "description": "Bad request" + }, + "404": { + "description": "Not found" + }, + "500": { + "description": "Internal server error" + }, + "503": { + "description": "Service unavailable" + } + } + } + }, + "/pets/{id}/owner": { + "post": { + "responses": { + "201": { + "description": "Created" + }, + "400": { + "description": "Bad request" + }, + "404": { + "description": "Not found" + }, + "413": { + "description": "Payload too large" + }, + "415": { + "description": "Unsupported media type" + }, + "500": { + "description": "Internal server error" + }, + "503": { + "description": "Service unavailable" + } + } + } + }, + "/pets/{id}/owner/get": { + "post": { + "responses": { + "200": { + "description": "Ok" + }, + "400": { + "description": "Bad request" + }, + "404": { + "description": "Not found" + }, + "413": { + "description": "Payload too large" + }, + "415": { + "description": "Unsupported media type" + }, + "500": { + "description": "Internal server error" + }, + "503": { + "description": "Service unavailable" + } + } + } + }, + "/pets/{id}/owner/delete": { + "post": { + "responses": { + "200": { + "description": "Ok" + }, + "400": { + "description": "Bad request" + }, + "404": { + "description": "Not found" + }, + "413": { + "description": "Payload too large" + }, + "415": { + "description": "Unsupported media type" + }, + "500": { + "description": "Internal server error" + }, + "503": { + "description": "Service unavailable" + } + } + } + }, + "/status": { + "get": { + "responses": { + "default": { + "description": "Unexpected error" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/operations/OAR039/valid.yaml b/src/test/resources/checks/v32/operations/OAR039/valid.yaml new file mode 100644 index 00000000..6d1fc278 --- /dev/null +++ b/src/test/resources/checks/v32/operations/OAR039/valid.yaml @@ -0,0 +1,184 @@ +openapi: "3.2.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: + get: + responses: + 206: + description: Partial collection + 400: + description: Bad request + 500: + description: Internal server error + 503: + description: Service unavailable + post: + responses: + 201: + description: Created + 400: + description: Bad request + 413: + description: Payload too large + 415: + description: Unsupported media type + 500: + description: Internal server error + 503: + description: Service unavailable + + /pets/get: + post: + responses: + 200: + description: Ok + 400: + description: Bad request + 404: + description: Not found + 413: + description: Payload too large + 415: + description: Unsupported media type + 500: + description: Internal server error + 503: + description: Service unavailable + + /pets/delete: + post: + responses: + 200: + description: Ok + 400: + description: Bad request + 404: + description: Not found + 413: + description: Payload too large + 415: + description: Unsupported media type + 500: + description: Internal server error + 503: + description: Service unavailable + + /pets/{id}: + get: + responses: + 200: + description: Ok + 400: + description: Bad request + 404: + description: Not found + 500: + description: Internal server error + 503: + description: Service unavailable + put: + responses: + 200: + description: Ok + 400: + description: Bad request + 404: + description: Not found + 413: + description: Payload too large + 415: + description: Unsupported media type + 500: + description: Internal server error + 503: + description: Service unavailable + patch: + responses: + 200: + description: Ok + 400: + description: Bad request + 404: + description: Not found + 413: + description: Payload too large + 415: + description: Unsupported media type + 500: + description: Internal server error + 503: + description: Service unavailable + delete: + responses: + 200: + description: Ok + 400: + description: Bad request + 404: + description: Not found + 500: + description: Internal server error + 503: + description: Service unavailable + + /pets/{id}/owner: + post: + responses: + 201: + description: Created + 400: + description: Bad request + 404: + description: Not found + 413: + description: Payload too large + 415: + description: Unsupported media type + 500: + description: Internal server error + 503: + description: Service unavailable + + /pets/{id}/owner/get: + post: + responses: + 200: + description: Ok + 400: + description: Bad request + 404: + description: Not found + 413: + description: Payload too large + 415: + description: Unsupported media type + 500: + description: Internal server error + 503: + description: Service unavailable + + /pets/{id}/owner/delete: + post: + responses: + 200: + description: Ok + 400: + description: Bad request + 404: + description: Not found + 413: + description: Payload too large + 415: + description: Unsupported media type + 500: + description: Internal server error + 503: + description: Service unavailable + + /status: + get: + responses: + default: + description: Unexpected error \ No newline at end of file diff --git a/src/test/resources/checks/v32/operations/OAR045/defined-response.json b/src/test/resources/checks/v32/operations/OAR045/defined-response.json index f86d6ac4..b19ef64b 100644 --- a/src/test/resources/checks/v32/operations/OAR045/defined-response.json +++ b/src/test/resources/checks/v32/operations/OAR045/defined-response.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v32/operations/OAR045/defined-response.yaml b/src/test/resources/checks/v32/operations/OAR045/defined-response.yaml index 4370ac6c..14f08cea 100644 --- a/src/test/resources/checks/v32/operations/OAR045/defined-response.yaml +++ b/src/test/resources/checks/v32/operations/OAR045/defined-response.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.0 +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/operations/OAR046/declared-tag.json b/src/test/resources/checks/v32/operations/OAR046/declared-tag.json new file mode 100644 index 00000000..e21e1581 --- /dev/null +++ b/src/test/resources/checks/v32/operations/OAR046/declared-tag.json @@ -0,0 +1,26 @@ +{ + "openapi" : "3.2.0", + "tags" : [ { + "name" : "used-tag", + "description" : "a tag referenced in the operations" + } ], + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/pets" : { + "get" : { + "tags" : [ "used-tag" ], + "responses" : { } + }, + "post" : { # Noncompliant {{OAR046: Associate a tag to this operation}} + "responses" : { + "default" : { + "description" : "the default response" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/operations/OAR046/declared-tag.yaml b/src/test/resources/checks/v32/operations/OAR046/declared-tag.yaml new file mode 100644 index 00000000..060d6d42 --- /dev/null +++ b/src/test/resources/checks/v32/operations/OAR046/declared-tag.yaml @@ -0,0 +1,17 @@ +openapi: "3.2.0" +tags: +- name: used-tag + description: a tag referenced in the operations +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: + get: + tags: + - used-tag + responses: {} + post: # Noncompliant {{OAR046: Associate a tag to this operation}} + responses: + default: + description: the default response \ No newline at end of file diff --git a/src/test/resources/checks/v32/operations/OAR048/many-body-params.json b/src/test/resources/checks/v32/operations/OAR048/many-body-params.json index 6efb018b..ddfcfed1 100644 --- a/src/test/resources/checks/v32/operations/OAR048/many-body-params.json +++ b/src/test/resources/checks/v32/operations/OAR048/many-body-params.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v32/operations/OAR048/many-body-params.yaml b/src/test/resources/checks/v32/operations/OAR048/many-body-params.yaml index 6e4df5b8..b4c8f96f 100644 --- a/src/test/resources/checks/v32/operations/OAR048/many-body-params.yaml +++ b/src/test/resources/checks/v32/operations/OAR048/many-body-params.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/operations/OAR061/insuficent-response-codes.json b/src/test/resources/checks/v32/operations/OAR061/insuficent-response-codes.json index d6afd0b7..07442dcb 100644 --- a/src/test/resources/checks/v32/operations/OAR061/insuficent-response-codes.json +++ b/src/test/resources/checks/v32/operations/OAR061/insuficent-response-codes.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v32/operations/OAR061/insuficent-response-codes.yaml b/src/test/resources/checks/v32/operations/OAR061/insuficent-response-codes.yaml index be4253c1..effc2d24 100644 --- a/src/test/resources/checks/v32/operations/OAR061/insuficent-response-codes.yaml +++ b/src/test/resources/checks/v32/operations/OAR061/insuficent-response-codes.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/operations/OAR061/valid.json b/src/test/resources/checks/v32/operations/OAR061/valid.json index eebb26a9..8c8e535c 100644 --- a/src/test/resources/checks/v32/operations/OAR061/valid.json +++ b/src/test/resources/checks/v32/operations/OAR061/valid.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v32/operations/OAR061/valid.yaml b/src/test/resources/checks/v32/operations/OAR061/valid.yaml index 46fd051f..23e12b7f 100644 --- a/src/test/resources/checks/v32/operations/OAR061/valid.yaml +++ b/src/test/resources/checks/v32/operations/OAR061/valid.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/operations/OAR062/insuficent-response-codes.json b/src/test/resources/checks/v32/operations/OAR062/insuficent-response-codes.json index 5c5c07f3..4a8b66f7 100644 --- a/src/test/resources/checks/v32/operations/OAR062/insuficent-response-codes.json +++ b/src/test/resources/checks/v32/operations/OAR062/insuficent-response-codes.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v32/operations/OAR062/insuficent-response-codes.yaml b/src/test/resources/checks/v32/operations/OAR062/insuficent-response-codes.yaml index b6afd0f4..15a14c02 100644 --- a/src/test/resources/checks/v32/operations/OAR062/insuficent-response-codes.yaml +++ b/src/test/resources/checks/v32/operations/OAR062/insuficent-response-codes.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/operations/OAR062/valid.json b/src/test/resources/checks/v32/operations/OAR062/valid.json index 41369536..01d3812d 100644 --- a/src/test/resources/checks/v32/operations/OAR062/valid.json +++ b/src/test/resources/checks/v32/operations/OAR062/valid.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v32/operations/OAR062/valid.yaml b/src/test/resources/checks/v32/operations/OAR062/valid.yaml index cbd378fe..d8da0633 100644 --- a/src/test/resources/checks/v32/operations/OAR062/valid.yaml +++ b/src/test/resources/checks/v32/operations/OAR062/valid.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/operations/OAR063/insuficent-response-codes.json b/src/test/resources/checks/v32/operations/OAR063/insuficent-response-codes.json index fd50ba37..81d5591a 100644 --- a/src/test/resources/checks/v32/operations/OAR063/insuficent-response-codes.json +++ b/src/test/resources/checks/v32/operations/OAR063/insuficent-response-codes.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v32/operations/OAR063/insuficent-response-codes.yaml b/src/test/resources/checks/v32/operations/OAR063/insuficent-response-codes.yaml index 46cb15dd..32c26e08 100644 --- a/src/test/resources/checks/v32/operations/OAR063/insuficent-response-codes.yaml +++ b/src/test/resources/checks/v32/operations/OAR063/insuficent-response-codes.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/operations/OAR063/valid.json b/src/test/resources/checks/v32/operations/OAR063/valid.json index 5f3a20ed..2a09b682 100644 --- a/src/test/resources/checks/v32/operations/OAR063/valid.json +++ b/src/test/resources/checks/v32/operations/OAR063/valid.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v32/operations/OAR063/valid.yaml b/src/test/resources/checks/v32/operations/OAR063/valid.yaml index d61b7b23..cc9f6184 100644 --- a/src/test/resources/checks/v32/operations/OAR063/valid.yaml +++ b/src/test/resources/checks/v32/operations/OAR063/valid.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/operations/OAR064/insuficent-response-codes.json b/src/test/resources/checks/v32/operations/OAR064/insuficent-response-codes.json index d72c819c..d7afbde4 100644 --- a/src/test/resources/checks/v32/operations/OAR064/insuficent-response-codes.json +++ b/src/test/resources/checks/v32/operations/OAR064/insuficent-response-codes.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v32/operations/OAR064/insuficent-response-codes.yaml b/src/test/resources/checks/v32/operations/OAR064/insuficent-response-codes.yaml index 84beaded..e77f9cc4 100644 --- a/src/test/resources/checks/v32/operations/OAR064/insuficent-response-codes.yaml +++ b/src/test/resources/checks/v32/operations/OAR064/insuficent-response-codes.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/operations/OAR064/valid.json b/src/test/resources/checks/v32/operations/OAR064/valid.json index 4109a3e7..e7c7a959 100644 --- a/src/test/resources/checks/v32/operations/OAR064/valid.json +++ b/src/test/resources/checks/v32/operations/OAR064/valid.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v32/operations/OAR064/valid.yaml b/src/test/resources/checks/v32/operations/OAR064/valid.yaml index fb387b6e..8a9e567c 100644 --- a/src/test/resources/checks/v32/operations/OAR064/valid.yaml +++ b/src/test/resources/checks/v32/operations/OAR064/valid.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/operations/OAR065/insuficent-response-codes.json b/src/test/resources/checks/v32/operations/OAR065/insuficent-response-codes.json index e246e5a4..dfaec82b 100644 --- a/src/test/resources/checks/v32/operations/OAR065/insuficent-response-codes.json +++ b/src/test/resources/checks/v32/operations/OAR065/insuficent-response-codes.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v32/operations/OAR065/insuficent-response-codes.yaml b/src/test/resources/checks/v32/operations/OAR065/insuficent-response-codes.yaml index 9ef40629..2e53a412 100644 --- a/src/test/resources/checks/v32/operations/OAR065/insuficent-response-codes.yaml +++ b/src/test/resources/checks/v32/operations/OAR065/insuficent-response-codes.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/operations/OAR065/valid.json b/src/test/resources/checks/v32/operations/OAR065/valid.json index f4e0b010..e369b083 100644 --- a/src/test/resources/checks/v32/operations/OAR065/valid.json +++ b/src/test/resources/checks/v32/operations/OAR065/valid.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v32/operations/OAR065/valid.yaml b/src/test/resources/checks/v32/operations/OAR065/valid.yaml index 5b7b3230..d725e721 100644 --- a/src/test/resources/checks/v32/operations/OAR065/valid.yaml +++ b/src/test/resources/checks/v32/operations/OAR065/valid.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/operations/OAR071/missing-query-params.json b/src/test/resources/checks/v32/operations/OAR071/missing-query-params.json index a3c5fe59..bfab69a1 100644 --- a/src/test/resources/checks/v32/operations/OAR071/missing-query-params.json +++ b/src/test/resources/checks/v32/operations/OAR071/missing-query-params.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "version": "1.0.0", "title": "My API" diff --git a/src/test/resources/checks/v32/operations/OAR071/missing-query-params.yaml b/src/test/resources/checks/v32/operations/OAR071/missing-query-params.yaml index fef15e36..b08e69cb 100644 --- a/src/test/resources/checks/v32/operations/OAR071/missing-query-params.yaml +++ b/src/test/resources/checks/v32/operations/OAR071/missing-query-params.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: My API diff --git a/src/test/resources/checks/v32/operations/OAR071/valid-query-params.json b/src/test/resources/checks/v32/operations/OAR071/valid-query-params.json index 5dcdf248..0f950a0d 100644 --- a/src/test/resources/checks/v32/operations/OAR071/valid-query-params.json +++ b/src/test/resources/checks/v32/operations/OAR071/valid-query-params.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "version": "1.0.0", "title": "My API" diff --git a/src/test/resources/checks/v32/operations/OAR071/valid-query-params.yaml b/src/test/resources/checks/v32/operations/OAR071/valid-query-params.yaml index 7a8d8899..94082031 100644 --- a/src/test/resources/checks/v32/operations/OAR071/valid-query-params.yaml +++ b/src/test/resources/checks/v32/operations/OAR071/valid-query-params.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: My API diff --git a/src/test/resources/checks/v32/operations/OAR091/no-ref.json b/src/test/resources/checks/v32/operations/OAR091/no-ref.json index 0a13ec43..e88f4af5 100644 --- a/src/test/resources/checks/v32/operations/OAR091/no-ref.json +++ b/src/test/resources/checks/v32/operations/OAR091/no-ref.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "title": "Sample API", "version": "1.0.0" diff --git a/src/test/resources/checks/v32/operations/OAR091/no-ref.yaml b/src/test/resources/checks/v32/operations/OAR091/no-ref.yaml index cf71ac9a..2634ee99 100644 --- a/src/test/resources/checks/v32/operations/OAR091/no-ref.yaml +++ b/src/test/resources/checks/v32/operations/OAR091/no-ref.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.0 +openapi: "3.2.0" info: title: Sample API version: 1.0.0 diff --git a/src/test/resources/checks/v32/operations/OAR091/with-ref.json b/src/test/resources/checks/v32/operations/OAR091/with-ref.json index 262538cd..17cfa3a8 100644 --- a/src/test/resources/checks/v32/operations/OAR091/with-ref.json +++ b/src/test/resources/checks/v32/operations/OAR091/with-ref.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "title": "Sample API", "version": "1.0.0" diff --git a/src/test/resources/checks/v32/operations/OAR091/with-ref.yaml b/src/test/resources/checks/v32/operations/OAR091/with-ref.yaml index ad4061d5..5c53e897 100644 --- a/src/test/resources/checks/v32/operations/OAR091/with-ref.yaml +++ b/src/test/resources/checks/v32/operations/OAR091/with-ref.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.0 +openapi: "3.2.0" info: title: Sample API version: 1.0.0 diff --git a/src/test/resources/checks/v32/operations/OAR092/no-ref.json b/src/test/resources/checks/v32/operations/OAR092/no-ref.json index b46235db..eb58d8e6 100644 --- a/src/test/resources/checks/v32/operations/OAR092/no-ref.json +++ b/src/test/resources/checks/v32/operations/OAR092/no-ref.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "title": "Sample API", "version": "1.0.0" diff --git a/src/test/resources/checks/v32/operations/OAR092/no-ref.yaml b/src/test/resources/checks/v32/operations/OAR092/no-ref.yaml index a44925c1..00d4b47b 100644 --- a/src/test/resources/checks/v32/operations/OAR092/no-ref.yaml +++ b/src/test/resources/checks/v32/operations/OAR092/no-ref.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.1 +openapi: "3.2.0" info: title: Sample-API_efc2b9f76813_V description: API de ejemplo para pruebas diff --git a/src/test/resources/checks/v32/operations/OAR092/with-ref.json b/src/test/resources/checks/v32/operations/OAR092/with-ref.json index bfda972c..e89f669d 100644 --- a/src/test/resources/checks/v32/operations/OAR092/with-ref.json +++ b/src/test/resources/checks/v32/operations/OAR092/with-ref.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "title": "Sample API", "version": "1.0.0" diff --git a/src/test/resources/checks/v32/operations/OAR092/with-ref.yaml b/src/test/resources/checks/v32/operations/OAR092/with-ref.yaml index aa5503ab..209d8c49 100644 --- a/src/test/resources/checks/v32/operations/OAR092/with-ref.yaml +++ b/src/test/resources/checks/v32/operations/OAR092/with-ref.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.0 +openapi: "3.2.0" info: title: Sample API version: '1.0.0' diff --git a/src/test/resources/checks/v32/operations/OAR093/no-ref.json b/src/test/resources/checks/v32/operations/OAR093/no-ref.json index a03de219..5719e271 100644 --- a/src/test/resources/checks/v32/operations/OAR093/no-ref.json +++ b/src/test/resources/checks/v32/operations/OAR093/no-ref.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "title": "Sample API", "version": "1.0.0" diff --git a/src/test/resources/checks/v32/operations/OAR093/no-ref.yaml b/src/test/resources/checks/v32/operations/OAR093/no-ref.yaml index ba07aaf3..d51d8849 100644 --- a/src/test/resources/checks/v32/operations/OAR093/no-ref.yaml +++ b/src/test/resources/checks/v32/operations/OAR093/no-ref.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.0 +openapi: "3.2.0" info: title: Sample API version: 1.0.0 diff --git a/src/test/resources/checks/v32/operations/OAR093/with-ref.json b/src/test/resources/checks/v32/operations/OAR093/with-ref.json index 1a4fa488..47a4d19a 100644 --- a/src/test/resources/checks/v32/operations/OAR093/with-ref.json +++ b/src/test/resources/checks/v32/operations/OAR093/with-ref.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "title": "Sample API", "version": "1.0.0" diff --git a/src/test/resources/checks/v32/operations/OAR093/with-ref.yaml b/src/test/resources/checks/v32/operations/OAR093/with-ref.yaml index 44518a95..86f5b424 100644 --- a/src/test/resources/checks/v32/operations/OAR093/with-ref.yaml +++ b/src/test/resources/checks/v32/operations/OAR093/with-ref.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.0 +openapi: "3.2.0" info: title: Sample API version: 1.0.0 diff --git a/src/test/resources/checks/v32/operations/OAR103/plain.json b/src/test/resources/checks/v32/operations/OAR103/plain.json index 2d2671b6..a783189f 100644 --- a/src/test/resources/checks/v32/operations/OAR103/plain.json +++ b/src/test/resources/checks/v32/operations/OAR103/plain.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "version": "1.0.0", "title": "Swagger Petstore (GETs only)" diff --git a/src/test/resources/checks/v32/operations/OAR103/plain.yaml b/src/test/resources/checks/v32/operations/OAR103/plain.yaml index a06d2246..cfd44356 100644 --- a/src/test/resources/checks/v32/operations/OAR103/plain.yaml +++ b/src/test/resources/checks/v32/operations/OAR103/plain.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.0 +openapi: "3.2.0" info: version: '1.0.0' title: Swagger Petstore (GETs only) diff --git a/src/test/resources/checks/v32/operations/OAR104/plain.yaml b/src/test/resources/checks/v32/operations/OAR104/plain.yaml index 521a52ca..7a1acb1c 100644 --- a/src/test/resources/checks/v32/operations/OAR104/plain.yaml +++ b/src/test/resources/checks/v32/operations/OAR104/plain.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.0 +openapi: "3.2.0" info: version: '1.0.0' title: Swagger Petstore (Posts only) diff --git a/src/test/resources/checks/v32/operations/OAR105/plain.json b/src/test/resources/checks/v32/operations/OAR105/plain.json index ff990d20..fa749740 100644 --- a/src/test/resources/checks/v32/operations/OAR105/plain.json +++ b/src/test/resources/checks/v32/operations/OAR105/plain.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "version": "1.0.0", "title": "Swagger Petstore (POSTs only)" diff --git a/src/test/resources/checks/v32/operations/OAR105/plain.yaml b/src/test/resources/checks/v32/operations/OAR105/plain.yaml index 0708ff20..e4d6a1c4 100644 --- a/src/test/resources/checks/v32/operations/OAR105/plain.yaml +++ b/src/test/resources/checks/v32/operations/OAR105/plain.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.0 +openapi: "3.2.0" info: version: '1.0.0' title: Swagger Petstore (Posts only) diff --git a/src/test/resources/checks/v32/operations/OAR106/plain.json b/src/test/resources/checks/v32/operations/OAR106/plain.json index 7cf21ad0..b486c05d 100644 --- a/src/test/resources/checks/v32/operations/OAR106/plain.json +++ b/src/test/resources/checks/v32/operations/OAR106/plain.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "version": "1.0.0", "title": "Swagger Petstore (POSTs only)" diff --git a/src/test/resources/checks/v32/operations/OAR106/plain.yaml b/src/test/resources/checks/v32/operations/OAR106/plain.yaml index 7072bd07..2e59b304 100644 --- a/src/test/resources/checks/v32/operations/OAR106/plain.yaml +++ b/src/test/resources/checks/v32/operations/OAR106/plain.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.0 +openapi: "3.2.0" info: version: '1.0.0' title: Swagger Petstore (Posts only) diff --git a/src/test/resources/checks/v32/operations/OAR107/plain.json b/src/test/resources/checks/v32/operations/OAR107/plain.json index 6bd61a1d..09d9c270 100644 --- a/src/test/resources/checks/v32/operations/OAR107/plain.json +++ b/src/test/resources/checks/v32/operations/OAR107/plain.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "version": "1.0.0", "title": "Swagger Petstore (POSTs only)" diff --git a/src/test/resources/checks/v32/operations/OAR107/plain.yaml b/src/test/resources/checks/v32/operations/OAR107/plain.yaml index 7b87298e..7607378b 100644 --- a/src/test/resources/checks/v32/operations/OAR107/plain.yaml +++ b/src/test/resources/checks/v32/operations/OAR107/plain.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.0 +openapi: "3.2.0" info: version: '1.0.0' title: Swagger Petstore (Posts only) diff --git a/src/test/resources/checks/v32/operations/OAR109/plain.json b/src/test/resources/checks/v32/operations/OAR109/plain.json index 1d2a84df..cd036afa 100644 --- a/src/test/resources/checks/v32/operations/OAR109/plain.json +++ b/src/test/resources/checks/v32/operations/OAR109/plain.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v32/operations/OAR109/plain.yaml b/src/test/resources/checks/v32/operations/OAR109/plain.yaml index 97cdd572..1a124ed2 100644 --- a/src/test/resources/checks/v32/operations/OAR109/plain.yaml +++ b/src/test/resources/checks/v32/operations/OAR109/plain.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.0 +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/owasp/OAR070/no-numeric.json b/src/test/resources/checks/v32/owasp/OAR070/no-numeric.json index 6c4d7036..573471a4 100644 --- a/src/test/resources/checks/v32/owasp/OAR070/no-numeric.json +++ b/src/test/resources/checks/v32/owasp/OAR070/no-numeric.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v32/owasp/OAR070/no-numeric.yaml b/src/test/resources/checks/v32/owasp/OAR070/no-numeric.yaml index b561d78e..269f435d 100644 --- a/src/test/resources/checks/v32/owasp/OAR070/no-numeric.yaml +++ b/src/test/resources/checks/v32/owasp/OAR070/no-numeric.yaml @@ -1,4 +1,4 @@ - openapi: "3.0.0" + openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/owasp/OAR070/numeric.json b/src/test/resources/checks/v32/owasp/OAR070/numeric.json index 95833d45..90725096 100644 --- a/src/test/resources/checks/v32/owasp/OAR070/numeric.json +++ b/src/test/resources/checks/v32/owasp/OAR070/numeric.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v32/owasp/OAR070/numeric.yaml b/src/test/resources/checks/v32/owasp/OAR070/numeric.yaml index c71f0c38..ece4727e 100644 --- a/src/test/resources/checks/v32/owasp/OAR070/numeric.yaml +++ b/src/test/resources/checks/v32/owasp/OAR070/numeric.yaml @@ -1,4 +1,4 @@ - openapi: "3.0.0" + openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/owasp/OAR073/no-rate-limit.json b/src/test/resources/checks/v32/owasp/OAR073/no-rate-limit.json index 6416f160..b65b4140 100644 --- a/src/test/resources/checks/v32/owasp/OAR073/no-rate-limit.json +++ b/src/test/resources/checks/v32/owasp/OAR073/no-rate-limit.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "version": "1.0.0", "title": "Non-compliant API" diff --git a/src/test/resources/checks/v32/owasp/OAR073/no-rate-limit.yaml b/src/test/resources/checks/v32/owasp/OAR073/no-rate-limit.yaml index e8cf9dae..333e02bc 100644 --- a/src/test/resources/checks/v32/owasp/OAR073/no-rate-limit.yaml +++ b/src/test/resources/checks/v32/owasp/OAR073/no-rate-limit.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Non-compliant API diff --git a/src/test/resources/checks/v32/owasp/OAR073/no-responses.json b/src/test/resources/checks/v32/owasp/OAR073/no-responses.json index e0294c8b..2f349079 100644 --- a/src/test/resources/checks/v32/owasp/OAR073/no-responses.json +++ b/src/test/resources/checks/v32/owasp/OAR073/no-responses.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "version": "1.0.0", "title": "Compliant API" diff --git a/src/test/resources/checks/v32/owasp/OAR073/no-responses.yaml b/src/test/resources/checks/v32/owasp/OAR073/no-responses.yaml index 2575f439..307433b4 100644 --- a/src/test/resources/checks/v32/owasp/OAR073/no-responses.yaml +++ b/src/test/resources/checks/v32/owasp/OAR073/no-responses.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Compliant API diff --git a/src/test/resources/checks/v32/owasp/OAR073/rate-limit.json b/src/test/resources/checks/v32/owasp/OAR073/rate-limit.json index 3103396f..4476389a 100644 --- a/src/test/resources/checks/v32/owasp/OAR073/rate-limit.json +++ b/src/test/resources/checks/v32/owasp/OAR073/rate-limit.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "version": "1.0.0", "title": "Compliant API" diff --git a/src/test/resources/checks/v32/owasp/OAR073/rate-limit.yaml b/src/test/resources/checks/v32/owasp/OAR073/rate-limit.yaml index d01f36ad..1b2663e8 100644 --- a/src/test/resources/checks/v32/owasp/OAR073/rate-limit.yaml +++ b/src/test/resources/checks/v32/owasp/OAR073/rate-limit.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Compliant API diff --git a/src/test/resources/checks/v32/parameters/OAR019/excluded.json b/src/test/resources/checks/v32/parameters/OAR019/excluded.json index 7b77042f..8acbcce3 100644 --- a/src/test/resources/checks/v32/parameters/OAR019/excluded.json +++ b/src/test/resources/checks/v32/parameters/OAR019/excluded.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.2.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v32/parameters/OAR019/excluded.yaml b/src/test/resources/checks/v32/parameters/OAR019/excluded.yaml index 7758deac..8a15d474 100644 --- a/src/test/resources/checks/v32/parameters/OAR019/excluded.yaml +++ b/src/test/resources/checks/v32/parameters/OAR019/excluded.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/parameters/OAR019/plain-without.json b/src/test/resources/checks/v32/parameters/OAR019/plain-without.json index 2e628a27..a10bede3 100644 --- a/src/test/resources/checks/v32/parameters/OAR019/plain-without.json +++ b/src/test/resources/checks/v32/parameters/OAR019/plain-without.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.2.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v32/parameters/OAR019/plain-without.yaml b/src/test/resources/checks/v32/parameters/OAR019/plain-without.yaml index 2f1bd5d6..43fea04b 100644 --- a/src/test/resources/checks/v32/parameters/OAR019/plain-without.yaml +++ b/src/test/resources/checks/v32/parameters/OAR019/plain-without.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/parameters/OAR019/plain.json b/src/test/resources/checks/v32/parameters/OAR019/plain.json index 18138264..2dcb585d 100644 --- a/src/test/resources/checks/v32/parameters/OAR019/plain.json +++ b/src/test/resources/checks/v32/parameters/OAR019/plain.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.2.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v32/parameters/OAR019/plain.yaml b/src/test/resources/checks/v32/parameters/OAR019/plain.yaml index af676143..83ea62a7 100644 --- a/src/test/resources/checks/v32/parameters/OAR019/plain.yaml +++ b/src/test/resources/checks/v32/parameters/OAR019/plain.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/parameters/OAR019/with-$ref-without.json b/src/test/resources/checks/v32/parameters/OAR019/with-$ref-without.json index 4b111e51..ce2463e3 100644 --- a/src/test/resources/checks/v32/parameters/OAR019/with-$ref-without.json +++ b/src/test/resources/checks/v32/parameters/OAR019/with-$ref-without.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.2.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v32/parameters/OAR019/with-$ref-without.yaml b/src/test/resources/checks/v32/parameters/OAR019/with-$ref-without.yaml index 40bd84a8..9ec37626 100644 --- a/src/test/resources/checks/v32/parameters/OAR019/with-$ref-without.yaml +++ b/src/test/resources/checks/v32/parameters/OAR019/with-$ref-without.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/parameters/OAR019/with-$ref.json b/src/test/resources/checks/v32/parameters/OAR019/with-$ref.json index 44519b76..6306b273 100644 --- a/src/test/resources/checks/v32/parameters/OAR019/with-$ref.json +++ b/src/test/resources/checks/v32/parameters/OAR019/with-$ref.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.2.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v32/parameters/OAR019/with-$ref.yaml b/src/test/resources/checks/v32/parameters/OAR019/with-$ref.yaml index 8144cd2f..a6e9d388 100644 --- a/src/test/resources/checks/v32/parameters/OAR019/with-$ref.yaml +++ b/src/test/resources/checks/v32/parameters/OAR019/with-$ref.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/parameters/OAR019/with-param.json b/src/test/resources/checks/v32/parameters/OAR019/with-param.json index 1097b436..64d4e9a0 100644 --- a/src/test/resources/checks/v32/parameters/OAR019/with-param.json +++ b/src/test/resources/checks/v32/parameters/OAR019/with-param.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "title": "Swagger Petstore", "version": "1.0.0" diff --git a/src/test/resources/checks/v32/parameters/OAR019/with-param.yaml b/src/test/resources/checks/v32/parameters/OAR019/with-param.yaml index 8b012753..195ae044 100644 --- a/src/test/resources/checks/v32/parameters/OAR019/with-param.yaml +++ b/src/test/resources/checks/v32/parameters/OAR019/with-param.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.0 +openapi: "3.2.0" info: title: Swagger Petstore version: 1.0.0 diff --git a/src/test/resources/checks/v32/parameters/OAR019/with-ref.json b/src/test/resources/checks/v32/parameters/OAR019/with-ref.json index e6772a42..aa068c35 100644 --- a/src/test/resources/checks/v32/parameters/OAR019/with-ref.json +++ b/src/test/resources/checks/v32/parameters/OAR019/with-ref.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v32/parameters/OAR019/with-ref.yaml b/src/test/resources/checks/v32/parameters/OAR019/with-ref.yaml index dfc1b239..93b3e7d1 100644 --- a/src/test/resources/checks/v32/parameters/OAR019/with-ref.yaml +++ b/src/test/resources/checks/v32/parameters/OAR019/with-ref.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.0 +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/parameters/OAR019/without-parameters.json b/src/test/resources/checks/v32/parameters/OAR019/without-parameters.json index 5fc9f4c1..071e3be7 100644 --- a/src/test/resources/checks/v32/parameters/OAR019/without-parameters.json +++ b/src/test/resources/checks/v32/parameters/OAR019/without-parameters.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.2.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v32/parameters/OAR019/without-parameters.yaml b/src/test/resources/checks/v32/parameters/OAR019/without-parameters.yaml index 7d1f1941..c033182d 100644 --- a/src/test/resources/checks/v32/parameters/OAR019/without-parameters.yaml +++ b/src/test/resources/checks/v32/parameters/OAR019/without-parameters.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/parameters/OAR020/excluded.json b/src/test/resources/checks/v32/parameters/OAR020/excluded.json index abb1867f..fc405edc 100644 --- a/src/test/resources/checks/v32/parameters/OAR020/excluded.json +++ b/src/test/resources/checks/v32/parameters/OAR020/excluded.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.2.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v32/parameters/OAR020/excluded.yaml b/src/test/resources/checks/v32/parameters/OAR020/excluded.yaml index 528f119e..f802af70 100644 --- a/src/test/resources/checks/v32/parameters/OAR020/excluded.yaml +++ b/src/test/resources/checks/v32/parameters/OAR020/excluded.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/parameters/OAR020/excluded2.json b/src/test/resources/checks/v32/parameters/OAR020/excluded2.json index 7b77042f..8acbcce3 100644 --- a/src/test/resources/checks/v32/parameters/OAR020/excluded2.json +++ b/src/test/resources/checks/v32/parameters/OAR020/excluded2.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.2.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v32/parameters/OAR020/excluded2.yaml b/src/test/resources/checks/v32/parameters/OAR020/excluded2.yaml index 5bb25ac8..387db41b 100644 --- a/src/test/resources/checks/v32/parameters/OAR020/excluded2.yaml +++ b/src/test/resources/checks/v32/parameters/OAR020/excluded2.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/parameters/OAR020/plain-without.json b/src/test/resources/checks/v32/parameters/OAR020/plain-without.json index ac05e24d..229d51af 100644 --- a/src/test/resources/checks/v32/parameters/OAR020/plain-without.json +++ b/src/test/resources/checks/v32/parameters/OAR020/plain-without.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.2.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v32/parameters/OAR020/plain-without.yaml b/src/test/resources/checks/v32/parameters/OAR020/plain-without.yaml index aadbb6e3..dbcaf0b0 100644 --- a/src/test/resources/checks/v32/parameters/OAR020/plain-without.yaml +++ b/src/test/resources/checks/v32/parameters/OAR020/plain-without.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/parameters/OAR020/plain-without2.json b/src/test/resources/checks/v32/parameters/OAR020/plain-without2.json index 96bdfe49..60c2c790 100644 --- a/src/test/resources/checks/v32/parameters/OAR020/plain-without2.json +++ b/src/test/resources/checks/v32/parameters/OAR020/plain-without2.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.2.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v32/parameters/OAR020/plain-without2.yaml b/src/test/resources/checks/v32/parameters/OAR020/plain-without2.yaml index 798c326e..a99252ed 100644 --- a/src/test/resources/checks/v32/parameters/OAR020/plain-without2.yaml +++ b/src/test/resources/checks/v32/parameters/OAR020/plain-without2.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/parameters/OAR020/plain.json b/src/test/resources/checks/v32/parameters/OAR020/plain.json index bdb3c7d1..75cdd4e2 100644 --- a/src/test/resources/checks/v32/parameters/OAR020/plain.json +++ b/src/test/resources/checks/v32/parameters/OAR020/plain.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.2.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v32/parameters/OAR020/plain.yaml b/src/test/resources/checks/v32/parameters/OAR020/plain.yaml index ad2fc836..aebcb70f 100644 --- a/src/test/resources/checks/v32/parameters/OAR020/plain.yaml +++ b/src/test/resources/checks/v32/parameters/OAR020/plain.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/parameters/OAR020/plain2.json b/src/test/resources/checks/v32/parameters/OAR020/plain2.json index b349d610..81022af4 100644 --- a/src/test/resources/checks/v32/parameters/OAR020/plain2.json +++ b/src/test/resources/checks/v32/parameters/OAR020/plain2.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.2.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v32/parameters/OAR020/plain2.yaml b/src/test/resources/checks/v32/parameters/OAR020/plain2.yaml index d6c6860b..63845223 100644 --- a/src/test/resources/checks/v32/parameters/OAR020/plain2.yaml +++ b/src/test/resources/checks/v32/parameters/OAR020/plain2.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/parameters/OAR020/with-$ref-without.json b/src/test/resources/checks/v32/parameters/OAR020/with-$ref-without.json index 33a10da9..b0781cb1 100644 --- a/src/test/resources/checks/v32/parameters/OAR020/with-$ref-without.json +++ b/src/test/resources/checks/v32/parameters/OAR020/with-$ref-without.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.2.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v32/parameters/OAR020/with-$ref-without.yaml b/src/test/resources/checks/v32/parameters/OAR020/with-$ref-without.yaml index 6080512e..40b18ee7 100644 --- a/src/test/resources/checks/v32/parameters/OAR020/with-$ref-without.yaml +++ b/src/test/resources/checks/v32/parameters/OAR020/with-$ref-without.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/parameters/OAR020/with-$ref.json b/src/test/resources/checks/v32/parameters/OAR020/with-$ref.json index 1354ddee..649ebd53 100644 --- a/src/test/resources/checks/v32/parameters/OAR020/with-$ref.json +++ b/src/test/resources/checks/v32/parameters/OAR020/with-$ref.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.2.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v32/parameters/OAR020/with-$ref.yaml b/src/test/resources/checks/v32/parameters/OAR020/with-$ref.yaml index 04c46fa9..508853fe 100644 --- a/src/test/resources/checks/v32/parameters/OAR020/with-$ref.yaml +++ b/src/test/resources/checks/v32/parameters/OAR020/with-$ref.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/parameters/OAR020/with-param.json b/src/test/resources/checks/v32/parameters/OAR020/with-param.json index 1097b436..64d4e9a0 100644 --- a/src/test/resources/checks/v32/parameters/OAR020/with-param.json +++ b/src/test/resources/checks/v32/parameters/OAR020/with-param.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "title": "Swagger Petstore", "version": "1.0.0" diff --git a/src/test/resources/checks/v32/parameters/OAR020/with-param.yaml b/src/test/resources/checks/v32/parameters/OAR020/with-param.yaml index 8b012753..195ae044 100644 --- a/src/test/resources/checks/v32/parameters/OAR020/with-param.yaml +++ b/src/test/resources/checks/v32/parameters/OAR020/with-param.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.0 +openapi: "3.2.0" info: title: Swagger Petstore version: 1.0.0 diff --git a/src/test/resources/checks/v32/parameters/OAR020/with-ref.json b/src/test/resources/checks/v32/parameters/OAR020/with-ref.json index 52a22a10..a9bfbbe5 100644 --- a/src/test/resources/checks/v32/parameters/OAR020/with-ref.json +++ b/src/test/resources/checks/v32/parameters/OAR020/with-ref.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v32/parameters/OAR020/with-ref.yaml b/src/test/resources/checks/v32/parameters/OAR020/with-ref.yaml index 315ab8f9..dd0f7f00 100644 --- a/src/test/resources/checks/v32/parameters/OAR020/with-ref.yaml +++ b/src/test/resources/checks/v32/parameters/OAR020/with-ref.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.0 +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/parameters/OAR020/without-parameters.json b/src/test/resources/checks/v32/parameters/OAR020/without-parameters.json index dd4f0781..65eadc9c 100644 --- a/src/test/resources/checks/v32/parameters/OAR020/without-parameters.json +++ b/src/test/resources/checks/v32/parameters/OAR020/without-parameters.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.2.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v32/parameters/OAR020/without-parameters.yaml b/src/test/resources/checks/v32/parameters/OAR020/without-parameters.yaml index 17256a1a..e6743395 100644 --- a/src/test/resources/checks/v32/parameters/OAR020/without-parameters.yaml +++ b/src/test/resources/checks/v32/parameters/OAR020/without-parameters.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/parameters/OAR021/excluded.json b/src/test/resources/checks/v32/parameters/OAR021/excluded.json index 7b77042f..8acbcce3 100644 --- a/src/test/resources/checks/v32/parameters/OAR021/excluded.json +++ b/src/test/resources/checks/v32/parameters/OAR021/excluded.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.2.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v32/parameters/OAR021/excluded.yaml b/src/test/resources/checks/v32/parameters/OAR021/excluded.yaml index 5bb25ac8..387db41b 100644 --- a/src/test/resources/checks/v32/parameters/OAR021/excluded.yaml +++ b/src/test/resources/checks/v32/parameters/OAR021/excluded.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/parameters/OAR021/plain-without.json b/src/test/resources/checks/v32/parameters/OAR021/plain-without.json index 78c3e87b..403592ed 100644 --- a/src/test/resources/checks/v32/parameters/OAR021/plain-without.json +++ b/src/test/resources/checks/v32/parameters/OAR021/plain-without.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.2.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v32/parameters/OAR021/plain-without.yaml b/src/test/resources/checks/v32/parameters/OAR021/plain-without.yaml index 72854964..3f43a238 100644 --- a/src/test/resources/checks/v32/parameters/OAR021/plain-without.yaml +++ b/src/test/resources/checks/v32/parameters/OAR021/plain-without.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/parameters/OAR021/plain.json b/src/test/resources/checks/v32/parameters/OAR021/plain.json index f07e2f8a..68796bea 100644 --- a/src/test/resources/checks/v32/parameters/OAR021/plain.json +++ b/src/test/resources/checks/v32/parameters/OAR021/plain.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.2.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v32/parameters/OAR021/plain.yaml b/src/test/resources/checks/v32/parameters/OAR021/plain.yaml index f5d21041..b91b5aa7 100644 --- a/src/test/resources/checks/v32/parameters/OAR021/plain.yaml +++ b/src/test/resources/checks/v32/parameters/OAR021/plain.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/parameters/OAR021/with-$ref-without.json b/src/test/resources/checks/v32/parameters/OAR021/with-$ref-without.json index a9531c2f..c7e863bc 100644 --- a/src/test/resources/checks/v32/parameters/OAR021/with-$ref-without.json +++ b/src/test/resources/checks/v32/parameters/OAR021/with-$ref-without.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.2.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v32/parameters/OAR021/with-$ref-without.yaml b/src/test/resources/checks/v32/parameters/OAR021/with-$ref-without.yaml index c31ca64e..24b286ea 100644 --- a/src/test/resources/checks/v32/parameters/OAR021/with-$ref-without.yaml +++ b/src/test/resources/checks/v32/parameters/OAR021/with-$ref-without.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/parameters/OAR021/with-$ref.json b/src/test/resources/checks/v32/parameters/OAR021/with-$ref.json index 60b07834..09ca2bce 100644 --- a/src/test/resources/checks/v32/parameters/OAR021/with-$ref.json +++ b/src/test/resources/checks/v32/parameters/OAR021/with-$ref.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.2.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v32/parameters/OAR021/with-$ref.yaml b/src/test/resources/checks/v32/parameters/OAR021/with-$ref.yaml index 967c1d7d..80084da1 100644 --- a/src/test/resources/checks/v32/parameters/OAR021/with-$ref.yaml +++ b/src/test/resources/checks/v32/parameters/OAR021/with-$ref.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/parameters/OAR021/with-param.json b/src/test/resources/checks/v32/parameters/OAR021/with-param.json index 1097b436..64d4e9a0 100644 --- a/src/test/resources/checks/v32/parameters/OAR021/with-param.json +++ b/src/test/resources/checks/v32/parameters/OAR021/with-param.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "title": "Swagger Petstore", "version": "1.0.0" diff --git a/src/test/resources/checks/v32/parameters/OAR021/with-param.yaml b/src/test/resources/checks/v32/parameters/OAR021/with-param.yaml index 8b012753..195ae044 100644 --- a/src/test/resources/checks/v32/parameters/OAR021/with-param.yaml +++ b/src/test/resources/checks/v32/parameters/OAR021/with-param.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.0 +openapi: "3.2.0" info: title: Swagger Petstore version: 1.0.0 diff --git a/src/test/resources/checks/v32/parameters/OAR021/with-ref.json b/src/test/resources/checks/v32/parameters/OAR021/with-ref.json index f3a1eb3d..ee94aab9 100644 --- a/src/test/resources/checks/v32/parameters/OAR021/with-ref.json +++ b/src/test/resources/checks/v32/parameters/OAR021/with-ref.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v32/parameters/OAR021/with-ref.yaml b/src/test/resources/checks/v32/parameters/OAR021/with-ref.yaml index 382897e5..78e6065c 100644 --- a/src/test/resources/checks/v32/parameters/OAR021/with-ref.yaml +++ b/src/test/resources/checks/v32/parameters/OAR021/with-ref.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.0 +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/parameters/OAR021/without-parameters.json b/src/test/resources/checks/v32/parameters/OAR021/without-parameters.json index fb4f3709..b537b48c 100644 --- a/src/test/resources/checks/v32/parameters/OAR021/without-parameters.json +++ b/src/test/resources/checks/v32/parameters/OAR021/without-parameters.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.2.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v32/parameters/OAR021/without-parameters.yaml b/src/test/resources/checks/v32/parameters/OAR021/without-parameters.yaml index f9ca221f..f89103af 100644 --- a/src/test/resources/checks/v32/parameters/OAR021/without-parameters.yaml +++ b/src/test/resources/checks/v32/parameters/OAR021/without-parameters.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/parameters/OAR022/excluded.json b/src/test/resources/checks/v32/parameters/OAR022/excluded.json index 7b77042f..8acbcce3 100644 --- a/src/test/resources/checks/v32/parameters/OAR022/excluded.json +++ b/src/test/resources/checks/v32/parameters/OAR022/excluded.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.2.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v32/parameters/OAR022/excluded.yaml b/src/test/resources/checks/v32/parameters/OAR022/excluded.yaml index 5bb25ac8..387db41b 100644 --- a/src/test/resources/checks/v32/parameters/OAR022/excluded.yaml +++ b/src/test/resources/checks/v32/parameters/OAR022/excluded.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/parameters/OAR022/plain-without.json b/src/test/resources/checks/v32/parameters/OAR022/plain-without.json index e263f6bb..3b7f35b5 100644 --- a/src/test/resources/checks/v32/parameters/OAR022/plain-without.json +++ b/src/test/resources/checks/v32/parameters/OAR022/plain-without.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.2.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v32/parameters/OAR022/plain-without.yaml b/src/test/resources/checks/v32/parameters/OAR022/plain-without.yaml index a284f1f4..a48e5de9 100644 --- a/src/test/resources/checks/v32/parameters/OAR022/plain-without.yaml +++ b/src/test/resources/checks/v32/parameters/OAR022/plain-without.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/parameters/OAR022/plain.json b/src/test/resources/checks/v32/parameters/OAR022/plain.json index dcf5ec3b..64ee817f 100644 --- a/src/test/resources/checks/v32/parameters/OAR022/plain.json +++ b/src/test/resources/checks/v32/parameters/OAR022/plain.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.2.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v32/parameters/OAR022/plain.yaml b/src/test/resources/checks/v32/parameters/OAR022/plain.yaml index 173955f8..014ef997 100644 --- a/src/test/resources/checks/v32/parameters/OAR022/plain.yaml +++ b/src/test/resources/checks/v32/parameters/OAR022/plain.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/parameters/OAR022/with-$ref-without.json b/src/test/resources/checks/v32/parameters/OAR022/with-$ref-without.json index 64cfcc5e..e2f6a956 100644 --- a/src/test/resources/checks/v32/parameters/OAR022/with-$ref-without.json +++ b/src/test/resources/checks/v32/parameters/OAR022/with-$ref-without.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.2.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v32/parameters/OAR022/with-$ref-without.yaml b/src/test/resources/checks/v32/parameters/OAR022/with-$ref-without.yaml index 7c120401..c37a96fa 100644 --- a/src/test/resources/checks/v32/parameters/OAR022/with-$ref-without.yaml +++ b/src/test/resources/checks/v32/parameters/OAR022/with-$ref-without.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/parameters/OAR022/with-$ref.json b/src/test/resources/checks/v32/parameters/OAR022/with-$ref.json index de939029..9bd7b4d8 100644 --- a/src/test/resources/checks/v32/parameters/OAR022/with-$ref.json +++ b/src/test/resources/checks/v32/parameters/OAR022/with-$ref.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.2.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v32/parameters/OAR022/with-$ref.yaml b/src/test/resources/checks/v32/parameters/OAR022/with-$ref.yaml index f4c69d5b..a5830ace 100644 --- a/src/test/resources/checks/v32/parameters/OAR022/with-$ref.yaml +++ b/src/test/resources/checks/v32/parameters/OAR022/with-$ref.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/parameters/OAR022/without-parameters.json b/src/test/resources/checks/v32/parameters/OAR022/without-parameters.json index be5c3701..8f203e14 100644 --- a/src/test/resources/checks/v32/parameters/OAR022/without-parameters.json +++ b/src/test/resources/checks/v32/parameters/OAR022/without-parameters.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.2.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v32/parameters/OAR022/without-parameters.yaml b/src/test/resources/checks/v32/parameters/OAR022/without-parameters.yaml index 3e65a579..6d44559d 100644 --- a/src/test/resources/checks/v32/parameters/OAR022/without-parameters.yaml +++ b/src/test/resources/checks/v32/parameters/OAR022/without-parameters.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/parameters/OAR023/excluded.json b/src/test/resources/checks/v32/parameters/OAR023/excluded.json index 7b77042f..8acbcce3 100644 --- a/src/test/resources/checks/v32/parameters/OAR023/excluded.json +++ b/src/test/resources/checks/v32/parameters/OAR023/excluded.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.2.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v32/parameters/OAR023/excluded.yaml b/src/test/resources/checks/v32/parameters/OAR023/excluded.yaml index 5bb25ac8..387db41b 100644 --- a/src/test/resources/checks/v32/parameters/OAR023/excluded.yaml +++ b/src/test/resources/checks/v32/parameters/OAR023/excluded.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/parameters/OAR023/plain-without.json b/src/test/resources/checks/v32/parameters/OAR023/plain-without.json index 871eddb2..3b1d996b 100644 --- a/src/test/resources/checks/v32/parameters/OAR023/plain-without.json +++ b/src/test/resources/checks/v32/parameters/OAR023/plain-without.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.2.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v32/parameters/OAR023/plain-without.yaml b/src/test/resources/checks/v32/parameters/OAR023/plain-without.yaml index 6f8d8d99..a37906a9 100644 --- a/src/test/resources/checks/v32/parameters/OAR023/plain-without.yaml +++ b/src/test/resources/checks/v32/parameters/OAR023/plain-without.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/parameters/OAR023/plain.json b/src/test/resources/checks/v32/parameters/OAR023/plain.json index 93ef330b..62525829 100644 --- a/src/test/resources/checks/v32/parameters/OAR023/plain.json +++ b/src/test/resources/checks/v32/parameters/OAR023/plain.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.2.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v32/parameters/OAR023/plain.yaml b/src/test/resources/checks/v32/parameters/OAR023/plain.yaml index e3b89931..cb01e52e 100644 --- a/src/test/resources/checks/v32/parameters/OAR023/plain.yaml +++ b/src/test/resources/checks/v32/parameters/OAR023/plain.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/parameters/OAR023/with-$ref-without.json b/src/test/resources/checks/v32/parameters/OAR023/with-$ref-without.json index 16176996..7ce67652 100644 --- a/src/test/resources/checks/v32/parameters/OAR023/with-$ref-without.json +++ b/src/test/resources/checks/v32/parameters/OAR023/with-$ref-without.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.2.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v32/parameters/OAR023/with-$ref-without.yaml b/src/test/resources/checks/v32/parameters/OAR023/with-$ref-without.yaml index fd019cc6..39d8a2d8 100644 --- a/src/test/resources/checks/v32/parameters/OAR023/with-$ref-without.yaml +++ b/src/test/resources/checks/v32/parameters/OAR023/with-$ref-without.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/parameters/OAR023/with-$ref.json b/src/test/resources/checks/v32/parameters/OAR023/with-$ref.json index db373f26..b1505d41 100644 --- a/src/test/resources/checks/v32/parameters/OAR023/with-$ref.json +++ b/src/test/resources/checks/v32/parameters/OAR023/with-$ref.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.2.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v32/parameters/OAR023/with-$ref.yaml b/src/test/resources/checks/v32/parameters/OAR023/with-$ref.yaml index 702bb880..57681126 100644 --- a/src/test/resources/checks/v32/parameters/OAR023/with-$ref.yaml +++ b/src/test/resources/checks/v32/parameters/OAR023/with-$ref.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/parameters/OAR023/without-parameters.json b/src/test/resources/checks/v32/parameters/OAR023/without-parameters.json index f2376bff..3b3b169d 100644 --- a/src/test/resources/checks/v32/parameters/OAR023/without-parameters.json +++ b/src/test/resources/checks/v32/parameters/OAR023/without-parameters.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.2.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v32/parameters/OAR023/without-parameters.yaml b/src/test/resources/checks/v32/parameters/OAR023/without-parameters.yaml index 76a349a0..d0d1537c 100644 --- a/src/test/resources/checks/v32/parameters/OAR023/without-parameters.yaml +++ b/src/test/resources/checks/v32/parameters/OAR023/without-parameters.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/parameters/OAR024/excluded.json b/src/test/resources/checks/v32/parameters/OAR024/excluded.json index 7b77042f..8acbcce3 100644 --- a/src/test/resources/checks/v32/parameters/OAR024/excluded.json +++ b/src/test/resources/checks/v32/parameters/OAR024/excluded.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.2.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v32/parameters/OAR024/excluded.yaml b/src/test/resources/checks/v32/parameters/OAR024/excluded.yaml index 5bb25ac8..387db41b 100644 --- a/src/test/resources/checks/v32/parameters/OAR024/excluded.yaml +++ b/src/test/resources/checks/v32/parameters/OAR024/excluded.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/parameters/OAR024/plain-without.json b/src/test/resources/checks/v32/parameters/OAR024/plain-without.json index d3533f31..ea252e01 100644 --- a/src/test/resources/checks/v32/parameters/OAR024/plain-without.json +++ b/src/test/resources/checks/v32/parameters/OAR024/plain-without.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.2.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v32/parameters/OAR024/plain-without.yaml b/src/test/resources/checks/v32/parameters/OAR024/plain-without.yaml index 4e44fb6e..e28fc84d 100644 --- a/src/test/resources/checks/v32/parameters/OAR024/plain-without.yaml +++ b/src/test/resources/checks/v32/parameters/OAR024/plain-without.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/parameters/OAR024/plain.json b/src/test/resources/checks/v32/parameters/OAR024/plain.json index 0e100ef0..b12f1a74 100644 --- a/src/test/resources/checks/v32/parameters/OAR024/plain.json +++ b/src/test/resources/checks/v32/parameters/OAR024/plain.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.2.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v32/parameters/OAR024/plain.yaml b/src/test/resources/checks/v32/parameters/OAR024/plain.yaml index 59d15dba..0bbe7a1a 100644 --- a/src/test/resources/checks/v32/parameters/OAR024/plain.yaml +++ b/src/test/resources/checks/v32/parameters/OAR024/plain.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/parameters/OAR024/with-$ref-without.json b/src/test/resources/checks/v32/parameters/OAR024/with-$ref-without.json index da1de6a6..bf2fff84 100644 --- a/src/test/resources/checks/v32/parameters/OAR024/with-$ref-without.json +++ b/src/test/resources/checks/v32/parameters/OAR024/with-$ref-without.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.2.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v32/parameters/OAR024/with-$ref-without.yaml b/src/test/resources/checks/v32/parameters/OAR024/with-$ref-without.yaml index 09efcc5a..7ab95ac3 100644 --- a/src/test/resources/checks/v32/parameters/OAR024/with-$ref-without.yaml +++ b/src/test/resources/checks/v32/parameters/OAR024/with-$ref-without.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/parameters/OAR024/with-$ref.json b/src/test/resources/checks/v32/parameters/OAR024/with-$ref.json index 4e4888fd..81fd4853 100644 --- a/src/test/resources/checks/v32/parameters/OAR024/with-$ref.json +++ b/src/test/resources/checks/v32/parameters/OAR024/with-$ref.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.2.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v32/parameters/OAR024/with-$ref.yaml b/src/test/resources/checks/v32/parameters/OAR024/with-$ref.yaml index 32148ae7..8d77acb3 100644 --- a/src/test/resources/checks/v32/parameters/OAR024/with-$ref.yaml +++ b/src/test/resources/checks/v32/parameters/OAR024/with-$ref.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/parameters/OAR024/without-parameters.json b/src/test/resources/checks/v32/parameters/OAR024/without-parameters.json index 1d44370b..eb2e1b45 100644 --- a/src/test/resources/checks/v32/parameters/OAR024/without-parameters.json +++ b/src/test/resources/checks/v32/parameters/OAR024/without-parameters.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.2.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v32/parameters/OAR024/without-parameters.yaml b/src/test/resources/checks/v32/parameters/OAR024/without-parameters.yaml index eb66f92f..d328e2ef 100644 --- a/src/test/resources/checks/v32/parameters/OAR024/without-parameters.yaml +++ b/src/test/resources/checks/v32/parameters/OAR024/without-parameters.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/parameters/OAR025/excluded.json b/src/test/resources/checks/v32/parameters/OAR025/excluded.json index 7b77042f..8acbcce3 100644 --- a/src/test/resources/checks/v32/parameters/OAR025/excluded.json +++ b/src/test/resources/checks/v32/parameters/OAR025/excluded.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.2.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v32/parameters/OAR025/excluded.yaml b/src/test/resources/checks/v32/parameters/OAR025/excluded.yaml index 5bb25ac8..387db41b 100644 --- a/src/test/resources/checks/v32/parameters/OAR025/excluded.yaml +++ b/src/test/resources/checks/v32/parameters/OAR025/excluded.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/parameters/OAR025/plain-without.json b/src/test/resources/checks/v32/parameters/OAR025/plain-without.json index e255f777..b28514bf 100644 --- a/src/test/resources/checks/v32/parameters/OAR025/plain-without.json +++ b/src/test/resources/checks/v32/parameters/OAR025/plain-without.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.2.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v32/parameters/OAR025/plain-without.yaml b/src/test/resources/checks/v32/parameters/OAR025/plain-without.yaml index aba5d2c0..ae142906 100644 --- a/src/test/resources/checks/v32/parameters/OAR025/plain-without.yaml +++ b/src/test/resources/checks/v32/parameters/OAR025/plain-without.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/parameters/OAR025/plain.json b/src/test/resources/checks/v32/parameters/OAR025/plain.json index b853da7f..33ee1029 100644 --- a/src/test/resources/checks/v32/parameters/OAR025/plain.json +++ b/src/test/resources/checks/v32/parameters/OAR025/plain.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.2.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v32/parameters/OAR025/plain.yaml b/src/test/resources/checks/v32/parameters/OAR025/plain.yaml index 7eebb8fa..ffee1572 100644 --- a/src/test/resources/checks/v32/parameters/OAR025/plain.yaml +++ b/src/test/resources/checks/v32/parameters/OAR025/plain.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/parameters/OAR025/with-$ref-without.json b/src/test/resources/checks/v32/parameters/OAR025/with-$ref-without.json index 864d968a..fb10ee06 100644 --- a/src/test/resources/checks/v32/parameters/OAR025/with-$ref-without.json +++ b/src/test/resources/checks/v32/parameters/OAR025/with-$ref-without.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.2.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v32/parameters/OAR025/with-$ref-without.yaml b/src/test/resources/checks/v32/parameters/OAR025/with-$ref-without.yaml index 36ceb535..bcf3e107 100644 --- a/src/test/resources/checks/v32/parameters/OAR025/with-$ref-without.yaml +++ b/src/test/resources/checks/v32/parameters/OAR025/with-$ref-without.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/parameters/OAR025/with-$ref.json b/src/test/resources/checks/v32/parameters/OAR025/with-$ref.json index 8ebf79a9..132d6207 100644 --- a/src/test/resources/checks/v32/parameters/OAR025/with-$ref.json +++ b/src/test/resources/checks/v32/parameters/OAR025/with-$ref.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.2.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v32/parameters/OAR025/with-$ref.yaml b/src/test/resources/checks/v32/parameters/OAR025/with-$ref.yaml index ae38c08d..5f28da0c 100644 --- a/src/test/resources/checks/v32/parameters/OAR025/with-$ref.yaml +++ b/src/test/resources/checks/v32/parameters/OAR025/with-$ref.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/parameters/OAR025/without-parameters.json b/src/test/resources/checks/v32/parameters/OAR025/without-parameters.json index 2c99e1ea..3014da2f 100644 --- a/src/test/resources/checks/v32/parameters/OAR025/without-parameters.json +++ b/src/test/resources/checks/v32/parameters/OAR025/without-parameters.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.2.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v32/parameters/OAR025/without-parameters.yaml b/src/test/resources/checks/v32/parameters/OAR025/without-parameters.yaml index 729668f0..e4db4bfa 100644 --- a/src/test/resources/checks/v32/parameters/OAR025/without-parameters.yaml +++ b/src/test/resources/checks/v32/parameters/OAR025/without-parameters.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/parameters/OAR026/plain-with-$total-with-defval-false.json b/src/test/resources/checks/v32/parameters/OAR026/plain-with-$total-with-defval-false.json index 1b477763..4e059c12 100644 --- a/src/test/resources/checks/v32/parameters/OAR026/plain-with-$total-with-defval-false.json +++ b/src/test/resources/checks/v32/parameters/OAR026/plain-with-$total-with-defval-false.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.2.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v32/parameters/OAR026/plain-with-$total-with-defval-false.yaml b/src/test/resources/checks/v32/parameters/OAR026/plain-with-$total-with-defval-false.yaml index c33165c9..04298875 100644 --- a/src/test/resources/checks/v32/parameters/OAR026/plain-with-$total-with-defval-false.yaml +++ b/src/test/resources/checks/v32/parameters/OAR026/plain-with-$total-with-defval-false.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/parameters/OAR026/plain-with-$total-with-defval-true.json b/src/test/resources/checks/v32/parameters/OAR026/plain-with-$total-with-defval-true.json index 0295039e..6844caab 100644 --- a/src/test/resources/checks/v32/parameters/OAR026/plain-with-$total-with-defval-true.json +++ b/src/test/resources/checks/v32/parameters/OAR026/plain-with-$total-with-defval-true.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.2.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v32/parameters/OAR026/plain-with-$total-with-defval-true.yaml b/src/test/resources/checks/v32/parameters/OAR026/plain-with-$total-with-defval-true.yaml index 3324a5a2..b2af2310 100644 --- a/src/test/resources/checks/v32/parameters/OAR026/plain-with-$total-with-defval-true.yaml +++ b/src/test/resources/checks/v32/parameters/OAR026/plain-with-$total-with-defval-true.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/parameters/OAR026/plain-with-$total-without-defval.json b/src/test/resources/checks/v32/parameters/OAR026/plain-with-$total-without-defval.json index d756597f..82d1bd2c 100644 --- a/src/test/resources/checks/v32/parameters/OAR026/plain-with-$total-without-defval.json +++ b/src/test/resources/checks/v32/parameters/OAR026/plain-with-$total-without-defval.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.2.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v32/parameters/OAR026/plain-with-$total-without-defval.yaml b/src/test/resources/checks/v32/parameters/OAR026/plain-with-$total-without-defval.yaml index c2580dc0..fc709154 100644 --- a/src/test/resources/checks/v32/parameters/OAR026/plain-with-$total-without-defval.yaml +++ b/src/test/resources/checks/v32/parameters/OAR026/plain-with-$total-without-defval.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/parameters/OAR026/plain-without-$total.json b/src/test/resources/checks/v32/parameters/OAR026/plain-without-$total.json index 03c10cc8..2d9a45bf 100644 --- a/src/test/resources/checks/v32/parameters/OAR026/plain-without-$total.json +++ b/src/test/resources/checks/v32/parameters/OAR026/plain-without-$total.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.2.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v32/parameters/OAR026/plain-without-$total.yaml b/src/test/resources/checks/v32/parameters/OAR026/plain-without-$total.yaml index bf36bc7d..2dfc4ee7 100644 --- a/src/test/resources/checks/v32/parameters/OAR026/plain-without-$total.yaml +++ b/src/test/resources/checks/v32/parameters/OAR026/plain-without-$total.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/parameters/OAR026/with-$ref-with-$total-with-defval-false.json b/src/test/resources/checks/v32/parameters/OAR026/with-$ref-with-$total-with-defval-false.json index ac0d6d53..1a841cdb 100644 --- a/src/test/resources/checks/v32/parameters/OAR026/with-$ref-with-$total-with-defval-false.json +++ b/src/test/resources/checks/v32/parameters/OAR026/with-$ref-with-$total-with-defval-false.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.2.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v32/parameters/OAR026/with-$ref-with-$total-with-defval-false.yaml b/src/test/resources/checks/v32/parameters/OAR026/with-$ref-with-$total-with-defval-false.yaml index 1e0b553f..1562124c 100644 --- a/src/test/resources/checks/v32/parameters/OAR026/with-$ref-with-$total-with-defval-false.yaml +++ b/src/test/resources/checks/v32/parameters/OAR026/with-$ref-with-$total-with-defval-false.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/parameters/OAR026/with-$ref-with-$total-with-defval-true.json b/src/test/resources/checks/v32/parameters/OAR026/with-$ref-with-$total-with-defval-true.json index 45028091..578b4095 100644 --- a/src/test/resources/checks/v32/parameters/OAR026/with-$ref-with-$total-with-defval-true.json +++ b/src/test/resources/checks/v32/parameters/OAR026/with-$ref-with-$total-with-defval-true.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.2.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v32/parameters/OAR026/with-$ref-with-$total-with-defval-true.yaml b/src/test/resources/checks/v32/parameters/OAR026/with-$ref-with-$total-with-defval-true.yaml index 4936969a..a172b3e6 100644 --- a/src/test/resources/checks/v32/parameters/OAR026/with-$ref-with-$total-with-defval-true.yaml +++ b/src/test/resources/checks/v32/parameters/OAR026/with-$ref-with-$total-with-defval-true.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/parameters/OAR026/with-$ref-with-$total-without-defval.json b/src/test/resources/checks/v32/parameters/OAR026/with-$ref-with-$total-without-defval.json index 9c5ef562..0c9c05b7 100644 --- a/src/test/resources/checks/v32/parameters/OAR026/with-$ref-with-$total-without-defval.json +++ b/src/test/resources/checks/v32/parameters/OAR026/with-$ref-with-$total-without-defval.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.2.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v32/parameters/OAR026/with-$ref-with-$total-without-defval.yaml b/src/test/resources/checks/v32/parameters/OAR026/with-$ref-with-$total-without-defval.yaml index 68f5a74b..3ac00495 100644 --- a/src/test/resources/checks/v32/parameters/OAR026/with-$ref-with-$total-without-defval.yaml +++ b/src/test/resources/checks/v32/parameters/OAR026/with-$ref-with-$total-without-defval.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/parameters/OAR026/with-$ref-without-$total.json b/src/test/resources/checks/v32/parameters/OAR026/with-$ref-without-$total.json index e32862b7..68f9d229 100644 --- a/src/test/resources/checks/v32/parameters/OAR026/with-$ref-without-$total.json +++ b/src/test/resources/checks/v32/parameters/OAR026/with-$ref-without-$total.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.2.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v32/parameters/OAR026/with-$ref-without-$total.yaml b/src/test/resources/checks/v32/parameters/OAR026/with-$ref-without-$total.yaml index 0b0047cb..8af2a3c3 100644 --- a/src/test/resources/checks/v32/parameters/OAR026/with-$ref-without-$total.yaml +++ b/src/test/resources/checks/v32/parameters/OAR026/with-$ref-without-$total.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/parameters/OAR026/without-parameters.json b/src/test/resources/checks/v32/parameters/OAR026/without-parameters.json index 6eb95f76..c16b7e81 100644 --- a/src/test/resources/checks/v32/parameters/OAR026/without-parameters.json +++ b/src/test/resources/checks/v32/parameters/OAR026/without-parameters.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.2.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v32/parameters/OAR026/without-parameters.yaml b/src/test/resources/checks/v32/parameters/OAR026/without-parameters.yaml index 28190798..0ce657a4 100644 --- a/src/test/resources/checks/v32/parameters/OAR026/without-parameters.yaml +++ b/src/test/resources/checks/v32/parameters/OAR026/without-parameters.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/parameters/OAR028/components-param.json b/src/test/resources/checks/v32/parameters/OAR028/components-param.json index 38b3f30a..c73f7b32 100644 --- a/src/test/resources/checks/v32/parameters/OAR028/components-param.json +++ b/src/test/resources/checks/v32/parameters/OAR028/components-param.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.2.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v32/parameters/OAR028/components-param.yaml b/src/test/resources/checks/v32/parameters/OAR028/components-param.yaml index 18bc4ac4..c1e954e8 100644 --- a/src/test/resources/checks/v32/parameters/OAR028/components-param.yaml +++ b/src/test/resources/checks/v32/parameters/OAR028/components-param.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/parameters/OAR028/exclude-noncompliant.json b/src/test/resources/checks/v32/parameters/OAR028/exclude-noncompliant.json index ec73f987..958ffb1a 100644 --- a/src/test/resources/checks/v32/parameters/OAR028/exclude-noncompliant.json +++ b/src/test/resources/checks/v32/parameters/OAR028/exclude-noncompliant.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.2.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v32/parameters/OAR028/exclude-noncompliant.yaml b/src/test/resources/checks/v32/parameters/OAR028/exclude-noncompliant.yaml index bc7139de..343b26ef 100644 --- a/src/test/resources/checks/v32/parameters/OAR028/exclude-noncompliant.yaml +++ b/src/test/resources/checks/v32/parameters/OAR028/exclude-noncompliant.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/parameters/OAR028/excluded.json b/src/test/resources/checks/v32/parameters/OAR028/excluded.json index 7b77042f..8acbcce3 100644 --- a/src/test/resources/checks/v32/parameters/OAR028/excluded.json +++ b/src/test/resources/checks/v32/parameters/OAR028/excluded.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.2.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v32/parameters/OAR028/excluded.yaml b/src/test/resources/checks/v32/parameters/OAR028/excluded.yaml index 5bb25ac8..387db41b 100644 --- a/src/test/resources/checks/v32/parameters/OAR028/excluded.yaml +++ b/src/test/resources/checks/v32/parameters/OAR028/excluded.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/parameters/OAR028/plain-without.json b/src/test/resources/checks/v32/parameters/OAR028/plain-without.json index 56ec4af2..6d78ca42 100644 --- a/src/test/resources/checks/v32/parameters/OAR028/plain-without.json +++ b/src/test/resources/checks/v32/parameters/OAR028/plain-without.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.2.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v32/parameters/OAR028/plain-without.yaml b/src/test/resources/checks/v32/parameters/OAR028/plain-without.yaml index e756f798..59f530dd 100644 --- a/src/test/resources/checks/v32/parameters/OAR028/plain-without.yaml +++ b/src/test/resources/checks/v32/parameters/OAR028/plain-without.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/parameters/OAR028/plain.json b/src/test/resources/checks/v32/parameters/OAR028/plain.json index aadfd6a9..1a95e034 100644 --- a/src/test/resources/checks/v32/parameters/OAR028/plain.json +++ b/src/test/resources/checks/v32/parameters/OAR028/plain.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.2.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v32/parameters/OAR028/plain.yaml b/src/test/resources/checks/v32/parameters/OAR028/plain.yaml index 69e65b70..66990d53 100644 --- a/src/test/resources/checks/v32/parameters/OAR028/plain.yaml +++ b/src/test/resources/checks/v32/parameters/OAR028/plain.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/parameters/OAR028/with-$ref-without.json b/src/test/resources/checks/v32/parameters/OAR028/with-$ref-without.json index e045953f..8182a1ac 100644 --- a/src/test/resources/checks/v32/parameters/OAR028/with-$ref-without.json +++ b/src/test/resources/checks/v32/parameters/OAR028/with-$ref-without.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.2.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v32/parameters/OAR028/with-$ref-without.yaml b/src/test/resources/checks/v32/parameters/OAR028/with-$ref-without.yaml index 74206e3d..26f4868a 100644 --- a/src/test/resources/checks/v32/parameters/OAR028/with-$ref-without.yaml +++ b/src/test/resources/checks/v32/parameters/OAR028/with-$ref-without.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/parameters/OAR028/with-$ref.json b/src/test/resources/checks/v32/parameters/OAR028/with-$ref.json index 02cd1cb9..2e0e6920 100644 --- a/src/test/resources/checks/v32/parameters/OAR028/with-$ref.json +++ b/src/test/resources/checks/v32/parameters/OAR028/with-$ref.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.2.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v32/parameters/OAR028/with-$ref.yaml b/src/test/resources/checks/v32/parameters/OAR028/with-$ref.yaml index 1cddb613..c3133401 100644 --- a/src/test/resources/checks/v32/parameters/OAR028/with-$ref.yaml +++ b/src/test/resources/checks/v32/parameters/OAR028/with-$ref.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/parameters/OAR028/without-parameters.json b/src/test/resources/checks/v32/parameters/OAR028/without-parameters.json index cd9cbea6..6ac4b9f5 100644 --- a/src/test/resources/checks/v32/parameters/OAR028/without-parameters.json +++ b/src/test/resources/checks/v32/parameters/OAR028/without-parameters.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.2.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v32/parameters/OAR028/without-parameters.yaml b/src/test/resources/checks/v32/parameters/OAR028/without-parameters.yaml index 12c50ca8..8301eadf 100644 --- a/src/test/resources/checks/v32/parameters/OAR028/without-parameters.yaml +++ b/src/test/resources/checks/v32/parameters/OAR028/without-parameters.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/parameters/OAR060/required-false.json b/src/test/resources/checks/v32/parameters/OAR060/required-false.json index e0608d51..b68a5697 100644 --- a/src/test/resources/checks/v32/parameters/OAR060/required-false.json +++ b/src/test/resources/checks/v32/parameters/OAR060/required-false.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.2.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v32/parameters/OAR060/required-false.yaml b/src/test/resources/checks/v32/parameters/OAR060/required-false.yaml index 5537b3e6..ffbdc316 100644 --- a/src/test/resources/checks/v32/parameters/OAR060/required-false.yaml +++ b/src/test/resources/checks/v32/parameters/OAR060/required-false.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/parameters/OAR060/required-true.json b/src/test/resources/checks/v32/parameters/OAR060/required-true.json index c57cdd06..cf62bf43 100644 --- a/src/test/resources/checks/v32/parameters/OAR060/required-true.json +++ b/src/test/resources/checks/v32/parameters/OAR060/required-true.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.2.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v32/parameters/OAR060/required-true.yaml b/src/test/resources/checks/v32/parameters/OAR060/required-true.yaml index 00a697fb..b6fbafbf 100644 --- a/src/test/resources/checks/v32/parameters/OAR060/required-true.yaml +++ b/src/test/resources/checks/v32/parameters/OAR060/required-true.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/parameters/OAR069/bad-request400.json b/src/test/resources/checks/v32/parameters/OAR069/bad-request400.json index 5f9e2b7c..3ec0761c 100644 --- a/src/test/resources/checks/v32/parameters/OAR069/bad-request400.json +++ b/src/test/resources/checks/v32/parameters/OAR069/bad-request400.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.2.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v32/parameters/OAR069/bad-request400.yaml b/src/test/resources/checks/v32/parameters/OAR069/bad-request400.yaml index 8e3ad04a..0257a31e 100644 --- a/src/test/resources/checks/v32/parameters/OAR069/bad-request400.yaml +++ b/src/test/resources/checks/v32/parameters/OAR069/bad-request400.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/parameters/OAR069/no-bad-request400.json b/src/test/resources/checks/v32/parameters/OAR069/no-bad-request400.json index 54ace04f..de68ddb7 100644 --- a/src/test/resources/checks/v32/parameters/OAR069/no-bad-request400.json +++ b/src/test/resources/checks/v32/parameters/OAR069/no-bad-request400.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.2.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v32/parameters/OAR069/no-bad-request400.yaml b/src/test/resources/checks/v32/parameters/OAR069/no-bad-request400.yaml index 44c1d8ad..12fa0e70 100644 --- a/src/test/resources/checks/v32/parameters/OAR069/no-bad-request400.yaml +++ b/src/test/resources/checks/v32/parameters/OAR069/no-bad-request400.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/regex/OAR112/external-docs-invalid.json b/src/test/resources/checks/v32/regex/OAR112/external-docs-invalid.json index 17586e7f..fc922fa8 100644 --- a/src/test/resources/checks/v32/regex/OAR112/external-docs-invalid.json +++ b/src/test/resources/checks/v32/regex/OAR112/external-docs-invalid.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.3", + "openapi" : "3.2.0", "info" : { "title" : "Test API", "version" : "1.0.0" diff --git a/src/test/resources/checks/v32/regex/OAR112/external-docs-invalid.yaml b/src/test/resources/checks/v32/regex/OAR112/external-docs-invalid.yaml index 587823ce..f4cd5bdf 100644 --- a/src/test/resources/checks/v32/regex/OAR112/external-docs-invalid.yaml +++ b/src/test/resources/checks/v32/regex/OAR112/external-docs-invalid.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.3 +openapi: "3.2.0" info: title: Test API version: 1.0.0 diff --git a/src/test/resources/checks/v32/regex/OAR112/external-docs-valid.json b/src/test/resources/checks/v32/regex/OAR112/external-docs-valid.json index b557673e..efb1324f 100644 --- a/src/test/resources/checks/v32/regex/OAR112/external-docs-valid.json +++ b/src/test/resources/checks/v32/regex/OAR112/external-docs-valid.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.3", + "openapi" : "3.2.0", "info" : { "title" : "Test API", "version" : "1.0.0" diff --git a/src/test/resources/checks/v32/regex/OAR112/external-docs-valid.yaml b/src/test/resources/checks/v32/regex/OAR112/external-docs-valid.yaml index a273f219..a16877bf 100644 --- a/src/test/resources/checks/v32/regex/OAR112/external-docs-valid.yaml +++ b/src/test/resources/checks/v32/regex/OAR112/external-docs-valid.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.3 +openapi: "3.2.0" info: title: Test API version: 1.0.0 diff --git a/src/test/resources/checks/v32/regex/OAR112/info-invalid.json b/src/test/resources/checks/v32/regex/OAR112/info-invalid.json index 1febb6b1..8b00932e 100644 --- a/src/test/resources/checks/v32/regex/OAR112/info-invalid.json +++ b/src/test/resources/checks/v32/regex/OAR112/info-invalid.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.3", + "openapi" : "3.2.0", "info" : { "title" : "Test API", "version" : "1.0.0", diff --git a/src/test/resources/checks/v32/regex/OAR112/info-invalid.yaml b/src/test/resources/checks/v32/regex/OAR112/info-invalid.yaml index 32fbcf71..287bbbcc 100644 --- a/src/test/resources/checks/v32/regex/OAR112/info-invalid.yaml +++ b/src/test/resources/checks/v32/regex/OAR112/info-invalid.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.3 +openapi: "3.2.0" info: title: Test API version: 1.0.0 diff --git a/src/test/resources/checks/v32/regex/OAR112/minimal.json b/src/test/resources/checks/v32/regex/OAR112/minimal.json index 2c084747..dcfa2d76 100644 --- a/src/test/resources/checks/v32/regex/OAR112/minimal.json +++ b/src/test/resources/checks/v32/regex/OAR112/minimal.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.3", + "openapi" : "3.2.0", "info" : { "title" : "Test API", "version" : "1.0.0" diff --git a/src/test/resources/checks/v32/regex/OAR112/minimal.yaml b/src/test/resources/checks/v32/regex/OAR112/minimal.yaml index f379c272..229672f1 100644 --- a/src/test/resources/checks/v32/regex/OAR112/minimal.yaml +++ b/src/test/resources/checks/v32/regex/OAR112/minimal.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.3 +openapi: "3.2.0" info: title: Test API version: 1.0.0 diff --git a/src/test/resources/checks/v32/regex/OAR112/missing-description.json b/src/test/resources/checks/v32/regex/OAR112/missing-description.json index f2549007..8090d27d 100644 --- a/src/test/resources/checks/v32/regex/OAR112/missing-description.json +++ b/src/test/resources/checks/v32/regex/OAR112/missing-description.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.3", + "openapi" : "3.2.0", "info" : { # Noncompliant {{OAR112: Expected to find a value but didn't.}} "title" : "Test API", "version" : "1.0.0" diff --git a/src/test/resources/checks/v32/regex/OAR112/missing-description.yaml b/src/test/resources/checks/v32/regex/OAR112/missing-description.yaml index db4ae777..32c89fee 100644 --- a/src/test/resources/checks/v32/regex/OAR112/missing-description.yaml +++ b/src/test/resources/checks/v32/regex/OAR112/missing-description.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.3 +openapi: "3.2.0" info: # Noncompliant {{OAR112: Expected to find a value but didn't.}} title: Test API version: 1.0.0 diff --git a/src/test/resources/checks/v32/regex/OAR112/operation-invalid.json b/src/test/resources/checks/v32/regex/OAR112/operation-invalid.json index 8bfbed2b..f6384306 100644 --- a/src/test/resources/checks/v32/regex/OAR112/operation-invalid.json +++ b/src/test/resources/checks/v32/regex/OAR112/operation-invalid.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.3", + "openapi" : "3.2.0", "info" : { "title" : "Test API", "version" : "1.0.0" diff --git a/src/test/resources/checks/v32/regex/OAR112/operation-invalid.yaml b/src/test/resources/checks/v32/regex/OAR112/operation-invalid.yaml index 0bc1243b..d4eea6c3 100644 --- a/src/test/resources/checks/v32/regex/OAR112/operation-invalid.yaml +++ b/src/test/resources/checks/v32/regex/OAR112/operation-invalid.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.3 +openapi: "3.2.0" info: title: Test API version: 1.0.0 diff --git a/src/test/resources/checks/v32/regex/OAR112/operation-valid.json b/src/test/resources/checks/v32/regex/OAR112/operation-valid.json index 84ad7faa..a8558a04 100644 --- a/src/test/resources/checks/v32/regex/OAR112/operation-valid.json +++ b/src/test/resources/checks/v32/regex/OAR112/operation-valid.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.3", + "openapi" : "3.2.0", "info" : { "title" : "Test API", "version" : "1.0.0" diff --git a/src/test/resources/checks/v32/regex/OAR112/operation-valid.yaml b/src/test/resources/checks/v32/regex/OAR112/operation-valid.yaml index 9b62b40c..41c58947 100644 --- a/src/test/resources/checks/v32/regex/OAR112/operation-valid.yaml +++ b/src/test/resources/checks/v32/regex/OAR112/operation-valid.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.3 +openapi: "3.2.0" info: title: Test API version: 1.0.0 diff --git a/src/test/resources/checks/v32/regex/OAR112/parameters-invalid.json b/src/test/resources/checks/v32/regex/OAR112/parameters-invalid.json index 46495733..5768d11e 100644 --- a/src/test/resources/checks/v32/regex/OAR112/parameters-invalid.json +++ b/src/test/resources/checks/v32/regex/OAR112/parameters-invalid.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.3", + "openapi" : "3.2.0", "info" : { "title" : "Test API", "version" : "1.0.0" diff --git a/src/test/resources/checks/v32/regex/OAR112/parameters-invalid.yaml b/src/test/resources/checks/v32/regex/OAR112/parameters-invalid.yaml index 86159506..e5da10c4 100644 --- a/src/test/resources/checks/v32/regex/OAR112/parameters-invalid.yaml +++ b/src/test/resources/checks/v32/regex/OAR112/parameters-invalid.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.3 +openapi: "3.2.0" info: title: Test API version: 1.0.0 diff --git a/src/test/resources/checks/v32/regex/OAR112/parameters-valid.json b/src/test/resources/checks/v32/regex/OAR112/parameters-valid.json index 27af1750..c292eed7 100644 --- a/src/test/resources/checks/v32/regex/OAR112/parameters-valid.json +++ b/src/test/resources/checks/v32/regex/OAR112/parameters-valid.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.3", + "openapi" : "3.2.0", "info" : { "title" : "Test API", "version" : "1.0.0" diff --git a/src/test/resources/checks/v32/regex/OAR112/parameters-valid.yaml b/src/test/resources/checks/v32/regex/OAR112/parameters-valid.yaml index 9ec6ebd6..7a1c2510 100644 --- a/src/test/resources/checks/v32/regex/OAR112/parameters-valid.yaml +++ b/src/test/resources/checks/v32/regex/OAR112/parameters-valid.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.3 +openapi: "3.2.0" info: title: Test API version: 1.0.0 diff --git a/src/test/resources/checks/v32/regex/OAR112/plain.json b/src/test/resources/checks/v32/regex/OAR112/plain.json index aab1e213..ce410511 100644 --- a/src/test/resources/checks/v32/regex/OAR112/plain.json +++ b/src/test/resources/checks/v32/regex/OAR112/plain.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.2.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v32/regex/OAR112/plain.yaml b/src/test/resources/checks/v32/regex/OAR112/plain.yaml index 4621ff6f..07364470 100644 --- a/src/test/resources/checks/v32/regex/OAR112/plain.yaml +++ b/src/test/resources/checks/v32/regex/OAR112/plain.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.3 +openapi: "3.2.0" info: title: Ejemplo de API version: 1.0.0 diff --git a/src/test/resources/checks/v32/regex/OAR112/servers-invalid.json b/src/test/resources/checks/v32/regex/OAR112/servers-invalid.json index c5cda036..0b80f6d3 100644 --- a/src/test/resources/checks/v32/regex/OAR112/servers-invalid.json +++ b/src/test/resources/checks/v32/regex/OAR112/servers-invalid.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.3", + "openapi" : "3.2.0", "info" : { "title" : "Test API", "version" : "1.0.0" diff --git a/src/test/resources/checks/v32/regex/OAR112/servers-invalid.yaml b/src/test/resources/checks/v32/regex/OAR112/servers-invalid.yaml index 835f2b06..4056de58 100644 --- a/src/test/resources/checks/v32/regex/OAR112/servers-invalid.yaml +++ b/src/test/resources/checks/v32/regex/OAR112/servers-invalid.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.3 +openapi: "3.2.0" info: title: Test API version: 1.0.0 diff --git a/src/test/resources/checks/v32/regex/OAR112/servers-valid.json b/src/test/resources/checks/v32/regex/OAR112/servers-valid.json index 735983f4..6c78c59a 100644 --- a/src/test/resources/checks/v32/regex/OAR112/servers-valid.json +++ b/src/test/resources/checks/v32/regex/OAR112/servers-valid.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.3", + "openapi" : "3.2.0", "info" : { "title" : "Test API", "version" : "1.0.0" diff --git a/src/test/resources/checks/v32/regex/OAR112/servers-valid.yaml b/src/test/resources/checks/v32/regex/OAR112/servers-valid.yaml index 511f93d7..96b47c7a 100644 --- a/src/test/resources/checks/v32/regex/OAR112/servers-valid.yaml +++ b/src/test/resources/checks/v32/regex/OAR112/servers-valid.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.3 +openapi: "3.2.0" info: title: Test API version: 1.0.0 diff --git a/src/test/resources/checks/v32/regex/OAR112/tags-invalid.json b/src/test/resources/checks/v32/regex/OAR112/tags-invalid.json index 5995f7ba..202ac69e 100644 --- a/src/test/resources/checks/v32/regex/OAR112/tags-invalid.json +++ b/src/test/resources/checks/v32/regex/OAR112/tags-invalid.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.3", + "openapi" : "3.2.0", "info" : { "title" : "Test API", "version" : "1.0.0" diff --git a/src/test/resources/checks/v32/regex/OAR112/tags-invalid.yaml b/src/test/resources/checks/v32/regex/OAR112/tags-invalid.yaml index 48c06b71..c09e07fe 100644 --- a/src/test/resources/checks/v32/regex/OAR112/tags-invalid.yaml +++ b/src/test/resources/checks/v32/regex/OAR112/tags-invalid.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.3 +openapi: "3.2.0" info: title: Test API version: 1.0.0 diff --git a/src/test/resources/checks/v32/regex/OAR112/tags-valid.json b/src/test/resources/checks/v32/regex/OAR112/tags-valid.json index f28ad145..151cfa52 100644 --- a/src/test/resources/checks/v32/regex/OAR112/tags-valid.json +++ b/src/test/resources/checks/v32/regex/OAR112/tags-valid.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.3", + "openapi" : "3.2.0", "info" : { "title" : "Test API", "version" : "1.0.0" diff --git a/src/test/resources/checks/v32/regex/OAR112/tags-valid.yaml b/src/test/resources/checks/v32/regex/OAR112/tags-valid.yaml index 045b483f..0119078a 100644 --- a/src/test/resources/checks/v32/regex/OAR112/tags-valid.yaml +++ b/src/test/resources/checks/v32/regex/OAR112/tags-valid.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.3 +openapi: "3.2.0" info: title: Test API version: 1.0.0 diff --git a/src/test/resources/checks/v32/resources/OAR008/plain.json b/src/test/resources/checks/v32/resources/OAR008/plain.json index 9b40ba23..1ff8ac46 100644 --- a/src/test/resources/checks/v32/resources/OAR008/plain.json +++ b/src/test/resources/checks/v32/resources/OAR008/plain.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.2.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v32/resources/OAR008/plain.yaml b/src/test/resources/checks/v32/resources/OAR008/plain.yaml index fa0fc5fc..f893e7d4 100644 --- a/src/test/resources/checks/v32/resources/OAR008/plain.yaml +++ b/src/test/resources/checks/v32/resources/OAR008/plain.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/resources/OAR013/plain.json b/src/test/resources/checks/v32/resources/OAR013/plain.json index 78e9374c..f01ecf15 100644 --- a/src/test/resources/checks/v32/resources/OAR013/plain.json +++ b/src/test/resources/checks/v32/resources/OAR013/plain.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.2.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v32/resources/OAR013/plain.yaml b/src/test/resources/checks/v32/resources/OAR013/plain.yaml index a58371d8..1c93c05c 100644 --- a/src/test/resources/checks/v32/resources/OAR013/plain.yaml +++ b/src/test/resources/checks/v32/resources/OAR013/plain.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/resources/OAR014/plain.json b/src/test/resources/checks/v32/resources/OAR014/plain.json index ec717959..2777ce2c 100644 --- a/src/test/resources/checks/v32/resources/OAR014/plain.json +++ b/src/test/resources/checks/v32/resources/OAR014/plain.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v32/resources/OAR014/plain.yaml b/src/test/resources/checks/v32/resources/OAR014/plain.yaml index 08c7baa0..a5037c89 100644 --- a/src/test/resources/checks/v32/resources/OAR014/plain.yaml +++ b/src/test/resources/checks/v32/resources/OAR014/plain.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/resources/OAR015/plain.json b/src/test/resources/checks/v32/resources/OAR015/plain.json index 258325fe..d2152946 100644 --- a/src/test/resources/checks/v32/resources/OAR015/plain.json +++ b/src/test/resources/checks/v32/resources/OAR015/plain.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v32/resources/OAR015/plain.yaml b/src/test/resources/checks/v32/resources/OAR015/plain.yaml index 94edfe5d..f29ada81 100644 --- a/src/test/resources/checks/v32/resources/OAR015/plain.yaml +++ b/src/test/resources/checks/v32/resources/OAR015/plain.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.0 +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/resources/OAR017/plain.json b/src/test/resources/checks/v32/resources/OAR017/plain.json index 1106c56c..54d66f97 100644 --- a/src/test/resources/checks/v32/resources/OAR017/plain.json +++ b/src/test/resources/checks/v32/resources/OAR017/plain.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.2.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v32/resources/OAR017/plain.yaml b/src/test/resources/checks/v32/resources/OAR017/plain.yaml index 29c02541..2f9c2417 100644 --- a/src/test/resources/checks/v32/resources/OAR017/plain.yaml +++ b/src/test/resources/checks/v32/resources/OAR017/plain.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/resources/OAR018/plain.json b/src/test/resources/checks/v32/resources/OAR018/plain.json index 691f21b9..7f33df14 100644 --- a/src/test/resources/checks/v32/resources/OAR018/plain.json +++ b/src/test/resources/checks/v32/resources/OAR018/plain.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v32/resources/OAR018/plain.yaml b/src/test/resources/checks/v32/resources/OAR018/plain.yaml index bed03643..bae7d175 100644 --- a/src/test/resources/checks/v32/resources/OAR018/plain.yaml +++ b/src/test/resources/checks/v32/resources/OAR018/plain.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/resources/OAR027/no-post.json b/src/test/resources/checks/v32/resources/OAR027/no-post.json index 06e93395..b0d8cd88 100644 --- a/src/test/resources/checks/v32/resources/OAR027/no-post.json +++ b/src/test/resources/checks/v32/resources/OAR027/no-post.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.2.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v32/resources/OAR027/no-post.yaml b/src/test/resources/checks/v32/resources/OAR027/no-post.yaml index 9e1d488a..430d9384 100644 --- a/src/test/resources/checks/v32/resources/OAR027/no-post.yaml +++ b/src/test/resources/checks/v32/resources/OAR027/no-post.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/resources/OAR027/post-201-with-location.json b/src/test/resources/checks/v32/resources/OAR027/post-201-with-location.json index 1911e07c..d0a66815 100644 --- a/src/test/resources/checks/v32/resources/OAR027/post-201-with-location.json +++ b/src/test/resources/checks/v32/resources/OAR027/post-201-with-location.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.2.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v32/resources/OAR027/post-201-with-location.yaml b/src/test/resources/checks/v32/resources/OAR027/post-201-with-location.yaml index 9b065b0a..8a83e03c 100644 --- a/src/test/resources/checks/v32/resources/OAR027/post-201-with-location.yaml +++ b/src/test/resources/checks/v32/resources/OAR027/post-201-with-location.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/resources/OAR027/post-201-with-other-headers.json b/src/test/resources/checks/v32/resources/OAR027/post-201-with-other-headers.json index 6e423478..c8fd6785 100644 --- a/src/test/resources/checks/v32/resources/OAR027/post-201-with-other-headers.json +++ b/src/test/resources/checks/v32/resources/OAR027/post-201-with-other-headers.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.2.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v32/resources/OAR027/post-201-with-other-headers.yaml b/src/test/resources/checks/v32/resources/OAR027/post-201-with-other-headers.yaml index a080d8ed..74e0450a 100644 --- a/src/test/resources/checks/v32/resources/OAR027/post-201-with-other-headers.yaml +++ b/src/test/resources/checks/v32/resources/OAR027/post-201-with-other-headers.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/resources/OAR027/post-201-without-location.json b/src/test/resources/checks/v32/resources/OAR027/post-201-without-location.json index 3c46c6a4..d5c533f8 100644 --- a/src/test/resources/checks/v32/resources/OAR027/post-201-without-location.json +++ b/src/test/resources/checks/v32/resources/OAR027/post-201-without-location.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.2.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v32/resources/OAR027/post-201-without-location.yaml b/src/test/resources/checks/v32/resources/OAR027/post-201-without-location.yaml index eb45ccf1..4b5ba620 100644 --- a/src/test/resources/checks/v32/resources/OAR027/post-201-without-location.yaml +++ b/src/test/resources/checks/v32/resources/OAR027/post-201-without-location.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/resources/OAR027/post-no-201.json b/src/test/resources/checks/v32/resources/OAR027/post-no-201.json index 680dc49d..af7a2bf5 100644 --- a/src/test/resources/checks/v32/resources/OAR027/post-no-201.json +++ b/src/test/resources/checks/v32/resources/OAR027/post-no-201.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.2.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v32/resources/OAR027/post-no-201.yaml b/src/test/resources/checks/v32/resources/OAR027/post-no-201.yaml index bef9c590..89cbdd7a 100644 --- a/src/test/resources/checks/v32/resources/OAR027/post-no-201.yaml +++ b/src/test/resources/checks/v32/resources/OAR027/post-no-201.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/resources/OAR029/valid-all-of-md.json b/src/test/resources/checks/v32/resources/OAR029/valid-all-of-md.json index d39ce425..103d68b4 100644 --- a/src/test/resources/checks/v32/resources/OAR029/valid-all-of-md.json +++ b/src/test/resources/checks/v32/resources/OAR029/valid-all-of-md.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.1", + "openapi" : "3.2.0", "info": { "title": "Swagger Petstore", "version": "1.0.0" diff --git a/src/test/resources/checks/v32/resources/OAR029/valid-all-of-md.yaml b/src/test/resources/checks/v32/resources/OAR029/valid-all-of-md.yaml index 5413414a..795fbdba 100644 --- a/src/test/resources/checks/v32/resources/OAR029/valid-all-of-md.yaml +++ b/src/test/resources/checks/v32/resources/OAR029/valid-all-of-md.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.1 +openapi: "3.2.0" info: title: Swagger Petstore version: 1.0.0 diff --git a/src/test/resources/checks/v32/resources/OAR029/valid-all-of.json b/src/test/resources/checks/v32/resources/OAR029/valid-all-of.json index cae30865..aeff0e27 100644 --- a/src/test/resources/checks/v32/resources/OAR029/valid-all-of.json +++ b/src/test/resources/checks/v32/resources/OAR029/valid-all-of.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.2.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v32/resources/OAR029/valid-all-of.yaml b/src/test/resources/checks/v32/resources/OAR029/valid-all-of.yaml index a7203f72..35903cf7 100644 --- a/src/test/resources/checks/v32/resources/OAR029/valid-all-of.yaml +++ b/src/test/resources/checks/v32/resources/OAR029/valid-all-of.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/resources/OAR029/valid-md.json b/src/test/resources/checks/v32/resources/OAR029/valid-md.json index dab6fe31..150c410b 100644 --- a/src/test/resources/checks/v32/resources/OAR029/valid-md.json +++ b/src/test/resources/checks/v32/resources/OAR029/valid-md.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.1", + "openapi" : "3.2.0", "info": { "title": "Swagger Petstore", "version": "1.0.0" diff --git a/src/test/resources/checks/v32/resources/OAR029/valid-md.yaml b/src/test/resources/checks/v32/resources/OAR029/valid-md.yaml index 7df432ae..cd56b90d 100644 --- a/src/test/resources/checks/v32/resources/OAR029/valid-md.yaml +++ b/src/test/resources/checks/v32/resources/OAR029/valid-md.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.1 +openapi: "3.2.0" info: title: Swagger Petstore version: 1.0.0 diff --git a/src/test/resources/checks/v32/resources/OAR029/valid-r.json b/src/test/resources/checks/v32/resources/OAR029/valid-r.json index 95ea5878..95e51635 100644 --- a/src/test/resources/checks/v32/resources/OAR029/valid-r.json +++ b/src/test/resources/checks/v32/resources/OAR029/valid-r.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v32/resources/OAR029/valid-r.yaml b/src/test/resources/checks/v32/resources/OAR029/valid-r.yaml index f3c42c5c..574b0a26 100644 --- a/src/test/resources/checks/v32/resources/OAR029/valid-r.yaml +++ b/src/test/resources/checks/v32/resources/OAR029/valid-r.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.0 +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/resources/OAR029/valid.json b/src/test/resources/checks/v32/resources/OAR029/valid.json index dc03b61e..34e25331 100644 --- a/src/test/resources/checks/v32/resources/OAR029/valid.json +++ b/src/test/resources/checks/v32/resources/OAR029/valid.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.2.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v32/resources/OAR029/valid.yaml b/src/test/resources/checks/v32/resources/OAR029/valid.yaml index 8aa93539..d5b57932 100644 --- a/src/test/resources/checks/v32/resources/OAR029/valid.yaml +++ b/src/test/resources/checks/v32/resources/OAR029/valid.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/resources/OAR029/with-error-with-properties-wrong-type-r.json b/src/test/resources/checks/v32/resources/OAR029/with-error-with-properties-wrong-type-r.json index 6a2f1e5e..bf3ca7b4 100644 --- a/src/test/resources/checks/v32/resources/OAR029/with-error-with-properties-wrong-type-r.json +++ b/src/test/resources/checks/v32/resources/OAR029/with-error-with-properties-wrong-type-r.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v32/resources/OAR029/with-error-with-properties-wrong-type-r.yaml b/src/test/resources/checks/v32/resources/OAR029/with-error-with-properties-wrong-type-r.yaml index 32eabe95..fd17ad18 100644 --- a/src/test/resources/checks/v32/resources/OAR029/with-error-with-properties-wrong-type-r.yaml +++ b/src/test/resources/checks/v32/resources/OAR029/with-error-with-properties-wrong-type-r.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/resources/OAR029/with-error-without-properties-r.json b/src/test/resources/checks/v32/resources/OAR029/with-error-without-properties-r.json index d8ea6754..928dedca 100644 --- a/src/test/resources/checks/v32/resources/OAR029/with-error-without-properties-r.json +++ b/src/test/resources/checks/v32/resources/OAR029/with-error-without-properties-r.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v32/resources/OAR029/with-error-without-properties-r.yaml b/src/test/resources/checks/v32/resources/OAR029/with-error-without-properties-r.yaml index 16e83e55..004056a3 100644 --- a/src/test/resources/checks/v32/resources/OAR029/with-error-without-properties-r.yaml +++ b/src/test/resources/checks/v32/resources/OAR029/with-error-without-properties-r.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/resources/OAR029/with-error-wrong-type-r.json b/src/test/resources/checks/v32/resources/OAR029/with-error-wrong-type-r.json index 2ed7ec61..19b70832 100644 --- a/src/test/resources/checks/v32/resources/OAR029/with-error-wrong-type-r.json +++ b/src/test/resources/checks/v32/resources/OAR029/with-error-wrong-type-r.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v32/resources/OAR029/with-error-wrong-type-r.yaml b/src/test/resources/checks/v32/resources/OAR029/with-error-wrong-type-r.yaml index ac0cbfcf..f6b69957 100644 --- a/src/test/resources/checks/v32/resources/OAR029/with-error-wrong-type-r.yaml +++ b/src/test/resources/checks/v32/resources/OAR029/with-error-wrong-type-r.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/resources/OAR029/with-result-with-properties-wrong-type-md.json b/src/test/resources/checks/v32/resources/OAR029/with-result-with-properties-wrong-type-md.json index fbdfa315..8c2fbd68 100644 --- a/src/test/resources/checks/v32/resources/OAR029/with-result-with-properties-wrong-type-md.json +++ b/src/test/resources/checks/v32/resources/OAR029/with-result-with-properties-wrong-type-md.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.1", + "openapi" : "3.2.0", "info": { "title": "Swagger Petstore", "version": "1.0.0" diff --git a/src/test/resources/checks/v32/resources/OAR029/with-result-with-properties-wrong-type-md.yaml b/src/test/resources/checks/v32/resources/OAR029/with-result-with-properties-wrong-type-md.yaml index 21b31cd5..448733fa 100644 --- a/src/test/resources/checks/v32/resources/OAR029/with-result-with-properties-wrong-type-md.yaml +++ b/src/test/resources/checks/v32/resources/OAR029/with-result-with-properties-wrong-type-md.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.1 +openapi: "3.2.0" info: title: Swagger Petstore version: 1.0.0 diff --git a/src/test/resources/checks/v32/resources/OAR029/with-result-without-properties-md.json b/src/test/resources/checks/v32/resources/OAR029/with-result-without-properties-md.json index 5b02c8a8..fa173fa7 100644 --- a/src/test/resources/checks/v32/resources/OAR029/with-result-without-properties-md.json +++ b/src/test/resources/checks/v32/resources/OAR029/with-result-without-properties-md.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.1", + "openapi" : "3.2.0", "info": { "title": "Swagger Petstore", "version": "1.0.0" diff --git a/src/test/resources/checks/v32/resources/OAR029/with-result-without-properties-md.yaml b/src/test/resources/checks/v32/resources/OAR029/with-result-without-properties-md.yaml index 6434b79c..62abc35a 100644 --- a/src/test/resources/checks/v32/resources/OAR029/with-result-without-properties-md.yaml +++ b/src/test/resources/checks/v32/resources/OAR029/with-result-without-properties-md.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.1 +openapi: "3.2.0" info: title: Swagger Petstore version: 1.0.0 diff --git a/src/test/resources/checks/v32/resources/OAR029/with-result-wrong-type-md.json b/src/test/resources/checks/v32/resources/OAR029/with-result-wrong-type-md.json index c24b20fd..48ab3c52 100644 --- a/src/test/resources/checks/v32/resources/OAR029/with-result-wrong-type-md.json +++ b/src/test/resources/checks/v32/resources/OAR029/with-result-wrong-type-md.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.1", + "openapi" : "3.2.0", "info": { "title": "Swagger Petstore", "version": "1.0.0" diff --git a/src/test/resources/checks/v32/resources/OAR029/with-result-wrong-type-md.yaml b/src/test/resources/checks/v32/resources/OAR029/with-result-wrong-type-md.yaml index 37e75c1b..e706d96b 100644 --- a/src/test/resources/checks/v32/resources/OAR029/with-result-wrong-type-md.yaml +++ b/src/test/resources/checks/v32/resources/OAR029/with-result-wrong-type-md.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.1 +openapi: "3.2.0" info: title: Swagger Petstore version: 1.0.0 diff --git a/src/test/resources/checks/v32/resources/OAR029/with-status-with-properties-wrong-type.json b/src/test/resources/checks/v32/resources/OAR029/with-status-with-properties-wrong-type.json index af6d6d23..f1f72fc4 100644 --- a/src/test/resources/checks/v32/resources/OAR029/with-status-with-properties-wrong-type.json +++ b/src/test/resources/checks/v32/resources/OAR029/with-status-with-properties-wrong-type.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.2.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v32/resources/OAR029/with-status-with-properties-wrong-type.yaml b/src/test/resources/checks/v32/resources/OAR029/with-status-with-properties-wrong-type.yaml index 68e59b91..15eacfbe 100644 --- a/src/test/resources/checks/v32/resources/OAR029/with-status-with-properties-wrong-type.yaml +++ b/src/test/resources/checks/v32/resources/OAR029/with-status-with-properties-wrong-type.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/resources/OAR029/with-status-without-properties.json b/src/test/resources/checks/v32/resources/OAR029/with-status-without-properties.json index 80e9dbf2..dbbd033e 100644 --- a/src/test/resources/checks/v32/resources/OAR029/with-status-without-properties.json +++ b/src/test/resources/checks/v32/resources/OAR029/with-status-without-properties.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.2.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v32/resources/OAR029/with-status-without-properties.yaml b/src/test/resources/checks/v32/resources/OAR029/with-status-without-properties.yaml index 2437684e..69406256 100644 --- a/src/test/resources/checks/v32/resources/OAR029/with-status-without-properties.yaml +++ b/src/test/resources/checks/v32/resources/OAR029/with-status-without-properties.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/resources/OAR029/with-status-wrong-type.json b/src/test/resources/checks/v32/resources/OAR029/with-status-wrong-type.json index 014223c9..e604523d 100644 --- a/src/test/resources/checks/v32/resources/OAR029/with-status-wrong-type.json +++ b/src/test/resources/checks/v32/resources/OAR029/with-status-wrong-type.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.2.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v32/resources/OAR029/with-status-wrong-type.yaml b/src/test/resources/checks/v32/resources/OAR029/with-status-wrong-type.yaml index 13bce453..8ae8cda4 100644 --- a/src/test/resources/checks/v32/resources/OAR029/with-status-wrong-type.yaml +++ b/src/test/resources/checks/v32/resources/OAR029/with-status-wrong-type.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/resources/OAR029/without-data-md.json b/src/test/resources/checks/v32/resources/OAR029/without-data-md.json index 8262dd65..2c897e92 100644 --- a/src/test/resources/checks/v32/resources/OAR029/without-data-md.json +++ b/src/test/resources/checks/v32/resources/OAR029/without-data-md.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.1", + "openapi" : "3.2.0", "info": { "title": "Swagger Petstore", "version": "1.0.0" diff --git a/src/test/resources/checks/v32/resources/OAR029/without-data-md.yaml b/src/test/resources/checks/v32/resources/OAR029/without-data-md.yaml index 950439cb..2585ab57 100644 --- a/src/test/resources/checks/v32/resources/OAR029/without-data-md.yaml +++ b/src/test/resources/checks/v32/resources/OAR029/without-data-md.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.1 +openapi: "3.2.0" info: title: Swagger Petstore version: 1.0.0 diff --git a/src/test/resources/checks/v32/resources/OAR029/without-data.json b/src/test/resources/checks/v32/resources/OAR029/without-data.json index 4c36767a..20f98676 100644 --- a/src/test/resources/checks/v32/resources/OAR029/without-data.json +++ b/src/test/resources/checks/v32/resources/OAR029/without-data.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.2.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v32/resources/OAR029/without-data.yaml b/src/test/resources/checks/v32/resources/OAR029/without-data.yaml index 02cb167f..d9688279 100644 --- a/src/test/resources/checks/v32/resources/OAR029/without-data.yaml +++ b/src/test/resources/checks/v32/resources/OAR029/without-data.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/resources/OAR029/without-error-r.json b/src/test/resources/checks/v32/resources/OAR029/without-error-r.json index 4a2978a7..bb63d29a 100644 --- a/src/test/resources/checks/v32/resources/OAR029/without-error-r.json +++ b/src/test/resources/checks/v32/resources/OAR029/without-error-r.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.2.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v32/resources/OAR029/without-error-r.yaml b/src/test/resources/checks/v32/resources/OAR029/without-error-r.yaml index fdaf26ad..e548f45d 100644 --- a/src/test/resources/checks/v32/resources/OAR029/without-error-r.yaml +++ b/src/test/resources/checks/v32/resources/OAR029/without-error-r.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/resources/OAR029/without-payload-r.json b/src/test/resources/checks/v32/resources/OAR029/without-payload-r.json index f2ee25c9..5929ab6b 100644 --- a/src/test/resources/checks/v32/resources/OAR029/without-payload-r.json +++ b/src/test/resources/checks/v32/resources/OAR029/without-payload-r.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.2.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v32/resources/OAR029/without-payload-r.yaml b/src/test/resources/checks/v32/resources/OAR029/without-payload-r.yaml index 0993f891..184c4c24 100644 --- a/src/test/resources/checks/v32/resources/OAR029/without-payload-r.yaml +++ b/src/test/resources/checks/v32/resources/OAR029/without-payload-r.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/resources/OAR029/without-required-fields-md.json b/src/test/resources/checks/v32/resources/OAR029/without-required-fields-md.json index 63d7a3bb..bd890695 100644 --- a/src/test/resources/checks/v32/resources/OAR029/without-required-fields-md.json +++ b/src/test/resources/checks/v32/resources/OAR029/without-required-fields-md.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.1", + "openapi" : "3.2.0", "info": { "title": "Swagger Petstore", "version": "1.0.0" diff --git a/src/test/resources/checks/v32/resources/OAR029/without-required-fields-md.yaml b/src/test/resources/checks/v32/resources/OAR029/without-required-fields-md.yaml index efecd06f..a78c5d44 100644 --- a/src/test/resources/checks/v32/resources/OAR029/without-required-fields-md.yaml +++ b/src/test/resources/checks/v32/resources/OAR029/without-required-fields-md.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.1 +openapi: "3.2.0" info: title: Swagger Petstore version: 1.0.0 diff --git a/src/test/resources/checks/v32/resources/OAR029/without-required-fields-r.json b/src/test/resources/checks/v32/resources/OAR029/without-required-fields-r.json index ea97f57f..0373d81a 100644 --- a/src/test/resources/checks/v32/resources/OAR029/without-required-fields-r.json +++ b/src/test/resources/checks/v32/resources/OAR029/without-required-fields-r.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v32/resources/OAR029/without-required-fields-r.yaml b/src/test/resources/checks/v32/resources/OAR029/without-required-fields-r.yaml index 8ee987d5..26ce647a 100644 --- a/src/test/resources/checks/v32/resources/OAR029/without-required-fields-r.yaml +++ b/src/test/resources/checks/v32/resources/OAR029/without-required-fields-r.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/resources/OAR029/without-required-fields.json b/src/test/resources/checks/v32/resources/OAR029/without-required-fields.json index 350d748a..323273cb 100644 --- a/src/test/resources/checks/v32/resources/OAR029/without-required-fields.json +++ b/src/test/resources/checks/v32/resources/OAR029/without-required-fields.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.2.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v32/resources/OAR029/without-required-fields.yaml b/src/test/resources/checks/v32/resources/OAR029/without-required-fields.yaml index 234683f0..f111d5fb 100644 --- a/src/test/resources/checks/v32/resources/OAR029/without-required-fields.yaml +++ b/src/test/resources/checks/v32/resources/OAR029/without-required-fields.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/resources/OAR029/without-result-md.json b/src/test/resources/checks/v32/resources/OAR029/without-result-md.json index 136cf12d..1c5066dc 100644 --- a/src/test/resources/checks/v32/resources/OAR029/without-result-md.json +++ b/src/test/resources/checks/v32/resources/OAR029/without-result-md.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.1", + "openapi" : "3.2.0", "info": { "title": "Swagger Petstore", "version": "1.0.0" diff --git a/src/test/resources/checks/v32/resources/OAR029/without-result-md.yaml b/src/test/resources/checks/v32/resources/OAR029/without-result-md.yaml index 81cebda9..18eacca4 100644 --- a/src/test/resources/checks/v32/resources/OAR029/without-result-md.yaml +++ b/src/test/resources/checks/v32/resources/OAR029/without-result-md.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.1 +openapi: "3.2.0" info: title: Swagger Petstore version: 1.0.0 diff --git a/src/test/resources/checks/v32/resources/OAR029/without-status.json b/src/test/resources/checks/v32/resources/OAR029/without-status.json index 6e0d5fcb..c748f46f 100644 --- a/src/test/resources/checks/v32/resources/OAR029/without-status.json +++ b/src/test/resources/checks/v32/resources/OAR029/without-status.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.2.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v32/resources/OAR029/without-status.yaml b/src/test/resources/checks/v32/resources/OAR029/without-status.yaml index de0781dd..272e3e26 100644 --- a/src/test/resources/checks/v32/resources/OAR029/without-status.yaml +++ b/src/test/resources/checks/v32/resources/OAR029/without-status.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/resources/OAR030/valid.json b/src/test/resources/checks/v32/resources/OAR030/valid.json index 69748c50..9fb64210 100644 --- a/src/test/resources/checks/v32/resources/OAR030/valid.json +++ b/src/test/resources/checks/v32/resources/OAR030/valid.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.2.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v32/resources/OAR030/valid.yaml b/src/test/resources/checks/v32/resources/OAR030/valid.yaml index 1f15c90e..b084d2f4 100644 --- a/src/test/resources/checks/v32/resources/OAR030/valid.yaml +++ b/src/test/resources/checks/v32/resources/OAR030/valid.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/resources/OAR030/with-status-without-get.json b/src/test/resources/checks/v32/resources/OAR030/with-status-without-get.json index c3694e1b..de85e0af 100644 --- a/src/test/resources/checks/v32/resources/OAR030/with-status-without-get.json +++ b/src/test/resources/checks/v32/resources/OAR030/with-status-without-get.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.2.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v32/resources/OAR030/with-status-without-get.yaml b/src/test/resources/checks/v32/resources/OAR030/with-status-without-get.yaml index e7b5a51f..c5b262df 100644 --- a/src/test/resources/checks/v32/resources/OAR030/with-status-without-get.yaml +++ b/src/test/resources/checks/v32/resources/OAR030/with-status-without-get.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/resources/OAR030/without-status.json b/src/test/resources/checks/v32/resources/OAR030/without-status.json index 5ae26a3c..15d69e15 100644 --- a/src/test/resources/checks/v32/resources/OAR030/without-status.json +++ b/src/test/resources/checks/v32/resources/OAR030/without-status.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.2.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v32/resources/OAR030/without-status.yaml b/src/test/resources/checks/v32/resources/OAR030/without-status.yaml index 2a015345..1c969a70 100644 --- a/src/test/resources/checks/v32/resources/OAR030/without-status.yaml +++ b/src/test/resources/checks/v32/resources/OAR030/without-status.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/resources/OAR031/valid.json b/src/test/resources/checks/v32/resources/OAR031/valid.json index 2beb36a3..d51f7834 100644 --- a/src/test/resources/checks/v32/resources/OAR031/valid.json +++ b/src/test/resources/checks/v32/resources/OAR031/valid.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v32/resources/OAR031/valid.yaml b/src/test/resources/checks/v32/resources/OAR031/valid.yaml index d0100253..5dc80af7 100644 --- a/src/test/resources/checks/v32/resources/OAR031/valid.yaml +++ b/src/test/resources/checks/v32/resources/OAR031/valid.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/resources/OAR031/without-examples.json b/src/test/resources/checks/v32/resources/OAR031/without-examples.json index 40728d00..6901f337 100644 --- a/src/test/resources/checks/v32/resources/OAR031/without-examples.json +++ b/src/test/resources/checks/v32/resources/OAR031/without-examples.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v32/resources/OAR031/without-examples.yaml b/src/test/resources/checks/v32/resources/OAR031/without-examples.yaml index ec8cd2a0..9f62c796 100644 --- a/src/test/resources/checks/v32/resources/OAR031/without-examples.yaml +++ b/src/test/resources/checks/v32/resources/OAR031/without-examples.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/resources/OAR032/forbidden-names.json b/src/test/resources/checks/v32/resources/OAR032/forbidden-names.json index 9c26b26f..e0a00540 100644 --- a/src/test/resources/checks/v32/resources/OAR032/forbidden-names.json +++ b/src/test/resources/checks/v32/resources/OAR032/forbidden-names.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.2.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v32/resources/OAR032/forbidden-names.yaml b/src/test/resources/checks/v32/resources/OAR032/forbidden-names.yaml index 2e3b2806..babefe4b 100644 --- a/src/test/resources/checks/v32/resources/OAR032/forbidden-names.yaml +++ b/src/test/resources/checks/v32/resources/OAR032/forbidden-names.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/resources/OAR032/valid.json b/src/test/resources/checks/v32/resources/OAR032/valid.json index bce9cd4c..6360b965 100644 --- a/src/test/resources/checks/v32/resources/OAR032/valid.json +++ b/src/test/resources/checks/v32/resources/OAR032/valid.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.2.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v32/resources/OAR032/valid.yaml b/src/test/resources/checks/v32/resources/OAR032/valid.yaml index f26951f4..2b13ba92 100644 --- a/src/test/resources/checks/v32/resources/OAR032/valid.yaml +++ b/src/test/resources/checks/v32/resources/OAR032/valid.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/resources/OAR034/valid-all-of.json b/src/test/resources/checks/v32/resources/OAR034/valid-all-of.json index 0a433770..4f3fba7d 100644 --- a/src/test/resources/checks/v32/resources/OAR034/valid-all-of.json +++ b/src/test/resources/checks/v32/resources/OAR034/valid-all-of.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v32/resources/OAR034/valid-all-of.yaml b/src/test/resources/checks/v32/resources/OAR034/valid-all-of.yaml index 15669c82..4ac9e62d 100644 --- a/src/test/resources/checks/v32/resources/OAR034/valid-all-of.yaml +++ b/src/test/resources/checks/v32/resources/OAR034/valid-all-of.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/resources/OAR034/valid.json b/src/test/resources/checks/v32/resources/OAR034/valid.json index 242adbb8..2cb72555 100644 --- a/src/test/resources/checks/v32/resources/OAR034/valid.json +++ b/src/test/resources/checks/v32/resources/OAR034/valid.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v32/resources/OAR034/valid.yaml b/src/test/resources/checks/v32/resources/OAR034/valid.yaml index 62da717a..9ce953bc 100644 --- a/src/test/resources/checks/v32/resources/OAR034/valid.yaml +++ b/src/test/resources/checks/v32/resources/OAR034/valid.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/resources/OAR034/with-links-without-properties.json b/src/test/resources/checks/v32/resources/OAR034/with-links-without-properties.json index 7f789dbc..1bdd1995 100644 --- a/src/test/resources/checks/v32/resources/OAR034/with-links-without-properties.json +++ b/src/test/resources/checks/v32/resources/OAR034/with-links-without-properties.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v32/resources/OAR034/with-links-without-properties.yaml b/src/test/resources/checks/v32/resources/OAR034/with-links-without-properties.yaml index 3685c1f3..f95e48fc 100644 --- a/src/test/resources/checks/v32/resources/OAR034/with-links-without-properties.yaml +++ b/src/test/resources/checks/v32/resources/OAR034/with-links-without-properties.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/resources/OAR034/with-paging-with-properties-wrong-types.json b/src/test/resources/checks/v32/resources/OAR034/with-paging-with-properties-wrong-types.json index 119921b1..f8fe57f8 100644 --- a/src/test/resources/checks/v32/resources/OAR034/with-paging-with-properties-wrong-types.json +++ b/src/test/resources/checks/v32/resources/OAR034/with-paging-with-properties-wrong-types.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v32/resources/OAR034/with-paging-with-properties-wrong-types.yaml b/src/test/resources/checks/v32/resources/OAR034/with-paging-with-properties-wrong-types.yaml index 4d725aca..78576885 100644 --- a/src/test/resources/checks/v32/resources/OAR034/with-paging-with-properties-wrong-types.yaml +++ b/src/test/resources/checks/v32/resources/OAR034/with-paging-with-properties-wrong-types.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/resources/OAR034/with-paging-without-properties.json b/src/test/resources/checks/v32/resources/OAR034/with-paging-without-properties.json index ed4ab056..72ba97fc 100644 --- a/src/test/resources/checks/v32/resources/OAR034/with-paging-without-properties.json +++ b/src/test/resources/checks/v32/resources/OAR034/with-paging-without-properties.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v32/resources/OAR034/with-paging-without-properties.yaml b/src/test/resources/checks/v32/resources/OAR034/with-paging-without-properties.yaml index 153ece2f..cc402f14 100644 --- a/src/test/resources/checks/v32/resources/OAR034/with-paging-without-properties.yaml +++ b/src/test/resources/checks/v32/resources/OAR034/with-paging-without-properties.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/resources/OAR034/with-paging-wrong-type.json b/src/test/resources/checks/v32/resources/OAR034/with-paging-wrong-type.json index d9966a0b..90235313 100644 --- a/src/test/resources/checks/v32/resources/OAR034/with-paging-wrong-type.json +++ b/src/test/resources/checks/v32/resources/OAR034/with-paging-wrong-type.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v32/resources/OAR034/with-paging-wrong-type.yaml b/src/test/resources/checks/v32/resources/OAR034/with-paging-wrong-type.yaml index 33d666d9..fab5fa73 100644 --- a/src/test/resources/checks/v32/resources/OAR034/with-paging-wrong-type.yaml +++ b/src/test/resources/checks/v32/resources/OAR034/with-paging-wrong-type.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/resources/OAR034/without-links-required-fields.json b/src/test/resources/checks/v32/resources/OAR034/without-links-required-fields.json index 5ecd5e4b..26ec828e 100644 --- a/src/test/resources/checks/v32/resources/OAR034/without-links-required-fields.json +++ b/src/test/resources/checks/v32/resources/OAR034/without-links-required-fields.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v32/resources/OAR034/without-links-required-fields.yaml b/src/test/resources/checks/v32/resources/OAR034/without-links-required-fields.yaml index 3ca7987e..944a6250 100644 --- a/src/test/resources/checks/v32/resources/OAR034/without-links-required-fields.yaml +++ b/src/test/resources/checks/v32/resources/OAR034/without-links-required-fields.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/resources/OAR034/without-pagination-required-fields.json b/src/test/resources/checks/v32/resources/OAR034/without-pagination-required-fields.json index fd7e6e38..c8997771 100644 --- a/src/test/resources/checks/v32/resources/OAR034/without-pagination-required-fields.json +++ b/src/test/resources/checks/v32/resources/OAR034/without-pagination-required-fields.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v32/resources/OAR034/without-pagination-required-fields.yaml b/src/test/resources/checks/v32/resources/OAR034/without-pagination-required-fields.yaml index cc4c316a..68bf3f34 100644 --- a/src/test/resources/checks/v32/resources/OAR034/without-pagination-required-fields.yaml +++ b/src/test/resources/checks/v32/resources/OAR034/without-pagination-required-fields.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/resources/OAR034/without-paging.json b/src/test/resources/checks/v32/resources/OAR034/without-paging.json index 4fb4a8e9..2a3aabff 100644 --- a/src/test/resources/checks/v32/resources/OAR034/without-paging.json +++ b/src/test/resources/checks/v32/resources/OAR034/without-paging.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v32/resources/OAR034/without-paging.yaml b/src/test/resources/checks/v32/resources/OAR034/without-paging.yaml index 0bb219ab..c0dbc57c 100644 --- a/src/test/resources/checks/v32/resources/OAR034/without-paging.yaml +++ b/src/test/resources/checks/v32/resources/OAR034/without-paging.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/resources/OAR038/valid-multiple-properties.json b/src/test/resources/checks/v32/resources/OAR038/valid-multiple-properties.json index 6c5aa7f8..12fc95b7 100644 --- a/src/test/resources/checks/v32/resources/OAR038/valid-multiple-properties.json +++ b/src/test/resources/checks/v32/resources/OAR038/valid-multiple-properties.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.2.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v32/resources/OAR038/valid-multiple-properties.yaml b/src/test/resources/checks/v32/resources/OAR038/valid-multiple-properties.yaml index 64c4f794..d5abbc7b 100644 --- a/src/test/resources/checks/v32/resources/OAR038/valid-multiple-properties.yaml +++ b/src/test/resources/checks/v32/resources/OAR038/valid-multiple-properties.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/resources/OAR038/valid-one-property.json b/src/test/resources/checks/v32/resources/OAR038/valid-one-property.json index 76dae630..2962b123 100644 --- a/src/test/resources/checks/v32/resources/OAR038/valid-one-property.json +++ b/src/test/resources/checks/v32/resources/OAR038/valid-one-property.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.2.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v32/resources/OAR038/valid-one-property.yaml b/src/test/resources/checks/v32/resources/OAR038/valid-one-property.yaml index 6a93ee9d..64779efd 100644 --- a/src/test/resources/checks/v32/resources/OAR038/valid-one-property.yaml +++ b/src/test/resources/checks/v32/resources/OAR038/valid-one-property.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/resources/OAR038/with-properties-empty.json b/src/test/resources/checks/v32/resources/OAR038/with-properties-empty.json index 8f2032d6..d8e8fe72 100644 --- a/src/test/resources/checks/v32/resources/OAR038/with-properties-empty.json +++ b/src/test/resources/checks/v32/resources/OAR038/with-properties-empty.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.2.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v32/resources/OAR038/with-properties-empty.yaml b/src/test/resources/checks/v32/resources/OAR038/with-properties-empty.yaml index 4680fd0a..853cc923 100644 --- a/src/test/resources/checks/v32/resources/OAR038/with-properties-empty.yaml +++ b/src/test/resources/checks/v32/resources/OAR038/with-properties-empty.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/resources/OAR038/without-data.json b/src/test/resources/checks/v32/resources/OAR038/without-data.json index a6d5f9a6..9a51222d 100644 --- a/src/test/resources/checks/v32/resources/OAR038/without-data.json +++ b/src/test/resources/checks/v32/resources/OAR038/without-data.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.2.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v32/resources/OAR038/without-data.yaml b/src/test/resources/checks/v32/resources/OAR038/without-data.yaml index b64463dd..47934fe1 100644 --- a/src/test/resources/checks/v32/resources/OAR038/without-data.yaml +++ b/src/test/resources/checks/v32/resources/OAR038/without-data.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/resources/OAR038/without-properties.json b/src/test/resources/checks/v32/resources/OAR038/without-properties.json index 3573e876..e16e924d 100644 --- a/src/test/resources/checks/v32/resources/OAR038/without-properties.json +++ b/src/test/resources/checks/v32/resources/OAR038/without-properties.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v32/resources/OAR038/without-properties.yaml b/src/test/resources/checks/v32/resources/OAR038/without-properties.yaml index b57f97f7..ab65b6ae 100644 --- a/src/test/resources/checks/v32/resources/OAR038/without-properties.yaml +++ b/src/test/resources/checks/v32/resources/OAR038/without-properties.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/resources/OAR038/without-schema.json b/src/test/resources/checks/v32/resources/OAR038/without-schema.json index 8cdacdba..4e661996 100644 --- a/src/test/resources/checks/v32/resources/OAR038/without-schema.json +++ b/src/test/resources/checks/v32/resources/OAR038/without-schema.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.2.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v32/resources/OAR038/without-schema.yaml b/src/test/resources/checks/v32/resources/OAR038/without-schema.yaml index 5ec0e410..6d2d9070 100644 --- a/src/test/resources/checks/v32/resources/OAR038/without-schema.yaml +++ b/src/test/resources/checks/v32/resources/OAR038/without-schema.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/resources/OAR039/missing-codes.json b/src/test/resources/checks/v32/resources/OAR039/missing-codes.json index 1495f285..0a97606f 100644 --- a/src/test/resources/checks/v32/resources/OAR039/missing-codes.json +++ b/src/test/resources/checks/v32/resources/OAR039/missing-codes.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.2.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v32/resources/OAR039/missing-codes.yaml b/src/test/resources/checks/v32/resources/OAR039/missing-codes.yaml index b2be1e3d..a3761ff4 100644 --- a/src/test/resources/checks/v32/resources/OAR039/missing-codes.yaml +++ b/src/test/resources/checks/v32/resources/OAR039/missing-codes.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/resources/OAR039/valid.json b/src/test/resources/checks/v32/resources/OAR039/valid.json index 59eaf067..e0abd6e0 100644 --- a/src/test/resources/checks/v32/resources/OAR039/valid.json +++ b/src/test/resources/checks/v32/resources/OAR039/valid.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.2.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v32/resources/OAR039/valid.yaml b/src/test/resources/checks/v32/resources/OAR039/valid.yaml index 1f23f21a..6d1fc278 100644 --- a/src/test/resources/checks/v32/resources/OAR039/valid.yaml +++ b/src/test/resources/checks/v32/resources/OAR039/valid.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/schemas/OAR029/valid-all-of-md.json b/src/test/resources/checks/v32/schemas/OAR029/valid-all-of-md.json new file mode 100644 index 00000000..6523cebc --- /dev/null +++ b/src/test/resources/checks/v32/schemas/OAR029/valid-all-of-md.json @@ -0,0 +1,134 @@ +{ + "openapi": "3.2.0", + "info": { + "title": "Swagger Petstore", + "version": "1.0.0" + }, + "servers": [ + { + "url": "/" + } + ], + "paths": { + "/endpoint": { + "get": { + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/response" + } + } + } + }, + "204": { + "description": "No content", + "content": { + } + }, + "400": { + "description": "Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/response" + } + } + } + }, + "default": { + "description": "Unknown", + "content": { + } + } + } + } + } + }, + "components": { + "schemas": { + "response": { + "allOf": [ + { + "$ref": "#/components/schemas/standard_response" + } + ], + "properties" : { + "data" : { + "type" : "object", + "properties" : { + "tipos" : { + "type" : "array", + "items" : { + "type" : "string" + } + } + } + } + } + }, + "standard_response": { + "allOf": [ + { + "$ref": "#/components/schemas/standard_response_result" + }, + { + "$ref": "#/components/schemas/standard_response_metadata" + } + ] + }, + "standard_response_result": { + "type": "object", + "properties": { + "result": { + "required": [ + "http_code", + "status", + "trace_id" + ], + "type": "object", + "properties": { + "status": { + "type": "boolean" + }, + "http_code": { + "type": "integer" + }, + "errors": { + "type": "array", + "items": { + "required": [ + "code", + "message" + ], + "type": "object", + "properties": { + "code": { + "type": "integer" + }, + "message": { + "type": "string" + } + } + } + }, + "trace_id": { + "type": "string" + } + } + } + } + }, + "standard_response_metadata": { + "type": "object", + "properties": { + "metadata": { + "type": "string" + } + } + } + } + } + } \ No newline at end of file diff --git a/src/test/resources/checks/v32/schemas/OAR029/valid-all-of-md.yaml b/src/test/resources/checks/v32/schemas/OAR029/valid-all-of-md.yaml new file mode 100644 index 00000000..795fbdba --- /dev/null +++ b/src/test/resources/checks/v32/schemas/OAR029/valid-all-of-md.yaml @@ -0,0 +1,78 @@ +openapi: "3.2.0" +info: + title: Swagger Petstore + version: 1.0.0 +servers: +- url: / +paths: + /endpoint: + get: + responses: + 200: + description: Ok + content: + 'application/json': + schema: + $ref: '#/components/schemas/response' + 204: + description: No content + content: {} + 400: + description: Error + content: + 'application/json': + schema: + $ref: '#/components/schemas/response' + default: + description: Unknown + content: {} +components: + schemas: + response: + allOf: + - $ref: '#/components/schemas/standard_response' + properties: + data: + type: object + properties: + tipos: + type: array + items: + type: string + standard_response: + allOf: + - $ref: '#/components/schemas/standard_response_result' + - $ref: '#/components/schemas/standard_response_metadata' + standard_response_result: + type: object + properties: + result: + required: + - http_code + - status + - trace_id + type: object + properties: + status: + type: boolean + http_code: + type: integer + errors: + type: array + items: + required: + - code + - message + type: object + properties: + code: + type: integer + message: + type: string + trace_id: + type: string + standard_response_metadata: + type: object + properties: + metadata: + type: string diff --git a/src/test/resources/checks/v32/schemas/OAR029/valid-all-of.json b/src/test/resources/checks/v32/schemas/OAR029/valid-all-of.json new file mode 100644 index 00000000..7ded0e59 --- /dev/null +++ b/src/test/resources/checks/v32/schemas/OAR029/valid-all-of.json @@ -0,0 +1,116 @@ +{ + "openapi": "3.2.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/endpoint" : { + "get" : { + "responses" : { + "200" : { + "description" : "Ok", + "content": { + "application/json": { + "schema" : { + "$ref" : "#/components/schemas/response" + } + } + } + }, + "204" : { + "description" : "No content" + }, + "400" : { + "description" : "Error", + "content": { + "application/json": { + "schema" : { + "$ref" : "#/components/schemas/response" + } + } + } + }, + "default" : { + "description" : "Unknown" + } + } + } + } + }, + "components": { + "schemas" : { + "response" : { + "type" : "object", + "allOf" : [ { + "$ref" : "#/components/schemas/standard_response" + } ], + "properties" : { + "data" : { + "type" : "object", + "properties" : { + "tipos" : { + "type" : "array", + "items" : { + "type" : "string" + } + } + } + } + } + }, + "standard_response" : { + "allOf" : [ { + "$ref" : "#/components/schemas/standard_response_result" + }, { + "$ref" : "#/components/schemas/standard_response_metadata" + } ], + "required" : [ "status" ] + }, + "standard_response_result" : { + "type" : "object", + "properties" : { + "status" : { + "type" : "object", + "properties" : { + "http_status" : { + "type" : "string" + }, + "code" : { + "type" : "integer" + }, + "errors" : { + "type" : "array", + "items" : { + "type" : "object", + "properties": { + "name": { + "type": "string" + }, + "value": { + "type": "string" + } + } + } + }, + "description" : { + "type" : "string" + }, + "internal_code" : { + "type" : "string" + } + }, + "required" : [ "http_status", "code", "description", "errors" ] + } + } + }, + "standard_response_metadata" : { + "properties" : { + "metadata" : { + "type" : "string" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/schemas/OAR029/valid-all-of.yaml b/src/test/resources/checks/v32/schemas/OAR029/valid-all-of.yaml new file mode 100644 index 00000000..35903cf7 --- /dev/null +++ b/src/test/resources/checks/v32/schemas/OAR029/valid-all-of.yaml @@ -0,0 +1,76 @@ +openapi: "3.2.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /endpoint: + get: + responses: + 200: + description: Ok + content: + application/json: + schema: + $ref: '#/components/schemas/response' + 204: + description: No content + 400: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/response' + default: + description: Unknown +components: + schemas: + response: + type: object + allOf: + - $ref: '#/components/schemas/standard_response' + properties: + data: + type: object + properties: + tipos: + type: array + items: + type: string + standard_response: + allOf: + - $ref: '#/components/schemas/standard_response_result' + - $ref: '#/components/schemas/standard_response_metadata' + required: + - status + standard_response_result: + type: object + properties: + status: + type: object + properties: + http_status: + type: string + code: + type: integer + errors: + type: array + items: + type: object + properties: + name: + type: string + value: + type: string + description: + type: string + internal_code: + type: string + required: + - http_status + - code + - description + - errors + standard_response_metadata: + properties: + metadata: + type: string \ No newline at end of file diff --git a/src/test/resources/checks/v32/schemas/OAR029/valid-md.json b/src/test/resources/checks/v32/schemas/OAR029/valid-md.json new file mode 100644 index 00000000..2fe3e030 --- /dev/null +++ b/src/test/resources/checks/v32/schemas/OAR029/valid-md.json @@ -0,0 +1,116 @@ +{ + "openapi": "3.2.0", + "info": { + "title": "Swagger Petstore", + "version": "1.0.0" + }, + "servers": [ + { + "url": "/" + } + ], + "paths": { + "/endpoint": { + "get": { + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/response" + } + } + } + }, + "204": { + "description": "No content", + "content": { + } + }, + "400": { + "description": "Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/response" + } + } + } + }, + "default": { + "description": "Unknown", + "content": { + } + } + } + } + } + }, + "components": { + "schemas": { + "response": { + "allOf": [ + { + "$ref": "#/components/schemas/standard_response" + } + ], + "properties" : { + "data" : { + "type" : "object", + "properties" : { + "tipos" : { + "type" : "array", + "items" : { + "type" : "string" + } + } + } + } + } + }, + "standard_response": { + "type": "object", + "properties": { + "result": { + "required": [ + "http_code", + "status", + "trace_id" + ], + "type": "object", + "properties": { + "status": { + "type": "boolean" + }, + "http_code": { + "type": "integer" + }, + "errors": { + "type": "array", + "items": { + "required": [ + "code", + "message" + ], + "type": "object", + "properties": { + "code": { + "type": "integer" + }, + "message": { + "type": "string" + } + } + } + }, + "trace_id": { + "type": "string" + } + } + } + } + } + } + } + } \ No newline at end of file diff --git a/src/test/resources/checks/v32/schemas/OAR029/valid-md.yaml b/src/test/resources/checks/v32/schemas/OAR029/valid-md.yaml new file mode 100644 index 00000000..cd56b90d --- /dev/null +++ b/src/test/resources/checks/v32/schemas/OAR029/valid-md.yaml @@ -0,0 +1,69 @@ +openapi: "3.2.0" +info: + title: Swagger Petstore + version: 1.0.0 +servers: +- url: / +paths: + /endpoint: + get: + responses: + 200: + description: Ok + content: + 'application/json': + schema: + $ref: '#/components/schemas/response' + 204: + description: No content + content: {} + 400: + description: Error + content: + 'application/json': + schema: + $ref: '#/components/schemas/response' + default: + description: Unknown + content: {} +components: + schemas: + response: + allOf: + - $ref: '#/components/schemas/standard_response' + properties: + data: + type: object + properties: + tipos: + type: array + items: + type: string + standard_response: + type: object + properties: + result: + required: + - http_code + - status + - trace_id + type: object + properties: + status: + type: boolean + http_code: + type: integer + errors: + type: array + items: + required: + - code + - message + type: object + properties: + code: + type: integer + message: + type: string + trace_id: + type: string diff --git a/src/test/resources/checks/v32/schemas/OAR029/valid-r.json b/src/test/resources/checks/v32/schemas/OAR029/valid-r.json new file mode 100644 index 00000000..d13c8e0f --- /dev/null +++ b/src/test/resources/checks/v32/schemas/OAR029/valid-r.json @@ -0,0 +1,96 @@ +{ + "openapi": "3.2.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/endpoint": { + "get": { + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/successResponseData" + } + } + } + }, + "204": { + "description": "No content" + }, + "400": { + "$ref": "#/components/responses/errorResponse" + }, + "default": { + "description": "Unknown" + } + } + } + } + }, + "components": { + "schemas": { + "successResponseData": { + "type": "object", + "properties": { + "payload": { + "type": "object", + "properties": { + "tipos": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + }, + "errorResponseData": { + "type": "object", + "properties": { + "error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "message": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "type": "string" + } + }, + "httpStatus": { + "type": "integer" + } + }, + "required": [ + "code", + "message", + "httpStatus" + ] + } + } + } + }, + "responses": { + "errorResponse": { + "description": "Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errorResponseData" + } + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/schemas/OAR029/valid-r.yaml b/src/test/resources/checks/v32/schemas/OAR029/valid-r.yaml new file mode 100644 index 00000000..574b0a26 --- /dev/null +++ b/src/test/resources/checks/v32/schemas/OAR029/valid-r.yaml @@ -0,0 +1,59 @@ +openapi: "3.2.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /endpoint: + get: + responses: + 200: + description: Ok + content: + application/json: + schema: + $ref: '#/components/schemas/successResponseData' + 204: + description: No content + 400: + $ref: '#/components/responses/errorResponse' + default: + description: Unknown +components: + schemas: + successResponseData: + type: object + properties: + payload: + type: object + properties: + tipos: + type: array + items: + type: string + errorResponseData: + type: object + properties: + error: + type: object + properties: + code: + type: string + message: + type: string + details: + type: array + items: + type: string + httpStatus: + type: integer + required: + - code + - message + - httpStatus + responses: + errorResponse: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/errorResponseData' diff --git a/src/test/resources/checks/v32/schemas/OAR029/valid.json b/src/test/resources/checks/v32/schemas/OAR029/valid.json new file mode 100644 index 00000000..60f23a03 --- /dev/null +++ b/src/test/resources/checks/v32/schemas/OAR029/valid.json @@ -0,0 +1,105 @@ +{ + "openapi": "3.2.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/endpoint" : { + "get" : { + "responses" : { + "200" : { + "description" : "Ok", + "content": { + "application/json": { + "schema" : { + "$ref" : "#/components/schemas/response" + } + } + } + }, + "204" : { + "description" : "No content" + }, + "400" : { + "description" : "Error", + "content": { + "application/json": { + "schema" : { + "$ref" : "#/components/schemas/response" + } + } + } + }, + "default" : { + "description" : "Unknown" + } + } + } + } + }, + "components": { + "schemas" : { + "response" : { + "type" : "object", + "allOf" : [ { + "$ref" : "#/components/schemas/standard_response" + } ], + "properties" : { + "data" : { + "type" : "object", + "properties" : { + "tipos" : { + "type" : "array", + "items" : { + "type" : "string" + } + } + } + } + }, + "required": [ + "status", + "data" + ] + }, + "standard_response" : { + "type" : "object", + "properties" : { + "status" : { + "type" : "object", + "properties" : { + "http_status" : { + "type" : "string" + }, + "code" : { + "type" : "integer" + }, + "errors" : { + "type" : "array", + "items" : { + "type" : "object", + "properties": { + "name": { + "type": "string" + }, + "value": { + "type": "string" + } + } + } + }, + "description" : { + "type" : "string" + }, + "internal_code" : { + "type" : "string" + } + }, + "required" : [ "http_status", "code", "description", "errors" ] + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/schemas/OAR029/valid.yaml b/src/test/resources/checks/v32/schemas/OAR029/valid.yaml new file mode 100644 index 00000000..bc015a41 --- /dev/null +++ b/src/test/resources/checks/v32/schemas/OAR029/valid.yaml @@ -0,0 +1,135 @@ +openapi: "3.2.0" +info: + version: 1.0.3 + title: Swagger-Petstore_ab4bbf6031ef_V + license: + name: MIT +servers: + - url: http://petstore.swagger.io/v1 +paths: + /pets: + get: + summary: List all pets + operationId: listPets + tags: + - pets + parameters: + - name: limit + in: query + description: How many items to return at one time (max 100). + required: false + schema: + type: integer + maximum: 100 + format: int32 + responses: + '200': + description: A paged array of pets + headers: + x-next: + description: A link to the next page of responses + schema: + type: string + content: + application/json: + schema: + $ref: >- + https://gitlab.com/api/v4/projects/55448121/repository/files/pet%2Eyaml/raw?private_token=glpat-Q7s_ciqer49cJB--sMFB#/Pets + default: + description: unexpected error + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + x-microcks-operation: + delay: 100 + dispatcher: SCRIPT + dispatcherRules: >- + def headers = mockRequest.getRequestHeaders(); if (headers.hasValues("X-Microcks-Response-Name")) { return headers.get("X-Microcks-Response-Name", "null") } + post: + summary: Create a pet + operationId: createPets + tags: + - pets + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Pet' + required: true + responses: + '201': + description: Null response + default: + description: unexpected error + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + x-microcks-operation: + delay: 100 + dispatcher: SCRIPT + dispatcherRules: >- + def headers = mockRequest.getRequestHeaders(); if (headers.hasValues("X-Microcks-Response-Name")) { return headers.get("X-Microcks-Response-Name", "null") } + /pets/{petId}: + get: + summary: Info for a specific pet + operationId: showPetById + tags: + - pets + parameters: + - name: petId + in: path + required: true + description: The id of the pet to retrieve + schema: + type: string + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/Pet' + default: + description: unexpected error + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + x-microcks-operation: + delay: 100 + dispatcher: SCRIPT + dispatcherRules: >- + def headers = mockRequest.getRequestHeaders(); if (headers.hasValues("X-Microcks-Response-Name")) { return headers.get("X-Microcks-Response-Name", "null") } +components: + schemas: + Pet: + type: object + required: + - id + - name + properties: + id: + type: integer + format: int64 + name: + type: string + tag: + type: string + Pets: + type: array + maxItems: 100 + items: + $ref: '#/components/schemas/Pet' + Error: + type: object + required: + - code + - message + properties: + code: + type: integer + format: int32 + message: + type: string diff --git a/src/test/resources/checks/v32/schemas/OAR034/valid-all-of.json b/src/test/resources/checks/v32/schemas/OAR034/valid-all-of.json new file mode 100644 index 00000000..83d29f55 --- /dev/null +++ b/src/test/resources/checks/v32/schemas/OAR034/valid-all-of.json @@ -0,0 +1,126 @@ +{ + "openapi": "3.2.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/endpoint": { + "get": { + "responses": { + "206": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/response" + } + } + } + }, + "204": { + "description": "No content" + }, + "400": { + "description": "Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/response" + } + } + } + }, + "default": { + "description": "Unknown" + } + } + } + } + }, + "components": { + "schemas": { + "response": { + "type": "object", + "allOf": [ { + "$ref": "#/components/schemas/paged_response" + } ], + "properties": { + "data": { + "type": "object", + "properties": { + "values": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + }, + "paged_response": { + "type": "object", + "properties": { + "paging": { + "type": "object", + "properties": { + "start": { + "type": "integer" + }, + "limit": { + "type": "integer" + }, + "total": { + "type": "integer" + }, + "numPages": { + "type": "integer" + }, + "links": { + "type": "object", + "properties": { + "self": { + "allOf": [ { + "$ref": "#/components/schemas/link" + } ] + }, + "first": { + "allOf": [ { + "$ref": "#/components/schemas/link" + } ] + }, + "previous": { + "allOf": [ { + "$ref": "#/components/schemas/link" + } ] + }, + "next": { + "allOf": [ { + "$ref": "#/components/schemas/link" + } ] + }, + "last": { + "allOf": [ { + "$ref": "#/components/schemas/link" + } ] + } + }, + "required": [ "self", "previous", "next" ] + } + }, + "required": [ "start", "limit", "links" ] + } + } + }, + "link": { + "type": "object", + "properties": { + "href": { + "type": "string" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/schemas/OAR034/valid-all-of.yaml b/src/test/resources/checks/v32/schemas/OAR034/valid-all-of.yaml new file mode 100644 index 00000000..4ac9e62d --- /dev/null +++ b/src/test/resources/checks/v32/schemas/OAR034/valid-all-of.yaml @@ -0,0 +1,84 @@ +openapi: "3.2.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /endpoint: + get: + responses: + 206: + description: Ok + content: + application/json: + schema: + $ref: '#/components/schemas/response' + 204: + description: No content + 400: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/response' + default: + description: Unknown + +components: + schemas: + response: + type: object + allOf: + - $ref: '#/components/schemas/paged_response' + properties: + data: + type: object + properties: + values: + type: array + items: + type: string + paged_response: + type: object + properties: + paging: + type: object + properties: + start: + type: integer + limit: + type: integer + total: + type: integer + numPages: + type: integer + links: + type: object + properties: + self: + allOf: + - $ref: '#/components/schemas/link' + first: + allOf: + - $ref: '#/components/schemas/link' + previous: + allOf: + - $ref: '#/components/schemas/link' + next: + allOf: + - $ref: '#/components/schemas/link' + last: + allOf: + - $ref: '#/components/schemas/link' + required: + - self + - previous + - next + required: + - start + - limit + - links + link: + type: object + properties: + href: + type: string \ No newline at end of file diff --git a/src/test/resources/checks/v32/schemas/OAR034/valid.json b/src/test/resources/checks/v32/schemas/OAR034/valid.json new file mode 100644 index 00000000..42220085 --- /dev/null +++ b/src/test/resources/checks/v32/schemas/OAR034/valid.json @@ -0,0 +1,116 @@ +{ + "openapi": "3.2.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/endpoint": { + "get": { + "responses": { + "206": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/response" + } + } + } + }, + "204": { + "description": "No content" + }, + "400": { + "description": "Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/response" + } + } + } + }, + "default": { + "description": "Unknown" + } + } + } + } + }, + "components": { + "schemas": { + "response": { + "type": "object", + "allOf": [ { + "$ref": "#/components/schemas/paged_response" + } ], + "properties": { + "data": { + "type": "object", + "properties": { + "values": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + }, + "paged_response": { + "type": "object", + "properties": { + "paging": { + "type": "object", + "properties": { + "start": { + "type": "integer" + }, + "limit": { + "type": "integer" + }, + "total": { + "type": "integer" + }, + "numPages": { + "type": "integer" + }, + "links": { + "type": "object", + "properties": { + "self": { + "$ref": "#/components/schemas/link" + }, + "first": { + "$ref": "#/components/schemas/link" + }, + "previous": { + "$ref": "#/components/schemas/link" + }, + "next": { + "$ref": "#/components/schemas/link" + }, + "last": { + "$ref": "#/components/schemas/link" + } + }, + "required": [ "self", "previous", "next" ] + } + }, + "required": [ "start", "limit", "links" ] + } + } + }, + "link": { + "type": "object", + "properties": { + "href": { + "type": "string" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/schemas/OAR034/valid.yaml b/src/test/resources/checks/v32/schemas/OAR034/valid.yaml new file mode 100644 index 00000000..9ce953bc --- /dev/null +++ b/src/test/resources/checks/v32/schemas/OAR034/valid.yaml @@ -0,0 +1,79 @@ +openapi: "3.2.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /endpoint: + get: + responses: + 206: + description: Ok + content: + application/json: + schema: + $ref: '#/components/schemas/response' + 204: + description: No content + 400: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/response' + default: + description: Unknown + +components: + schemas: + response: + type: object + allOf: + - $ref: '#/components/schemas/paged_response' + properties: + data: + type: object + properties: + values: + type: array + items: + type: string + paged_response: + type: object + properties: + paging: + type: object + properties: + start: + type: integer + limit: + type: integer + total: + type: integer + numPages: + type: integer + links: + type: object + properties: + self: + $ref: '#/components/schemas/link' + first: + $ref: '#/components/schemas/link' + previous: + $ref: '#/components/schemas/link' + next: + $ref: '#/components/schemas/link' + last: + $ref: '#/components/schemas/link' + required: + - self + - previous + - next + required: + - start + - limit + - links + link: + type: object + properties: + href: + type: string \ No newline at end of file diff --git a/src/test/resources/checks/v32/schemas/OAR034/with-links-without-properties.json b/src/test/resources/checks/v32/schemas/OAR034/with-links-without-properties.json new file mode 100644 index 00000000..8ca6ad31 --- /dev/null +++ b/src/test/resources/checks/v32/schemas/OAR034/with-links-without-properties.json @@ -0,0 +1,96 @@ +{ + "openapi": "3.2.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/endpoint": { + "get": { + "responses": { + "206": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/response" + } + } + } + }, + "204": { + "description": "No content" + }, + "400": { + "description": "Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/response" + } + } + } + }, + "default": { + "description": "Unknown" + } + } + } + } + }, + "components": { + "schemas": { + "response": { + "type": "object", + "allOf": [ { + "$ref": "#/components/schemas/paged_response" + } ], + "properties": { + "data": { + "type": "object", + "properties": { + "values": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + }, + "paged_response": { + "type": "object", + "properties": { + "paging": { + "type": "object", + "properties": { + "start": { + "type": "integer" + }, + "limit": { + "type": "integer" + }, + "total": { + "type": "integer" + }, + "numPages": { + "type": "integer" + }, + "links": { # Noncompliant {{OAR034: 'first' property is missing}} {{OAR034: 'last' property is missing}} {{OAR034: 'next' property is missing}} {{OAR034: 'previous' property is missing}} {{OAR034: 'self' property is missing}} + "type": "object", + "properties": { + "name": { + "type": "string" + } + }, + "required": [ "self", "previous", "next" ] + } + }, + "required": [ "start", "limit", "links" ] + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/schemas/OAR034/with-links-without-properties.yaml b/src/test/resources/checks/v32/schemas/OAR034/with-links-without-properties.yaml new file mode 100644 index 00000000..f95e48fc --- /dev/null +++ b/src/test/resources/checks/v32/schemas/OAR034/with-links-without-properties.yaml @@ -0,0 +1,66 @@ +openapi: "3.2.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /endpoint: + get: + responses: + 206: + description: Ok + content: + application/json: + schema: + $ref: '#/components/schemas/response' + 204: + description: No content + 400: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/response' + default: + description: Unknown + +components: + schemas: + response: + type: object + allOf: + - $ref: '#/components/schemas/paged_response' + properties: + data: + type: object + properties: + values: + type: array + items: + type: string + paged_response: + type: object + properties: + paging: + type: object + properties: + start: + type: integer + limit: + type: integer + total: + type: integer + numPages: + type: integer + links: # Noncompliant {{OAR034: 'first' property is missing}} {{OAR034: 'last' property is missing}} {{OAR034: 'next' property is missing}} {{OAR034: 'previous' property is missing}} {{OAR034: 'self' property is missing}} + type: object + properties: + name: + type: string + required: + - self + - previous + - next + required: + - start + - limit + - links \ No newline at end of file diff --git a/src/test/resources/checks/v32/schemas/OAR034/with-paging-with-properties-wrong-types.json b/src/test/resources/checks/v32/schemas/OAR034/with-paging-with-properties-wrong-types.json new file mode 100644 index 00000000..abebc687 --- /dev/null +++ b/src/test/resources/checks/v32/schemas/OAR034/with-paging-with-properties-wrong-types.json @@ -0,0 +1,91 @@ +{ + "openapi": "3.2.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/endpoint": { + "get": { + "responses": { + "206": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/response" + } + } + } + }, + "204": { + "description": "No content" + }, + "400": { + "description": "Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/response" + } + } + } + }, + "default": { + "description": "Unknown" + } + } + } + } + }, + "components": { + "schemas": { + "response": { + "type": "object", + "allOf": [ { + "$ref": "#/components/schemas/paged_response" + } ], + "properties": { + "data": { + "type": "object", + "properties": { + "values": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + }, + "paged_response": { + "type": "object", + "properties": { + "paging": { + "type": "object", + "properties": { + "start": { + "type": "string" # Noncompliant {{OAR034: 'start' must be of type integer}} + }, + "limit": { + "type": "string" # Noncompliant {{OAR034: 'limit' must be of type integer}} + }, + "total": { + "type": "string" # Noncompliant {{OAR034: 'total' must be of type integer}} + }, + "numPages": { + "type": "string" # Noncompliant {{OAR034: 'numPages' must be of type integer}} + }, + "links": { + "type": "string", # Noncompliant {{OAR034: 'links' must be of type object}} + "required": [ "self", "previous", "next" ] + } + }, + "required": [ "start", "limit", "links" ] + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/schemas/OAR034/with-paging-with-properties-wrong-types.yaml b/src/test/resources/checks/v32/schemas/OAR034/with-paging-with-properties-wrong-types.yaml new file mode 100644 index 00000000..78576885 --- /dev/null +++ b/src/test/resources/checks/v32/schemas/OAR034/with-paging-with-properties-wrong-types.yaml @@ -0,0 +1,63 @@ +openapi: "3.2.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /endpoint: + get: + responses: + 206: + description: Ok + content: + application/json: + schema: + $ref: '#/components/schemas/response' + 204: + description: No content + 400: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/response' + default: + description: Unknown + +components: + schemas: + response: + type: object + allOf: + - $ref: '#/components/schemas/paged_response' + properties: + data: + type: object + properties: + values: + type: array + items: + type: string + paged_response: + type: object + properties: + paging: + type: object + properties: + start: + type: string # Noncompliant {{OAR034: 'start' must be of type integer}} + limit: + type: string # Noncompliant {{OAR034: 'limit' must be of type integer}} + total: + type: string # Noncompliant {{OAR034: 'total' must be of type integer}} + numPages: + type: string # Noncompliant {{OAR034: 'numPages' must be of type integer}} + links: + type: string # Noncompliant {{OAR034: 'links' must be of type object}} + required: + - self + - previous + - next + required: + - start + - limit + - links \ No newline at end of file diff --git a/src/test/resources/checks/v32/schemas/OAR034/with-paging-without-properties.json b/src/test/resources/checks/v32/schemas/OAR034/with-paging-without-properties.json new file mode 100644 index 00000000..553117f2 --- /dev/null +++ b/src/test/resources/checks/v32/schemas/OAR034/with-paging-without-properties.json @@ -0,0 +1,78 @@ +{ + "openapi": "3.2.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/endpoint": { + "get": { + "responses": { + "206": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/response" + } + } + } + }, + "204": { + "description": "No content" + }, + "400": { + "description": "Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/response" + } + } + } + }, + "default": { + "description": "Unknown" + } + } + } + } + }, + "components": { + "schemas": { + "response": { + "type": "object", + "allOf": [ { + "$ref": "#/components/schemas/paged_response" + } ], + "properties": { + "data": { + "type": "object", + "properties": { + "values": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + }, + "paged_response": { + "type": "object", + "properties": { + "paging": { # Noncompliant {{OAR034: 'limit' property is missing}} {{OAR034: 'links' property is missing}} {{OAR034: 'numPages' property is missing}} {{OAR034: 'start' property is missing}} {{OAR034: 'total' property is missing}} + "type": "object", + "properties": { + "name": { + "type": "string" + } + }, + "required": [ "start", "limit", "links" ] + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/schemas/OAR034/with-paging-without-properties.yaml b/src/test/resources/checks/v32/schemas/OAR034/with-paging-without-properties.yaml new file mode 100644 index 00000000..cc402f14 --- /dev/null +++ b/src/test/resources/checks/v32/schemas/OAR034/with-paging-without-properties.yaml @@ -0,0 +1,51 @@ +openapi: "3.2.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /endpoint: + get: + responses: + 206: + description: Ok + content: + application/json: + schema: + $ref: '#/components/schemas/response' + 204: + description: No content + 400: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/response' + default: + description: Unknown + +components: + schemas: + response: + type: object + allOf: + - $ref: '#/components/schemas/paged_response' + properties: + data: + type: object + properties: + values: + type: array + items: + type: string + paged_response: + type: object + properties: + paging: # Noncompliant {{OAR034: 'limit' property is missing}} {{OAR034: 'links' property is missing}} {{OAR034: 'numPages' property is missing}} {{OAR034: 'start' property is missing}} {{OAR034: 'total' property is missing}} + type: object + properties: + name: + type: string + required: + - start + - limit + - links \ No newline at end of file diff --git a/src/test/resources/checks/v32/schemas/OAR034/with-paging-wrong-type.json b/src/test/resources/checks/v32/schemas/OAR034/with-paging-wrong-type.json new file mode 100644 index 00000000..72641c42 --- /dev/null +++ b/src/test/resources/checks/v32/schemas/OAR034/with-paging-wrong-type.json @@ -0,0 +1,73 @@ +{ + "openapi": "3.2.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/endpoint": { + "get": { + "responses": { + "206": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/response" + } + } + } + }, + "204": { + "description": "No content" + }, + "400": { + "description": "Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/response" + } + } + } + }, + "default": { + "description": "Unknown" + } + } + } + } + }, + "components": { + "schemas": { + "response": { + "type": "object", + "allOf": [ { + "$ref": "#/components/schemas/paged_response" + } ], + "properties": { + "data": { + "type": "object", + "properties": { + "values": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + }, + "paged_response": { + "type": "object", + "properties": { + "paging": { + "type": "string", # Noncompliant {{OAR034: 'paging' must be of type object}} + "required": [ "start", "limit", "links" ] + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/schemas/OAR034/with-paging-wrong-type.yaml b/src/test/resources/checks/v32/schemas/OAR034/with-paging-wrong-type.yaml new file mode 100644 index 00000000..fab5fa73 --- /dev/null +++ b/src/test/resources/checks/v32/schemas/OAR034/with-paging-wrong-type.yaml @@ -0,0 +1,48 @@ +openapi: "3.2.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /endpoint: + get: + responses: + 206: + description: Ok + content: + application/json: + schema: + $ref: '#/components/schemas/response' + 204: + description: No content + 400: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/response' + default: + description: Unknown + +components: + schemas: + response: + type: object + allOf: + - $ref: '#/components/schemas/paged_response' + properties: + data: + type: object + properties: + values: + type: array + items: + type: string + paged_response: + type: object + properties: + paging: + type: string # Noncompliant {{OAR034: 'paging' must be of type object}} + required: + - start + - limit + - links \ No newline at end of file diff --git a/src/test/resources/checks/v32/schemas/OAR034/without-links-required-fields.json b/src/test/resources/checks/v32/schemas/OAR034/without-links-required-fields.json new file mode 100644 index 00000000..3ca43d94 --- /dev/null +++ b/src/test/resources/checks/v32/schemas/OAR034/without-links-required-fields.json @@ -0,0 +1,116 @@ +{ + "openapi": "3.2.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/endpoint": { + "get": { + "responses": { + "206": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/response" + } + } + } + }, + "204": { + "description": "No content" + }, + "400": { + "description": "Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/response" + } + } + } + }, + "default": { + "description": "Unknown" + } + } + } + } + }, + "components": { + "schemas": { + "response": { + "type": "object", + "allOf": [ { + "$ref": "#/components/schemas/paged_response" + } ], + "properties": { + "data": { + "type": "object", + "properties": { + "values": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + }, + "paged_response": { + "type": "object", + "properties": { + "paging": { + "type": "object", + "properties": { + "start": { + "type": "integer" + }, + "limit": { + "type": "integer" + }, + "total": { + "type": "integer" + }, + "numPages": { + "type": "integer" + }, + "links": { + "type": "object", + "properties": { + "self": { + "$ref": "#/components/schemas/link" + }, + "first": { + "$ref": "#/components/schemas/link" + }, + "previous": { + "$ref": "#/components/schemas/link" + }, + "next": { + "$ref": "#/components/schemas/link" + }, + "last": { + "$ref": "#/components/schemas/link" + } + }, + "required": [ "self" ] # Noncompliant {{OAR034: The following fields must be required: next, previous, self}} + } + }, + "required": [ "start", "limit", "links" ] + } + } + }, + "link": { + "type": "object", + "properties": { + "href": { + "type": "string" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/schemas/OAR034/without-links-required-fields.yaml b/src/test/resources/checks/v32/schemas/OAR034/without-links-required-fields.yaml new file mode 100644 index 00000000..944a6250 --- /dev/null +++ b/src/test/resources/checks/v32/schemas/OAR034/without-links-required-fields.yaml @@ -0,0 +1,77 @@ +openapi: "3.2.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /endpoint: + get: + responses: + 206: + description: Ok + content: + application/json: + schema: + $ref: '#/components/schemas/response' + 204: + description: No content + 400: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/response' + default: + description: Unknown + +components: + schemas: + response: + type: object + allOf: + - $ref: '#/components/schemas/paged_response' + properties: + data: + type: object + properties: + values: + type: array + items: + type: string + paged_response: + type: object + properties: + paging: + type: object + properties: + start: + type: integer + limit: + type: integer + total: + type: integer + numPages: + type: integer + links: + type: object + properties: + self: + $ref: '#/components/schemas/link' + first: + $ref: '#/components/schemas/link' + previous: + $ref: '#/components/schemas/link' + next: + $ref: '#/components/schemas/link' + last: + $ref: '#/components/schemas/link' + required: # Noncompliant {{OAR034: The following fields must be required: next, previous, self}} + - self + required: + - start + - limit + - links + link: + type: object + properties: + href: + type: string \ No newline at end of file diff --git a/src/test/resources/checks/v32/schemas/OAR034/without-pagination-required-fields.json b/src/test/resources/checks/v32/schemas/OAR034/without-pagination-required-fields.json new file mode 100644 index 00000000..e4341052 --- /dev/null +++ b/src/test/resources/checks/v32/schemas/OAR034/without-pagination-required-fields.json @@ -0,0 +1,116 @@ +{ + "openapi": "3.2.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/endpoint": { + "get": { + "responses": { + "206": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/response" + } + } + } + }, + "204": { + "description": "No content" + }, + "400": { + "description": "Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/response" + } + } + } + }, + "default": { + "description": "Unknown" + } + } + } + } + }, + "components": { + "schemas": { + "response": { + "type": "object", + "allOf": [ { + "$ref": "#/components/schemas/paged_response" + } ], + "properties": { + "data": { + "type": "object", + "properties": { + "values": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + }, + "paged_response": { + "type": "object", + "properties": { + "paging": { + "type": "object", + "properties": { + "start": { + "type": "integer" + }, + "limit": { + "type": "integer" + }, + "total": { + "type": "integer" + }, + "numPages": { + "type": "integer" + }, + "links": { + "type": "object", + "properties": { + "self": { + "$ref": "#/components/schemas/link" + }, + "first": { + "$ref": "#/components/schemas/link" + }, + "previous": { + "$ref": "#/components/schemas/link" + }, + "next": { + "$ref": "#/components/schemas/link" + }, + "last": { + "$ref": "#/components/schemas/link" + } + }, + "required": [ "self", "previous", "next" ] + } + }, + "required": [ "start" ] # Noncompliant {{OAR034: The following fields must be required: limit, links, start}} + } + } + }, + "link": { + "type": "object", + "properties": { + "href": { + "type": "string" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/schemas/OAR034/without-pagination-required-fields.yaml b/src/test/resources/checks/v32/schemas/OAR034/without-pagination-required-fields.yaml new file mode 100644 index 00000000..68bf3f34 --- /dev/null +++ b/src/test/resources/checks/v32/schemas/OAR034/without-pagination-required-fields.yaml @@ -0,0 +1,77 @@ +openapi: "3.2.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /endpoint: + get: + responses: + 206: + description: Ok + content: + application/json: + schema: + $ref: '#/components/schemas/response' + 204: + description: No content + 400: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/response' + default: + description: Unknown + +components: + schemas: + response: + type: object + allOf: + - $ref: '#/components/schemas/paged_response' + properties: + data: + type: object + properties: + values: + type: array + items: + type: string + paged_response: + type: object + properties: + paging: + type: object + properties: + start: + type: integer + limit: + type: integer + total: + type: integer + numPages: + type: integer + links: + type: object + properties: + self: + $ref: '#/components/schemas/link' + first: + $ref: '#/components/schemas/link' + previous: + $ref: '#/components/schemas/link' + next: + $ref: '#/components/schemas/link' + last: + $ref: '#/components/schemas/link' + required: + - self + - previous + - next + required: # Noncompliant {{OAR034: The following fields must be required: limit, links, start}} + - start + link: + type: object + properties: + href: + type: string \ No newline at end of file diff --git a/src/test/resources/checks/v32/schemas/OAR034/without-paging.json b/src/test/resources/checks/v32/schemas/OAR034/without-paging.json new file mode 100644 index 00000000..4c4b6437 --- /dev/null +++ b/src/test/resources/checks/v32/schemas/OAR034/without-paging.json @@ -0,0 +1,61 @@ +{ + "openapi": "3.2.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/endpoint": { + "get": { + "responses": { + "206": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/response" + } + } + } + }, + "204": { + "description": "No content" + }, + "400": { + "description": "Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/response" + } + } + } + }, + "default": { + "description": "Unknown" + } + } + } + } + }, + "components": { + "schemas": { + "response": { # Noncompliant {{OAR034: 'paging' property is missing}} + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "values": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/schemas/OAR034/without-paging.yaml b/src/test/resources/checks/v32/schemas/OAR034/without-paging.yaml new file mode 100644 index 00000000..c0dbc57c --- /dev/null +++ b/src/test/resources/checks/v32/schemas/OAR034/without-paging.yaml @@ -0,0 +1,37 @@ +openapi: "3.2.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /endpoint: + get: + responses: + 206: + description: Ok + content: + application/json: + schema: + $ref: '#/components/schemas/response' + 204: + description: No content + 400: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/response' + default: + description: Unknown + +components: + schemas: + response: # Noncompliant {{OAR034: 'paging' property is missing}} + type: object + properties: + data: + type: object + properties: + values: + type: array + items: + type: string \ No newline at end of file diff --git a/src/test/resources/checks/v32/schemas/OAR080/empty-global-security.json b/src/test/resources/checks/v32/schemas/OAR080/empty-global-security.json index 81763b5c..8193dfa4 100644 --- a/src/test/resources/checks/v32/schemas/OAR080/empty-global-security.json +++ b/src/test/resources/checks/v32/schemas/OAR080/empty-global-security.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "version": "1.0.0", "title": "Sample API" diff --git a/src/test/resources/checks/v32/schemas/OAR080/empty-global-security.yaml b/src/test/resources/checks/v32/schemas/OAR080/empty-global-security.yaml index 05fb3ba3..53a97a51 100644 --- a/src/test/resources/checks/v32/schemas/OAR080/empty-global-security.yaml +++ b/src/test/resources/checks/v32/schemas/OAR080/empty-global-security.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.0 +openapi: "3.2.0" info: version: 1.0.0 title: Sample API diff --git a/src/test/resources/checks/v32/schemas/OAR080/empty-security.json b/src/test/resources/checks/v32/schemas/OAR080/empty-security.json index b7f31ef0..671a98b0 100644 --- a/src/test/resources/checks/v32/schemas/OAR080/empty-security.json +++ b/src/test/resources/checks/v32/schemas/OAR080/empty-security.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "version": "1.0.0", "title": "Sample API" diff --git a/src/test/resources/checks/v32/schemas/OAR080/empty-security.yaml b/src/test/resources/checks/v32/schemas/OAR080/empty-security.yaml index 8821cacf..b246d1f4 100644 --- a/src/test/resources/checks/v32/schemas/OAR080/empty-security.yaml +++ b/src/test/resources/checks/v32/schemas/OAR080/empty-security.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.0 +openapi: "3.2.0" info: version: 1.0.0 title: Sample API diff --git a/src/test/resources/checks/v32/schemas/OAR080/global-security.json b/src/test/resources/checks/v32/schemas/OAR080/global-security.json index 645a4a88..aab7da02 100644 --- a/src/test/resources/checks/v32/schemas/OAR080/global-security.json +++ b/src/test/resources/checks/v32/schemas/OAR080/global-security.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "version": "1.0.0", "title": "Sample API" diff --git a/src/test/resources/checks/v32/schemas/OAR080/global-security.yaml b/src/test/resources/checks/v32/schemas/OAR080/global-security.yaml index 3205ed2a..532b155a 100644 --- a/src/test/resources/checks/v32/schemas/OAR080/global-security.yaml +++ b/src/test/resources/checks/v32/schemas/OAR080/global-security.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.0 +openapi: "3.2.0" info: version: 1.0.0 title: Sample API diff --git a/src/test/resources/checks/v32/schemas/OAR080/with-security.json b/src/test/resources/checks/v32/schemas/OAR080/with-security.json index 1157cab0..c0b8fe2c 100644 --- a/src/test/resources/checks/v32/schemas/OAR080/with-security.json +++ b/src/test/resources/checks/v32/schemas/OAR080/with-security.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "version": "1.0.0", "title": "Sample API" diff --git a/src/test/resources/checks/v32/schemas/OAR080/with-security.yaml b/src/test/resources/checks/v32/schemas/OAR080/with-security.yaml index de18bc04..99c44eb7 100644 --- a/src/test/resources/checks/v32/schemas/OAR080/with-security.yaml +++ b/src/test/resources/checks/v32/schemas/OAR080/with-security.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.0 +openapi: "3.2.0" info: version: 1.0.0 title: Sample API diff --git a/src/test/resources/checks/v32/schemas/OAR080/without-security.json b/src/test/resources/checks/v32/schemas/OAR080/without-security.json index 82430d79..7e02041a 100644 --- a/src/test/resources/checks/v32/schemas/OAR080/without-security.json +++ b/src/test/resources/checks/v32/schemas/OAR080/without-security.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "version": "1.0.0", "title": "Sample API" diff --git a/src/test/resources/checks/v32/schemas/OAR080/without-security.yaml b/src/test/resources/checks/v32/schemas/OAR080/without-security.yaml index 675f89b2..0ab16d33 100644 --- a/src/test/resources/checks/v32/schemas/OAR080/without-security.yaml +++ b/src/test/resources/checks/v32/schemas/OAR080/without-security.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.0 +openapi: "3.2.0" info: version: 1.0.0 title: Sample API diff --git a/src/test/resources/checks/v32/schemas/OAR080/wrong-scheme.json b/src/test/resources/checks/v32/schemas/OAR080/wrong-scheme.json index b042b2b4..e20a76f3 100644 --- a/src/test/resources/checks/v32/schemas/OAR080/wrong-scheme.json +++ b/src/test/resources/checks/v32/schemas/OAR080/wrong-scheme.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "version": "1.0.0", "title": "Sample API" diff --git a/src/test/resources/checks/v32/schemas/OAR080/wrong-scheme.yaml b/src/test/resources/checks/v32/schemas/OAR080/wrong-scheme.yaml index 86220d9f..f047839b 100644 --- a/src/test/resources/checks/v32/schemas/OAR080/wrong-scheme.yaml +++ b/src/test/resources/checks/v32/schemas/OAR080/wrong-scheme.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.0 +openapi: "3.2.0" info: version: 1.0.0 title: Sample API diff --git a/src/test/resources/checks/v32/schemas/OAR108/invalid.json b/src/test/resources/checks/v32/schemas/OAR108/invalid.json index 3ce871c6..96a5d234 100644 --- a/src/test/resources/checks/v32/schemas/OAR108/invalid.json +++ b/src/test/resources/checks/v32/schemas/OAR108/invalid.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "title": "Ejemplo de API", "version": "1.0.0" diff --git a/src/test/resources/checks/v32/schemas/OAR108/invalid.yaml b/src/test/resources/checks/v32/schemas/OAR108/invalid.yaml index 67c4fb32..dccc1f8b 100644 --- a/src/test/resources/checks/v32/schemas/OAR108/invalid.yaml +++ b/src/test/resources/checks/v32/schemas/OAR108/invalid.yaml @@ -1,4 +1,4 @@ - openapi: 3.0.0 + openapi: "3.2.0" info: title: Ejemplo de API version: 1.0.0 diff --git a/src/test/resources/checks/v32/schemas/OAR108/valid.json b/src/test/resources/checks/v32/schemas/OAR108/valid.json index 6a922454..53977b51 100644 --- a/src/test/resources/checks/v32/schemas/OAR108/valid.json +++ b/src/test/resources/checks/v32/schemas/OAR108/valid.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "title": "Ejemplo de API", "version": "1.0.0" diff --git a/src/test/resources/checks/v32/schemas/OAR108/valid.yaml b/src/test/resources/checks/v32/schemas/OAR108/valid.yaml index 6c14d980..c2c1b929 100644 --- a/src/test/resources/checks/v32/schemas/OAR108/valid.yaml +++ b/src/test/resources/checks/v32/schemas/OAR108/valid.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.0 +openapi: "3.2.0" info: title: Ejemplo de API Ampliada version: 1.0.0 diff --git a/src/test/resources/checks/v32/security/OAR001/with-servers.json b/src/test/resources/checks/v32/security/OAR001/with-servers.json index 14fb615b..934be5ad 100644 --- a/src/test/resources/checks/v32/security/OAR001/with-servers.json +++ b/src/test/resources/checks/v32/security/OAR001/with-servers.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.2.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v32/security/OAR001/with-servers.yaml b/src/test/resources/checks/v32/security/OAR001/with-servers.yaml index 0827de6e..0f37bb45 100644 --- a/src/test/resources/checks/v32/security/OAR001/with-servers.yaml +++ b/src/test/resources/checks/v32/security/OAR001/with-servers.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/security/OAR001/without-servers.json b/src/test/resources/checks/v32/security/OAR001/without-servers.json index 0bb90cf7..b90a9639 100644 --- a/src/test/resources/checks/v32/security/OAR001/without-servers.json +++ b/src/test/resources/checks/v32/security/OAR001/without-servers.json @@ -1,5 +1,5 @@ { # Noncompliant {{OAR001: Define 'servers' is mandatory}} - "openapi" : "3.0.0", + "openapi" : "3.2.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v32/security/OAR001/without-servers.yaml b/src/test/resources/checks/v32/security/OAR001/without-servers.yaml index a4233292..63401c50 100644 --- a/src/test/resources/checks/v32/security/OAR001/without-servers.yaml +++ b/src/test/resources/checks/v32/security/OAR001/without-servers.yaml @@ -1,5 +1,5 @@ # Noncompliant {{OAR001: Define 'servers' is mandatory}} -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/security/OAR033/valid.json b/src/test/resources/checks/v32/security/OAR033/valid.json index 8315cce5..4e4529b9 100644 --- a/src/test/resources/checks/v32/security/OAR033/valid.json +++ b/src/test/resources/checks/v32/security/OAR033/valid.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v32/security/OAR033/valid.yaml b/src/test/resources/checks/v32/security/OAR033/valid.yaml index 87f75ec1..5e9cbb6b 100644 --- a/src/test/resources/checks/v32/security/OAR033/valid.yaml +++ b/src/test/resources/checks/v32/security/OAR033/valid.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/security/OAR033/with-forbidden-params.json b/src/test/resources/checks/v32/security/OAR033/with-forbidden-params.json index ea0db738..ce8ecd49 100644 --- a/src/test/resources/checks/v32/security/OAR033/with-forbidden-params.json +++ b/src/test/resources/checks/v32/security/OAR033/with-forbidden-params.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v32/security/OAR033/with-forbidden-params.yaml b/src/test/resources/checks/v32/security/OAR033/with-forbidden-params.yaml index 187dab95..f01a8cbe 100644 --- a/src/test/resources/checks/v32/security/OAR033/with-forbidden-params.yaml +++ b/src/test/resources/checks/v32/security/OAR033/with-forbidden-params.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/security/OAR033/without-required-params.json b/src/test/resources/checks/v32/security/OAR033/without-required-params.json index 27231df1..08c3a340 100644 --- a/src/test/resources/checks/v32/security/OAR033/without-required-params.json +++ b/src/test/resources/checks/v32/security/OAR033/without-required-params.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v32/security/OAR033/without-required-params.yaml b/src/test/resources/checks/v32/security/OAR033/without-required-params.yaml index ff8b0fc6..9fd19bbe 100644 --- a/src/test/resources/checks/v32/security/OAR033/without-required-params.yaml +++ b/src/test/resources/checks/v32/security/OAR033/without-required-params.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/security/OAR035/valid.json b/src/test/resources/checks/v32/security/OAR035/valid.json index c45fbe9a..afe22a84 100644 --- a/src/test/resources/checks/v32/security/OAR035/valid.json +++ b/src/test/resources/checks/v32/security/OAR035/valid.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v32/security/OAR035/valid.yaml b/src/test/resources/checks/v32/security/OAR035/valid.yaml index 4ada663f..1e29e338 100644 --- a/src/test/resources/checks/v32/security/OAR035/valid.yaml +++ b/src/test/resources/checks/v32/security/OAR035/valid.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/security/OAR035/without-authorization-responses.json b/src/test/resources/checks/v32/security/OAR035/without-authorization-responses.json index cf9d9e5c..f2eaff61 100644 --- a/src/test/resources/checks/v32/security/OAR035/without-authorization-responses.json +++ b/src/test/resources/checks/v32/security/OAR035/without-authorization-responses.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v32/security/OAR035/without-authorization-responses.yaml b/src/test/resources/checks/v32/security/OAR035/without-authorization-responses.yaml index b03ad2df..d78a208a 100644 --- a/src/test/resources/checks/v32/security/OAR035/without-authorization-responses.yaml +++ b/src/test/resources/checks/v32/security/OAR035/without-authorization-responses.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/security/OAR036/valid.json b/src/test/resources/checks/v32/security/OAR036/valid.json index bead835f..abd690f0 100644 --- a/src/test/resources/checks/v32/security/OAR036/valid.json +++ b/src/test/resources/checks/v32/security/OAR036/valid.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v32/security/OAR036/valid.yaml b/src/test/resources/checks/v32/security/OAR036/valid.yaml index 23afab6a..3cd82124 100644 --- a/src/test/resources/checks/v32/security/OAR036/valid.yaml +++ b/src/test/resources/checks/v32/security/OAR036/valid.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/security/OAR036/with-cookie.json b/src/test/resources/checks/v32/security/OAR036/with-cookie.json index 9d79650a..913683bf 100644 --- a/src/test/resources/checks/v32/security/OAR036/with-cookie.json +++ b/src/test/resources/checks/v32/security/OAR036/with-cookie.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v32/security/OAR036/with-cookie.yaml b/src/test/resources/checks/v32/security/OAR036/with-cookie.yaml index e6b279f4..954d494d 100644 --- a/src/test/resources/checks/v32/security/OAR036/with-cookie.yaml +++ b/src/test/resources/checks/v32/security/OAR036/with-cookie.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/security/OAR045/defined-response.json b/src/test/resources/checks/v32/security/OAR045/defined-response.json index f86d6ac4..b19ef64b 100644 --- a/src/test/resources/checks/v32/security/OAR045/defined-response.json +++ b/src/test/resources/checks/v32/security/OAR045/defined-response.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v32/security/OAR045/defined-response.yaml b/src/test/resources/checks/v32/security/OAR045/defined-response.yaml index 4370ac6c..14f08cea 100644 --- a/src/test/resources/checks/v32/security/OAR045/defined-response.yaml +++ b/src/test/resources/checks/v32/security/OAR045/defined-response.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.0 +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/security/OAR049/no-content-in-204.json b/src/test/resources/checks/v32/security/OAR049/no-content-in-204.json new file mode 100644 index 00000000..a8697a7e --- /dev/null +++ b/src/test/resources/checks/v32/security/OAR049/no-content-in-204.json @@ -0,0 +1,25 @@ +{ + "openapi" : "3.2.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/other-pets/{petId}" : { + "delete" : { + "responses" : { + "204" : { # Noncompliant {{OAR049: 204 No Content MUST NOT return anything}} + "description" : "delete pet", + "content" : { + "application/json" : { + "schema" : { + "type" : "object" + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/security/OAR049/no-content-in-204.yaml b/src/test/resources/checks/v32/security/OAR049/no-content-in-204.yaml new file mode 100644 index 00000000..9de0d682 --- /dev/null +++ b/src/test/resources/checks/v32/security/OAR049/no-content-in-204.yaml @@ -0,0 +1,14 @@ +openapi: "3.2.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /other-pets/{petId}: + delete: + responses: + '204': # Noncompliant {{OAR049: 204 No Content MUST NOT return anything}} + description: delete pet + content: + 'application/json': + schema: + type: object \ No newline at end of file diff --git a/src/test/resources/checks/v32/security/OAR053/valid.json b/src/test/resources/checks/v32/security/OAR053/valid.json index 774ea388..85a9f5ff 100644 --- a/src/test/resources/checks/v32/security/OAR053/valid.json +++ b/src/test/resources/checks/v32/security/OAR053/valid.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v32/security/OAR053/valid.yaml b/src/test/resources/checks/v32/security/OAR053/valid.yaml index bfda5f93..a3b32904 100644 --- a/src/test/resources/checks/v32/security/OAR053/valid.yaml +++ b/src/test/resources/checks/v32/security/OAR053/valid.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/security/OAR054/valid.json b/src/test/resources/checks/v32/security/OAR054/valid.json index 2f45e288..a8b59154 100644 --- a/src/test/resources/checks/v32/security/OAR054/valid.json +++ b/src/test/resources/checks/v32/security/OAR054/valid.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v32/security/OAR054/valid.yaml b/src/test/resources/checks/v32/security/OAR054/valid.yaml index a87e4212..ff09239f 100644 --- a/src/test/resources/checks/v32/security/OAR054/valid.yaml +++ b/src/test/resources/checks/v32/security/OAR054/valid.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/security/OAR072/no-stack-trace.json b/src/test/resources/checks/v32/security/OAR072/no-stack-trace.json index 929b4279..5abbe93e 100644 --- a/src/test/resources/checks/v32/security/OAR072/no-stack-trace.json +++ b/src/test/resources/checks/v32/security/OAR072/no-stack-trace.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "title": "Compliant API", "version": "1.0.0" diff --git a/src/test/resources/checks/v32/security/OAR072/no-stack-trace.yaml b/src/test/resources/checks/v32/security/OAR072/no-stack-trace.yaml index 9c5c83f1..ba476c40 100644 --- a/src/test/resources/checks/v32/security/OAR072/no-stack-trace.yaml +++ b/src/test/resources/checks/v32/security/OAR072/no-stack-trace.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.0 +openapi: "3.2.0" info: title: Sample API version: 1.0.0 diff --git a/src/test/resources/checks/v32/security/OAR072/with-stack-trace.json b/src/test/resources/checks/v32/security/OAR072/with-stack-trace.json index 35468a59..08854fef 100644 --- a/src/test/resources/checks/v32/security/OAR072/with-stack-trace.json +++ b/src/test/resources/checks/v32/security/OAR072/with-stack-trace.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "title": "Sample API", "version": "1.0.0" diff --git a/src/test/resources/checks/v32/security/OAR072/with-stack-trace.yaml b/src/test/resources/checks/v32/security/OAR072/with-stack-trace.yaml index 8d1fcadf..ba0fa6f8 100644 --- a/src/test/resources/checks/v32/security/OAR072/with-stack-trace.yaml +++ b/src/test/resources/checks/v32/security/OAR072/with-stack-trace.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.0 +openapi: "3.2.0" info: title: Sample API version: 1.0.0 diff --git a/src/test/resources/checks/v32/security/OAR074/no-restrictions.json b/src/test/resources/checks/v32/security/OAR074/no-restrictions.json index 4d6b726c..30a2ca68 100644 --- a/src/test/resources/checks/v32/security/OAR074/no-restrictions.json +++ b/src/test/resources/checks/v32/security/OAR074/no-restrictions.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "version": "1.0.0", "title": "My API" diff --git a/src/test/resources/checks/v32/security/OAR074/no-restrictions.yaml b/src/test/resources/checks/v32/security/OAR074/no-restrictions.yaml index 91fea43c..80f4e7ef 100644 --- a/src/test/resources/checks/v32/security/OAR074/no-restrictions.yaml +++ b/src/test/resources/checks/v32/security/OAR074/no-restrictions.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: My API diff --git a/src/test/resources/checks/v32/security/OAR074/with-restrictions.json b/src/test/resources/checks/v32/security/OAR074/with-restrictions.json index 02a94a5f..fef30980 100644 --- a/src/test/resources/checks/v32/security/OAR074/with-restrictions.json +++ b/src/test/resources/checks/v32/security/OAR074/with-restrictions.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "version": "1.0.0", "title": "My API" diff --git a/src/test/resources/checks/v32/security/OAR074/with-restrictions.yaml b/src/test/resources/checks/v32/security/OAR074/with-restrictions.yaml index 65e43fea..b7693fe3 100644 --- a/src/test/resources/checks/v32/security/OAR074/with-restrictions.yaml +++ b/src/test/resources/checks/v32/security/OAR074/with-restrictions.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: My API diff --git a/src/test/resources/checks/v32/security/OAR075/no-restrictions.json b/src/test/resources/checks/v32/security/OAR075/no-restrictions.json index 1c260f41..b82d61c7 100644 --- a/src/test/resources/checks/v32/security/OAR075/no-restrictions.json +++ b/src/test/resources/checks/v32/security/OAR075/no-restrictions.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "title": "API sin restricciones", "version": "1.0.0" diff --git a/src/test/resources/checks/v32/security/OAR075/no-restrictions.yaml b/src/test/resources/checks/v32/security/OAR075/no-restrictions.yaml index 067bbe64..68d3cc96 100644 --- a/src/test/resources/checks/v32/security/OAR075/no-restrictions.yaml +++ b/src/test/resources/checks/v32/security/OAR075/no-restrictions.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.0 +openapi: "3.2.0" info: title: API sin restricciones version: 1.0.0 diff --git a/src/test/resources/checks/v32/security/OAR075/with-restrictions.json b/src/test/resources/checks/v32/security/OAR075/with-restrictions.json index b27eda32..e432f96b 100644 --- a/src/test/resources/checks/v32/security/OAR075/with-restrictions.json +++ b/src/test/resources/checks/v32/security/OAR075/with-restrictions.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "title": "API con restricciones", "version": "1.0.0" diff --git a/src/test/resources/checks/v32/security/OAR075/with-restrictions.yaml b/src/test/resources/checks/v32/security/OAR075/with-restrictions.yaml index 69aadfff..ef75a4ba 100644 --- a/src/test/resources/checks/v32/security/OAR075/with-restrictions.yaml +++ b/src/test/resources/checks/v32/security/OAR075/with-restrictions.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.0 +openapi: "3.2.0" info: title: API con restricciones version: 1.0.0 diff --git a/src/test/resources/checks/v32/security/OAR076/nested.json b/src/test/resources/checks/v32/security/OAR076/nested.json index b02da78c..e949f5da 100644 --- a/src/test/resources/checks/v32/security/OAR076/nested.json +++ b/src/test/resources/checks/v32/security/OAR076/nested.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v32/security/OAR076/nested.yaml b/src/test/resources/checks/v32/security/OAR076/nested.yaml index f0607065..7d83c848 100644 --- a/src/test/resources/checks/v32/security/OAR076/nested.yaml +++ b/src/test/resources/checks/v32/security/OAR076/nested.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/security/OAR076/plain.json b/src/test/resources/checks/v32/security/OAR076/plain.json index b41cd0e8..0fc18c99 100644 --- a/src/test/resources/checks/v32/security/OAR076/plain.json +++ b/src/test/resources/checks/v32/security/OAR076/plain.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v32/security/OAR076/plain.yaml b/src/test/resources/checks/v32/security/OAR076/plain.yaml index 8128fb01..da61ff97 100644 --- a/src/test/resources/checks/v32/security/OAR076/plain.yaml +++ b/src/test/resources/checks/v32/security/OAR076/plain.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/security/OAR076/with-$ref.json b/src/test/resources/checks/v32/security/OAR076/with-$ref.json index f2c2d7c8..498df227 100644 --- a/src/test/resources/checks/v32/security/OAR076/with-$ref.json +++ b/src/test/resources/checks/v32/security/OAR076/with-$ref.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v32/security/OAR076/with-$ref.yaml b/src/test/resources/checks/v32/security/OAR076/with-$ref.yaml index 3f3e2db7..44973e70 100644 --- a/src/test/resources/checks/v32/security/OAR076/with-$ref.yaml +++ b/src/test/resources/checks/v32/security/OAR076/with-$ref.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/security/OAR078/no-security.json b/src/test/resources/checks/v32/security/OAR078/no-security.json index 74770f90..6190e361 100644 --- a/src/test/resources/checks/v32/security/OAR078/no-security.json +++ b/src/test/resources/checks/v32/security/OAR078/no-security.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "version": "1.0.0", "title": "Sample API" diff --git a/src/test/resources/checks/v32/security/OAR078/no-security.yaml b/src/test/resources/checks/v32/security/OAR078/no-security.yaml index 005c2fbc..c9e96179 100644 --- a/src/test/resources/checks/v32/security/OAR078/no-security.yaml +++ b/src/test/resources/checks/v32/security/OAR078/no-security.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.0 +openapi: "3.2.0" info: version: 1.0.0 title: Sample API diff --git a/src/test/resources/checks/v32/security/OAR078/with-security.json b/src/test/resources/checks/v32/security/OAR078/with-security.json index dd025133..53583a35 100644 --- a/src/test/resources/checks/v32/security/OAR078/with-security.json +++ b/src/test/resources/checks/v32/security/OAR078/with-security.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "version": "1.0.0", "title": "Sample API" diff --git a/src/test/resources/checks/v32/security/OAR078/with-security.yaml b/src/test/resources/checks/v32/security/OAR078/with-security.yaml index c591c997..6aab85d4 100644 --- a/src/test/resources/checks/v32/security/OAR078/with-security.yaml +++ b/src/test/resources/checks/v32/security/OAR078/with-security.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.0 +openapi: "3.2.0" info: title: Sample API version: 1.0.0 diff --git a/src/test/resources/checks/v32/security/OAR079/bad-request404.json b/src/test/resources/checks/v32/security/OAR079/bad-request404.json index 751268d5..5f7c42b7 100644 --- a/src/test/resources/checks/v32/security/OAR079/bad-request404.json +++ b/src/test/resources/checks/v32/security/OAR079/bad-request404.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.2.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v32/security/OAR079/bad-request404.yaml b/src/test/resources/checks/v32/security/OAR079/bad-request404.yaml index 53082801..57f8f4c2 100644 --- a/src/test/resources/checks/v32/security/OAR079/bad-request404.yaml +++ b/src/test/resources/checks/v32/security/OAR079/bad-request404.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/security/OAR079/no-bad-request404.json b/src/test/resources/checks/v32/security/OAR079/no-bad-request404.json index be422fe0..82467638 100644 --- a/src/test/resources/checks/v32/security/OAR079/no-bad-request404.json +++ b/src/test/resources/checks/v32/security/OAR079/no-bad-request404.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.0", + "openapi" : "3.2.0", "info" : { "version" : "1.0.0", "title" : "Swagger Petstore" diff --git a/src/test/resources/checks/v32/security/OAR079/no-bad-request404.yaml b/src/test/resources/checks/v32/security/OAR079/no-bad-request404.yaml index 0cbefaf9..50903fb1 100644 --- a/src/test/resources/checks/v32/security/OAR079/no-bad-request404.yaml +++ b/src/test/resources/checks/v32/security/OAR079/no-bad-request404.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/security/OAR079/no-parameters.json b/src/test/resources/checks/v32/security/OAR079/no-parameters.json index 9d39ba8a..535baf45 100644 --- a/src/test/resources/checks/v32/security/OAR079/no-parameters.json +++ b/src/test/resources/checks/v32/security/OAR079/no-parameters.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v32/security/OAR079/no-parameters.yaml b/src/test/resources/checks/v32/security/OAR079/no-parameters.yaml index f220c16c..7017ea09 100644 --- a/src/test/resources/checks/v32/security/OAR079/no-parameters.yaml +++ b/src/test/resources/checks/v32/security/OAR079/no-parameters.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/security/OAR079/query-param-only.json b/src/test/resources/checks/v32/security/OAR079/query-param-only.json index ad428c6b..2138fa47 100644 --- a/src/test/resources/checks/v32/security/OAR079/query-param-only.json +++ b/src/test/resources/checks/v32/security/OAR079/query-param-only.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v32/security/OAR079/query-param-only.yaml b/src/test/resources/checks/v32/security/OAR079/query-param-only.yaml index d85cf1b8..d6865b7c 100644 --- a/src/test/resources/checks/v32/security/OAR079/query-param-only.yaml +++ b/src/test/resources/checks/v32/security/OAR079/query-param-only.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/security/OAR081/not-valid-password.json b/src/test/resources/checks/v32/security/OAR081/not-valid-password.json index eb626afe..3ec58921 100644 --- a/src/test/resources/checks/v32/security/OAR081/not-valid-password.json +++ b/src/test/resources/checks/v32/security/OAR081/not-valid-password.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v32/security/OAR081/not-valid-password.yaml b/src/test/resources/checks/v32/security/OAR081/not-valid-password.yaml index 4d7804fb..05b349e0 100644 --- a/src/test/resources/checks/v32/security/OAR081/not-valid-password.yaml +++ b/src/test/resources/checks/v32/security/OAR081/not-valid-password.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/security/OAR081/valid-password.json b/src/test/resources/checks/v32/security/OAR081/valid-password.json index 1bc3a18d..39f22784 100644 --- a/src/test/resources/checks/v32/security/OAR081/valid-password.json +++ b/src/test/resources/checks/v32/security/OAR081/valid-password.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v32/security/OAR081/valid-password.yaml b/src/test/resources/checks/v32/security/OAR081/valid-password.yaml index 2545f739..568a8c78 100644 --- a/src/test/resources/checks/v32/security/OAR081/valid-password.yaml +++ b/src/test/resources/checks/v32/security/OAR081/valid-password.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/security/OAR081/valid-with-components.json b/src/test/resources/checks/v32/security/OAR081/valid-with-components.json index 0ce1cdd6..517286df 100644 --- a/src/test/resources/checks/v32/security/OAR081/valid-with-components.json +++ b/src/test/resources/checks/v32/security/OAR081/valid-with-components.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v32/security/OAR081/valid-with-components.yaml b/src/test/resources/checks/v32/security/OAR081/valid-with-components.yaml index 61c4d53c..49e82667 100644 --- a/src/test/resources/checks/v32/security/OAR081/valid-with-components.yaml +++ b/src/test/resources/checks/v32/security/OAR081/valid-with-components.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/security/OAR082/valid-format.json b/src/test/resources/checks/v32/security/OAR082/valid-format.json index 7423cb98..9c00671e 100644 --- a/src/test/resources/checks/v32/security/OAR082/valid-format.json +++ b/src/test/resources/checks/v32/security/OAR082/valid-format.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v32/security/OAR082/valid-format.yaml b/src/test/resources/checks/v32/security/OAR082/valid-format.yaml index 626624e9..6af346ba 100644 --- a/src/test/resources/checks/v32/security/OAR082/valid-format.yaml +++ b/src/test/resources/checks/v32/security/OAR082/valid-format.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: "1.0.0" title: "Swagger Petstore" diff --git a/src/test/resources/checks/v32/security/OAR083/forbidden-query-params.json b/src/test/resources/checks/v32/security/OAR083/forbidden-query-params.json index b0519a8d..402aa882 100644 --- a/src/test/resources/checks/v32/security/OAR083/forbidden-query-params.json +++ b/src/test/resources/checks/v32/security/OAR083/forbidden-query-params.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "version": "1.0.0", "title": "My API" diff --git a/src/test/resources/checks/v32/security/OAR083/forbidden-query-params.yaml b/src/test/resources/checks/v32/security/OAR083/forbidden-query-params.yaml index 1a6d9121..0cf5c0a7 100644 --- a/src/test/resources/checks/v32/security/OAR083/forbidden-query-params.yaml +++ b/src/test/resources/checks/v32/security/OAR083/forbidden-query-params.yaml @@ -1,4 +1,4 @@ - openapi: "3.0.0" + openapi: "3.2.0" info: version: 1.0.0 title: My API diff --git a/src/test/resources/checks/v32/security/OAR083/no-parameters.json b/src/test/resources/checks/v32/security/OAR083/no-parameters.json index c4aee44f..a705a344 100644 --- a/src/test/resources/checks/v32/security/OAR083/no-parameters.json +++ b/src/test/resources/checks/v32/security/OAR083/no-parameters.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "version": "1.0.0", "title": "My API" diff --git a/src/test/resources/checks/v32/security/OAR083/no-parameters.yaml b/src/test/resources/checks/v32/security/OAR083/no-parameters.yaml index cc4eaac0..069cf9fe 100644 --- a/src/test/resources/checks/v32/security/OAR083/no-parameters.yaml +++ b/src/test/resources/checks/v32/security/OAR083/no-parameters.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: My API diff --git a/src/test/resources/checks/v32/security/OAR083/null-name-param.json b/src/test/resources/checks/v32/security/OAR083/null-name-param.json index 467fc8c9..619c7bfe 100644 --- a/src/test/resources/checks/v32/security/OAR083/null-name-param.json +++ b/src/test/resources/checks/v32/security/OAR083/null-name-param.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "version": "1.0.0", "title": "My API" diff --git a/src/test/resources/checks/v32/security/OAR083/null-name-param.yaml b/src/test/resources/checks/v32/security/OAR083/null-name-param.yaml index 67ccaf06..561150ef 100644 --- a/src/test/resources/checks/v32/security/OAR083/null-name-param.yaml +++ b/src/test/resources/checks/v32/security/OAR083/null-name-param.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: My API diff --git a/src/test/resources/checks/v32/security/OAR083/options-operation.json b/src/test/resources/checks/v32/security/OAR083/options-operation.json index f2471041..f5cb7ef2 100644 --- a/src/test/resources/checks/v32/security/OAR083/options-operation.json +++ b/src/test/resources/checks/v32/security/OAR083/options-operation.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "version": "1.0.0", "title": "My API" diff --git a/src/test/resources/checks/v32/security/OAR083/options-operation.yaml b/src/test/resources/checks/v32/security/OAR083/options-operation.yaml index 02b2fada..47c08a6f 100644 --- a/src/test/resources/checks/v32/security/OAR083/options-operation.yaml +++ b/src/test/resources/checks/v32/security/OAR083/options-operation.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: My API diff --git a/src/test/resources/checks/v32/security/OAR083/valid-query-params.json b/src/test/resources/checks/v32/security/OAR083/valid-query-params.json index 9251c180..19c72c9a 100644 --- a/src/test/resources/checks/v32/security/OAR083/valid-query-params.json +++ b/src/test/resources/checks/v32/security/OAR083/valid-query-params.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "version": "1.0.0", "title": "My API" diff --git a/src/test/resources/checks/v32/security/OAR083/valid-query-params.yaml b/src/test/resources/checks/v32/security/OAR083/valid-query-params.yaml index 4347bb96..b197d0e1 100644 --- a/src/test/resources/checks/v32/security/OAR083/valid-query-params.yaml +++ b/src/test/resources/checks/v32/security/OAR083/valid-query-params.yaml @@ -1,4 +1,4 @@ - openapi: "3.0.0" + openapi: "3.2.0" info: version: 1.0.0 title: My API diff --git a/src/test/resources/checks/v32/security/OAR084/forbidden-query-formats.json b/src/test/resources/checks/v32/security/OAR084/forbidden-query-formats.json index 9b2e7f7b..1cd4b749 100644 --- a/src/test/resources/checks/v32/security/OAR084/forbidden-query-formats.json +++ b/src/test/resources/checks/v32/security/OAR084/forbidden-query-formats.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "version": "1.0.0", "title": "My API" diff --git a/src/test/resources/checks/v32/security/OAR084/forbidden-query-formats.yaml b/src/test/resources/checks/v32/security/OAR084/forbidden-query-formats.yaml index 892eaa69..4a59d181 100644 --- a/src/test/resources/checks/v32/security/OAR084/forbidden-query-formats.yaml +++ b/src/test/resources/checks/v32/security/OAR084/forbidden-query-formats.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.0 +openapi: "3.2.0" info: version: 1.0.0 title: My API diff --git a/src/test/resources/checks/v32/security/OAR084/no-parameters.json b/src/test/resources/checks/v32/security/OAR084/no-parameters.json index dcdc8dd6..30c27d40 100644 --- a/src/test/resources/checks/v32/security/OAR084/no-parameters.json +++ b/src/test/resources/checks/v32/security/OAR084/no-parameters.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "version": "1.0.0", "title": "My API" diff --git a/src/test/resources/checks/v32/security/OAR084/no-parameters.yaml b/src/test/resources/checks/v32/security/OAR084/no-parameters.yaml index cc4eaac0..069cf9fe 100644 --- a/src/test/resources/checks/v32/security/OAR084/no-parameters.yaml +++ b/src/test/resources/checks/v32/security/OAR084/no-parameters.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: My API diff --git a/src/test/resources/checks/v32/security/OAR084/non-query-param.json b/src/test/resources/checks/v32/security/OAR084/non-query-param.json index 2b52b6d3..d4e1d97d 100644 --- a/src/test/resources/checks/v32/security/OAR084/non-query-param.json +++ b/src/test/resources/checks/v32/security/OAR084/non-query-param.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "version": "1.0.0", "title": "My API" diff --git a/src/test/resources/checks/v32/security/OAR084/non-query-param.yaml b/src/test/resources/checks/v32/security/OAR084/non-query-param.yaml index b9ec5900..2dcaec30 100644 --- a/src/test/resources/checks/v32/security/OAR084/non-query-param.yaml +++ b/src/test/resources/checks/v32/security/OAR084/non-query-param.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: My API diff --git a/src/test/resources/checks/v32/security/OAR084/null-format-param.json b/src/test/resources/checks/v32/security/OAR084/null-format-param.json index 8f760ba8..13a53849 100644 --- a/src/test/resources/checks/v32/security/OAR084/null-format-param.json +++ b/src/test/resources/checks/v32/security/OAR084/null-format-param.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "version": "1.0.0", "title": "My API" diff --git a/src/test/resources/checks/v32/security/OAR084/null-format-param.yaml b/src/test/resources/checks/v32/security/OAR084/null-format-param.yaml index dbdd4a21..ba804e6a 100644 --- a/src/test/resources/checks/v32/security/OAR084/null-format-param.yaml +++ b/src/test/resources/checks/v32/security/OAR084/null-format-param.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: My API diff --git a/src/test/resources/checks/v32/security/OAR084/valid-query-formats.json b/src/test/resources/checks/v32/security/OAR084/valid-query-formats.json index 9251c180..19c72c9a 100644 --- a/src/test/resources/checks/v32/security/OAR084/valid-query-formats.json +++ b/src/test/resources/checks/v32/security/OAR084/valid-query-formats.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "version": "1.0.0", "title": "My API" diff --git a/src/test/resources/checks/v32/security/OAR084/valid-query-formats.yaml b/src/test/resources/checks/v32/security/OAR084/valid-query-formats.yaml index 5a53854c..93194d88 100644 --- a/src/test/resources/checks/v32/security/OAR084/valid-query-formats.yaml +++ b/src/test/resources/checks/v32/security/OAR084/valid-query-formats.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.0 +openapi: "3.2.0" info: version: 1.0.0 title: My API diff --git a/src/test/resources/checks/v32/security/OAR085/invalid-openapi-version.json b/src/test/resources/checks/v32/security/OAR085/invalid-openapi-version.json index 88a6bbca..256544c0 100644 --- a/src/test/resources/checks/v32/security/OAR085/invalid-openapi-version.json +++ b/src/test/resources/checks/v32/security/OAR085/invalid-openapi-version.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.3", + "openapi" : "3.2.0", "info": { "title": "Sample API", "description": "This is a sample API.", diff --git a/src/test/resources/checks/v32/security/OAR085/invalid-openapi-version.yaml b/src/test/resources/checks/v32/security/OAR085/invalid-openapi-version.yaml index 9cfcd02d..ad5d7aab 100644 --- a/src/test/resources/checks/v32/security/OAR085/invalid-openapi-version.yaml +++ b/src/test/resources/checks/v32/security/OAR085/invalid-openapi-version.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.3 +openapi: "3.2.0" info: title: Sample API description: This is a sample API. diff --git a/src/test/resources/checks/v32/security/OAR085/valid-openapi-version.json b/src/test/resources/checks/v32/security/OAR085/valid-openapi-version.json index 0997875d..f752e79a 100644 --- a/src/test/resources/checks/v32/security/OAR085/valid-openapi-version.json +++ b/src/test/resources/checks/v32/security/OAR085/valid-openapi-version.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "title": "Sample API", "description": "This is a sample API.", diff --git a/src/test/resources/checks/v32/security/OAR085/valid-openapi-version.yaml b/src/test/resources/checks/v32/security/OAR085/valid-openapi-version.yaml index ee95c7c0..ad5d7aab 100644 --- a/src/test/resources/checks/v32/security/OAR085/valid-openapi-version.yaml +++ b/src/test/resources/checks/v32/security/OAR085/valid-openapi-version.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.0 +openapi: "3.2.0" info: title: Sample API description: This is a sample API. diff --git a/src/test/resources/checks/v32/security/OAR096/valid.json b/src/test/resources/checks/v32/security/OAR096/valid.json index c45fbe9a..afe22a84 100644 --- a/src/test/resources/checks/v32/security/OAR096/valid.json +++ b/src/test/resources/checks/v32/security/OAR096/valid.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v32/security/OAR096/valid.yaml b/src/test/resources/checks/v32/security/OAR096/valid.yaml index 4ada663f..1e29e338 100644 --- a/src/test/resources/checks/v32/security/OAR096/valid.yaml +++ b/src/test/resources/checks/v32/security/OAR096/valid.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/security/OAR096/without-authorization-responses.json b/src/test/resources/checks/v32/security/OAR096/without-authorization-responses.json index 4fa2d839..dfc5b706 100644 --- a/src/test/resources/checks/v32/security/OAR096/without-authorization-responses.json +++ b/src/test/resources/checks/v32/security/OAR096/without-authorization-responses.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "version": "1.0.0", "title": "Swagger Petstore" diff --git a/src/test/resources/checks/v32/security/OAR096/without-authorization-responses.yaml b/src/test/resources/checks/v32/security/OAR096/without-authorization-responses.yaml index 45b6d2e7..654f0e76 100644 --- a/src/test/resources/checks/v32/security/OAR096/without-authorization-responses.yaml +++ b/src/test/resources/checks/v32/security/OAR096/without-authorization-responses.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.2.0" info: version: 1.0.0 title: Swagger Petstore diff --git a/src/test/resources/checks/v32/security/OAR114/valid.json b/src/test/resources/checks/v32/security/OAR114/valid.json index 79d9c816..9e4f6f6e 100644 --- a/src/test/resources/checks/v32/security/OAR114/valid.json +++ b/src/test/resources/checks/v32/security/OAR114/valid.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "title": "Valid Response Headers Test", "version": "1.0" diff --git a/src/test/resources/checks/v32/security/OAR114/valid.yaml b/src/test/resources/checks/v32/security/OAR114/valid.yaml index 8c936a19..d45749e5 100644 --- a/src/test/resources/checks/v32/security/OAR114/valid.yaml +++ b/src/test/resources/checks/v32/security/OAR114/valid.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.0 +openapi: "3.2.0" info: title: Valid Response Headers Test version: "1.0" diff --git a/src/test/resources/checks/v32/security/OAR114/with-forbidden-params.json b/src/test/resources/checks/v32/security/OAR114/with-forbidden-params.json index 975318bc..403e73dc 100644 --- a/src/test/resources/checks/v32/security/OAR114/with-forbidden-params.json +++ b/src/test/resources/checks/v32/security/OAR114/with-forbidden-params.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "title": "Forbidden Header Test", "version": "1.0" diff --git a/src/test/resources/checks/v32/security/OAR114/with-forbidden-params.yaml b/src/test/resources/checks/v32/security/OAR114/with-forbidden-params.yaml index 4f2c2bc7..0d9f1f35 100644 --- a/src/test/resources/checks/v32/security/OAR114/with-forbidden-params.yaml +++ b/src/test/resources/checks/v32/security/OAR114/with-forbidden-params.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.0 +openapi: "3.2.0" info: title: Forbidden Header Test version: "1.0" diff --git a/src/test/resources/checks/v32/security/OAR114/without-required-params.json b/src/test/resources/checks/v32/security/OAR114/without-required-params.json index 876746f3..daec8dcc 100644 --- a/src/test/resources/checks/v32/security/OAR114/without-required-params.json +++ b/src/test/resources/checks/v32/security/OAR114/without-required-params.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi" : "3.2.0", "info": { "title": "Missing Mandatory Header Test", "version": "1.0" diff --git a/src/test/resources/checks/v32/security/OAR114/without-required-params.yaml b/src/test/resources/checks/v32/security/OAR114/without-required-params.yaml index 5603c561..06a30abd 100644 --- a/src/test/resources/checks/v32/security/OAR114/without-required-params.yaml +++ b/src/test/resources/checks/v32/security/OAR114/without-required-params.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.0 +openapi: "3.2.0" info: title: Missing Mandatory Header Test version: "1.0" From e0c9c6e6201528b8ff1364f87dd7a8bd96de51c7 Mon Sep 17 00:00:00 2001 From: Sebastian Diaz Torres Date: Tue, 12 May 2026 10:05:20 -0500 Subject: [PATCH 04/28] fix: Move sonar organization to github action workflow --- .github/workflows/maven.yml | 2 +- CHANGELOG.md | 4 ++++ pom.xml | 3 --- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index 6c484687..db94658a 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -26,7 +26,7 @@ jobs: - name: SonarCloud Analysis env: SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - run: mvn sonar:sonar -Dsonar.token=$SONAR_TOKEN + run: mvn sonar:sonar -Dsonar.token=$SONAR_TOKEN -Dsonar.host.url=https://sonarcloud.io -Dsonar.organization=apiaddicts -Dsonar.projectKey=apiaddicts_sonaropenapi-rules # Optional: Uploads the full dependency graph to GitHub to improve the quality of Dependabot alerts this repository can receive - name: Update dependency graph diff --git a/CHANGELOG.md b/CHANGELOG.md index abdc796d..23699282 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [1.4.0] - 2024-05-06 +## Changed + +- Move sonar organization config to github action + ## Added ### Now, support for OpenAPI 3.2 is included. These are some of the new changes: diff --git a/pom.xml b/pom.xml index 177be358..39d77e8c 100644 --- a/pom.xml +++ b/pom.xml @@ -74,9 +74,6 @@ 5.5.0.6356 jacoco ${project.basedir}/target/site/jacoco/jacoco.xml - https://sonarcloud.io - apiaddicts - apiaddicts_sonaropenapi-rules java **/*.html,**/*.json **/*.html,**/*.json From 2538edd2dd317f5ce6445721ed8c96d7bdb7a847 Mon Sep 17 00:00:00 2001 From: Melsy Huamani Date: Thu, 14 May 2026 08:29:25 -0500 Subject: [PATCH 05/28] fix: resolve language suffix conflict with built-in yaml and json support --- .../OpenAPICustomJsonRuleRepository.java | 26 ++++++++++++++ .../sonar/openapi/OpenAPICustomPlugin.java | 3 +- .../OpenAPICustomProfileDefinition.java | 34 ++++++++++++------- .../openapi/OpenAPICustomRulesDefinition.java | 9 +++-- .../openapi/OpenAPICustomPluginTest.java | 5 +-- .../OpenAPICustomProfileDefinitionTest.java | 22 ++++++++---- .../OpenAPICustomRulesDefinitionTest.java | 16 ++++++--- 7 files changed, 86 insertions(+), 29 deletions(-) create mode 100644 src/main/java/apiaddicts/sonar/openapi/OpenAPICustomJsonRuleRepository.java diff --git a/src/main/java/apiaddicts/sonar/openapi/OpenAPICustomJsonRuleRepository.java b/src/main/java/apiaddicts/sonar/openapi/OpenAPICustomJsonRuleRepository.java new file mode 100644 index 00000000..cff187f9 --- /dev/null +++ b/src/main/java/apiaddicts/sonar/openapi/OpenAPICustomJsonRuleRepository.java @@ -0,0 +1,26 @@ +package apiaddicts.sonar.openapi; + +import org.sonar.api.ExtensionPoint; +import org.sonar.api.scanner.ScannerSide; +import org.apiaddicts.apitools.dosonarapi.api.OpenApiCustomRuleRepository; +import apiaddicts.sonar.openapi.checks.RulesLists; +import org.sonarsource.api.sonarlint.SonarLintSide; + +import java.util.List; + +import static apiaddicts.sonar.openapi.OpenAPICustomRulesDefinition.JSON_REPOSITORY_KEY; + +@SonarLintSide +@ScannerSide +@ExtensionPoint +public class OpenAPICustomJsonRuleRepository implements OpenApiCustomRuleRepository { + @Override + public String repositoryKey() { + return JSON_REPOSITORY_KEY; + } + + @Override + public List> checkClasses() { + return RulesLists.getAllChecks(); + } +} diff --git a/src/main/java/apiaddicts/sonar/openapi/OpenAPICustomPlugin.java b/src/main/java/apiaddicts/sonar/openapi/OpenAPICustomPlugin.java index 86a189b5..aaf6c302 100644 --- a/src/main/java/apiaddicts/sonar/openapi/OpenAPICustomPlugin.java +++ b/src/main/java/apiaddicts/sonar/openapi/OpenAPICustomPlugin.java @@ -14,7 +14,8 @@ public void define(Context context) { OpenAPICustomProfileDefinition.class, OpenAPICustomRulesDefinition.class, // batch extensions -> objects are instantiated during code analysis - OpenAPICustomRuleRepository.class + OpenAPICustomRuleRepository.class, + OpenAPICustomJsonRuleRepository.class ); } diff --git a/src/main/java/apiaddicts/sonar/openapi/OpenAPICustomProfileDefinition.java b/src/main/java/apiaddicts/sonar/openapi/OpenAPICustomProfileDefinition.java index 05996f96..a36a9ce5 100644 --- a/src/main/java/apiaddicts/sonar/openapi/OpenAPICustomProfileDefinition.java +++ b/src/main/java/apiaddicts/sonar/openapi/OpenAPICustomProfileDefinition.java @@ -1,6 +1,7 @@ package apiaddicts.sonar.openapi; import org.apiaddicts.apitools.dosonarapi.api.OpenApiCustomRuleRepository; +import org.apiaddicts.apitools.dosonarapi.checks.CheckList; import org.sonar.api.server.profile.BuiltInQualityProfilesDefinition; import org.sonar.api.utils.AnnotationUtils; import org.sonar.check.Rule; @@ -9,28 +10,35 @@ import javax.annotation.Nullable; import java.util.List; -/** - * Declare a new quality profile that comprises all the custom rules, plus the SonarOpenApi standard rules. - *

- * This allows to create a built-in profile that extends the Sonar Way profile, and that includes your rules. - * This profile will automatically inherit any new rule brought in by the core plugin. - */ public class OpenAPICustomProfileDefinition implements BuiltInQualityProfilesDefinition { - public static final String MY_COMPANY_WAY = "Custom"; + public static final String OPENAPI_WAY = "OpenAPI"; public OpenAPICustomProfileDefinition() { this(null); } public OpenAPICustomProfileDefinition(@Nullable OpenApiCustomRuleRepository[] repositories) { - // Intentional blank + // Intentional blank } @Override public void define(Context context) { - NewBuiltInQualityProfile profile = context.createBuiltInQualityProfile(MY_COMPANY_WAY, "openapi"); - addRepositoryRules(profile, OpenAPICustomRulesDefinition.REPOSITORY_KEY, RulesLists.getAllChecks()); - profile.done(); + NewBuiltInQualityProfile yamlProfile = context.createBuiltInQualityProfile(OPENAPI_WAY, "yaml"); + addBaseRules(yamlProfile, CheckList.REPOSITORY_KEY); + addRepositoryRules(yamlProfile, OpenAPICustomRulesDefinition.REPOSITORY_KEY, RulesLists.getAllChecks()); + yamlProfile.done(); + + NewBuiltInQualityProfile jsonProfile = context.createBuiltInQualityProfile(OPENAPI_WAY, "json"); + addBaseRules(jsonProfile, CheckList.JSON_REPOSITORY_KEY); + addRepositoryRules(jsonProfile, OpenAPICustomRulesDefinition.JSON_REPOSITORY_KEY, RulesLists.getAllChecks()); + jsonProfile.done(); + } + + private void addBaseRules(NewBuiltInQualityProfile profile, String repositoryKey) { + for (Class check : CheckList.getChecks()) { + Rule annotation = AnnotationUtils.getAnnotation(check, Rule.class); + profile.activateRule(repositoryKey, annotation.key()); + } } private void addRepositoryRules(NewBuiltInQualityProfile profile, String key, List> checks) { @@ -41,8 +49,8 @@ private void addRepositoryRules(NewBuiltInQualityProfile profile, String key, Li } } } - + private boolean isTemplateRule(String ruleKey) { - return "OAR112".equals(ruleKey); + return "OAR112".equals(ruleKey); } } diff --git a/src/main/java/apiaddicts/sonar/openapi/OpenAPICustomRulesDefinition.java b/src/main/java/apiaddicts/sonar/openapi/OpenAPICustomRulesDefinition.java index a51ab94f..a54bc12c 100644 --- a/src/main/java/apiaddicts/sonar/openapi/OpenAPICustomRulesDefinition.java +++ b/src/main/java/apiaddicts/sonar/openapi/OpenAPICustomRulesDefinition.java @@ -16,6 +16,7 @@ @ExtensionPoint public class OpenAPICustomRulesDefinition implements RulesDefinition { public static final String REPOSITORY_KEY = "openapi-custom"; + public static final String JSON_REPOSITORY_KEY = "openapi-custom-json"; private static final String REPOSITORY_NAME = "OpenAPI Custom"; private static final String ROOT_RESOURCE_FOLDER = "org/sonar/l10n/openapi/rules/openapi/"; private static final String SECURITY_GROUP = "security"; @@ -31,11 +32,15 @@ public class OpenAPICustomRulesDefinition implements RulesDefinition { @Override public void define(Context context) { I18nContext.initializeFromUserLanguage(); + populateRepository(context, REPOSITORY_KEY, "yaml"); + populateRepository(context, JSON_REPOSITORY_KEY, "json"); + } + + private void populateRepository(Context context, String key, String language) { NewRepository repository = context - .createRepository(REPOSITORY_KEY, "openapi") + .createRepository(key, language) .setName(REPOSITORY_NAME); - // Carga de reglas para cada grupo new RuleMetadataLoader(getPath(SECURITY_GROUP)).addRulesByAnnotatedClass(repository, RulesLists.getSecurityChecks()); new RuleMetadataLoader(getPath(FORMAT_GROUP)).addRulesByAnnotatedClass(repository, RulesLists.getFormatChecks()); new RuleMetadataLoader(getPath(SCHEMAS_GROUP)).addRulesByAnnotatedClass(repository, RulesLists.getSchemasChecks()); diff --git a/src/test/java/apiaddicts/sonar/openapi/OpenAPICustomPluginTest.java b/src/test/java/apiaddicts/sonar/openapi/OpenAPICustomPluginTest.java index db247fca..df1ff7a4 100644 --- a/src/test/java/apiaddicts/sonar/openapi/OpenAPICustomPluginTest.java +++ b/src/test/java/apiaddicts/sonar/openapi/OpenAPICustomPluginTest.java @@ -22,10 +22,11 @@ public void testDefine() { }; Plugin.Context context = new Plugin.Context(runtime); plugin.define(context); - assertThat(context.getExtensions()).hasSize(3); + assertThat(context.getExtensions()).hasSize(4); assertThat(context.getExtensions()).contains( OpenAPICustomProfileDefinition.class, OpenAPICustomRulesDefinition.class, - OpenAPICustomRuleRepository.class); + OpenAPICustomRuleRepository.class, + OpenAPICustomJsonRuleRepository.class); } } diff --git a/src/test/java/apiaddicts/sonar/openapi/OpenAPICustomProfileDefinitionTest.java b/src/test/java/apiaddicts/sonar/openapi/OpenAPICustomProfileDefinitionTest.java index 904cf042..907aee0a 100644 --- a/src/test/java/apiaddicts/sonar/openapi/OpenAPICustomProfileDefinitionTest.java +++ b/src/test/java/apiaddicts/sonar/openapi/OpenAPICustomProfileDefinitionTest.java @@ -1,6 +1,7 @@ package apiaddicts.sonar.openapi; import static org.assertj.core.api.Assertions.assertThat; +import org.apiaddicts.apitools.dosonarapi.checks.CheckList; import org.junit.Test; import org.sonar.api.server.profile.BuiltInQualityProfilesDefinition; import org.sonar.api.server.profile.BuiltInQualityProfilesDefinition.BuiltInQualityProfile; @@ -15,12 +16,21 @@ public void testDefine() { OpenAPICustomProfileDefinition profileDefinition = new OpenAPICustomProfileDefinition(); BuiltInQualityProfilesDefinition.Context context = new BuiltInQualityProfilesDefinition.Context(); profileDefinition.define(context); - BuiltInQualityProfile profile = context.profile("openapi", OpenAPICustomProfileDefinition.MY_COMPANY_WAY); - assertThat(profile).isNotNull(); - assertThat(profile.language()).isEqualTo("openapi"); - assertThat(profile.name()).isEqualTo(OpenAPICustomProfileDefinition.MY_COMPANY_WAY); - assertThat(profile.rules()).hasSize(RulesLists.getAllChecks().size() - 1); - assertThat(profile.rules().stream().noneMatch(r -> r.ruleKey().equals("OAR112"))).isTrue(); + int expectedSize = CheckList.getChecks().size() + RulesLists.getAllChecks().size() - 1; + + BuiltInQualityProfile yamlProfile = context.profile("yaml", OpenAPICustomProfileDefinition.OPENAPI_WAY); + assertThat(yamlProfile).isNotNull(); + assertThat(yamlProfile.language()).isEqualTo("yaml"); + assertThat(yamlProfile.name()).isEqualTo(OpenAPICustomProfileDefinition.OPENAPI_WAY); + assertThat(yamlProfile.rules()).hasSize(expectedSize); + assertThat(yamlProfile.rules().stream().noneMatch(r -> r.ruleKey().equals("OAR112"))).isTrue(); + + BuiltInQualityProfile jsonProfile = context.profile("json", OpenAPICustomProfileDefinition.OPENAPI_WAY); + assertThat(jsonProfile).isNotNull(); + assertThat(jsonProfile.language()).isEqualTo("json"); + assertThat(jsonProfile.name()).isEqualTo(OpenAPICustomProfileDefinition.OPENAPI_WAY); + assertThat(jsonProfile.rules()).hasSize(expectedSize); + assertThat(jsonProfile.rules().stream().noneMatch(r -> r.ruleKey().equals("OAR112"))).isTrue(); } } diff --git a/src/test/java/apiaddicts/sonar/openapi/OpenAPICustomRulesDefinitionTest.java b/src/test/java/apiaddicts/sonar/openapi/OpenAPICustomRulesDefinitionTest.java index e507fcb3..285445fb 100644 --- a/src/test/java/apiaddicts/sonar/openapi/OpenAPICustomRulesDefinitionTest.java +++ b/src/test/java/apiaddicts/sonar/openapi/OpenAPICustomRulesDefinitionTest.java @@ -16,10 +16,16 @@ public void testRepository() { OpenAPICustomRulesDefinition rulesDefinition = new OpenAPICustomRulesDefinition(); RulesDefinition.Context context = new RulesDefinition.Context(); rulesDefinition.define(context); - Repository repository = context.repository(OpenAPICustomRulesDefinition.REPOSITORY_KEY); - assertThat(repository.name()).isEqualTo("OpenAPI Custom"); - assertThat(repository.language()).isEqualTo("openapi"); - assertThat(repository.rules()).hasSize(RulesLists.getAllChecks().size()); + + Repository yamlRepository = context.repository(OpenAPICustomRulesDefinition.REPOSITORY_KEY); + assertThat(yamlRepository.name()).isEqualTo("OpenAPI Custom"); + assertThat(yamlRepository.language()).isEqualTo("yaml"); + assertThat(yamlRepository.rules()).hasSize(RulesLists.getAllChecks().size()); + + Repository jsonRepository = context.repository(OpenAPICustomRulesDefinition.JSON_REPOSITORY_KEY); + assertThat(jsonRepository.name()).isEqualTo("OpenAPI Custom"); + assertThat(jsonRepository.language()).isEqualTo("json"); + assertThat(jsonRepository.rules()).hasSize(RulesLists.getAllChecks().size()); } @Test @@ -39,7 +45,7 @@ public void testMarkAsTemplateWithNonExistentRule() throws Exception { I18nContext.setLang("en"); OpenAPICustomRulesDefinition rulesDefinition = new OpenAPICustomRulesDefinition(); RulesDefinition.Context context = new RulesDefinition.Context(); - RulesDefinition.NewRepository newRepo = context.createRepository("test-repo", "openapi").setName("Test"); + RulesDefinition.NewRepository newRepo = context.createRepository("test-repo", "yaml").setName("Test"); Method method = OpenAPICustomRulesDefinition.class.getDeclaredMethod( "markAsTemplate", RulesDefinition.NewRepository.class, String.class); From 52b104f1b80e7b1cde9118f765d4d6ccd99677a3 Mon Sep 17 00:00:00 2001 From: Melsy Huamani Date: Thu, 14 May 2026 10:37:13 -0500 Subject: [PATCH 06/28] fix: duplicated sonar issues for yaml and json and rename repository key --- .../OpenAPICustomProfileDefinition.java | 4 +-- .../openapi/OpenAPICustomRuleRepository.java | 4 +-- .../openapi/OpenAPICustomRulesDefinition.java | 4 +-- .../sonar/openapi/utils/JsonNodeUtils.java | 27 ++++++++++++------- .../sonar/openapi/BaseCheckTest.java | 2 +- .../OpenAPICustomRuleRepositoryTest.java | 2 +- .../OpenAPICustomRulesDefinitionTest.java | 2 +- 7 files changed, 26 insertions(+), 19 deletions(-) diff --git a/src/main/java/apiaddicts/sonar/openapi/OpenAPICustomProfileDefinition.java b/src/main/java/apiaddicts/sonar/openapi/OpenAPICustomProfileDefinition.java index a36a9ce5..5ccaa621 100644 --- a/src/main/java/apiaddicts/sonar/openapi/OpenAPICustomProfileDefinition.java +++ b/src/main/java/apiaddicts/sonar/openapi/OpenAPICustomProfileDefinition.java @@ -24,8 +24,8 @@ public OpenAPICustomProfileDefinition(@Nullable OpenApiCustomRuleRepository[] re @Override public void define(Context context) { NewBuiltInQualityProfile yamlProfile = context.createBuiltInQualityProfile(OPENAPI_WAY, "yaml"); - addBaseRules(yamlProfile, CheckList.REPOSITORY_KEY); - addRepositoryRules(yamlProfile, OpenAPICustomRulesDefinition.REPOSITORY_KEY, RulesLists.getAllChecks()); + addBaseRules(yamlProfile, CheckList.YAML_REPOSITORY_KEY); + addRepositoryRules(yamlProfile, OpenAPICustomRulesDefinition.YAML_REPOSITORY_KEY, RulesLists.getAllChecks()); yamlProfile.done(); NewBuiltInQualityProfile jsonProfile = context.createBuiltInQualityProfile(OPENAPI_WAY, "json"); diff --git a/src/main/java/apiaddicts/sonar/openapi/OpenAPICustomRuleRepository.java b/src/main/java/apiaddicts/sonar/openapi/OpenAPICustomRuleRepository.java index ec1a3fc1..0310376e 100644 --- a/src/main/java/apiaddicts/sonar/openapi/OpenAPICustomRuleRepository.java +++ b/src/main/java/apiaddicts/sonar/openapi/OpenAPICustomRuleRepository.java @@ -8,7 +8,7 @@ import java.util.List; -import static apiaddicts.sonar.openapi.OpenAPICustomRulesDefinition.REPOSITORY_KEY; +import static apiaddicts.sonar.openapi.OpenAPICustomRulesDefinition.YAML_REPOSITORY_KEY; /** * Makes the rules visible to the OpenAPI scanner sensor, @@ -22,7 +22,7 @@ public class OpenAPICustomRuleRepository implements OpenApiCustomRuleRepository { @Override public String repositoryKey() { - return REPOSITORY_KEY; + return YAML_REPOSITORY_KEY; } @Override diff --git a/src/main/java/apiaddicts/sonar/openapi/OpenAPICustomRulesDefinition.java b/src/main/java/apiaddicts/sonar/openapi/OpenAPICustomRulesDefinition.java index a54bc12c..47f64a74 100644 --- a/src/main/java/apiaddicts/sonar/openapi/OpenAPICustomRulesDefinition.java +++ b/src/main/java/apiaddicts/sonar/openapi/OpenAPICustomRulesDefinition.java @@ -15,7 +15,7 @@ @ScannerSide @ExtensionPoint public class OpenAPICustomRulesDefinition implements RulesDefinition { - public static final String REPOSITORY_KEY = "openapi-custom"; + public static final String YAML_REPOSITORY_KEY = "openapi-custom-yaml"; public static final String JSON_REPOSITORY_KEY = "openapi-custom-json"; private static final String REPOSITORY_NAME = "OpenAPI Custom"; private static final String ROOT_RESOURCE_FOLDER = "org/sonar/l10n/openapi/rules/openapi/"; @@ -32,7 +32,7 @@ public class OpenAPICustomRulesDefinition implements RulesDefinition { @Override public void define(Context context) { I18nContext.initializeFromUserLanguage(); - populateRepository(context, REPOSITORY_KEY, "yaml"); + populateRepository(context, YAML_REPOSITORY_KEY, "yaml"); populateRepository(context, JSON_REPOSITORY_KEY, "json"); } diff --git a/src/main/java/apiaddicts/sonar/openapi/utils/JsonNodeUtils.java b/src/main/java/apiaddicts/sonar/openapi/utils/JsonNodeUtils.java index a2aa4130..1763698f 100644 --- a/src/main/java/apiaddicts/sonar/openapi/utils/JsonNodeUtils.java +++ b/src/main/java/apiaddicts/sonar/openapi/utils/JsonNodeUtils.java @@ -18,14 +18,16 @@ import java.io.IOException; import java.nio.charset.StandardCharsets; import java.util.Set; -import java.util.logging.Level; -import java.util.logging.Logger; import java.util.stream.Collectors; import com.sonar.sslr.api.AstNodeType; +import org.sonar.api.utils.log.Logger; +import org.sonar.api.utils.log.Loggers; public class JsonNodeUtils { - private static final Logger LOG = Logger.getLogger(JsonNodeUtils.class.getName()); + private static final Logger LOG = Loggers.get(JsonNodeUtils.class); + private static final int CONNECT_TIMEOUT_MS = 5_000; + private static final int READ_TIMEOUT_MS = 10_000; private JsonNodeUtils() { // Intentional blank @@ -49,7 +51,8 @@ public static JsonNode resolve(JsonNode original) { if (ref.startsWith("#")) { return original.resolve(); } else { - return resolveExternalRef(ref); + JsonNode resolved = resolveExternalRef(ref); + return resolved != null ? resolved : original; } } return original; @@ -66,6 +69,9 @@ public static boolean isExternalRef (JsonNode original){ private static JsonNode resolveExternalRef(String url) { String content = retriveExternalRefContent(url); + if (content == null) { + return null; + } OpenApiConfiguration configuration = new OpenApiConfiguration(StandardCharsets.UTF_8, true); YamlParser parser = OpenApiParser.createGeneric(configuration); @@ -93,8 +99,10 @@ private static String retriveExternalRefContent(String ref) { try { URL url = URI.create(ref).toURL(); conn = (HttpURLConnection) url.openConnection(); + conn.setConnectTimeout(CONNECT_TIMEOUT_MS); + conn.setReadTimeout(READ_TIMEOUT_MS); conn.setRequestMethod("GET"); - conn.setRequestProperty("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36"); + conn.setRequestProperty("User-Agent", "SonarQube OpenAPI Plugin"); conn.connect(); int responseCode = conn.getResponseCode(); @@ -106,11 +114,11 @@ private static String retriveExternalRefContent(String ref) { } } else { handleErrorResponse(conn); - return "Error: Response code " + responseCode; + return null; } } catch (IOException e) { - LOG.log(Level.SEVERE, String.format("Error parsing external ref %s", ref), e); - return "Error: " + e.getMessage(); + LOG.warn("Cannot resolve external ref " + ref + ": " + e.getMessage()); + return null; } finally { if (conn != null) { conn.disconnect(); @@ -133,8 +141,7 @@ private static void handleErrorResponse(HttpURLConnection conn) throws IOExcepti int responseCode = conn.getResponseCode(); InputStream errorStream = conn.getErrorStream(); String errorResponse = errorStream != null ? readInputStreamToString(errorStream) : "No error message"; - conn.getHeaderFields().forEach((key, value) -> LOG.info("Header " + key + ": " + value)); - LOG.log(Level.SEVERE, "Error resolving external ref {0} {1}", new Object[]{responseCode, errorResponse}); + LOG.warn("External ref returned HTTP " + responseCode + ": " + errorResponse); } public static String getLastFetchedContent() { diff --git a/src/test/java/apiaddicts/sonar/openapi/BaseCheckTest.java b/src/test/java/apiaddicts/sonar/openapi/BaseCheckTest.java index 82598e2e..36f52fe7 100644 --- a/src/test/java/apiaddicts/sonar/openapi/BaseCheckTest.java +++ b/src/test/java/apiaddicts/sonar/openapi/BaseCheckTest.java @@ -96,7 +96,7 @@ public static void beforeClass() { OpenAPICustomRulesDefinition rulesDefinition = new OpenAPICustomRulesDefinition(); RulesDefinition.Context context = new RulesDefinition.Context(); rulesDefinition.define(context); - repository = context.repository(OpenAPICustomRulesDefinition.REPOSITORY_KEY); + repository = context.repository(OpenAPICustomRulesDefinition.YAML_REPOSITORY_KEY); } @Test diff --git a/src/test/java/apiaddicts/sonar/openapi/OpenAPICustomRuleRepositoryTest.java b/src/test/java/apiaddicts/sonar/openapi/OpenAPICustomRuleRepositoryTest.java index 180b70cd..d54ef603 100644 --- a/src/test/java/apiaddicts/sonar/openapi/OpenAPICustomRuleRepositoryTest.java +++ b/src/test/java/apiaddicts/sonar/openapi/OpenAPICustomRuleRepositoryTest.java @@ -10,7 +10,7 @@ public class OpenAPICustomRuleRepositoryTest { @Test public void testRepositoryKey() { OpenAPICustomRuleRepository repository = new OpenAPICustomRuleRepository(); - assertThat(repository.repositoryKey()).isEqualTo(OpenAPICustomRulesDefinition.REPOSITORY_KEY); + assertThat(repository.repositoryKey()).isEqualTo(OpenAPICustomRulesDefinition.YAML_REPOSITORY_KEY); } @Test diff --git a/src/test/java/apiaddicts/sonar/openapi/OpenAPICustomRulesDefinitionTest.java b/src/test/java/apiaddicts/sonar/openapi/OpenAPICustomRulesDefinitionTest.java index 285445fb..225b0e36 100644 --- a/src/test/java/apiaddicts/sonar/openapi/OpenAPICustomRulesDefinitionTest.java +++ b/src/test/java/apiaddicts/sonar/openapi/OpenAPICustomRulesDefinitionTest.java @@ -17,7 +17,7 @@ public void testRepository() { RulesDefinition.Context context = new RulesDefinition.Context(); rulesDefinition.define(context); - Repository yamlRepository = context.repository(OpenAPICustomRulesDefinition.REPOSITORY_KEY); + Repository yamlRepository = context.repository(OpenAPICustomRulesDefinition.YAML_REPOSITORY_KEY); assertThat(yamlRepository.name()).isEqualTo("OpenAPI Custom"); assertThat(yamlRepository.language()).isEqualTo("yaml"); assertThat(yamlRepository.rules()).hasSize(RulesLists.getAllChecks().size()); From 427e90c971085eb83a10194e45ca34f724e8de6f Mon Sep 17 00:00:00 2001 From: Melsy Huamani Date: Thu, 14 May 2026 12:30:33 -0500 Subject: [PATCH 07/28] add tests and update changelog and readme --- CHANGELOG.md | 7 + pom.xml | 14 +- .../security/OAR053ResponseHeadersCheck.java | 4 +- .../OpenAPICustomJsonRuleRepositoryTest.java | 22 +++ .../OAR053ResponseHeadersCheckTest.java | 136 +++++++++++++++++- .../OAR085OpenAPIVersionCheckTest.java | 74 ++++++++++ .../openapi/utils/VerbPathMatcherTest.java | 98 +++++++++++++ .../v2/security/OAR053/excluded-code.json | 18 +++ .../v2/security/OAR053/excluded-code.yaml | 11 ++ .../v2/security/OAR053/excluded-path.json | 18 +++ .../v2/security/OAR053/excluded-path.yaml | 11 ++ .../v2/security/OAR053/forbidden-header.json | 23 +++ .../v2/security/OAR053/forbidden-header.yaml | 14 ++ .../v2/security/OAR053/missing-header.json | 23 +++ .../v2/security/OAR053/missing-header.yaml | 14 ++ .../v2/security/OAR085/truly-invalid.json | 9 ++ .../v2/security/OAR085/truly-invalid.yaml | 6 + .../v3/security/OAR053/excluded-code.json | 18 +++ .../v3/security/OAR053/excluded-code.yaml | 11 ++ .../v3/security/OAR053/excluded-path.json | 18 +++ .../v3/security/OAR053/excluded-path.yaml | 11 ++ .../v3/security/OAR053/forbidden-header.json | 25 ++++ .../v3/security/OAR053/forbidden-header.yaml | 15 ++ .../v3/security/OAR053/missing-header.json | 25 ++++ .../v3/security/OAR053/missing-header.yaml | 15 ++ .../v3/security/OAR085/truly-invalid.json | 9 ++ .../v3/security/OAR085/truly-invalid.yaml | 6 + .../v31/security/OAR053/excluded-code.json | 18 +++ .../v31/security/OAR053/excluded-code.yaml | 11 ++ .../v31/security/OAR053/excluded-path.json | 18 +++ .../v31/security/OAR053/excluded-path.yaml | 11 ++ .../v31/security/OAR053/forbidden-header.json | 25 ++++ .../v31/security/OAR053/forbidden-header.yaml | 15 ++ .../v31/security/OAR053/missing-header.json | 25 ++++ .../v31/security/OAR053/missing-header.yaml | 15 ++ .../v31/security/OAR085/truly-invalid.json | 9 ++ .../v31/security/OAR085/truly-invalid.yaml | 6 + .../v32/security/OAR053/excluded-code.json | 18 +++ .../v32/security/OAR053/excluded-code.yaml | 11 ++ .../v32/security/OAR053/excluded-path.json | 18 +++ .../v32/security/OAR053/excluded-path.yaml | 11 ++ .../v32/security/OAR053/forbidden-header.json | 25 ++++ .../v32/security/OAR053/forbidden-header.yaml | 15 ++ .../v32/security/OAR053/missing-header.json | 25 ++++ .../v32/security/OAR053/missing-header.yaml | 15 ++ .../v32/security/OAR085/truly-invalid.json | 9 ++ .../v32/security/OAR085/truly-invalid.yaml | 6 + 47 files changed, 955 insertions(+), 6 deletions(-) create mode 100644 src/test/java/apiaddicts/sonar/openapi/OpenAPICustomJsonRuleRepositoryTest.java create mode 100644 src/test/java/apiaddicts/sonar/openapi/utils/VerbPathMatcherTest.java create mode 100644 src/test/resources/checks/v2/security/OAR053/excluded-code.json create mode 100644 src/test/resources/checks/v2/security/OAR053/excluded-code.yaml create mode 100644 src/test/resources/checks/v2/security/OAR053/excluded-path.json create mode 100644 src/test/resources/checks/v2/security/OAR053/excluded-path.yaml create mode 100644 src/test/resources/checks/v2/security/OAR053/forbidden-header.json create mode 100644 src/test/resources/checks/v2/security/OAR053/forbidden-header.yaml create mode 100644 src/test/resources/checks/v2/security/OAR053/missing-header.json create mode 100644 src/test/resources/checks/v2/security/OAR053/missing-header.yaml create mode 100644 src/test/resources/checks/v2/security/OAR085/truly-invalid.json create mode 100644 src/test/resources/checks/v2/security/OAR085/truly-invalid.yaml create mode 100644 src/test/resources/checks/v3/security/OAR053/excluded-code.json create mode 100644 src/test/resources/checks/v3/security/OAR053/excluded-code.yaml create mode 100644 src/test/resources/checks/v3/security/OAR053/excluded-path.json create mode 100644 src/test/resources/checks/v3/security/OAR053/excluded-path.yaml create mode 100644 src/test/resources/checks/v3/security/OAR053/forbidden-header.json create mode 100644 src/test/resources/checks/v3/security/OAR053/forbidden-header.yaml create mode 100644 src/test/resources/checks/v3/security/OAR053/missing-header.json create mode 100644 src/test/resources/checks/v3/security/OAR053/missing-header.yaml create mode 100644 src/test/resources/checks/v3/security/OAR085/truly-invalid.json create mode 100644 src/test/resources/checks/v3/security/OAR085/truly-invalid.yaml create mode 100644 src/test/resources/checks/v31/security/OAR053/excluded-code.json create mode 100644 src/test/resources/checks/v31/security/OAR053/excluded-code.yaml create mode 100644 src/test/resources/checks/v31/security/OAR053/excluded-path.json create mode 100644 src/test/resources/checks/v31/security/OAR053/excluded-path.yaml create mode 100644 src/test/resources/checks/v31/security/OAR053/forbidden-header.json create mode 100644 src/test/resources/checks/v31/security/OAR053/forbidden-header.yaml create mode 100644 src/test/resources/checks/v31/security/OAR053/missing-header.json create mode 100644 src/test/resources/checks/v31/security/OAR053/missing-header.yaml create mode 100644 src/test/resources/checks/v31/security/OAR085/truly-invalid.json create mode 100644 src/test/resources/checks/v31/security/OAR085/truly-invalid.yaml create mode 100644 src/test/resources/checks/v32/security/OAR053/excluded-code.json create mode 100644 src/test/resources/checks/v32/security/OAR053/excluded-code.yaml create mode 100644 src/test/resources/checks/v32/security/OAR053/excluded-path.json create mode 100644 src/test/resources/checks/v32/security/OAR053/excluded-path.yaml create mode 100644 src/test/resources/checks/v32/security/OAR053/forbidden-header.json create mode 100644 src/test/resources/checks/v32/security/OAR053/forbidden-header.yaml create mode 100644 src/test/resources/checks/v32/security/OAR053/missing-header.json create mode 100644 src/test/resources/checks/v32/security/OAR053/missing-header.yaml create mode 100644 src/test/resources/checks/v32/security/OAR085/truly-invalid.json create mode 100644 src/test/resources/checks/v32/security/OAR085/truly-invalid.yaml diff --git a/CHANGELOG.md b/CHANGELOG.md index 23699282..97892725 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [1.4.1] - 2024-05-14 + +## Fixed + +- Resolve language suffix conflict between the plugin's custom YAML/JSON support and SonarQube's built-in language detection. + + ## [1.4.0] - 2024-05-06 ## Changed diff --git a/pom.xml b/pom.xml index 39d77e8c..0bb36750 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 org.apiaddicts.apitools.dosonarapi sonaropenapi-rules-community - 1.4.0 + 1.4.1 sonar-plugin SonarQube OpenAPI Community Rules @@ -64,7 +64,7 @@ 8.7.0.41497 6.7 - 1.2.0 + 1.3.0 1.22.0.848 20220320 4.13.2 @@ -91,7 +91,13 @@ org.apiaddicts.apitools.dosonarapi openapi-front-end - 1.2.0 + 1.3.0 + + + org.apiaddicts.apitools.dosonarapi + openapi-checks + ${sonaropenapi.version} + provided org.sonarsource.sonarqube @@ -125,7 +131,7 @@ org.apiaddicts.apitools.dosonarapi openapi-test-tools - 1.2.0 + 1.3.0 junit diff --git a/src/main/java/apiaddicts/sonar/openapi/checks/security/OAR053ResponseHeadersCheck.java b/src/main/java/apiaddicts/sonar/openapi/checks/security/OAR053ResponseHeadersCheck.java index b1b9229f..34ce2172 100644 --- a/src/main/java/apiaddicts/sonar/openapi/checks/security/OAR053ResponseHeadersCheck.java +++ b/src/main/java/apiaddicts/sonar/openapi/checks/security/OAR053ResponseHeadersCheck.java @@ -9,6 +9,8 @@ import org.apiaddicts.apitools.dosonarapi.api.v2.OpenApi2Grammar; import org.apiaddicts.apitools.dosonarapi.api.v3.OpenApi3Grammar; +import org.apiaddicts.apitools.dosonarapi.api.v31.OpenApi31Grammar; +import org.apiaddicts.apitools.dosonarapi.api.v32.OpenApi32Grammar; import org.apiaddicts.apitools.dosonarapi.sslr.yaml.grammar.JsonNode; import org.sonar.check.Rule; import org.sonar.check.RuleProperty; @@ -72,7 +74,7 @@ protected void visitFile(JsonNode root) { @Override public Set subscribedKinds() { - return ImmutableSet.of(OpenApi2Grammar.PATH, OpenApi3Grammar.PATH); + return ImmutableSet.of(OpenApi2Grammar.PATH, OpenApi3Grammar.PATH, OpenApi31Grammar.PATH, OpenApi32Grammar.PATH); } @Override diff --git a/src/test/java/apiaddicts/sonar/openapi/OpenAPICustomJsonRuleRepositoryTest.java b/src/test/java/apiaddicts/sonar/openapi/OpenAPICustomJsonRuleRepositoryTest.java new file mode 100644 index 00000000..21a403da --- /dev/null +++ b/src/test/java/apiaddicts/sonar/openapi/OpenAPICustomJsonRuleRepositoryTest.java @@ -0,0 +1,22 @@ +package apiaddicts.sonar.openapi; + +import static org.assertj.core.api.Assertions.assertThat; +import org.junit.Test; + +import apiaddicts.sonar.openapi.checks.RulesLists; + +public class OpenAPICustomJsonRuleRepositoryTest { + + @Test + public void testRepositoryKey() { + OpenAPICustomJsonRuleRepository repository = new OpenAPICustomJsonRuleRepository(); + assertThat(repository.repositoryKey()).isEqualTo(OpenAPICustomRulesDefinition.JSON_REPOSITORY_KEY); + } + + @Test + public void testCheckClasses() { + OpenAPICustomJsonRuleRepository repository = new OpenAPICustomJsonRuleRepository(); + assertThat(repository.checkClasses()).isEqualTo(RulesLists.getAllChecks()); + assertThat(repository.checkClasses()).isNotEmpty(); + } +} diff --git a/src/test/java/apiaddicts/sonar/openapi/checks/security/OAR053ResponseHeadersCheckTest.java b/src/test/java/apiaddicts/sonar/openapi/checks/security/OAR053ResponseHeadersCheckTest.java index 692b01af..1831534e 100644 --- a/src/test/java/apiaddicts/sonar/openapi/checks/security/OAR053ResponseHeadersCheckTest.java +++ b/src/test/java/apiaddicts/sonar/openapi/checks/security/OAR053ResponseHeadersCheckTest.java @@ -5,7 +5,14 @@ import org.sonar.api.rule.Severity; import org.sonar.api.rules.RuleType; import org.sonar.api.server.rule.RuleParamType; +import org.apiaddicts.apitools.dosonarapi.api.PreciseIssue; import apiaddicts.sonar.openapi.BaseCheckTest; +import apiaddicts.sonar.openapi.ExtendedOpenApiCheckVerifier; + +import java.io.File; +import java.util.List; + +import static org.assertj.core.api.Assertions.assertThat; public class OAR053ResponseHeadersCheckTest extends BaseCheckTest{ @Before @@ -16,7 +23,7 @@ public void init() { v3Path = getV3Path("security"); v31Path = getV31Path("security"); v32Path = getV32Path("security"); - } + } @Test @@ -36,6 +43,133 @@ public void verifyInV32() { verifyV32("valid"); } + @Test + public void verifyMissingHeaderInV2() { + List yamlIssues = ExtendedOpenApiCheckVerifier.scanFileForIssues( + new File(v2Path + "missing-header.yaml"), check, true, false, false, false); + assertThat(yamlIssues).isNotEmpty(); + check = new OAR053ResponseHeadersCheck(); + List jsonIssues = ExtendedOpenApiCheckVerifier.scanFileForIssues( + new File(v2Path + "missing-header.json"), check, true, false, false, false); + assertThat(jsonIssues).isNotEmpty(); + } + + @Test + public void verifyMissingHeaderInV3() { + List yamlIssues = ExtendedOpenApiCheckVerifier.scanFileForIssues( + new File(v3Path + "missing-header.yaml"), check, false, true, false, false); + assertThat(yamlIssues).isNotEmpty(); + check = new OAR053ResponseHeadersCheck(); + List jsonIssues = ExtendedOpenApiCheckVerifier.scanFileForIssues( + new File(v3Path + "missing-header.json"), check, false, true, false, false); + assertThat(jsonIssues).isNotEmpty(); + } + + @Test + public void verifyMissingHeaderInV31() { + List yamlIssues = ExtendedOpenApiCheckVerifier.scanFileForIssues( + new File(v31Path + "missing-header.yaml"), check, false, false, true, false); + assertThat(yamlIssues).isNotEmpty(); + check = new OAR053ResponseHeadersCheck(); + List jsonIssues = ExtendedOpenApiCheckVerifier.scanFileForIssues( + new File(v31Path + "missing-header.json"), check, false, false, true, false); + assertThat(jsonIssues).isNotEmpty(); + } + + @Test + public void verifyMissingHeaderInV32() { + List yamlIssues = ExtendedOpenApiCheckVerifier.scanFileForIssues( + new File(v32Path + "missing-header.yaml"), check, false, false, false, true); + assertThat(yamlIssues).isNotEmpty(); + check = new OAR053ResponseHeadersCheck(); + List jsonIssues = ExtendedOpenApiCheckVerifier.scanFileForIssues( + new File(v32Path + "missing-header.json"), check, false, false, false, true); + assertThat(jsonIssues).isNotEmpty(); + } + + @Test + public void verifyForbiddenHeaderInV2() { + List yamlIssues = ExtendedOpenApiCheckVerifier.scanFileForIssues( + new File(v2Path + "forbidden-header.yaml"), check, true, false, false, false); + assertThat(yamlIssues).isNotEmpty(); + check = new OAR053ResponseHeadersCheck(); + List jsonIssues = ExtendedOpenApiCheckVerifier.scanFileForIssues( + new File(v2Path + "forbidden-header.json"), check, true, false, false, false); + assertThat(jsonIssues).isNotEmpty(); + } + + @Test + public void verifyForbiddenHeaderInV3() { + List yamlIssues = ExtendedOpenApiCheckVerifier.scanFileForIssues( + new File(v3Path + "forbidden-header.yaml"), check, false, true, false, false); + assertThat(yamlIssues).isNotEmpty(); + check = new OAR053ResponseHeadersCheck(); + List jsonIssues = ExtendedOpenApiCheckVerifier.scanFileForIssues( + new File(v3Path + "forbidden-header.json"), check, false, true, false, false); + assertThat(jsonIssues).isNotEmpty(); + } + + @Test + public void verifyForbiddenHeaderInV31() { + List yamlIssues = ExtendedOpenApiCheckVerifier.scanFileForIssues( + new File(v31Path + "forbidden-header.yaml"), check, false, false, true, false); + assertThat(yamlIssues).isNotEmpty(); + check = new OAR053ResponseHeadersCheck(); + List jsonIssues = ExtendedOpenApiCheckVerifier.scanFileForIssues( + new File(v31Path + "forbidden-header.json"), check, false, false, true, false); + assertThat(jsonIssues).isNotEmpty(); + } + + @Test + public void verifyForbiddenHeaderInV32() { + List yamlIssues = ExtendedOpenApiCheckVerifier.scanFileForIssues( + new File(v32Path + "forbidden-header.yaml"), check, false, false, false, true); + assertThat(yamlIssues).isNotEmpty(); + check = new OAR053ResponseHeadersCheck(); + List jsonIssues = ExtendedOpenApiCheckVerifier.scanFileForIssues( + new File(v32Path + "forbidden-header.json"), check, false, false, false, true); + assertThat(jsonIssues).isNotEmpty(); + } + + @Test + public void verifyExcludedPathInV2() { + verifyV2("excluded-path"); + } + + @Test + public void verifyExcludedPathInV3() { + verifyV3("excluded-path"); + } + + @Test + public void verifyExcludedPathInV31() { + verifyV31("excluded-path"); + } + + @Test + public void verifyExcludedPathInV32() { + verifyV32("excluded-path"); + } + + @Test + public void verifyExcludedCodeInV2() { + verifyV2("excluded-code"); + } + + @Test + public void verifyExcludedCodeInV3() { + verifyV3("excluded-code"); + } + + @Test + public void verifyExcludedCodeInV31() { + verifyV31("excluded-code"); + } + + @Test + public void verifyExcludedCodeInV32() { + verifyV32("excluded-code"); + } @Override public void verifyParameters() { diff --git a/src/test/java/apiaddicts/sonar/openapi/checks/security/OAR085OpenAPIVersionCheckTest.java b/src/test/java/apiaddicts/sonar/openapi/checks/security/OAR085OpenAPIVersionCheckTest.java index 10a7feff..3d09c539 100644 --- a/src/test/java/apiaddicts/sonar/openapi/checks/security/OAR085OpenAPIVersionCheckTest.java +++ b/src/test/java/apiaddicts/sonar/openapi/checks/security/OAR085OpenAPIVersionCheckTest.java @@ -6,6 +6,14 @@ import org.sonar.api.rules.RuleType; import org.sonar.api.server.rule.RuleParamType; import apiaddicts.sonar.openapi.BaseCheckTest; +import apiaddicts.sonar.openapi.ExtendedOpenApiCheckVerifier; +import org.apiaddicts.apitools.dosonarapi.api.PreciseIssue; +import org.apiaddicts.apitools.dosonarapi.sslr.yaml.grammar.ValidationException; + +import java.io.File; +import java.util.List; + +import static org.assertj.core.api.Assertions.assertThat; public class OAR085OpenAPIVersionCheckTest extends BaseCheckTest { @@ -55,6 +63,72 @@ public void verifyInvalidOpenApiVersionInV32() { verifyV32("invalid-openapi-version"); } + @Test + public void verifyTrulyInvalidVersionInV2() { + try { + List issues = ExtendedOpenApiCheckVerifier.scanFileForIssues( + new File(v2Path + "truly-invalid.yaml"), check, true, false, false, false); + assertThat(issues).isNotEmpty(); + } catch (ValidationException e) { + // Intentional blanck + } + } + + @Test + public void verifyTrulyInvalidVersionInV2Json() { + try { + List issues = ExtendedOpenApiCheckVerifier.scanFileForIssues( + new File(v2Path + "truly-invalid.json"), check, true, false, false, false); + assertThat(issues).isNotEmpty(); + } catch (ValidationException e) { + // Intentional blanck + } + } + + @Test + public void verifyTrulyInvalidVersionInV3() { + try { + List issues = ExtendedOpenApiCheckVerifier.scanFileForIssues( + new File(v3Path + "truly-invalid.yaml"), check, false, true, false, false); + assertThat(issues).isNotEmpty(); + } catch (ValidationException e) { + // Intentional blanck + } + } + + @Test + public void verifyTrulyInvalidVersionInV3Json() { + try { + List issues = ExtendedOpenApiCheckVerifier.scanFileForIssues( + new File(v3Path + "truly-invalid.json"), check, false, true, false, false); + assertThat(issues).isNotEmpty(); + } catch (ValidationException e) { + // Intentional blanck + } + } + + @Test + public void verifyTrulyInvalidVersionInV31() { + try { + List issues = ExtendedOpenApiCheckVerifier.scanFileForIssues( + new File(v31Path + "truly-invalid.yaml"), check, false, false, true, false); + assertThat(issues).isNotEmpty(); + } catch (ValidationException e) { + // Intentional blanck + } + } + + @Test + public void verifyTrulyInvalidVersionInV32() { + try { + List issues = ExtendedOpenApiCheckVerifier.scanFileForIssues( + new File(v32Path + "truly-invalid.yaml"), check, false, false, false, true); + assertThat(issues).isNotEmpty(); + } catch (ValidationException e) { + // Intentional blanck + } + } + @Override public void verifyRule() { assertRuleProperties("OAR085 - OpenAPIVersion - The OpenAPI version should be one of the allowed by the organization", RuleType.VULNERABILITY, Severity.MINOR, tags("safety")); diff --git a/src/test/java/apiaddicts/sonar/openapi/utils/VerbPathMatcherTest.java b/src/test/java/apiaddicts/sonar/openapi/utils/VerbPathMatcherTest.java new file mode 100644 index 00000000..b334ba7d --- /dev/null +++ b/src/test/java/apiaddicts/sonar/openapi/utils/VerbPathMatcherTest.java @@ -0,0 +1,98 @@ +package apiaddicts.sonar.openapi.utils; + +import org.junit.Test; + +import java.util.Arrays; +import java.util.Collections; +import java.util.Optional; +import java.util.regex.Pattern; + +import static org.assertj.core.api.Assertions.assertThat; + +public class VerbPathMatcherTest { + + @Test + public void testMatchesWithValuesExcluded() { + VerbPathMatcher matcher = new VerbPathMatcher("get:^/items$", "get:/items"); + Optional result = matcher.matchesWithValues("get", "/items"); + assertThat(result).isEmpty(); + } + + @Test + public void testMatchesWithValuesMatched() { + VerbPathMatcher matcher = new VerbPathMatcher("get:^/items$"); + Optional result = matcher.matchesWithValues("get", "/items"); + assertThat(result).isPresent(); + } + + @Test + public void testMatchesWithValuesNoMatch() { + VerbPathMatcher matcher = new VerbPathMatcher("get:^/items$"); + Optional result = matcher.matchesWithValues("get", "/other"); + assertThat(result).isEmpty(); + } + + @Test + public void testMatchesWithUnknownVerb() { + VerbPathMatcher matcher = new VerbPathMatcher("get:^/items$"); + Optional result = matcher.matchesWithValues("post", "/items"); + assertThat(result).isEmpty(); + } + + @Test + public void testPatternGroupStrToSetWithNull() { + VerbPathMatcher.PatternGroup pg = new VerbPathMatcher.PatternGroup( + Pattern.compile(".*"), Collections.singletonList(null)); + assertThat(pg.getValues()).isEmpty(); + } + + @Test + public void testPatternGroupWithValues() { + VerbPathMatcher.PatternGroup pg = new VerbPathMatcher.PatternGroup( + Pattern.compile(".*"), Arrays.asList("a,b", "c")); + assertThat(pg.getValues(0)).containsExactlyInAnyOrder("a", "b"); + assertThat(pg.getValues(1)).containsExactly("c"); + } + + @Test + public void testMatchesReturnsFalseForMultipleMeWords() { + VerbPathMatcher matcher = new VerbPathMatcher("get:^/me/[^/{}]*/me$"); + Optional result = matcher.matchesWithValues("get", "/me/pets/me"); + assertThat(result).isEmpty(); + } + + @Test + public void testMatchesReturnsTrueForSingleMeWord() { + VerbPathMatcher matcher = new VerbPathMatcher("get:^/me$"); + Optional result = matcher.matchesWithValues("get", "/me"); + assertThat(result).isPresent(); + } + + @Test + public void testExpressionWithMultipleVerbs() { + VerbPathMatcher matcher = new VerbPathMatcher("get,post:^/items$"); + assertThat(matcher.matchesWithValues("get", "/items")).isPresent(); + assertThat(matcher.matchesWithValues("post", "/items")).isPresent(); + } + + @Test + public void testExpressionWithMultiplePatterns() { + VerbPathMatcher matcher = new VerbPathMatcher("get:^/items$,^/users$"); + assertThat(matcher.matchesWithValues("get", "/items")).isPresent(); + assertThat(matcher.matchesWithValues("get", "/users")).isPresent(); + } + + @Test + public void testNullExclusionExpression() { + VerbPathMatcher matcher = new VerbPathMatcher("get:^/items$", null); + assertThat(matcher.matchesWithValues("get", "/items")).isPresent(); + } + + @Test + public void testExpressionWithValues() { + VerbPathMatcher matcher = new VerbPathMatcher("get:^/items$:value1,value2"); + Optional result = matcher.matchesWithValues("get", "/items"); + assertThat(result).isPresent(); + assertThat(result.get().getValues()).containsExactlyInAnyOrder("value1", "value2"); + } +} diff --git a/src/test/resources/checks/v2/security/OAR053/excluded-code.json b/src/test/resources/checks/v2/security/OAR053/excluded-code.json new file mode 100644 index 00000000..6933e319 --- /dev/null +++ b/src/test/resources/checks/v2/security/OAR053/excluded-code.json @@ -0,0 +1,18 @@ +{ + "swagger": "2.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/pets": { + "delete": { + "responses": { + "204": { + "description": "No Content" + } + } + } + } + } +} diff --git a/src/test/resources/checks/v2/security/OAR053/excluded-code.yaml b/src/test/resources/checks/v2/security/OAR053/excluded-code.yaml new file mode 100644 index 00000000..0ac8a88f --- /dev/null +++ b/src/test/resources/checks/v2/security/OAR053/excluded-code.yaml @@ -0,0 +1,11 @@ +swagger: "2.0" +info: + version: 1.0.0 + title: Swagger Petstore + +paths: + /pets: + delete: + responses: + '204': + description: No Content diff --git a/src/test/resources/checks/v2/security/OAR053/excluded-path.json b/src/test/resources/checks/v2/security/OAR053/excluded-path.json new file mode 100644 index 00000000..ddc5c18c --- /dev/null +++ b/src/test/resources/checks/v2/security/OAR053/excluded-path.json @@ -0,0 +1,18 @@ +{ + "swagger": "2.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/status": { + "get": { + "responses": { + "200": { + "description": "OK" + } + } + } + } + } +} diff --git a/src/test/resources/checks/v2/security/OAR053/excluded-path.yaml b/src/test/resources/checks/v2/security/OAR053/excluded-path.yaml new file mode 100644 index 00000000..dea3cf23 --- /dev/null +++ b/src/test/resources/checks/v2/security/OAR053/excluded-path.yaml @@ -0,0 +1,11 @@ +swagger: "2.0" +info: + version: 1.0.0 + title: Swagger Petstore + +paths: + /status: + get: + responses: + '200': + description: OK diff --git a/src/test/resources/checks/v2/security/OAR053/forbidden-header.json b/src/test/resources/checks/v2/security/OAR053/forbidden-header.json new file mode 100644 index 00000000..77daf75d --- /dev/null +++ b/src/test/resources/checks/v2/security/OAR053/forbidden-header.json @@ -0,0 +1,23 @@ +{ + "swagger": "2.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/pets": { + "get": { + "responses": { + "200": { + "description": "OK", + "headers": { + "x-forbidden-custom-header": { + "type": "string" + } + } + } + } + } + } + } +} diff --git a/src/test/resources/checks/v2/security/OAR053/forbidden-header.yaml b/src/test/resources/checks/v2/security/OAR053/forbidden-header.yaml new file mode 100644 index 00000000..0bf30618 --- /dev/null +++ b/src/test/resources/checks/v2/security/OAR053/forbidden-header.yaml @@ -0,0 +1,14 @@ +swagger: "2.0" +info: + version: 1.0.0 + title: Swagger Petstore + +paths: + /pets: + get: + responses: + '200': + description: OK + headers: + x-forbidden-custom-header: + type: string diff --git a/src/test/resources/checks/v2/security/OAR053/missing-header.json b/src/test/resources/checks/v2/security/OAR053/missing-header.json new file mode 100644 index 00000000..88f1770f --- /dev/null +++ b/src/test/resources/checks/v2/security/OAR053/missing-header.json @@ -0,0 +1,23 @@ +{ + "swagger": "2.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/pets": { + "get": { + "responses": { + "200": { + "description": "OK", + "headers": { + "idCorrelacion": { + "type": "string" + } + } + } + } + } + } + } +} diff --git a/src/test/resources/checks/v2/security/OAR053/missing-header.yaml b/src/test/resources/checks/v2/security/OAR053/missing-header.yaml new file mode 100644 index 00000000..401c7c6c --- /dev/null +++ b/src/test/resources/checks/v2/security/OAR053/missing-header.yaml @@ -0,0 +1,14 @@ +swagger: "2.0" +info: + version: 1.0.0 + title: Swagger Petstore + +paths: + /pets: + get: + responses: + '200': + description: OK + headers: + idCorrelacion: + type: string diff --git a/src/test/resources/checks/v2/security/OAR085/truly-invalid.json b/src/test/resources/checks/v2/security/OAR085/truly-invalid.json new file mode 100644 index 00000000..ec03effe --- /dev/null +++ b/src/test/resources/checks/v2/security/OAR085/truly-invalid.json @@ -0,0 +1,9 @@ +{ + "swagger": "1.0", + "info": { + "title": "Sample API", + "description": "This is a sample API with an invalid swagger version.", + "version": "1.0.0" + }, + "paths": {} +} diff --git a/src/test/resources/checks/v2/security/OAR085/truly-invalid.yaml b/src/test/resources/checks/v2/security/OAR085/truly-invalid.yaml new file mode 100644 index 00000000..0f0347b2 --- /dev/null +++ b/src/test/resources/checks/v2/security/OAR085/truly-invalid.yaml @@ -0,0 +1,6 @@ +swagger: "1.0" +info: + title: Sample API + description: This is a sample API with an invalid swagger version. + version: "1.0.0" +paths: {} diff --git a/src/test/resources/checks/v3/security/OAR053/excluded-code.json b/src/test/resources/checks/v3/security/OAR053/excluded-code.json new file mode 100644 index 00000000..619f4f86 --- /dev/null +++ b/src/test/resources/checks/v3/security/OAR053/excluded-code.json @@ -0,0 +1,18 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/pets": { + "delete": { + "responses": { + "204": { + "description": "No Content" + } + } + } + } + } +} diff --git a/src/test/resources/checks/v3/security/OAR053/excluded-code.yaml b/src/test/resources/checks/v3/security/OAR053/excluded-code.yaml new file mode 100644 index 00000000..a02d35b0 --- /dev/null +++ b/src/test/resources/checks/v3/security/OAR053/excluded-code.yaml @@ -0,0 +1,11 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore + +paths: + /pets: + delete: + responses: + '204': + description: No Content diff --git a/src/test/resources/checks/v3/security/OAR053/excluded-path.json b/src/test/resources/checks/v3/security/OAR053/excluded-path.json new file mode 100644 index 00000000..54d786d9 --- /dev/null +++ b/src/test/resources/checks/v3/security/OAR053/excluded-path.json @@ -0,0 +1,18 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/status": { + "get": { + "responses": { + "200": { + "description": "OK" + } + } + } + } + } +} diff --git a/src/test/resources/checks/v3/security/OAR053/excluded-path.yaml b/src/test/resources/checks/v3/security/OAR053/excluded-path.yaml new file mode 100644 index 00000000..18f1d53e --- /dev/null +++ b/src/test/resources/checks/v3/security/OAR053/excluded-path.yaml @@ -0,0 +1,11 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore + +paths: + /status: + get: + responses: + '200': + description: OK diff --git a/src/test/resources/checks/v3/security/OAR053/forbidden-header.json b/src/test/resources/checks/v3/security/OAR053/forbidden-header.json new file mode 100644 index 00000000..e17d6b8f --- /dev/null +++ b/src/test/resources/checks/v3/security/OAR053/forbidden-header.json @@ -0,0 +1,25 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/pets": { + "get": { + "responses": { + "200": { + "description": "OK", + "headers": { + "x-forbidden-custom-header": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + } +} diff --git a/src/test/resources/checks/v3/security/OAR053/forbidden-header.yaml b/src/test/resources/checks/v3/security/OAR053/forbidden-header.yaml new file mode 100644 index 00000000..ea8ae055 --- /dev/null +++ b/src/test/resources/checks/v3/security/OAR053/forbidden-header.yaml @@ -0,0 +1,15 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore + +paths: + /pets: + get: + responses: + '200': + description: OK + headers: + x-forbidden-custom-header: + schema: + type: string diff --git a/src/test/resources/checks/v3/security/OAR053/missing-header.json b/src/test/resources/checks/v3/security/OAR053/missing-header.json new file mode 100644 index 00000000..bd00e3ba --- /dev/null +++ b/src/test/resources/checks/v3/security/OAR053/missing-header.json @@ -0,0 +1,25 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/pets": { + "get": { + "responses": { + "200": { + "description": "OK", + "headers": { + "idCorrelacion": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + } +} diff --git a/src/test/resources/checks/v3/security/OAR053/missing-header.yaml b/src/test/resources/checks/v3/security/OAR053/missing-header.yaml new file mode 100644 index 00000000..5ef9c5cf --- /dev/null +++ b/src/test/resources/checks/v3/security/OAR053/missing-header.yaml @@ -0,0 +1,15 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore + +paths: + /pets: + get: + responses: + '200': + description: OK + headers: + idCorrelacion: + schema: + type: string diff --git a/src/test/resources/checks/v3/security/OAR085/truly-invalid.json b/src/test/resources/checks/v3/security/OAR085/truly-invalid.json new file mode 100644 index 00000000..e7637d72 --- /dev/null +++ b/src/test/resources/checks/v3/security/OAR085/truly-invalid.json @@ -0,0 +1,9 @@ +{ + "openapi": "4.0.0", + "info": { + "title": "Sample API", + "description": "This is a sample API with an invalid openapi version.", + "version": "1.0.0" + }, + "paths": {} +} diff --git a/src/test/resources/checks/v3/security/OAR085/truly-invalid.yaml b/src/test/resources/checks/v3/security/OAR085/truly-invalid.yaml new file mode 100644 index 00000000..d9dbb374 --- /dev/null +++ b/src/test/resources/checks/v3/security/OAR085/truly-invalid.yaml @@ -0,0 +1,6 @@ +openapi: "4.0.0" +info: + title: Sample API + description: This is a sample API with an invalid openapi version. + version: 1.0.0 +paths: {} diff --git a/src/test/resources/checks/v31/security/OAR053/excluded-code.json b/src/test/resources/checks/v31/security/OAR053/excluded-code.json new file mode 100644 index 00000000..1ccf567f --- /dev/null +++ b/src/test/resources/checks/v31/security/OAR053/excluded-code.json @@ -0,0 +1,18 @@ +{ + "openapi": "3.1.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/pets": { + "delete": { + "responses": { + "204": { + "description": "No Content" + } + } + } + } + } +} diff --git a/src/test/resources/checks/v31/security/OAR053/excluded-code.yaml b/src/test/resources/checks/v31/security/OAR053/excluded-code.yaml new file mode 100644 index 00000000..9f7e9866 --- /dev/null +++ b/src/test/resources/checks/v31/security/OAR053/excluded-code.yaml @@ -0,0 +1,11 @@ +openapi: "3.1.0" +info: + version: 1.0.0 + title: Swagger Petstore + +paths: + /pets: + delete: + responses: + '204': + description: No Content diff --git a/src/test/resources/checks/v31/security/OAR053/excluded-path.json b/src/test/resources/checks/v31/security/OAR053/excluded-path.json new file mode 100644 index 00000000..ad1c0125 --- /dev/null +++ b/src/test/resources/checks/v31/security/OAR053/excluded-path.json @@ -0,0 +1,18 @@ +{ + "openapi": "3.1.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/status": { + "get": { + "responses": { + "200": { + "description": "OK" + } + } + } + } + } +} diff --git a/src/test/resources/checks/v31/security/OAR053/excluded-path.yaml b/src/test/resources/checks/v31/security/OAR053/excluded-path.yaml new file mode 100644 index 00000000..165c23c1 --- /dev/null +++ b/src/test/resources/checks/v31/security/OAR053/excluded-path.yaml @@ -0,0 +1,11 @@ +openapi: "3.1.0" +info: + version: 1.0.0 + title: Swagger Petstore + +paths: + /status: + get: + responses: + '200': + description: OK diff --git a/src/test/resources/checks/v31/security/OAR053/forbidden-header.json b/src/test/resources/checks/v31/security/OAR053/forbidden-header.json new file mode 100644 index 00000000..812de108 --- /dev/null +++ b/src/test/resources/checks/v31/security/OAR053/forbidden-header.json @@ -0,0 +1,25 @@ +{ + "openapi": "3.1.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/pets": { + "get": { + "responses": { + "200": { + "description": "OK", + "headers": { + "x-forbidden-custom-header": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + } +} diff --git a/src/test/resources/checks/v31/security/OAR053/forbidden-header.yaml b/src/test/resources/checks/v31/security/OAR053/forbidden-header.yaml new file mode 100644 index 00000000..d8a00eb3 --- /dev/null +++ b/src/test/resources/checks/v31/security/OAR053/forbidden-header.yaml @@ -0,0 +1,15 @@ +openapi: "3.1.0" +info: + version: 1.0.0 + title: Swagger Petstore + +paths: + /pets: + get: + responses: + '200': + description: OK + headers: + x-forbidden-custom-header: + schema: + type: string diff --git a/src/test/resources/checks/v31/security/OAR053/missing-header.json b/src/test/resources/checks/v31/security/OAR053/missing-header.json new file mode 100644 index 00000000..b3f8a993 --- /dev/null +++ b/src/test/resources/checks/v31/security/OAR053/missing-header.json @@ -0,0 +1,25 @@ +{ + "openapi": "3.1.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/pets": { + "get": { + "responses": { + "200": { + "description": "OK", + "headers": { + "idCorrelacion": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + } +} diff --git a/src/test/resources/checks/v31/security/OAR053/missing-header.yaml b/src/test/resources/checks/v31/security/OAR053/missing-header.yaml new file mode 100644 index 00000000..b56a02e6 --- /dev/null +++ b/src/test/resources/checks/v31/security/OAR053/missing-header.yaml @@ -0,0 +1,15 @@ +openapi: "3.1.0" +info: + version: 1.0.0 + title: Swagger Petstore + +paths: + /pets: + get: + responses: + '200': + description: OK + headers: + idCorrelacion: + schema: + type: string diff --git a/src/test/resources/checks/v31/security/OAR085/truly-invalid.json b/src/test/resources/checks/v31/security/OAR085/truly-invalid.json new file mode 100644 index 00000000..e7637d72 --- /dev/null +++ b/src/test/resources/checks/v31/security/OAR085/truly-invalid.json @@ -0,0 +1,9 @@ +{ + "openapi": "4.0.0", + "info": { + "title": "Sample API", + "description": "This is a sample API with an invalid openapi version.", + "version": "1.0.0" + }, + "paths": {} +} diff --git a/src/test/resources/checks/v31/security/OAR085/truly-invalid.yaml b/src/test/resources/checks/v31/security/OAR085/truly-invalid.yaml new file mode 100644 index 00000000..d9dbb374 --- /dev/null +++ b/src/test/resources/checks/v31/security/OAR085/truly-invalid.yaml @@ -0,0 +1,6 @@ +openapi: "4.0.0" +info: + title: Sample API + description: This is a sample API with an invalid openapi version. + version: 1.0.0 +paths: {} diff --git a/src/test/resources/checks/v32/security/OAR053/excluded-code.json b/src/test/resources/checks/v32/security/OAR053/excluded-code.json new file mode 100644 index 00000000..bab1a2ca --- /dev/null +++ b/src/test/resources/checks/v32/security/OAR053/excluded-code.json @@ -0,0 +1,18 @@ +{ + "openapi": "3.2.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/pets": { + "delete": { + "responses": { + "204": { + "description": "No Content" + } + } + } + } + } +} diff --git a/src/test/resources/checks/v32/security/OAR053/excluded-code.yaml b/src/test/resources/checks/v32/security/OAR053/excluded-code.yaml new file mode 100644 index 00000000..80d58771 --- /dev/null +++ b/src/test/resources/checks/v32/security/OAR053/excluded-code.yaml @@ -0,0 +1,11 @@ +openapi: "3.2.0" +info: + version: 1.0.0 + title: Swagger Petstore + +paths: + /pets: + delete: + responses: + '204': + description: No Content diff --git a/src/test/resources/checks/v32/security/OAR053/excluded-path.json b/src/test/resources/checks/v32/security/OAR053/excluded-path.json new file mode 100644 index 00000000..1b2876b6 --- /dev/null +++ b/src/test/resources/checks/v32/security/OAR053/excluded-path.json @@ -0,0 +1,18 @@ +{ + "openapi": "3.2.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/status": { + "get": { + "responses": { + "200": { + "description": "OK" + } + } + } + } + } +} diff --git a/src/test/resources/checks/v32/security/OAR053/excluded-path.yaml b/src/test/resources/checks/v32/security/OAR053/excluded-path.yaml new file mode 100644 index 00000000..fd3408e3 --- /dev/null +++ b/src/test/resources/checks/v32/security/OAR053/excluded-path.yaml @@ -0,0 +1,11 @@ +openapi: "3.2.0" +info: + version: 1.0.0 + title: Swagger Petstore + +paths: + /status: + get: + responses: + '200': + description: OK diff --git a/src/test/resources/checks/v32/security/OAR053/forbidden-header.json b/src/test/resources/checks/v32/security/OAR053/forbidden-header.json new file mode 100644 index 00000000..0a084165 --- /dev/null +++ b/src/test/resources/checks/v32/security/OAR053/forbidden-header.json @@ -0,0 +1,25 @@ +{ + "openapi": "3.2.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/pets": { + "get": { + "responses": { + "200": { + "description": "OK", + "headers": { + "x-forbidden-custom-header": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + } +} diff --git a/src/test/resources/checks/v32/security/OAR053/forbidden-header.yaml b/src/test/resources/checks/v32/security/OAR053/forbidden-header.yaml new file mode 100644 index 00000000..2da22886 --- /dev/null +++ b/src/test/resources/checks/v32/security/OAR053/forbidden-header.yaml @@ -0,0 +1,15 @@ +openapi: "3.2.0" +info: + version: 1.0.0 + title: Swagger Petstore + +paths: + /pets: + get: + responses: + '200': + description: OK + headers: + x-forbidden-custom-header: + schema: + type: string diff --git a/src/test/resources/checks/v32/security/OAR053/missing-header.json b/src/test/resources/checks/v32/security/OAR053/missing-header.json new file mode 100644 index 00000000..20259f73 --- /dev/null +++ b/src/test/resources/checks/v32/security/OAR053/missing-header.json @@ -0,0 +1,25 @@ +{ + "openapi": "3.2.0", + "info": { + "version": "1.0.0", + "title": "Swagger Petstore" + }, + "paths": { + "/pets": { + "get": { + "responses": { + "200": { + "description": "OK", + "headers": { + "idCorrelacion": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + } +} diff --git a/src/test/resources/checks/v32/security/OAR053/missing-header.yaml b/src/test/resources/checks/v32/security/OAR053/missing-header.yaml new file mode 100644 index 00000000..6e266fa3 --- /dev/null +++ b/src/test/resources/checks/v32/security/OAR053/missing-header.yaml @@ -0,0 +1,15 @@ +openapi: "3.2.0" +info: + version: 1.0.0 + title: Swagger Petstore + +paths: + /pets: + get: + responses: + '200': + description: OK + headers: + idCorrelacion: + schema: + type: string diff --git a/src/test/resources/checks/v32/security/OAR085/truly-invalid.json b/src/test/resources/checks/v32/security/OAR085/truly-invalid.json new file mode 100644 index 00000000..e7637d72 --- /dev/null +++ b/src/test/resources/checks/v32/security/OAR085/truly-invalid.json @@ -0,0 +1,9 @@ +{ + "openapi": "4.0.0", + "info": { + "title": "Sample API", + "description": "This is a sample API with an invalid openapi version.", + "version": "1.0.0" + }, + "paths": {} +} diff --git a/src/test/resources/checks/v32/security/OAR085/truly-invalid.yaml b/src/test/resources/checks/v32/security/OAR085/truly-invalid.yaml new file mode 100644 index 00000000..d9dbb374 --- /dev/null +++ b/src/test/resources/checks/v32/security/OAR085/truly-invalid.yaml @@ -0,0 +1,6 @@ +openapi: "4.0.0" +info: + title: Sample API + description: This is a sample API with an invalid openapi version. + version: 1.0.0 +paths: {} From f6a9536dda519167b2e62fb51f07d869c612cf3d Mon Sep 17 00:00:00 2001 From: Melsy Huamani Date: Thu, 14 May 2026 15:07:18 -0500 Subject: [PATCH 08/28] fix: pom version for sonarapi --- pom.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index 0bb36750..e9a9043f 100644 --- a/pom.xml +++ b/pom.xml @@ -64,7 +64,7 @@ 8.7.0.41497 6.7 - 1.3.0 + 1.2.1 1.22.0.848 20220320 4.13.2 @@ -91,7 +91,7 @@ org.apiaddicts.apitools.dosonarapi openapi-front-end - 1.3.0 + 1.2.1 org.apiaddicts.apitools.dosonarapi @@ -131,7 +131,7 @@ org.apiaddicts.apitools.dosonarapi openapi-test-tools - 1.3.0 + 1.2.1 junit From 1ca48a2d4cbd3622b243222c9cd5fb457fb6e844 Mon Sep 17 00:00:00 2001 From: Melsy Huamani Date: Mon, 18 May 2026 10:05:37 -0500 Subject: [PATCH 09/28] add oar048 documentation --- .../rules/openapi/operations/OAR048.html | 129 ++++++++++++++++++ .../rules/openapi/operations/OAR048.json | 13 ++ 2 files changed, 142 insertions(+) create mode 100644 src/main/resources/org/sonar/l10n/es/openapi/rules/openapi/operations/OAR048.html create mode 100644 src/main/resources/org/sonar/l10n/es/openapi/rules/openapi/operations/OAR048.json diff --git a/src/main/resources/org/sonar/l10n/es/openapi/rules/openapi/operations/OAR048.html b/src/main/resources/org/sonar/l10n/es/openapi/rules/openapi/operations/OAR048.html new file mode 100644 index 00000000..cfc3c741 --- /dev/null +++ b/src/main/resources/org/sonar/l10n/es/openapi/rules/openapi/operations/OAR048.html @@ -0,0 +1,129 @@ +

Solo puede haber como máximo un parámetro body en cada operación. Esta restricción aplica únicamente a OpenAPI 2.

+

Ejemplo de código no compatible (OpenAPI 2)

+

JSON

+
+{
+    "swagger": "2.0",
+    "info": {
+        "version": "1.0.0",
+        "title": "Swagger Petstore"
+    },
+    "paths": {
+        "/pets": {
+            "post": {
+                "parameters": [
+                    {
+                        "in": "body",
+                        "name": "someParam",
+                        "required": true,
+                        "schema": {
+                            "type": "string"
+                        }
+                    },
+                    {
+                        "in": "body",
+                        "name": "otherParam",
+                        "required": true,
+                        "schema": {
+                            "type": "string"
+                        }
+                    }
+                ],
+                "responses": {
+                    "default": {
+                        "description": "the default response"
+                    }
+                }
+            }
+        }
+    }
+}
+
+

YAML

+
+swagger: "2.0"
+info:
+  version: 1.0.0
+  title: Swagger Petstore
+paths:
+  /pets:
+    post:
+      parameters:
+      - in: body
+        name: someParam
+        required: true
+        schema:
+          type: string
+      - in: body
+        name: otherParam
+        required: true
+        schema:
+          type: string
+      responses:
+        default:
+          description: the default response
+
+

Solución compatible (OpenAPI 2)

+

JSON

+
+{
+    "swagger": "2.0",
+    "info": {
+        "version": "1.0.0",
+        "title": "Swagger Petstore"
+    },
+    "paths": {
+        "/pets": {
+            "post": {
+                "parameters": [
+                    {
+                        "in": "body",
+                        "name": "someParam",
+                        "required": true,
+                        "schema": {
+                            "type": "string"
+                        }
+                    },
+                    {
+                        "in": "query",
+                        "name": "otherParam",
+                        "required": true,
+                        "schema": {
+                            "type": "string"
+                        }
+                    }
+                ],
+                "responses": {
+                    "default": {
+                        "description": "the default response"
+                    }
+                }
+            }
+        }
+    }
+}
+
+

YAML

+
+swagger: "2.0"
+info:
+  version: 1.0.0
+  title: Swagger Petstore
+paths:
+  /pets:
+    post:
+      parameters:
+      - in: body
+        name: someParam
+        required: true
+        schema:
+          type: string
+      - in: query
+        name: otherParam
+        required: true
+        schema:
+          type: string
+      responses:
+        default:
+          description: the default response
+
diff --git a/src/main/resources/org/sonar/l10n/es/openapi/rules/openapi/operations/OAR048.json b/src/main/resources/org/sonar/l10n/es/openapi/rules/openapi/operations/OAR048.json new file mode 100644 index 00000000..a5f6b959 --- /dev/null +++ b/src/main/resources/org/sonar/l10n/es/openapi/rules/openapi/operations/OAR048.json @@ -0,0 +1,13 @@ +{ + "title": "OAR048 - AtMostOneBodyParameter - Las APIs deben definir como máximo un parámetro body.", + "type": "BUG", + "status": "ready", + "remediation": { + "func": "Constant\/Issue", + "constantCost": "30mn" + }, + "tags": [ + "operations" + ], + "defaultSeverity": "BLOCKER" +} From ae0a2485fe4df5d5278261a399fb7cd0e0622526 Mon Sep 17 00:00:00 2001 From: Melsy Huamani Date: Mon, 18 May 2026 09:36:41 -0500 Subject: [PATCH 10/28] fix: align OAR020, OAR021, OAR028, OAR051, OAR066 rules --- CHANGELOG.md | 10 ++++++ pom.xml | 8 ++--- .../AbstractSchemaNamingConventionCheck.java | 6 +++- .../AbstractQueryParameterCheck.java | 3 ++ .../OAR028FilterParameterCheck.java | 3 ++ .../OAR020ExpandParameterCheckTest.java | 17 ++++++++++ .../OAR021ExcludeParameterCheckTest.java | 17 ++++++++++ .../OAR028FilterParameterCheckTest.java | 17 ++++++++++ .../format/OAR051/different-description.json | 3 +- .../format/OAR051/different-description.yaml | 4 +-- .../v2/format/OAR066/snake-case-error.json | 20 +++++++++-- .../v2/format/OAR066/snake-case-error.yaml | 14 ++++++-- .../parameters/OAR020/expand-no-dollar.json | 26 ++++++++++++++ .../parameters/OAR020/expand-no-dollar.yaml | 16 +++++++++ .../parameters/OAR021/exclude-no-dollar.json | 26 ++++++++++++++ .../parameters/OAR021/exclude-no-dollar.yaml | 16 +++++++++ .../v2/parameters/OAR028/header-ignored.json | 30 ++++++++++++++++ .../v2/parameters/OAR028/header-ignored.yaml | 19 +++++++++++ .../format/OAR051/different-description.json | 3 +- .../format/OAR051/different-description.yaml | 4 +-- .../v3/format/OAR066/snake-case-error.json | 16 +++++++-- .../v3/format/OAR066/snake-case-error.yaml | 14 ++++++-- .../parameters/OAR020/expand-no-dollar.json | 28 +++++++++++++++ .../parameters/OAR020/expand-no-dollar.yaml | 17 ++++++++++ .../parameters/OAR021/exclude-no-dollar.json | 28 +++++++++++++++ .../parameters/OAR021/exclude-no-dollar.yaml | 17 ++++++++++ .../v3/parameters/OAR028/header-ignored.json | 34 +++++++++++++++++++ .../v3/parameters/OAR028/header-ignored.yaml | 21 ++++++++++++ .../format/OAR051/different-description.json | 3 +- .../format/OAR051/different-description.yaml | 4 +-- .../v31/format/OAR066/snake-case-error.json | 16 +++++++-- .../v31/format/OAR066/snake-case-error.yaml | 14 ++++++-- .../parameters/OAR020/expand-no-dollar.json | 28 +++++++++++++++ .../parameters/OAR020/expand-no-dollar.yaml | 17 ++++++++++ .../parameters/OAR021/exclude-no-dollar.json | 28 +++++++++++++++ .../parameters/OAR021/exclude-no-dollar.yaml | 17 ++++++++++ .../v31/parameters/OAR028/header-ignored.json | 34 +++++++++++++++++++ .../v31/parameters/OAR028/header-ignored.yaml | 21 ++++++++++++ .../format/OAR051/different-description.json | 3 +- .../format/OAR051/different-description.yaml | 4 +-- .../v32/format/OAR066/snake-case-error.json | 16 +++++++-- .../v32/format/OAR066/snake-case-error.yaml | 14 ++++++-- .../parameters/OAR020/expand-no-dollar.json | 28 +++++++++++++++ .../parameters/OAR020/expand-no-dollar.yaml | 17 ++++++++++ .../parameters/OAR021/exclude-no-dollar.json | 28 +++++++++++++++ .../parameters/OAR021/exclude-no-dollar.yaml | 17 ++++++++++ .../v32/parameters/OAR028/header-ignored.json | 34 +++++++++++++++++++ .../v32/parameters/OAR028/header-ignored.yaml | 21 ++++++++++++ 48 files changed, 768 insertions(+), 33 deletions(-) create mode 100644 src/test/resources/checks/v2/parameters/OAR020/expand-no-dollar.json create mode 100644 src/test/resources/checks/v2/parameters/OAR020/expand-no-dollar.yaml create mode 100644 src/test/resources/checks/v2/parameters/OAR021/exclude-no-dollar.json create mode 100644 src/test/resources/checks/v2/parameters/OAR021/exclude-no-dollar.yaml create mode 100644 src/test/resources/checks/v2/parameters/OAR028/header-ignored.json create mode 100644 src/test/resources/checks/v2/parameters/OAR028/header-ignored.yaml create mode 100644 src/test/resources/checks/v3/parameters/OAR020/expand-no-dollar.json create mode 100644 src/test/resources/checks/v3/parameters/OAR020/expand-no-dollar.yaml create mode 100644 src/test/resources/checks/v3/parameters/OAR021/exclude-no-dollar.json create mode 100644 src/test/resources/checks/v3/parameters/OAR021/exclude-no-dollar.yaml create mode 100644 src/test/resources/checks/v3/parameters/OAR028/header-ignored.json create mode 100644 src/test/resources/checks/v3/parameters/OAR028/header-ignored.yaml create mode 100644 src/test/resources/checks/v31/parameters/OAR020/expand-no-dollar.json create mode 100644 src/test/resources/checks/v31/parameters/OAR020/expand-no-dollar.yaml create mode 100644 src/test/resources/checks/v31/parameters/OAR021/exclude-no-dollar.json create mode 100644 src/test/resources/checks/v31/parameters/OAR021/exclude-no-dollar.yaml create mode 100644 src/test/resources/checks/v31/parameters/OAR028/header-ignored.json create mode 100644 src/test/resources/checks/v31/parameters/OAR028/header-ignored.yaml create mode 100644 src/test/resources/checks/v32/parameters/OAR020/expand-no-dollar.json create mode 100644 src/test/resources/checks/v32/parameters/OAR020/expand-no-dollar.yaml create mode 100644 src/test/resources/checks/v32/parameters/OAR021/exclude-no-dollar.json create mode 100644 src/test/resources/checks/v32/parameters/OAR021/exclude-no-dollar.yaml create mode 100644 src/test/resources/checks/v32/parameters/OAR028/header-ignored.json create mode 100644 src/test/resources/checks/v32/parameters/OAR028/header-ignored.yaml diff --git a/CHANGELOG.md b/CHANGELOG.md index 23699282..b2732758 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,16 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [1.4.1] - 2024-05-18 + +### Fixed + +- OAR020 - ExpandParameterCheck: rule now explicitly requires `$expand` (with `$` prefix) as the query parameter name, rejecting `expand` without prefix, aligning with Spectral behavior. +- OAR021 - ExcludeParameterCheck: rule now explicitly requires `$exclude` (with `$` prefix) as the query parameter name, rejecting `exclude` without prefix, aligning with Spectral behavior. +- OAR028 - FilterParameterCheck: rule now only evaluates `query` parameters; header, path and cookie parameters are ignored, aligning with Spectral behavior. +- OAR051 - DescriptionDiffersSummaryCheck: rule now evaluates all HTTP methods (GET, POST, PUT, PATCH, DELETE), not only GET, aligning with Spectral behavior. +- OAR066 - SnakeCaseNamingConventionCheck: rule now recursively validates nested schema property names at all depth levels, aligning with Spectral behavior. + ## [1.4.0] - 2024-05-06 ## Changed diff --git a/pom.xml b/pom.xml index 39d77e8c..a540fdb9 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 org.apiaddicts.apitools.dosonarapi sonaropenapi-rules-community - 1.4.0 + 1.4.1 sonar-plugin SonarQube OpenAPI Community Rules @@ -64,7 +64,7 @@ 8.7.0.41497 6.7 - 1.2.0 + 1.2.1 1.22.0.848 20220320 4.13.2 @@ -91,7 +91,7 @@ org.apiaddicts.apitools.dosonarapi openapi-front-end - 1.2.0 + 1.2.1 org.sonarsource.sonarqube @@ -125,7 +125,7 @@ org.apiaddicts.apitools.dosonarapi openapi-test-tools - 1.2.0 + 1.2.1 junit diff --git a/src/main/java/apiaddicts/sonar/openapi/checks/format/AbstractSchemaNamingConventionCheck.java b/src/main/java/apiaddicts/sonar/openapi/checks/format/AbstractSchemaNamingConventionCheck.java index dbc25a3c..8b527c02 100644 --- a/src/main/java/apiaddicts/sonar/openapi/checks/format/AbstractSchemaNamingConventionCheck.java +++ b/src/main/java/apiaddicts/sonar/openapi/checks/format/AbstractSchemaNamingConventionCheck.java @@ -108,6 +108,7 @@ private void visitSchemaNode(JsonNode schemaNode) { JsonNode nameNode = property.key(); String name = nameNode.getTokenValue(); validateNamingConvention(name, nameNode); + visitSchemaNode(property); } } } @@ -145,7 +146,10 @@ private void visitSchemaNode2(JsonNode responseOrMediaTypeNode) { JsonNode propsNode = schemaResolved.get(PROPERTIES); if (!propsNode.isMissing() && propsNode.isObject()) { propsNode.propertyMap() - .forEach((name, property) -> validateNamingConvention(name, handleExternalRef.getTrueNode(property.key()))); + .forEach((name, property) -> { + validateNamingConvention(name, handleExternalRef.getTrueNode(property.key())); + visitSchemaNode(property); + }); } }); } diff --git a/src/main/java/apiaddicts/sonar/openapi/checks/parameters/AbstractQueryParameterCheck.java b/src/main/java/apiaddicts/sonar/openapi/checks/parameters/AbstractQueryParameterCheck.java index 7d808a63..9bf995c2 100644 --- a/src/main/java/apiaddicts/sonar/openapi/checks/parameters/AbstractQueryParameterCheck.java +++ b/src/main/java/apiaddicts/sonar/openapi/checks/parameters/AbstractQueryParameterCheck.java @@ -142,6 +142,9 @@ protected String getPath(JsonNode node) { } protected boolean shouldIncludePath(String path) { + if (paths.isEmpty()) { + return pathCheckStrategy.equals(PATH_STRATEGY_EXCLUDE); + } if (pathCheckStrategy.equals(PATH_STRATEGY_EXCLUDE)) { return !paths.contains(path); } else if (pathCheckStrategy.equals(PATH_STRATEGY_INCLUDE)) { diff --git a/src/main/java/apiaddicts/sonar/openapi/checks/parameters/OAR028FilterParameterCheck.java b/src/main/java/apiaddicts/sonar/openapi/checks/parameters/OAR028FilterParameterCheck.java index d839d3e2..9ddd2738 100644 --- a/src/main/java/apiaddicts/sonar/openapi/checks/parameters/OAR028FilterParameterCheck.java +++ b/src/main/java/apiaddicts/sonar/openapi/checks/parameters/OAR028FilterParameterCheck.java @@ -75,6 +75,9 @@ public void visitParameterNode(JsonNode node) { JsonNode nameNode = node.get("name"); if (inNode != null && nameNode != null) { + if (!"query".equals(inNode.getTokenValue())) { + return; + } String path = getPath(node); if (shouldExcludePath(path) && !parameterName.equals(nameNode.getTokenValue())) { addIssue(KEY, translate(MESSAGE, parameterName), nameNode); diff --git a/src/test/java/apiaddicts/sonar/openapi/checks/parameters/OAR020ExpandParameterCheckTest.java b/src/test/java/apiaddicts/sonar/openapi/checks/parameters/OAR020ExpandParameterCheckTest.java index 1b40fb88..9b3b6ae7 100644 --- a/src/test/java/apiaddicts/sonar/openapi/checks/parameters/OAR020ExpandParameterCheckTest.java +++ b/src/test/java/apiaddicts/sonar/openapi/checks/parameters/OAR020ExpandParameterCheckTest.java @@ -109,6 +109,23 @@ public void verifyInV32PathEndingWithParam() { verifyV32("with-param"); } + @Test + public void verifyInV2ExpandNoDollar() { + verifyV2("expand-no-dollar"); + } + @Test + public void verifyInV3ExpandNoDollar() { + verifyV3("expand-no-dollar"); + } + @Test + public void verifyInV31ExpandNoDollar() { + verifyV31("expand-no-dollar"); + } + @Test + public void verifyInV32ExpandNoDollar() { + verifyV32("expand-no-dollar"); + } + @Override public void verifyRule() { assertRuleProperties("OAR020 - ExpandParameter - the chosen parameter must be defined in this operation", RuleType.BUG, Severity.MINOR, tags("parameters")); diff --git a/src/test/java/apiaddicts/sonar/openapi/checks/parameters/OAR021ExcludeParameterCheckTest.java b/src/test/java/apiaddicts/sonar/openapi/checks/parameters/OAR021ExcludeParameterCheckTest.java index b3a8a653..fb7047e4 100644 --- a/src/test/java/apiaddicts/sonar/openapi/checks/parameters/OAR021ExcludeParameterCheckTest.java +++ b/src/test/java/apiaddicts/sonar/openapi/checks/parameters/OAR021ExcludeParameterCheckTest.java @@ -109,6 +109,23 @@ public void verifyInV32PathEndingWithParam() { verifyV32("with-param"); } + @Test + public void verifyInV2ExcludeNoDollar() { + verifyV2("exclude-no-dollar"); + } + @Test + public void verifyInV3ExcludeNoDollar() { + verifyV3("exclude-no-dollar"); + } + @Test + public void verifyInV31ExcludeNoDollar() { + verifyV31("exclude-no-dollar"); + } + @Test + public void verifyInV32ExcludeNoDollar() { + verifyV32("exclude-no-dollar"); + } + @Override public void verifyRule() { assertRuleProperties("OAR021 - ExcludeParameter - the chosen parameter must be defined in this operation", RuleType.BUG, Severity.MINOR, tags("parameters")); diff --git a/src/test/java/apiaddicts/sonar/openapi/checks/parameters/OAR028FilterParameterCheckTest.java b/src/test/java/apiaddicts/sonar/openapi/checks/parameters/OAR028FilterParameterCheckTest.java index 9fdee131..c37d4ca8 100644 --- a/src/test/java/apiaddicts/sonar/openapi/checks/parameters/OAR028FilterParameterCheckTest.java +++ b/src/test/java/apiaddicts/sonar/openapi/checks/parameters/OAR028FilterParameterCheckTest.java @@ -143,6 +143,23 @@ public void verifyInV32ComponentsParam() { verifyV32("components-param"); } + @Test + public void verifyInV2HeaderIgnored() { + verifyV2("header-ignored"); + } + @Test + public void verifyInV3HeaderIgnored() { + verifyV3("header-ignored"); + } + @Test + public void verifyInV31HeaderIgnored() { + verifyV31("header-ignored"); + } + @Test + public void verifyInV32HeaderIgnored() { + verifyV32("header-ignored"); + } + private void setField(String name, String value) { try { java.lang.reflect.Field f = OAR028FilterParameterCheck.class.getDeclaredField(name); diff --git a/src/test/resources/checks/v2/format/OAR051/different-description.json b/src/test/resources/checks/v2/format/OAR051/different-description.json index 7b5a5306..82c54c22 100644 --- a/src/test/resources/checks/v2/format/OAR051/different-description.json +++ b/src/test/resources/checks/v2/format/OAR051/different-description.json @@ -8,7 +8,8 @@ "/pets" : { "post" : { "summary" : "create a pet", - "description" : "Create a new pet. The pet type is assigned a new unique ID, and can then be referenced in other operations.", + # Noncompliant@+1 {{OAR051: Description must differ from summary}} + "description" : "Create a pet", "responses" : { "default" : { "description" : "the default response" diff --git a/src/test/resources/checks/v2/format/OAR051/different-description.yaml b/src/test/resources/checks/v2/format/OAR051/different-description.yaml index 3cb9810d..03a4f52e 100644 --- a/src/test/resources/checks/v2/format/OAR051/different-description.yaml +++ b/src/test/resources/checks/v2/format/OAR051/different-description.yaml @@ -6,8 +6,8 @@ paths: /pets: post: summary: create a pet - description: Create a new pet. The pet type is assigned a new unique ID, and can then be referenced in other - operations. + # Noncompliant@+1 {{OAR051: Description must differ from summary}} + description: Create a pet responses: default: description: the default response diff --git a/src/test/resources/checks/v2/format/OAR066/snake-case-error.json b/src/test/resources/checks/v2/format/OAR066/snake-case-error.json index 9164a423..1dff8698 100644 --- a/src/test/resources/checks/v2/format/OAR066/snake-case-error.json +++ b/src/test/resources/checks/v2/format/OAR066/snake-case-error.json @@ -19,7 +19,15 @@ "type": "string" }, "last_name": { - "type": "string" + "type": "object", + "properties": { + "streetName": { # Noncompliant {{OAR066: RequestBody and Responses schema property names must be compliant with the snake_case naming convention}} + "type": "string" + }, + "street_name": { + "type": "string" + } + } } } } @@ -35,7 +43,15 @@ "type": "integer" }, "user_name": { - "type": "string" + "type": "object", + "properties": { + "userId": { # Noncompliant {{OAR066: RequestBody and Responses schema property names must be compliant with the snake_case naming convention}} + "type": "integer" + }, + "user_id": { + "type": "integer" + } + } } } } diff --git a/src/test/resources/checks/v2/format/OAR066/snake-case-error.yaml b/src/test/resources/checks/v2/format/OAR066/snake-case-error.yaml index b3142268..9dbeb577 100644 --- a/src/test/resources/checks/v2/format/OAR066/snake-case-error.yaml +++ b/src/test/resources/checks/v2/format/OAR066/snake-case-error.yaml @@ -15,7 +15,12 @@ paths: firstName: # Noncompliant {{OAR066: RequestBody and Responses schema property names must be compliant with the snake_case naming convention}} type: string last_name: - type: string + type: object + properties: + streetName: # Noncompliant {{OAR066: RequestBody and Responses schema property names must be compliant with the snake_case naming convention}} + type: string + street_name: + type: string responses: '200': description: Success @@ -25,4 +30,9 @@ paths: userId: # Noncompliant {{OAR066: RequestBody and Responses schema property names must be compliant with the snake_case naming convention}} type: integer user_name: - type: string \ No newline at end of file + type: object + properties: + userId: # Noncompliant {{OAR066: RequestBody and Responses schema property names must be compliant with the snake_case naming convention}} + type: integer + user_id: + type: integer \ No newline at end of file diff --git a/src/test/resources/checks/v2/parameters/OAR020/expand-no-dollar.json b/src/test/resources/checks/v2/parameters/OAR020/expand-no-dollar.json new file mode 100644 index 00000000..42b242d0 --- /dev/null +++ b/src/test/resources/checks/v2/parameters/OAR020/expand-no-dollar.json @@ -0,0 +1,26 @@ +{ + "swagger" : "2.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/examples" : { + "get" : { # Noncompliant {{OAR020: $expand must be defined as a parameter in this operation}} + "parameters" : [ { + "in" : "query", + "name" : "expand", + "type" : "array", + "items" : { + "type" : "string" + } + } ], + "responses" : { + "206" : { + "description" : "Ok" + } + } + } + } + } +} diff --git a/src/test/resources/checks/v2/parameters/OAR020/expand-no-dollar.yaml b/src/test/resources/checks/v2/parameters/OAR020/expand-no-dollar.yaml new file mode 100644 index 00000000..b40045e0 --- /dev/null +++ b/src/test/resources/checks/v2/parameters/OAR020/expand-no-dollar.yaml @@ -0,0 +1,16 @@ +swagger: "2.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /examples: + get: # Noncompliant {{OAR020: $expand must be defined as a parameter in this operation}} + parameters: + - in: query + name: expand + type: array + items: + type: string + responses: + 206: + description: Ok diff --git a/src/test/resources/checks/v2/parameters/OAR021/exclude-no-dollar.json b/src/test/resources/checks/v2/parameters/OAR021/exclude-no-dollar.json new file mode 100644 index 00000000..2306e767 --- /dev/null +++ b/src/test/resources/checks/v2/parameters/OAR021/exclude-no-dollar.json @@ -0,0 +1,26 @@ +{ + "swagger" : "2.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/examples" : { + "get" : { # Noncompliant {{OAR021: $exclude must be defined as a parameter in this operation}} + "parameters" : [ { + "in" : "query", + "name" : "exclude", + "type" : "array", + "items" : { + "type" : "string" + } + } ], + "responses" : { + "206" : { + "description" : "Ok" + } + } + } + } + } +} diff --git a/src/test/resources/checks/v2/parameters/OAR021/exclude-no-dollar.yaml b/src/test/resources/checks/v2/parameters/OAR021/exclude-no-dollar.yaml new file mode 100644 index 00000000..b222ea24 --- /dev/null +++ b/src/test/resources/checks/v2/parameters/OAR021/exclude-no-dollar.yaml @@ -0,0 +1,16 @@ +swagger: "2.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /examples: + get: # Noncompliant {{OAR021: $exclude must be defined as a parameter in this operation}} + parameters: + - in: query + name: exclude + type: array + items: + type: string + responses: + 206: + description: Ok diff --git a/src/test/resources/checks/v2/parameters/OAR028/header-ignored.json b/src/test/resources/checks/v2/parameters/OAR028/header-ignored.json new file mode 100644 index 00000000..95fc1e97 --- /dev/null +++ b/src/test/resources/checks/v2/parameters/OAR028/header-ignored.json @@ -0,0 +1,30 @@ +{ + "swagger" : "2.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/examples" : { + "get" : { + "parameters" : [ { + "in" : "header", + "name" : "Authorization", + "type" : "string" + }, { + "in" : "query", + "name" : "$filter", + "type" : "array", + "items" : { + "type" : "string" + } + } ], + "responses" : { + "206" : { + "description" : "Ok" + } + } + } + } + } +} diff --git a/src/test/resources/checks/v2/parameters/OAR028/header-ignored.yaml b/src/test/resources/checks/v2/parameters/OAR028/header-ignored.yaml new file mode 100644 index 00000000..7ec8978e --- /dev/null +++ b/src/test/resources/checks/v2/parameters/OAR028/header-ignored.yaml @@ -0,0 +1,19 @@ +swagger: "2.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /examples: + get: + parameters: + - in: header + name: Authorization + type: string + - in: query + name: $filter + type: array + items: + type: string + responses: + 206: + description: Ok diff --git a/src/test/resources/checks/v3/format/OAR051/different-description.json b/src/test/resources/checks/v3/format/OAR051/different-description.json index 784c6b8b..2c1e4b1e 100644 --- a/src/test/resources/checks/v3/format/OAR051/different-description.json +++ b/src/test/resources/checks/v3/format/OAR051/different-description.json @@ -8,7 +8,8 @@ "/pets" : { "post" : { "summary" : "create a pet", - "description" : "Create a new pet. The pet type is assigned a new unique ID, and can then be referenced in other operations.", + # Noncompliant@+1 {{OAR051: Description must differ from summary}} + "description" : "Create a pet", "responses" : { "default" : { "description" : "the default response" diff --git a/src/test/resources/checks/v3/format/OAR051/different-description.yaml b/src/test/resources/checks/v3/format/OAR051/different-description.yaml index 600efaff..33a87e0d 100644 --- a/src/test/resources/checks/v3/format/OAR051/different-description.yaml +++ b/src/test/resources/checks/v3/format/OAR051/different-description.yaml @@ -6,8 +6,8 @@ paths: /pets: post: summary: create a pet - description: Create a new pet. The pet type is assigned a new unique ID, and can then be referenced in other - operations. + # Noncompliant@+1 {{OAR051: Description must differ from summary}} + description: Create a pet responses: default: description: the default response diff --git a/src/test/resources/checks/v3/format/OAR066/snake-case-error.json b/src/test/resources/checks/v3/format/OAR066/snake-case-error.json index 5362c7f2..38d6d4af 100644 --- a/src/test/resources/checks/v3/format/OAR066/snake-case-error.json +++ b/src/test/resources/checks/v3/format/OAR066/snake-case-error.json @@ -14,7 +14,13 @@ "type": "object", "properties": { "firstName": { "type": "string" }, # Noncompliant {{OAR066: RequestBody and Responses schema property names must be compliant with the snake_case naming convention}} - "last_name": { "type": "string" } + "last_name": { + "type": "object", + "properties": { + "streetName": { "type": "string" }, # Noncompliant {{OAR066: RequestBody and Responses schema property names must be compliant with the snake_case naming convention}} + "street_name": { "type": "string" } + } + } } } } @@ -29,7 +35,13 @@ "type": "object", "properties": { "userID": { "type": "integer" }, # Noncompliant {{OAR066: RequestBody and Responses schema property names must be compliant with the snake_case naming convention}} - "user_name": { "type": "string" } + "user_name": { + "type": "object", + "properties": { + "userId": { "type": "integer" }, # Noncompliant {{OAR066: RequestBody and Responses schema property names must be compliant with the snake_case naming convention}} + "user_id": { "type": "integer" } + } + } } } } diff --git a/src/test/resources/checks/v3/format/OAR066/snake-case-error.yaml b/src/test/resources/checks/v3/format/OAR066/snake-case-error.yaml index 6bf327fb..089ff7b5 100644 --- a/src/test/resources/checks/v3/format/OAR066/snake-case-error.yaml +++ b/src/test/resources/checks/v3/format/OAR066/snake-case-error.yaml @@ -14,7 +14,12 @@ paths: firstName: # Noncompliant {{OAR066: RequestBody and Responses schema property names must be compliant with the snake_case naming convention}} type: string last_name: - type: string + type: object + properties: + streetName: # Noncompliant {{OAR066: RequestBody and Responses schema property names must be compliant with the snake_case naming convention}} + type: string + street_name: + type: string responses: '200': description: Success @@ -26,4 +31,9 @@ paths: userID: # Noncompliant {{OAR066: RequestBody and Responses schema property names must be compliant with the snake_case naming convention}} type: integer user_name: - type: string \ No newline at end of file + type: object + properties: + userId: # Noncompliant {{OAR066: RequestBody and Responses schema property names must be compliant with the snake_case naming convention}} + type: integer + user_id: + type: integer \ No newline at end of file diff --git a/src/test/resources/checks/v3/parameters/OAR020/expand-no-dollar.json b/src/test/resources/checks/v3/parameters/OAR020/expand-no-dollar.json new file mode 100644 index 00000000..9c39cc06 --- /dev/null +++ b/src/test/resources/checks/v3/parameters/OAR020/expand-no-dollar.json @@ -0,0 +1,28 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/examples" : { + "get" : { # Noncompliant {{OAR020: $expand must be defined as a parameter in this operation}} + "parameters" : [ { + "in" : "query", + "name" : "expand", + "schema" : { + "type" : "array", + "items" : { + "type" : "string" + } + } + } ], + "responses" : { + "206" : { + "description" : "Ok" + } + } + } + } + } +} diff --git a/src/test/resources/checks/v3/parameters/OAR020/expand-no-dollar.yaml b/src/test/resources/checks/v3/parameters/OAR020/expand-no-dollar.yaml new file mode 100644 index 00000000..a15bae06 --- /dev/null +++ b/src/test/resources/checks/v3/parameters/OAR020/expand-no-dollar.yaml @@ -0,0 +1,17 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /examples: + get: # Noncompliant {{OAR020: $expand must be defined as a parameter in this operation}} + parameters: + - in: query + name: expand + schema: + type: array + items: + type: string + responses: + 206: + description: Ok diff --git a/src/test/resources/checks/v3/parameters/OAR021/exclude-no-dollar.json b/src/test/resources/checks/v3/parameters/OAR021/exclude-no-dollar.json new file mode 100644 index 00000000..33a8e94d --- /dev/null +++ b/src/test/resources/checks/v3/parameters/OAR021/exclude-no-dollar.json @@ -0,0 +1,28 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/examples" : { + "get" : { # Noncompliant {{OAR021: $exclude must be defined as a parameter in this operation}} + "parameters" : [ { + "in" : "query", + "name" : "exclude", + "schema" : { + "type" : "array", + "items" : { + "type" : "string" + } + } + } ], + "responses" : { + "206" : { + "description" : "Ok" + } + } + } + } + } +} diff --git a/src/test/resources/checks/v3/parameters/OAR021/exclude-no-dollar.yaml b/src/test/resources/checks/v3/parameters/OAR021/exclude-no-dollar.yaml new file mode 100644 index 00000000..cda8d1ad --- /dev/null +++ b/src/test/resources/checks/v3/parameters/OAR021/exclude-no-dollar.yaml @@ -0,0 +1,17 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /examples: + get: # Noncompliant {{OAR021: $exclude must be defined as a parameter in this operation}} + parameters: + - in: query + name: exclude + schema: + type: array + items: + type: string + responses: + 206: + description: Ok diff --git a/src/test/resources/checks/v3/parameters/OAR028/header-ignored.json b/src/test/resources/checks/v3/parameters/OAR028/header-ignored.json new file mode 100644 index 00000000..e981b6e3 --- /dev/null +++ b/src/test/resources/checks/v3/parameters/OAR028/header-ignored.json @@ -0,0 +1,34 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/examples" : { + "get" : { + "parameters" : [ { + "in" : "header", + "name" : "Authorization", + "schema" : { + "type" : "string" + } + }, { + "in" : "query", + "name" : "$filter", + "schema" : { + "type" : "array", + "items" : { + "type" : "string" + } + } + } ], + "responses" : { + "206" : { + "description" : "Ok" + } + } + } + } + } +} diff --git a/src/test/resources/checks/v3/parameters/OAR028/header-ignored.yaml b/src/test/resources/checks/v3/parameters/OAR028/header-ignored.yaml new file mode 100644 index 00000000..eebe9721 --- /dev/null +++ b/src/test/resources/checks/v3/parameters/OAR028/header-ignored.yaml @@ -0,0 +1,21 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /examples: + get: + parameters: + - in: header + name: Authorization + schema: + type: string + - in: query + name: $filter + schema: + type: array + items: + type: string + responses: + 206: + description: Ok diff --git a/src/test/resources/checks/v31/format/OAR051/different-description.json b/src/test/resources/checks/v31/format/OAR051/different-description.json index 976500ed..e86c1152 100644 --- a/src/test/resources/checks/v31/format/OAR051/different-description.json +++ b/src/test/resources/checks/v31/format/OAR051/different-description.json @@ -8,7 +8,8 @@ "/pets" : { "post" : { "summary" : "create a pet", - "description" : "Create a new pet. The pet type is assigned a new unique ID, and can then be referenced in other operations.", + # Noncompliant@+1 {{OAR051: Description must differ from summary}} + "description" : "Create a pet", "responses" : { "default" : { "description" : "the default response" diff --git a/src/test/resources/checks/v31/format/OAR051/different-description.yaml b/src/test/resources/checks/v31/format/OAR051/different-description.yaml index cb97cd8f..ab7d7f43 100644 --- a/src/test/resources/checks/v31/format/OAR051/different-description.yaml +++ b/src/test/resources/checks/v31/format/OAR051/different-description.yaml @@ -6,8 +6,8 @@ paths: /pets: post: summary: create a pet - description: Create a new pet. The pet type is assigned a new unique ID, and can then be referenced in other - operations. + # Noncompliant@+1 {{OAR051: Description must differ from summary}} + description: Create a pet responses: default: description: the default response diff --git a/src/test/resources/checks/v31/format/OAR066/snake-case-error.json b/src/test/resources/checks/v31/format/OAR066/snake-case-error.json index e30a89b5..6e141341 100644 --- a/src/test/resources/checks/v31/format/OAR066/snake-case-error.json +++ b/src/test/resources/checks/v31/format/OAR066/snake-case-error.json @@ -14,7 +14,13 @@ "type": "object", "properties": { "firstName": { "type": "string" }, # Noncompliant {{OAR066: RequestBody and Responses schema property names must be compliant with the snake_case naming convention}} - "last_name": { "type": "string" } + "last_name": { + "type": "object", + "properties": { + "streetName": { "type": "string" }, # Noncompliant {{OAR066: RequestBody and Responses schema property names must be compliant with the snake_case naming convention}} + "street_name": { "type": "string" } + } + } } } } @@ -29,7 +35,13 @@ "type": "object", "properties": { "userID": { "type": "integer" }, # Noncompliant {{OAR066: RequestBody and Responses schema property names must be compliant with the snake_case naming convention}} - "user_name": { "type": "string" } + "user_name": { + "type": "object", + "properties": { + "userId": { "type": "integer" }, # Noncompliant {{OAR066: RequestBody and Responses schema property names must be compliant with the snake_case naming convention}} + "user_id": { "type": "integer" } + } + } } } } diff --git a/src/test/resources/checks/v31/format/OAR066/snake-case-error.yaml b/src/test/resources/checks/v31/format/OAR066/snake-case-error.yaml index 90474029..6abbf89b 100644 --- a/src/test/resources/checks/v31/format/OAR066/snake-case-error.yaml +++ b/src/test/resources/checks/v31/format/OAR066/snake-case-error.yaml @@ -14,7 +14,12 @@ paths: firstName: # Noncompliant {{OAR066: RequestBody and Responses schema property names must be compliant with the snake_case naming convention}} type: string last_name: - type: string + type: object + properties: + streetName: # Noncompliant {{OAR066: RequestBody and Responses schema property names must be compliant with the snake_case naming convention}} + type: string + street_name: + type: string responses: '200': description: Success @@ -26,4 +31,9 @@ paths: userID: # Noncompliant {{OAR066: RequestBody and Responses schema property names must be compliant with the snake_case naming convention}} type: integer user_name: - type: string \ No newline at end of file + type: object + properties: + userId: # Noncompliant {{OAR066: RequestBody and Responses schema property names must be compliant with the snake_case naming convention}} + type: integer + user_id: + type: integer \ No newline at end of file diff --git a/src/test/resources/checks/v31/parameters/OAR020/expand-no-dollar.json b/src/test/resources/checks/v31/parameters/OAR020/expand-no-dollar.json new file mode 100644 index 00000000..ae97bec9 --- /dev/null +++ b/src/test/resources/checks/v31/parameters/OAR020/expand-no-dollar.json @@ -0,0 +1,28 @@ +{ + "openapi" : "3.1.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/examples" : { + "get" : { # Noncompliant {{OAR020: $expand must be defined as a parameter in this operation}} + "parameters" : [ { + "in" : "query", + "name" : "expand", + "schema" : { + "type" : "array", + "items" : { + "type" : "string" + } + } + } ], + "responses" : { + "206" : { + "description" : "Ok" + } + } + } + } + } +} diff --git a/src/test/resources/checks/v31/parameters/OAR020/expand-no-dollar.yaml b/src/test/resources/checks/v31/parameters/OAR020/expand-no-dollar.yaml new file mode 100644 index 00000000..1d91fe46 --- /dev/null +++ b/src/test/resources/checks/v31/parameters/OAR020/expand-no-dollar.yaml @@ -0,0 +1,17 @@ +openapi: "3.1.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /examples: + get: # Noncompliant {{OAR020: $expand must be defined as a parameter in this operation}} + parameters: + - in: query + name: expand + schema: + type: array + items: + type: string + responses: + 206: + description: Ok diff --git a/src/test/resources/checks/v31/parameters/OAR021/exclude-no-dollar.json b/src/test/resources/checks/v31/parameters/OAR021/exclude-no-dollar.json new file mode 100644 index 00000000..52d848b5 --- /dev/null +++ b/src/test/resources/checks/v31/parameters/OAR021/exclude-no-dollar.json @@ -0,0 +1,28 @@ +{ + "openapi" : "3.1.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/examples" : { + "get" : { # Noncompliant {{OAR021: $exclude must be defined as a parameter in this operation}} + "parameters" : [ { + "in" : "query", + "name" : "exclude", + "schema" : { + "type" : "array", + "items" : { + "type" : "string" + } + } + } ], + "responses" : { + "206" : { + "description" : "Ok" + } + } + } + } + } +} diff --git a/src/test/resources/checks/v31/parameters/OAR021/exclude-no-dollar.yaml b/src/test/resources/checks/v31/parameters/OAR021/exclude-no-dollar.yaml new file mode 100644 index 00000000..0a3b5a2c --- /dev/null +++ b/src/test/resources/checks/v31/parameters/OAR021/exclude-no-dollar.yaml @@ -0,0 +1,17 @@ +openapi: "3.1.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /examples: + get: # Noncompliant {{OAR021: $exclude must be defined as a parameter in this operation}} + parameters: + - in: query + name: exclude + schema: + type: array + items: + type: string + responses: + 206: + description: Ok diff --git a/src/test/resources/checks/v31/parameters/OAR028/header-ignored.json b/src/test/resources/checks/v31/parameters/OAR028/header-ignored.json new file mode 100644 index 00000000..4f115962 --- /dev/null +++ b/src/test/resources/checks/v31/parameters/OAR028/header-ignored.json @@ -0,0 +1,34 @@ +{ + "openapi" : "3.1.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/examples" : { + "get" : { + "parameters" : [ { + "in" : "header", + "name" : "Authorization", + "schema" : { + "type" : "string" + } + }, { + "in" : "query", + "name" : "$filter", + "schema" : { + "type" : "array", + "items" : { + "type" : "string" + } + } + } ], + "responses" : { + "206" : { + "description" : "Ok" + } + } + } + } + } +} diff --git a/src/test/resources/checks/v31/parameters/OAR028/header-ignored.yaml b/src/test/resources/checks/v31/parameters/OAR028/header-ignored.yaml new file mode 100644 index 00000000..21d22719 --- /dev/null +++ b/src/test/resources/checks/v31/parameters/OAR028/header-ignored.yaml @@ -0,0 +1,21 @@ +openapi: "3.1.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /examples: + get: + parameters: + - in: header + name: Authorization + schema: + type: string + - in: query + name: $filter + schema: + type: array + items: + type: string + responses: + 206: + description: Ok diff --git a/src/test/resources/checks/v32/format/OAR051/different-description.json b/src/test/resources/checks/v32/format/OAR051/different-description.json index 652c891f..39b7066d 100644 --- a/src/test/resources/checks/v32/format/OAR051/different-description.json +++ b/src/test/resources/checks/v32/format/OAR051/different-description.json @@ -8,7 +8,8 @@ "/pets" : { "post" : { "summary" : "create a pet", - "description" : "Create a new pet. The pet type is assigned a new unique ID, and can then be referenced in other operations.", + # Noncompliant@+1 {{OAR051: Description must differ from summary}} + "description" : "Create a pet", "responses" : { "default" : { "description" : "the default response" diff --git a/src/test/resources/checks/v32/format/OAR051/different-description.yaml b/src/test/resources/checks/v32/format/OAR051/different-description.yaml index 645dfc1f..726898c9 100644 --- a/src/test/resources/checks/v32/format/OAR051/different-description.yaml +++ b/src/test/resources/checks/v32/format/OAR051/different-description.yaml @@ -6,8 +6,8 @@ paths: /pets: post: summary: create a pet - description: Create a new pet. The pet type is assigned a new unique ID, and can then be referenced in other - operations. + # Noncompliant@+1 {{OAR051: Description must differ from summary}} + description: Create a pet responses: default: description: the default response diff --git a/src/test/resources/checks/v32/format/OAR066/snake-case-error.json b/src/test/resources/checks/v32/format/OAR066/snake-case-error.json index efc8ce35..8858ab1a 100644 --- a/src/test/resources/checks/v32/format/OAR066/snake-case-error.json +++ b/src/test/resources/checks/v32/format/OAR066/snake-case-error.json @@ -14,7 +14,13 @@ "type": "object", "properties": { "firstName": { "type": "string" }, # Noncompliant {{OAR066: RequestBody and Responses schema property names must be compliant with the snake_case naming convention}} - "last_name": { "type": "string" } + "last_name": { + "type": "object", + "properties": { + "streetName": { "type": "string" }, # Noncompliant {{OAR066: RequestBody and Responses schema property names must be compliant with the snake_case naming convention}} + "street_name": { "type": "string" } + } + } } } } @@ -29,7 +35,13 @@ "type": "object", "properties": { "userID": { "type": "integer" }, # Noncompliant {{OAR066: RequestBody and Responses schema property names must be compliant with the snake_case naming convention}} - "user_name": { "type": "string" } + "user_name": { + "type": "object", + "properties": { + "userId": { "type": "integer" }, # Noncompliant {{OAR066: RequestBody and Responses schema property names must be compliant with the snake_case naming convention}} + "user_id": { "type": "integer" } + } + } } } } diff --git a/src/test/resources/checks/v32/format/OAR066/snake-case-error.yaml b/src/test/resources/checks/v32/format/OAR066/snake-case-error.yaml index aa7017af..0d90ec7c 100644 --- a/src/test/resources/checks/v32/format/OAR066/snake-case-error.yaml +++ b/src/test/resources/checks/v32/format/OAR066/snake-case-error.yaml @@ -14,7 +14,12 @@ paths: firstName: # Noncompliant {{OAR066: RequestBody and Responses schema property names must be compliant with the snake_case naming convention}} type: string last_name: - type: string + type: object + properties: + streetName: # Noncompliant {{OAR066: RequestBody and Responses schema property names must be compliant with the snake_case naming convention}} + type: string + street_name: + type: string responses: '200': description: Success @@ -26,4 +31,9 @@ paths: userID: # Noncompliant {{OAR066: RequestBody and Responses schema property names must be compliant with the snake_case naming convention}} type: integer user_name: - type: string \ No newline at end of file + type: object + properties: + userId: # Noncompliant {{OAR066: RequestBody and Responses schema property names must be compliant with the snake_case naming convention}} + type: integer + user_id: + type: integer \ No newline at end of file diff --git a/src/test/resources/checks/v32/parameters/OAR020/expand-no-dollar.json b/src/test/resources/checks/v32/parameters/OAR020/expand-no-dollar.json new file mode 100644 index 00000000..6806c9b8 --- /dev/null +++ b/src/test/resources/checks/v32/parameters/OAR020/expand-no-dollar.json @@ -0,0 +1,28 @@ +{ + "openapi" : "3.2.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/examples" : { + "get" : { # Noncompliant {{OAR020: $expand must be defined as a parameter in this operation}} + "parameters" : [ { + "in" : "query", + "name" : "expand", + "schema" : { + "type" : "array", + "items" : { + "type" : "string" + } + } + } ], + "responses" : { + "206" : { + "description" : "Ok" + } + } + } + } + } +} diff --git a/src/test/resources/checks/v32/parameters/OAR020/expand-no-dollar.yaml b/src/test/resources/checks/v32/parameters/OAR020/expand-no-dollar.yaml new file mode 100644 index 00000000..2ee0ef79 --- /dev/null +++ b/src/test/resources/checks/v32/parameters/OAR020/expand-no-dollar.yaml @@ -0,0 +1,17 @@ +openapi: "3.2.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /examples: + get: # Noncompliant {{OAR020: $expand must be defined as a parameter in this operation}} + parameters: + - in: query + name: expand + schema: + type: array + items: + type: string + responses: + 206: + description: Ok diff --git a/src/test/resources/checks/v32/parameters/OAR021/exclude-no-dollar.json b/src/test/resources/checks/v32/parameters/OAR021/exclude-no-dollar.json new file mode 100644 index 00000000..a31fedd7 --- /dev/null +++ b/src/test/resources/checks/v32/parameters/OAR021/exclude-no-dollar.json @@ -0,0 +1,28 @@ +{ + "openapi" : "3.2.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/examples" : { + "get" : { # Noncompliant {{OAR021: $exclude must be defined as a parameter in this operation}} + "parameters" : [ { + "in" : "query", + "name" : "exclude", + "schema" : { + "type" : "array", + "items" : { + "type" : "string" + } + } + } ], + "responses" : { + "206" : { + "description" : "Ok" + } + } + } + } + } +} diff --git a/src/test/resources/checks/v32/parameters/OAR021/exclude-no-dollar.yaml b/src/test/resources/checks/v32/parameters/OAR021/exclude-no-dollar.yaml new file mode 100644 index 00000000..19e8486f --- /dev/null +++ b/src/test/resources/checks/v32/parameters/OAR021/exclude-no-dollar.yaml @@ -0,0 +1,17 @@ +openapi: "3.2.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /examples: + get: # Noncompliant {{OAR021: $exclude must be defined as a parameter in this operation}} + parameters: + - in: query + name: exclude + schema: + type: array + items: + type: string + responses: + 206: + description: Ok diff --git a/src/test/resources/checks/v32/parameters/OAR028/header-ignored.json b/src/test/resources/checks/v32/parameters/OAR028/header-ignored.json new file mode 100644 index 00000000..97b9946c --- /dev/null +++ b/src/test/resources/checks/v32/parameters/OAR028/header-ignored.json @@ -0,0 +1,34 @@ +{ + "openapi" : "3.2.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/examples" : { + "get" : { + "parameters" : [ { + "in" : "header", + "name" : "Authorization", + "schema" : { + "type" : "string" + } + }, { + "in" : "query", + "name" : "$filter", + "schema" : { + "type" : "array", + "items" : { + "type" : "string" + } + } + } ], + "responses" : { + "206" : { + "description" : "Ok" + } + } + } + } + } +} diff --git a/src/test/resources/checks/v32/parameters/OAR028/header-ignored.yaml b/src/test/resources/checks/v32/parameters/OAR028/header-ignored.yaml new file mode 100644 index 00000000..1d451717 --- /dev/null +++ b/src/test/resources/checks/v32/parameters/OAR028/header-ignored.yaml @@ -0,0 +1,21 @@ +openapi: "3.2.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /examples: + get: + parameters: + - in: header + name: Authorization + schema: + type: string + - in: query + name: $filter + schema: + type: array + items: + type: string + responses: + 206: + description: Ok From 87d0639fc01f38a0282014c6b944d5260cc6ca23 Mon Sep 17 00:00:00 2001 From: Melsy Huamani Date: Wed, 20 May 2026 16:07:26 -0500 Subject: [PATCH 11/28] fix: cve alert with jackson-dataformat-yaml 2.18.6 --- CHANGELOG.md | 13 ++++++++----- pom.xml | 4 ++-- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bf008a72..6a24f884 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,14 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## [1.4.1] - 2024-05-14 -## Fixed - -- Resolve language suffix conflict between the plugin's custom YAML/JSON support and SonarQube's built-in language detection. +## [1.4.0] - 2024-05-20 +## Security -## [1.4.0] - 2024-05-06 +- Upgrade `jackson-dataformat-yaml` from 2.13.3 to 2.18.6 to fix CVE alerts. ## Changed @@ -26,6 +24,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Added a comprehensive set of test cases for every rule to ensure correct behavior and validation under OpenAPI 3.2 schemas. - Enhanced the engine to support new 3.2 structural changes, including updated reference handling and metadata fields. +## Fixed + +- Resolve language suffix conflict between the plugin's custom YAML/JSON support and SonarQube's built-in language detection. + + ## [1.3.7] - 2026-05-18 ### Fixed diff --git a/pom.xml b/pom.xml index e9a9043f..10637b01 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 org.apiaddicts.apitools.dosonarapi sonaropenapi-rules-community - 1.4.1 + 1.4.0 sonar-plugin SonarQube OpenAPI Community Rules @@ -108,7 +108,7 @@ com.fasterxml.jackson.dataformat jackson-dataformat-yaml - 2.13.3 + 2.18.6 org.sonarsource.analyzer-commons From b5e64e65c7db045d2a09fc677293261bcd380a6e Mon Sep 17 00:00:00 2001 From: Melsy Huamani Date: Wed, 20 May 2026 18:12:26 -0500 Subject: [PATCH 12/28] fix: cve alert with org-json 20231013 --- CHANGELOG.md | 13 ++++++++----- pom.xml | 4 ++-- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bf008a72..f1e96c2f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,14 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## [1.4.1] - 2024-05-14 -## Fixed - -- Resolve language suffix conflict between the plugin's custom YAML/JSON support and SonarQube's built-in language detection. +## [1.4.0] - 2024-05-20 +## Security -## [1.4.0] - 2024-05-06 +- Upgrade `org.json:json` to `20231013` to fix CVE vulnerabilities ## Changed @@ -26,6 +24,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Added a comprehensive set of test cases for every rule to ensure correct behavior and validation under OpenAPI 3.2 schemas. - Enhanced the engine to support new 3.2 structural changes, including updated reference handling and metadata fields. +## Fixed + +- Resolve language suffix conflict between the plugin's custom YAML/JSON support and SonarQube's built-in language detection. + + ## [1.3.7] - 2026-05-18 ### Fixed diff --git a/pom.xml b/pom.xml index e9a9043f..e1c8e5a8 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 org.apiaddicts.apitools.dosonarapi sonaropenapi-rules-community - 1.4.1 + 1.4.0 sonar-plugin SonarQube OpenAPI Community Rules @@ -66,7 +66,7 @@ 6.7 1.2.1 1.22.0.848 - 20220320 + 20231013 4.13.2 3.22.0 From 6ea1ae120969527087768cf2bb3d2c87218a7579 Mon Sep 17 00:00:00 2001 From: Melsy Huamani Date: Thu, 21 May 2026 14:24:01 -0500 Subject: [PATCH 13/28] fix: xxe alert with assertj-core 3.27.7 --- CHANGELOG.md | 13 +++++++------ pom.xml | 2 +- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e77135cb..c8757e94 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,26 +6,27 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## [1.4.0] - 2024-05-20 +## [1.4.0] - 2024-05-22 -## Security +### Security - Upgrade `org.json:json` to `20231013` to fix CVE vulnerabilities - Upgrade `jackson-dataformat-yaml` from 2.13.3 to 2.18.6 to fix CVE alerts. +- Upgrade `assertj-core` from 3.22.0 to 3.27.7 to fix XXE vulnerability. -## Changed +### Changed - Move sonar organization config to github action -## Added +### Added -### Now, support for OpenAPI 3.2 is included. These are some of the new changes: +#### Now, support for OpenAPI 3.2 is included. These are some of the new changes: - All existing rules (OAR001 - OAR115) have been updated and validated for compatibility with the OpenAPI 3.2 specification. - Added a comprehensive set of test cases for every rule to ensure correct behavior and validation under OpenAPI 3.2 schemas. - Enhanced the engine to support new 3.2 structural changes, including updated reference handling and metadata fields. -## Fixed +### Fixed - Resolve language suffix conflict between the plugin's custom YAML/JSON support and SonarQube's built-in language detection. diff --git a/pom.xml b/pom.xml index 59a5bd6c..437cdca3 100644 --- a/pom.xml +++ b/pom.xml @@ -68,7 +68,7 @@ 1.22.0.848 20231013 4.13.2 - 3.22.0 + 3.27.7 0.8.6 5.5.0.6356 From bfa1cb6d59c9a61d75bc56594b0e13c3fc2ba22e Mon Sep 17 00:00:00 2001 From: Sebastian Diaz Torres Date: Tue, 26 May 2026 09:06:57 -0500 Subject: [PATCH 14/28] fix: Update beta --- CHANGELOG.md | 10 +++++++++- pom.xml | 8 ++++---- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 37a6edf1..b555d655 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,15 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## [1.4.0] - 2024-05-22 +## [1.4.1-beta-1] - 2026-05-26 + +### Changed + +- Bump plugin version to `1.4.1-beta-1`. +- Update `sonaropenapi.version` to `1.2.1-beta-1`. +- Reference `openapi-front-end` and `openapi-test-tools` dependencies via `${sonaropenapi.version}` property instead of hardcoded version. + +## [1.4.0] - 2026-05-22 ### Security diff --git a/pom.xml b/pom.xml index 2532897d..3e3aab47 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 org.apiaddicts.apitools.dosonarapi sonaropenapi-rules-community - 1.4.1 + 1.4.1-beta-1 sonar-plugin SonarQube OpenAPI Community Rules @@ -64,7 +64,7 @@ 8.7.0.41497 6.7 - 1.2.1 + 1.2.1-beta-1 1.22.0.848 20231013 4.13.2 @@ -91,7 +91,7 @@ org.apiaddicts.apitools.dosonarapi openapi-front-end - 1.2.1 + ${sonaropenapi.version} org.apiaddicts.apitools.dosonarapi @@ -131,7 +131,7 @@ org.apiaddicts.apitools.dosonarapi openapi-test-tools - 1.2.1 + ${sonaropenapi.version} junit From 402b90899b2ec5b643c2b481d51534804b91919a Mon Sep 17 00:00:00 2001 From: Melsy Huamani Date: Wed, 27 May 2026 16:28:41 -0500 Subject: [PATCH 15/28] feat: add OpenAPI language support without YAML and JSON conflicts --- .../OpenAPICustomOpenApiRuleRepository.java | 26 +++++++++++++++++++ .../sonar/openapi/OpenAPICustomPlugin.java | 3 ++- .../OpenAPICustomProfileDefinition.java | 5 ++++ .../openapi/OpenAPICustomRulesDefinition.java | 2 ++ ...penAPICustomOpenApiRuleRepositoryTest.java | 26 +++++++++++++++++++ .../openapi/OpenAPICustomPluginTest.java | 5 ++-- .../OpenAPICustomProfileDefinitionTest.java | 7 +++++ .../OpenAPICustomRulesDefinitionTest.java | 5 ++++ 8 files changed, 76 insertions(+), 3 deletions(-) create mode 100644 src/main/java/apiaddicts/sonar/openapi/OpenAPICustomOpenApiRuleRepository.java create mode 100644 src/test/java/apiaddicts/sonar/openapi/OpenAPICustomOpenApiRuleRepositoryTest.java diff --git a/src/main/java/apiaddicts/sonar/openapi/OpenAPICustomOpenApiRuleRepository.java b/src/main/java/apiaddicts/sonar/openapi/OpenAPICustomOpenApiRuleRepository.java new file mode 100644 index 00000000..8c27535a --- /dev/null +++ b/src/main/java/apiaddicts/sonar/openapi/OpenAPICustomOpenApiRuleRepository.java @@ -0,0 +1,26 @@ +package apiaddicts.sonar.openapi; + +import org.sonar.api.ExtensionPoint; +import org.sonar.api.scanner.ScannerSide; +import org.apiaddicts.apitools.dosonarapi.api.OpenApiCustomRuleRepository; +import apiaddicts.sonar.openapi.checks.RulesLists; +import org.sonarsource.api.sonarlint.SonarLintSide; + +import java.util.List; + +import static apiaddicts.sonar.openapi.OpenAPICustomRulesDefinition.OPENAPI_REPOSITORY_KEY; + +@SonarLintSide +@ScannerSide +@ExtensionPoint +public class OpenAPICustomOpenApiRuleRepository implements OpenApiCustomRuleRepository { + @Override + public String repositoryKey() { + return OPENAPI_REPOSITORY_KEY; + } + + @Override + public List> checkClasses() { + return RulesLists.getAllChecks(); + } +} diff --git a/src/main/java/apiaddicts/sonar/openapi/OpenAPICustomPlugin.java b/src/main/java/apiaddicts/sonar/openapi/OpenAPICustomPlugin.java index aaf6c302..15654b06 100644 --- a/src/main/java/apiaddicts/sonar/openapi/OpenAPICustomPlugin.java +++ b/src/main/java/apiaddicts/sonar/openapi/OpenAPICustomPlugin.java @@ -15,7 +15,8 @@ public void define(Context context) { OpenAPICustomRulesDefinition.class, // batch extensions -> objects are instantiated during code analysis OpenAPICustomRuleRepository.class, - OpenAPICustomJsonRuleRepository.class + OpenAPICustomJsonRuleRepository.class, + OpenAPICustomOpenApiRuleRepository.class ); } diff --git a/src/main/java/apiaddicts/sonar/openapi/OpenAPICustomProfileDefinition.java b/src/main/java/apiaddicts/sonar/openapi/OpenAPICustomProfileDefinition.java index 5ccaa621..9eb7d1f3 100644 --- a/src/main/java/apiaddicts/sonar/openapi/OpenAPICustomProfileDefinition.java +++ b/src/main/java/apiaddicts/sonar/openapi/OpenAPICustomProfileDefinition.java @@ -32,6 +32,11 @@ public void define(Context context) { addBaseRules(jsonProfile, CheckList.JSON_REPOSITORY_KEY); addRepositoryRules(jsonProfile, OpenAPICustomRulesDefinition.JSON_REPOSITORY_KEY, RulesLists.getAllChecks()); jsonProfile.done(); + + NewBuiltInQualityProfile openapiProfile = context.createBuiltInQualityProfile(OPENAPI_WAY, CheckList.OPENAPI_LANGUAGE); + addBaseRules(openapiProfile, CheckList.OPENAPI_REPOSITORY_KEY); + addRepositoryRules(openapiProfile, OpenAPICustomRulesDefinition.OPENAPI_REPOSITORY_KEY, RulesLists.getAllChecks()); + openapiProfile.done(); } private void addBaseRules(NewBuiltInQualityProfile profile, String repositoryKey) { diff --git a/src/main/java/apiaddicts/sonar/openapi/OpenAPICustomRulesDefinition.java b/src/main/java/apiaddicts/sonar/openapi/OpenAPICustomRulesDefinition.java index 47f64a74..a0dff556 100644 --- a/src/main/java/apiaddicts/sonar/openapi/OpenAPICustomRulesDefinition.java +++ b/src/main/java/apiaddicts/sonar/openapi/OpenAPICustomRulesDefinition.java @@ -17,6 +17,7 @@ public class OpenAPICustomRulesDefinition implements RulesDefinition { public static final String YAML_REPOSITORY_KEY = "openapi-custom-yaml"; public static final String JSON_REPOSITORY_KEY = "openapi-custom-json"; + public static final String OPENAPI_REPOSITORY_KEY = "openapi-custom"; private static final String REPOSITORY_NAME = "OpenAPI Custom"; private static final String ROOT_RESOURCE_FOLDER = "org/sonar/l10n/openapi/rules/openapi/"; private static final String SECURITY_GROUP = "security"; @@ -34,6 +35,7 @@ public void define(Context context) { I18nContext.initializeFromUserLanguage(); populateRepository(context, YAML_REPOSITORY_KEY, "yaml"); populateRepository(context, JSON_REPOSITORY_KEY, "json"); + populateRepository(context, OPENAPI_REPOSITORY_KEY, "openapi"); } private void populateRepository(Context context, String key, String language) { diff --git a/src/test/java/apiaddicts/sonar/openapi/OpenAPICustomOpenApiRuleRepositoryTest.java b/src/test/java/apiaddicts/sonar/openapi/OpenAPICustomOpenApiRuleRepositoryTest.java new file mode 100644 index 00000000..34d65499 --- /dev/null +++ b/src/test/java/apiaddicts/sonar/openapi/OpenAPICustomOpenApiRuleRepositoryTest.java @@ -0,0 +1,26 @@ +package apiaddicts.sonar.openapi; + +import static org.assertj.core.api.Assertions.assertThat; +import org.junit.Test; + +public class OpenAPICustomOpenApiRuleRepositoryTest { + + @Test + public void testRepositoryKey() { + OpenAPICustomOpenApiRuleRepository repository = new OpenAPICustomOpenApiRuleRepository(); + assertThat(repository.repositoryKey()).isEqualTo("openapi-custom"); + } + + @Test + public void testCheckClassesNotEmpty() { + OpenAPICustomOpenApiRuleRepository repository = new OpenAPICustomOpenApiRuleRepository(); + assertThat(repository.checkClasses()).isNotEmpty(); + } + + @Test + public void testCheckClassesSameAsAllChecks() { + OpenAPICustomOpenApiRuleRepository repository = new OpenAPICustomOpenApiRuleRepository(); + OpenAPICustomRuleRepository yamlRepo = new OpenAPICustomRuleRepository(); + assertThat(repository.checkClasses()).isEqualTo(yamlRepo.checkClasses()); + } +} diff --git a/src/test/java/apiaddicts/sonar/openapi/OpenAPICustomPluginTest.java b/src/test/java/apiaddicts/sonar/openapi/OpenAPICustomPluginTest.java index df1ff7a4..8225eac6 100644 --- a/src/test/java/apiaddicts/sonar/openapi/OpenAPICustomPluginTest.java +++ b/src/test/java/apiaddicts/sonar/openapi/OpenAPICustomPluginTest.java @@ -22,11 +22,12 @@ public void testDefine() { }; Plugin.Context context = new Plugin.Context(runtime); plugin.define(context); - assertThat(context.getExtensions()).hasSize(4); + assertThat(context.getExtensions()).hasSize(5); assertThat(context.getExtensions()).contains( OpenAPICustomProfileDefinition.class, OpenAPICustomRulesDefinition.class, OpenAPICustomRuleRepository.class, - OpenAPICustomJsonRuleRepository.class); + OpenAPICustomJsonRuleRepository.class, + OpenAPICustomOpenApiRuleRepository.class); } } diff --git a/src/test/java/apiaddicts/sonar/openapi/OpenAPICustomProfileDefinitionTest.java b/src/test/java/apiaddicts/sonar/openapi/OpenAPICustomProfileDefinitionTest.java index 907aee0a..3cf3b80c 100644 --- a/src/test/java/apiaddicts/sonar/openapi/OpenAPICustomProfileDefinitionTest.java +++ b/src/test/java/apiaddicts/sonar/openapi/OpenAPICustomProfileDefinitionTest.java @@ -32,5 +32,12 @@ public void testDefine() { assertThat(jsonProfile.name()).isEqualTo(OpenAPICustomProfileDefinition.OPENAPI_WAY); assertThat(jsonProfile.rules()).hasSize(expectedSize); assertThat(jsonProfile.rules().stream().noneMatch(r -> r.ruleKey().equals("OAR112"))).isTrue(); + + BuiltInQualityProfile openapiProfile = context.profile("openapi", OpenAPICustomProfileDefinition.OPENAPI_WAY); + assertThat(openapiProfile).isNotNull(); + assertThat(openapiProfile.language()).isEqualTo("openapi"); + assertThat(openapiProfile.name()).isEqualTo(OpenAPICustomProfileDefinition.OPENAPI_WAY); + assertThat(openapiProfile.rules()).hasSize(expectedSize); + assertThat(openapiProfile.rules().stream().noneMatch(r -> r.ruleKey().equals("OAR112"))).isTrue(); } } diff --git a/src/test/java/apiaddicts/sonar/openapi/OpenAPICustomRulesDefinitionTest.java b/src/test/java/apiaddicts/sonar/openapi/OpenAPICustomRulesDefinitionTest.java index 225b0e36..f8e2d86b 100644 --- a/src/test/java/apiaddicts/sonar/openapi/OpenAPICustomRulesDefinitionTest.java +++ b/src/test/java/apiaddicts/sonar/openapi/OpenAPICustomRulesDefinitionTest.java @@ -26,6 +26,11 @@ public void testRepository() { assertThat(jsonRepository.name()).isEqualTo("OpenAPI Custom"); assertThat(jsonRepository.language()).isEqualTo("json"); assertThat(jsonRepository.rules()).hasSize(RulesLists.getAllChecks().size()); + + Repository openapiRepository = context.repository(OpenAPICustomRulesDefinition.OPENAPI_REPOSITORY_KEY); + assertThat(openapiRepository.name()).isEqualTo("OpenAPI Custom"); + assertThat(openapiRepository.language()).isEqualTo("openapi"); + assertThat(openapiRepository.rules()).hasSize(RulesLists.getAllChecks().size()); } @Test From 0bce485830c8f51ddb592caafbb1b78662a44ce3 Mon Sep 17 00:00:00 2001 From: Melsy Huamani Date: Thu, 28 May 2026 08:36:44 -0500 Subject: [PATCH 16/28] update changelog and version --- CHANGELOG.md | 7 +++++++ pom.xml | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b555d655..c355422a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [1.4.1-beta-2] - 2026-05-28 + +### Added + +- Add OpenAPI language support without YAML and JSON conflicts. + ## [1.4.1-beta-1] - 2026-05-26 ### Changed diff --git a/pom.xml b/pom.xml index 3e3aab47..9de5e121 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 org.apiaddicts.apitools.dosonarapi sonaropenapi-rules-community - 1.4.1-beta-1 + 1.4.1-beta-2 sonar-plugin SonarQube OpenAPI Community Rules From 4205c870f336aa8d9ded6c21ba4199f82242f5d2 Mon Sep 17 00:00:00 2001 From: Sebastian Diaz Torres Date: Thu, 28 May 2026 16:23:10 -0500 Subject: [PATCH 17/28] fix: Update pom version for core plugin --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 9de5e121..da0e3b33 100644 --- a/pom.xml +++ b/pom.xml @@ -64,7 +64,7 @@ 8.7.0.41497 6.7 - 1.2.1-beta-1 + 1.2.1-beta-2 1.22.0.848 20231013 4.13.2 From 4fd76038e77463a7bb109a7059e6d4b4e3aafa8f Mon Sep 17 00:00:00 2001 From: Melsy Huamani Date: Fri, 29 May 2026 09:45:04 -0500 Subject: [PATCH 18/28] fix: align OAR004, OAR014 and OAR015, fix array roles, depth and docs --- .../wso2/AbstractPatternWso2ScopesCheck.java | 19 +- .../AbstractResourceLevelCheck.java | 23 +- ...urceLevelWithinNonSuggestedRangeCheck.java | 2 +- .../rules/openapi/operations/OAR014.html | 43 ++- .../rules/openapi/operations/OAR015.html | 41 +-- .../rules/openapi/resources/OAR014.html | 285 +++++++++--------- .../rules/openapi/resources/OAR015.html | 279 ++++------------- .../rules/openapi/operations/OAR014.html | 41 ++- .../rules/openapi/operations/OAR015.html | 41 +-- .../rules/openapi/resources/OAR014.html | 283 ++++++++--------- .../rules/openapi/resources/OAR015.html | 279 ++++------------- .../OAR004ValidWso2ScopesRolesCheckTest.java | 40 +++ .../wso2/OAR004/with-invalid-array-roles.json | 20 ++ .../wso2/OAR004/with-invalid-array-roles.yaml | 16 + .../wso2/OAR004/with-valid-array-roles.json | 20 ++ .../wso2/OAR004/with-valid-array-roles.yaml | 16 + .../checks/v2/operations/OAR014/plain.json | 4 +- .../checks/v2/operations/OAR014/plain.yaml | 4 +- .../checks/v2/operations/OAR015/plain.json | 2 +- .../checks/v2/operations/OAR015/plain.yaml | 2 +- .../wso2/OAR004/with-invalid-array-roles.json | 20 ++ .../wso2/OAR004/with-invalid-array-roles.yaml | 16 + .../wso2/OAR004/with-valid-array-roles.json | 20 ++ .../wso2/OAR004/with-valid-array-roles.yaml | 16 + .../apim/OAR004/with-invalid-array-roles.json | 20 ++ .../apim/OAR004/with-invalid-array-roles.yaml | 16 + .../apim/OAR004/with-valid-array-roles.json | 20 ++ .../apim/OAR004/with-valid-array-roles.yaml | 16 + .../apim/OAR004/with-invalid-array-roles.json | 20 ++ .../apim/OAR004/with-invalid-array-roles.yaml | 16 + .../apim/OAR004/with-valid-array-roles.json | 20 ++ .../apim/OAR004/with-valid-array-roles.yaml | 16 + 32 files changed, 874 insertions(+), 802 deletions(-) create mode 100644 src/test/resources/checks/v2/apim/wso2/OAR004/with-invalid-array-roles.json create mode 100644 src/test/resources/checks/v2/apim/wso2/OAR004/with-invalid-array-roles.yaml create mode 100644 src/test/resources/checks/v2/apim/wso2/OAR004/with-valid-array-roles.json create mode 100644 src/test/resources/checks/v2/apim/wso2/OAR004/with-valid-array-roles.yaml create mode 100644 src/test/resources/checks/v3/apim/wso2/OAR004/with-invalid-array-roles.json create mode 100644 src/test/resources/checks/v3/apim/wso2/OAR004/with-invalid-array-roles.yaml create mode 100644 src/test/resources/checks/v3/apim/wso2/OAR004/with-valid-array-roles.json create mode 100644 src/test/resources/checks/v3/apim/wso2/OAR004/with-valid-array-roles.yaml create mode 100644 src/test/resources/checks/v31/apim/OAR004/with-invalid-array-roles.json create mode 100644 src/test/resources/checks/v31/apim/OAR004/with-invalid-array-roles.yaml create mode 100644 src/test/resources/checks/v31/apim/OAR004/with-valid-array-roles.json create mode 100644 src/test/resources/checks/v31/apim/OAR004/with-valid-array-roles.yaml create mode 100644 src/test/resources/checks/v32/apim/OAR004/with-invalid-array-roles.json create mode 100644 src/test/resources/checks/v32/apim/OAR004/with-invalid-array-roles.yaml create mode 100644 src/test/resources/checks/v32/apim/OAR004/with-valid-array-roles.json create mode 100644 src/test/resources/checks/v32/apim/OAR004/with-valid-array-roles.yaml diff --git a/src/main/java/apiaddicts/sonar/openapi/checks/apim/wso2/AbstractPatternWso2ScopesCheck.java b/src/main/java/apiaddicts/sonar/openapi/checks/apim/wso2/AbstractPatternWso2ScopesCheck.java index ce651971..c6df9d14 100644 --- a/src/main/java/apiaddicts/sonar/openapi/checks/apim/wso2/AbstractPatternWso2ScopesCheck.java +++ b/src/main/java/apiaddicts/sonar/openapi/checks/apim/wso2/AbstractPatternWso2ScopesCheck.java @@ -2,6 +2,7 @@ import org.apiaddicts.apitools.dosonarapi.sslr.yaml.grammar.JsonNode; +import java.util.List; import java.util.regex.Pattern; public abstract class AbstractPatternWso2ScopesCheck extends AbstractWso2ScopesCheck { @@ -31,9 +32,19 @@ protected void visitScope(JsonNode scope) { JsonNode fieldNode = scope.propertyMap().get(fieldName); if (fieldNode == null || fieldNode.isNull() || fieldNode.isMissing()) return; - String fieldText = fieldNode.getTokenValue(); - boolean notValid = !pattern.matcher(fieldText).matches(); - - if (notValid) addIssue(ruleKey, translate(messageKey), fieldNode.value()); + List elements = fieldNode.elements(); + if (!elements.isEmpty()) { + for (JsonNode element : elements) { + String roleText = element.getTokenValue(); + if (roleText != null && !pattern.matcher(roleText).matches()) { + addIssue(ruleKey, translate(messageKey), element.value()); + } + } + } else { + String fieldText = fieldNode.getTokenValue(); + if (!pattern.matcher(fieldText).matches()) { + addIssue(ruleKey, translate(messageKey), fieldNode.value()); + } + } } } \ No newline at end of file diff --git a/src/main/java/apiaddicts/sonar/openapi/checks/operations/AbstractResourceLevelCheck.java b/src/main/java/apiaddicts/sonar/openapi/checks/operations/AbstractResourceLevelCheck.java index 76d65b10..ac94b477 100644 --- a/src/main/java/apiaddicts/sonar/openapi/checks/operations/AbstractResourceLevelCheck.java +++ b/src/main/java/apiaddicts/sonar/openapi/checks/operations/AbstractResourceLevelCheck.java @@ -2,7 +2,6 @@ import com.google.common.collect.ImmutableSet; import com.sonar.sslr.api.AstNodeType; -import java.util.regex.Matcher; import org.apiaddicts.apitools.dosonarapi.api.v2.OpenApi2Grammar; import org.apiaddicts.apitools.dosonarapi.api.v3.OpenApi3Grammar; @@ -12,7 +11,6 @@ import org.apiaddicts.apitools.dosonarapi.sslr.yaml.grammar.JsonNode; import java.util.Set; -import java.util.regex.Pattern; import java.util.stream.Stream; public abstract class AbstractResourceLevelCheck extends BaseCheck { @@ -32,26 +30,17 @@ public Set subscribedKinds() { @Override public void visitNode(JsonNode node) { - visitV2Node(node); - } - - private void visitV2Node(JsonNode node) { String path = node.key().getTokenValue(); if (matchLevel(path)) addIssue(key, translate(MESSAGE), node.key()); } private boolean matchLevel(String path) { - String levelRegex = "\\/[^/{}]*\\/\\{[^/{}]*\\}"; - Pattern levelPattern = Pattern.compile(levelRegex); - Matcher levelMatcher = levelPattern.matcher(path); - Integer levels = 0; - while ( levelMatcher.find() ) { - levels++; - } - - long pathParts = Stream.of(path.split("/")).filter(p -> !p.trim().isEmpty()).count(); - return matchLevel(pathParts - levels); - + long literalCount = Stream.of(path.split("/")) + .filter(s -> !s.trim().isEmpty()) + .filter(s -> !(s.startsWith("{") && s.endsWith("}"))) + .filter(s -> !s.equals("me")) + .count(); + return matchLevel(literalCount); } abstract boolean matchLevel(long level); diff --git a/src/main/java/apiaddicts/sonar/openapi/checks/operations/OAR014ResourceLevelWithinNonSuggestedRangeCheck.java b/src/main/java/apiaddicts/sonar/openapi/checks/operations/OAR014ResourceLevelWithinNonSuggestedRangeCheck.java index d8c53479..75164014 100644 --- a/src/main/java/apiaddicts/sonar/openapi/checks/operations/OAR014ResourceLevelWithinNonSuggestedRangeCheck.java +++ b/src/main/java/apiaddicts/sonar/openapi/checks/operations/OAR014ResourceLevelWithinNonSuggestedRangeCheck.java @@ -32,6 +32,6 @@ public OAR014ResourceLevelWithinNonSuggestedRangeCheck() { @Override boolean matchLevel(long level) { - return minLevel <= level && maxLevel >= level; + return minLevel <= level; } } diff --git a/src/main/resources/org/sonar/l10n/es/openapi/rules/openapi/operations/OAR014.html b/src/main/resources/org/sonar/l10n/es/openapi/rules/openapi/operations/OAR014.html index 25257577..c59c7ebe 100644 --- a/src/main/resources/org/sonar/l10n/es/openapi/rules/openapi/operations/OAR014.html +++ b/src/main/resources/org/sonar/l10n/es/openapi/rules/openapi/operations/OAR014.html @@ -1,5 +1,6 @@

Una ruta compleja puede ser una insinuación para detectar definiciones de API incorrectas.

-

El número de partes de la ruta debe ser menor a 4, cuando el número de partes de la ruta este entre 4 y 5 se mostrará una advertencia.

+

El número de partes de la ruta debe ser menor a 4, cuando el número de partes de la ruta esté entre 4 y 5 se mostrará una advertencia.

+

Nota: Los parámetros de ruta (p.ej. {customerId}) se excluyen del conteo de profundidad — solo cuentan los segmentos literales de nombre de recurso.

Ejemplo de código no compatible (OpenAPI 2)

 swagger: "2.0"
@@ -7,7 +8,7 @@ 

Ejemplo de código no compatible (OpenAPI 2)

title: Swagger Petstore version: "1.0" paths: - /customers/{customerId}/invoices/{invoiceId}: + /customers/{customerId}/invoices/{invoiceId}/products: get: parameters: - in: path @@ -21,7 +22,7 @@

Ejemplo de código no compatible (OpenAPI 2)

responses: 200: description: OK - /customers/{customerId}/invoices/{invoiceId}/products: + /customers/{customerId}/invoices/{invoiceId}/products/details: # Noncompliant {{OAR014: Resources depth level should be smaller}} get: parameters: - in: path @@ -73,6 +74,20 @@

Solución compatible (OpenAPI 2)

responses: 200: description: OK + /customers/{customerId}/invoices/{invoiceId}/products: + get: + parameters: + - in: path + name: customerId + type: integer + required: true + - in: path + name: invoiceId + type: integer + required: true + responses: + 200: + description: OK

Ejemplo de código no compatible (OpenAPI 3)

@@ -81,7 +96,7 @@ 

Ejemplo de código no compatible (OpenAPI 3)

title: Swagger Petstore version: "1.0" paths: - /customers/{customerId}/invoices/{invoiceId}: + /customers/{customerId}/invoices/{invoiceId}/products: get: parameters: - name: customerId @@ -97,7 +112,7 @@

Ejemplo de código no compatible (OpenAPI 3)

responses: 200: description: OK - /customers/{customerId}/invoices/{invoiceId}/products: + /customers/{customerId}/invoices/{invoiceId}/products/details: # Noncompliant {{OAR014: Resources depth level should be smaller}} get: parameters: - name: customerId @@ -154,4 +169,20 @@

Solución compatible (OpenAPI 3)

responses: 200: description: OK -
\ No newline at end of file + /customers/{customerId}/invoices/{invoiceId}/products: + get: + parameters: + - name: customerId + in: path + required: true + schema: + type: integer + - name: invoiceId + in: path + required: true + schema: + type: integer + responses: + 200: + description: OK + diff --git a/src/main/resources/org/sonar/l10n/es/openapi/rules/openapi/operations/OAR015.html b/src/main/resources/org/sonar/l10n/es/openapi/rules/openapi/operations/OAR015.html index ff5c8018..19274297 100644 --- a/src/main/resources/org/sonar/l10n/es/openapi/rules/openapi/operations/OAR015.html +++ b/src/main/resources/org/sonar/l10n/es/openapi/rules/openapi/operations/OAR015.html @@ -1,5 +1,6 @@

Una ruta compleja puede ser una insinuación para detectar definiciones de API incorrectas.

El número de partes de la ruta debe ser menor a 4, cuando el número de partes de la ruta sea mayor o igual a 6 se mostrará un error.

+

Nota: Los parámetros de ruta (p.ej. {customerId}) se excluyen del conteo de profundidad — solo cuentan los segmentos literales de nombre de recurso.

Ejemplo de código no compatible (OpenAPI 2)

 swagger: "2.0"
@@ -7,7 +8,7 @@ 

Ejemplo de código no compatible (OpenAPI 2)

title: Swagger Petstore version: "1.0" paths: - /customers/{customerId}/invoices/{invoiceId}/products/{productId}: + /customers/{customerId}/invoices/{invoiceId}/products/details/versions: get: parameters: - in: path @@ -18,10 +19,6 @@

Ejemplo de código no compatible (OpenAPI 2)

name: invoiceId type: integer required: true - - in: path - name: productId - type: integer - required: true responses: 200: description: OK @@ -53,19 +50,17 @@

Solución compatible (OpenAPI 2)

responses: 200: description: OK - /invoices/{invoiceId}/products: + /customers/{customerId}/invoices/{invoiceId}/products/{productId}: get: parameters: + - in: path + name: customerId + type: integer + required: true - in: path name: invoiceId type: integer required: true - responses: - 200: - description: OK - /products/{productId}: - get: - parameters: - in: path name: productId type: integer @@ -81,7 +76,7 @@

Ejemplo de código no compatible (OpenAPI 3)

title: Swagger Petstore version: "1.0" paths: - /customers/{customerId}/invoices/{invoiceId}/products/{productId}: + /customers/{customerId}/invoices/{invoiceId}/products/details/versions: get: parameters: - name: customerId @@ -94,11 +89,6 @@

Ejemplo de código no compatible (OpenAPI 3)

required: true schema: type: integer - - name: productId - in: path - required: true - schema: - type: integer responses: 200: description: OK @@ -132,20 +122,19 @@

Solución compatible (OpenAPI 3)

responses: 200: description: OK - /invoices/{invoiceId}/products: + /customers/{customerId}/invoices/{invoiceId}/products/{productId}: get: parameters: + - name: customerId + in: path + required: true + schema: + type: integer - name: invoiceId in: path required: true schema: type: integer - responses: - 200: - description: OK - /products/{productId}: - get: - parameters: - name: productId in: path required: true @@ -154,4 +143,4 @@

Solución compatible (OpenAPI 3)

responses: 200: description: OK -
\ No newline at end of file + diff --git a/src/main/resources/org/sonar/l10n/es/openapi/rules/openapi/resources/OAR014.html b/src/main/resources/org/sonar/l10n/es/openapi/rules/openapi/resources/OAR014.html index 62819921..7542bc69 100644 --- a/src/main/resources/org/sonar/l10n/es/openapi/rules/openapi/resources/OAR014.html +++ b/src/main/resources/org/sonar/l10n/es/openapi/rules/openapi/resources/OAR014.html @@ -1,54 +1,32 @@

Una ruta compleja puede ser una insinuación para detectar definiciones de API incorrectas.

-

El número de partes de la ruta debe ser menor a 4, cuando el número de partes de la ruta este entre 4 y 5 se mostrará una advertencia.

+

El número de partes de la ruta debe ser menor a 4, cuando el número de partes de la ruta esté entre 4 y 5 se mostrará una advertencia.

+

Nota: Los parámetros de ruta (p.ej. {customerId}) se excluyen del conteo de profundidad — solo cuentan los segmentos literales de nombre de recurso.

Ejemplo de código no compatible (OpenAPI 2)

JSON

 {
-    "swagger": "2.0", 
+    "swagger": "2.0",
     "info": {
-        "title": "Swagger Petstore", 
+        "title": "Swagger Petstore",
         "version": "1.0"
-    }, 
+    },
     "paths": {
-        "/customers/{customerId}/invoices/{invoiceId}": {
+        "/customers/{customerId}/invoices/{invoiceId}/products/details": {
             "get": {
                 "parameters": [
                     {
-                        "in": "path", 
-                        "name": "customerId", 
-                        "type": "integer", 
+                        "in": "path",
+                        "name": "customerId",
+                        "type": "integer",
                         "required": true
-                    }, 
+                    },
                     {
-                        "in": "path", 
-                        "name": "invoiceId", 
-                        "type": "integer", 
+                        "in": "path",
+                        "name": "invoiceId",
+                        "type": "integer",
                         "required": true
                     }
-                ], 
-                "responses": {
-                    "200": {
-                        "description": "OK"
-                    }
-                }
-            }
-        }, 
-        "/customers/{customerId}/invoices/{invoiceId}/products": {
-            "get": {
-                "parameters": [
-                    {
-                        "in": "path", 
-                        "name": "customerId", 
-                        "type": "integer", 
-                        "required": true
-                    }, 
-                    {
-                        "in": "path", 
-                        "name": "invoiceId", 
-                        "type": "integer", 
-                        "required": true
-                    }
-                ], 
+                ],
                 "responses": {
                     "200": {
                         "description": "OK"
@@ -66,21 +44,7 @@ 

YAML

title: Swagger Petstore version: "1.0" paths: - /customers/{customerId}/invoices/{invoiceId}: - get: - parameters: - - in: path - name: customerId - type: integer - required: true - - in: path - name: invoiceId - type: integer - required: true - responses: - 200: - description: OK - /customers/{customerId}/invoices/{invoiceId}/products: + /customers/{customerId}/invoices/{invoiceId}/products/details: get: parameters: - in: path @@ -99,56 +63,79 @@

Solución compatible (OpenAPI 2)

JSON

 {
-    "swagger": "2.0", 
+    "swagger": "2.0",
     "info": {
-        "title": "Swagger Petstore", 
+        "title": "Swagger Petstore",
         "version": "1.0"
-    }, 
+    },
     "paths": {
         "/customers/{customerId}/invoices": {
             "get": {
                 "parameters": [
                     {
-                        "in": "path", 
-                        "name": "customerId", 
-                        "type": "integer", 
+                        "in": "path",
+                        "name": "customerId",
+                        "type": "integer",
                         "required": true
                     }
-                ], 
+                ],
                 "responses": {
                     "200": {
                         "description": "OK"
                     }
                 }
             }
-        }, 
+        },
         "/invoices/{invoiceId}": {
             "get": {
                 "parameters": [
                     {
-                        "in": "path", 
-                        "name": "invoiceId", 
-                        "type": "integer", 
+                        "in": "path",
+                        "name": "invoiceId",
+                        "type": "integer",
                         "required": true
                     }
-                ], 
+                ],
                 "responses": {
                     "200": {
                         "description": "OK"
                     }
                 }
             }
-        }, 
+        },
         "/invoices/{invoiceId}/products": {
             "get": {
                 "parameters": [
                     {
-                        "in": "path", 
-                        "name": "invoiceId", 
-                        "type": "integer", 
+                        "in": "path",
+                        "name": "invoiceId",
+                        "type": "integer",
                         "required": true
                     }
-                ], 
+                ],
+                "responses": {
+                    "200": {
+                        "description": "OK"
+                    }
+                }
+            }
+        },
+        "/customers/{customerId}/invoices/{invoiceId}/products": {
+            "get": {
+                "parameters": [
+                    {
+                        "in": "path",
+                        "name": "customerId",
+                        "type": "integer",
+                        "required": true
+                    },
+                    {
+                        "in": "path",
+                        "name": "invoiceId",
+                        "type": "integer",
+                        "required": true
+                    }
+                ],
                 "responses": {
                     "200": {
                         "description": "OK"
@@ -196,64 +183,51 @@ 

YAML

responses: 200: description: OK + /customers/{customerId}/invoices/{invoiceId}/products: + get: + parameters: + - in: path + name: customerId + type: integer + required: true + - in: path + name: invoiceId + type: integer + required: true + responses: + 200: + description: OK

Ejemplo de código no compatible (OpenAPI 3)

JSON

 {
-    "openapi": "3.0.1", 
+    "openapi": "3.0.1",
     "info": {
-        "title": "Swagger Petstore", 
+        "title": "Swagger Petstore",
         "version": "1.0"
-    }, 
+    },
     "paths": {
-        "/customers/{customerId}/invoices/{invoiceId}": {
+        "/customers/{customerId}/invoices/{invoiceId}/products/details": {
             "get": {
                 "parameters": [
                     {
-                        "name": "customerId", 
-                        "in": "path", 
-                        "required": true, 
+                        "name": "customerId",
+                        "in": "path",
+                        "required": true,
                         "schema": {
                             "type": "integer"
                         }
-                    }, 
+                    },
                     {
-                        "name": "invoiceId", 
-                        "in": "path", 
-                        "required": true, 
+                        "name": "invoiceId",
+                        "in": "path",
+                        "required": true,
                         "schema": {
                             "type": "integer"
                         }
                     }
-                ], 
-                "responses": {
-                    "200": {
-                        "description": "OK"
-                    }
-                }
-            }
-        }, 
-        "/customers/{customerId}/invoices/{invoiceId}/products": {
-            "get": {
-                "parameters": [
-                    {
-                        "name": "customerId", 
-                        "in": "path", 
-                        "required": true, 
-                        "schema": {
-                            "type": "integer"
-                        }
-                    }, 
-                    {
-                        "name": "invoiceId", 
-                        "in": "path", 
-                        "required": true, 
-                        "schema": {
-                            "type": "integer"
-                        }
-                    }
-                ], 
+                ],
                 "responses": {
                     "200": {
                         "description": "OK"
@@ -271,23 +245,7 @@ 

YAML

title: Swagger Petstore version: "1.0" paths: - /customers/{customerId}/invoices/{invoiceId}: - get: - parameters: - - name: customerId - in: path - required: true - schema: - type: integer - - name: invoiceId - in: path - required: true - schema: - type: integer - responses: - 200: - description: OK - /customers/{customerId}/invoices/{invoiceId}/products: + /customers/{customerId}/invoices/{invoiceId}/products/details: get: parameters: - name: customerId @@ -308,62 +266,89 @@

Solución compatible (OpenAPI 3)

JSON

 {
-    "openapi": "3.0.1", 
+    "openapi": "3.0.1",
     "info": {
-        "title": "Swagger Petstore", 
+        "title": "Swagger Petstore",
         "version": "1.0"
-    }, 
+    },
     "paths": {
         "/customers/{customerId}/invoices": {
             "get": {
                 "parameters": [
                     {
-                        "name": "customerId", 
-                        "in": "path", 
-                        "required": true, 
+                        "name": "customerId",
+                        "in": "path",
+                        "required": true,
                         "schema": {
                             "type": "integer"
                         }
                     }
-                ], 
+                ],
                 "responses": {
                     "200": {
                         "description": "OK"
                     }
                 }
             }
-        }, 
+        },
         "/invoices/{invoiceId}": {
             "get": {
                 "parameters": [
                     {
-                        "name": "invoiceId", 
-                        "in": "path", 
-                        "required": true, 
+                        "name": "invoiceId",
+                        "in": "path",
+                        "required": true,
                         "schema": {
                             "type": "integer"
                         }
                     }
-                ], 
+                ],
                 "responses": {
                     "200": {
                         "description": "OK"
                     }
                 }
             }
-        }, 
+        },
         "/invoices/{invoiceId}/products": {
             "get": {
                 "parameters": [
                     {
-                        "name": "invoiceId", 
-                        "in": "path", 
-                        "required": true, 
+                        "name": "invoiceId",
+                        "in": "path",
+                        "required": true,
+                        "schema": {
+                            "type": "integer"
+                        }
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "OK"
+                    }
+                }
+            }
+        },
+        "/customers/{customerId}/invoices/{invoiceId}/products": {
+            "get": {
+                "parameters": [
+                    {
+                        "name": "customerId",
+                        "in": "path",
+                        "required": true,
+                        "schema": {
+                            "type": "integer"
+                        }
+                    },
+                    {
+                        "name": "invoiceId",
+                        "in": "path",
+                        "required": true,
                         "schema": {
                             "type": "integer"
                         }
                     }
-                ], 
+                ],
                 "responses": {
                     "200": {
                         "description": "OK"
@@ -414,4 +399,20 @@ 

YAML

responses: 200: description: OK -
\ No newline at end of file + /customers/{customerId}/invoices/{invoiceId}/products: + get: + parameters: + - name: customerId + in: path + required: true + schema: + type: integer + - name: invoiceId + in: path + required: true + schema: + type: integer + responses: + 200: + description: OK +
diff --git a/src/main/resources/org/sonar/l10n/es/openapi/rules/openapi/resources/OAR015.html b/src/main/resources/org/sonar/l10n/es/openapi/rules/openapi/resources/OAR015.html index a30a70c3..3ce2860e 100644 --- a/src/main/resources/org/sonar/l10n/es/openapi/rules/openapi/resources/OAR015.html +++ b/src/main/resources/org/sonar/l10n/es/openapi/rules/openapi/resources/OAR015.html @@ -1,42 +1,23 @@

Una ruta compleja puede ser una insinuación para detectar definiciones de API incorrectas.

El número de partes de la ruta debe ser menor a 4, cuando el número de partes de la ruta sea mayor o igual a 6 se mostrará un error.

+

Nota: Los parámetros de ruta (p.ej. {customerId}) se excluyen del conteo de profundidad — solo cuentan los segmentos literales de nombre de recurso.

Ejemplo de código no compatible (OpenAPI 2)

JSON

 {
-    "swagger": "2.0", 
+    "swagger": "2.0",
     "info": {
-        "title": "Swagger Petstore", 
+        "title": "Swagger Petstore",
         "version": "1.0"
-    }, 
+    },
     "paths": {
-        "/customers/{customerId}/invoices/{invoiceId}/products/{productId}": {
+        "/customers/{customerId}/invoices/{invoiceId}/products/details/versions": {
             "get": {
                 "parameters": [
-                    {
-                        "in": "path", 
-                        "name": "customerId", 
-                        "type": "integer", 
-                        "required": true
-                    }, 
-                    {
-                        "in": "path", 
-                        "name": "invoiceId", 
-                        "type": "integer", 
-                        "required": true
-                    }, 
-                    {
-                        "in": "path", 
-                        "name": "productId", 
-                        "type": "integer", 
-                        "required": true
-                    }
-                ], 
-                "responses": {
-                    "200": {
-                        "description": "OK"
-                    }
-                }
+                    { "in": "path", "name": "customerId", "type": "integer", "required": true },
+                    { "in": "path", "name": "invoiceId", "type": "integer", "required": true }
+                ],
+                "responses": { "200": { "description": "OK" } }
             }
         }
     }
@@ -49,7 +30,7 @@ 

YAML

title: Swagger Petstore version: "1.0" paths: - /customers/{customerId}/invoices/{invoiceId}/products/{productId}: + /customers/{customerId}/invoices/{invoiceId}/products/details/versions: get: parameters: - in: path @@ -60,10 +41,6 @@

YAML

name: invoiceId type: integer required: true - - in: path - name: productId - type: integer - required: true responses: 200: description: OK @@ -72,78 +49,36 @@

Solución compatible (OpenAPI 2)

JSON

 {
-    "swagger": "2.0", 
+    "swagger": "2.0",
     "info": {
-        "title": "Swagger Petstore", 
+        "title": "Swagger Petstore",
         "version": "1.0"
-    }, 
+    },
     "paths": {
         "/customers/{customerId}/invoices": {
             "get": {
                 "parameters": [
-                    {
-                        "in": "path", 
-                        "name": "customerId", 
-                        "type": "integer", 
-                        "required": true
-                    }
-                ], 
-                "responses": {
-                    "200": {
-                        "description": "OK"
-                    }
-                }
+                    { "in": "path", "name": "customerId", "type": "integer", "required": true }
+                ],
+                "responses": { "200": { "description": "OK" } }
             }
-        }, 
+        },
         "/invoices/{invoiceId}": {
             "get": {
                 "parameters": [
-                    {
-                        "in": "path", 
-                        "name": "invoiceId", 
-                        "type": "integer", 
-                        "required": true
-                    }
-                ], 
-                "responses": {
-                    "200": {
-                        "description": "OK"
-                    }
-                }
+                    { "in": "path", "name": "invoiceId", "type": "integer", "required": true }
+                ],
+                "responses": { "200": { "description": "OK" } }
             }
-        }, 
-        "/invoices/{invoiceId}/products": {
-            "get": {
-                "parameters": [
-                    {
-                        "in": "path", 
-                        "name": "invoiceId", 
-                        "type": "integer", 
-                        "required": true
-                    }
-                ], 
-                "responses": {
-                    "200": {
-                        "description": "OK"
-                    }
-                }
-            }
-        }, 
-        "/products/{productId}": {
+        },
+        "/customers/{customerId}/invoices/{invoiceId}/products/{productId}": {
             "get": {
                 "parameters": [
-                    {
-                        "in": "path", 
-                        "name": "productId", 
-                        "type": "integer", 
-                        "required": true
-                    }
-                ], 
-                "responses": {
-                    "200": {
-                        "description": "OK"
-                    }
-                }
+                    { "in": "path", "name": "customerId", "type": "integer", "required": true },
+                    { "in": "path", "name": "invoiceId", "type": "integer", "required": true },
+                    { "in": "path", "name": "productId", "type": "integer", "required": true }
+                ],
+                "responses": { "200": { "description": "OK" } }
             }
         }
     }
@@ -176,19 +111,17 @@ 

YAML

responses: 200: description: OK - /invoices/{invoiceId}/products: + /customers/{customerId}/invoices/{invoiceId}/products/{productId}: get: parameters: + - in: path + name: customerId + type: integer + required: true - in: path name: invoiceId type: integer required: true - responses: - 200: - description: OK - /products/{productId}: - get: - parameters: - in: path name: productId type: integer @@ -201,45 +134,19 @@

Ejemplo de código no compatible (OpenAPI 3)

JSON

 {
-    "openapi": "3.0.1", 
+    "openapi": "3.0.1",
     "info": {
-        "title": "Swagger Petstore", 
+        "title": "Swagger Petstore",
         "version": "1.0"
-    }, 
+    },
     "paths": {
-        "/customers/{customerId}/invoices/{invoiceId}/products/{productId}": {
+        "/customers/{customerId}/invoices/{invoiceId}/products/details/versions": {
             "get": {
                 "parameters": [
-                    {
-                        "name": "customerId", 
-                        "in": "path", 
-                        "required": true, 
-                        "schema": {
-                            "type": "integer"
-                        }
-                    }, 
-                    {
-                        "name": "invoiceId", 
-                        "in": "path", 
-                        "required": true, 
-                        "schema": {
-                            "type": "integer"
-                        }
-                    }, 
-                    {
-                        "name": "productId", 
-                        "in": "path", 
-                        "required": true, 
-                        "schema": {
-                            "type": "integer"
-                        }
-                    }
-                ], 
-                "responses": {
-                    "200": {
-                        "description": "OK"
-                    }
-                }
+                    { "name": "customerId", "in": "path", "required": true, "schema": { "type": "integer" } },
+                    { "name": "invoiceId", "in": "path", "required": true, "schema": { "type": "integer" } }
+                ],
+                "responses": { "200": { "description": "OK" } }
             }
         }
     }
@@ -252,7 +159,7 @@ 

YAML

title: Swagger Petstore version: "1.0" paths: - /customers/{customerId}/invoices/{invoiceId}/products/{productId}: + /customers/{customerId}/invoices/{invoiceId}/products/details/versions: get: parameters: - name: customerId @@ -265,11 +172,6 @@

YAML

required: true schema: type: integer - - name: productId - in: path - required: true - schema: - type: integer responses: 200: description: OK @@ -278,86 +180,36 @@

Solución compatible (OpenAPI 3)

JSON

 {
-    "openapi": "3.0.1", 
+    "openapi": "3.0.1",
     "info": {
-        "title": "Swagger Petstore", 
+        "title": "Swagger Petstore",
         "version": "1.0"
-    }, 
+    },
     "paths": {
         "/customers/{customerId}/invoices": {
             "get": {
                 "parameters": [
-                    {
-                        "name": "customerId", 
-                        "in": "path", 
-                        "required": true, 
-                        "schema": {
-                            "type": "integer"
-                        }
-                    }
-                ], 
-                "responses": {
-                    "200": {
-                        "description": "OK"
-                    }
-                }
+                    { "name": "customerId", "in": "path", "required": true, "schema": { "type": "integer" } }
+                ],
+                "responses": { "200": { "description": "OK" } }
             }
-        }, 
+        },
         "/invoices/{invoiceId}": {
             "get": {
                 "parameters": [
-                    {
-                        "name": "invoiceId", 
-                        "in": "path", 
-                        "required": true, 
-                        "schema": {
-                            "type": "integer"
-                        }
-                    }
-                ], 
-                "responses": {
-                    "200": {
-                        "description": "OK"
-                    }
-                }
+                    { "name": "invoiceId", "in": "path", "required": true, "schema": { "type": "integer" } }
+                ],
+                "responses": { "200": { "description": "OK" } }
             }
-        }, 
-        "/invoices/{invoiceId}/products": {
-            "get": {
-                "parameters": [
-                    {
-                        "name": "invoiceId", 
-                        "in": "path", 
-                        "required": true, 
-                        "schema": {
-                            "type": "integer"
-                        }
-                    }
-                ], 
-                "responses": {
-                    "200": {
-                        "description": "OK"
-                    }
-                }
-            }
-        }, 
-        "/products/{productId}": {
+        },
+        "/customers/{customerId}/invoices/{invoiceId}/products/{productId}": {
             "get": {
                 "parameters": [
-                    {
-                        "name": "productId", 
-                        "in": "path", 
-                        "required": true, 
-                        "schema": {
-                            "type": "integer"
-                        }
-                    }
-                ], 
-                "responses": {
-                    "200": {
-                        "description": "OK"
-                    }
-                }
+                    { "name": "customerId", "in": "path", "required": true, "schema": { "type": "integer" } },
+                    { "name": "invoiceId", "in": "path", "required": true, "schema": { "type": "integer" } },
+                    { "name": "productId", "in": "path", "required": true, "schema": { "type": "integer" } }
+                ],
+                "responses": { "200": { "description": "OK" } }
             }
         }
     }
@@ -392,20 +244,19 @@ 

YAML

responses: 200: description: OK - /invoices/{invoiceId}/products: + /customers/{customerId}/invoices/{invoiceId}/products/{productId}: get: parameters: + - name: customerId + in: path + required: true + schema: + type: integer - name: invoiceId in: path required: true schema: type: integer - responses: - 200: - description: OK - /products/{productId}: - get: - parameters: - name: productId in: path required: true @@ -414,4 +265,4 @@

YAML

responses: 200: description: OK -
\ No newline at end of file +
diff --git a/src/main/resources/org/sonar/l10n/openapi/rules/openapi/operations/OAR014.html b/src/main/resources/org/sonar/l10n/openapi/rules/openapi/operations/OAR014.html index 532ded52..fe4414b9 100644 --- a/src/main/resources/org/sonar/l10n/openapi/rules/openapi/operations/OAR014.html +++ b/src/main/resources/org/sonar/l10n/openapi/rules/openapi/operations/OAR014.html @@ -1,5 +1,6 @@

A complex path may be a hint to detect wrong API definitions.

The number of parts of the path must be less than 4, when the number of parts of the route is between 4 and 5 a warning will be displayed.

+

Note: Path parameters (e.g. {customerId}) are excluded from the depth count — only literal resource name segments count toward the depth.

Noncompliant Code Example (OpenAPI 2)

 swagger: "2.0"
@@ -7,7 +8,7 @@ 

Noncompliant Code Example (OpenAPI 2)

title: Swagger Petstore version: "1.0" paths: - /customers/{customerId}/invoices/{invoiceId}: + /customers/{customerId}/invoices/{invoiceId}/products: get: parameters: - in: path @@ -21,7 +22,7 @@

Noncompliant Code Example (OpenAPI 2)

responses: 200: description: OK - /customers/{customerId}/invoices/{invoiceId}/products: # Noncompliant {{OAR014: Resources depth level should be smaller}} + /customers/{customerId}/invoices/{invoiceId}/products/details: # Noncompliant {{OAR014: Resources depth level should be smaller}} get: parameters: - in: path @@ -73,6 +74,20 @@

Compliant Solution (OpenAPI 2)

responses: 200: description: OK + /customers/{customerId}/invoices/{invoiceId}/products: + get: + parameters: + - in: path + name: customerId + type: integer + required: true + - in: path + name: invoiceId + type: integer + required: true + responses: + 200: + description: OK

Noncompliant Code Example (OpenAPI 3)

@@ -81,7 +96,7 @@ 

Noncompliant Code Example (OpenAPI 3)

title: Swagger Petstore version: "1.0" paths: - /customers/{customerId}/invoices/{invoiceId}: + /customers/{customerId}/invoices/{invoiceId}/products: get: parameters: - name: customerId @@ -97,7 +112,7 @@

Noncompliant Code Example (OpenAPI 3)

responses: 200: description: OK - /customers/{customerId}/invoices/{invoiceId}/products: # Noncompliant {{OAR014: Resources depth level should be smaller}} + /customers/{customerId}/invoices/{invoiceId}/products/details: # Noncompliant {{OAR014: Resources depth level should be smaller}} get: parameters: - name: customerId @@ -154,4 +169,20 @@

Compliant Solution (OpenAPI 3)

responses: 200: description: OK -
\ No newline at end of file + /customers/{customerId}/invoices/{invoiceId}/products: + get: + parameters: + - name: customerId + in: path + required: true + schema: + type: integer + - name: invoiceId + in: path + required: true + schema: + type: integer + responses: + 200: + description: OK +
diff --git a/src/main/resources/org/sonar/l10n/openapi/rules/openapi/operations/OAR015.html b/src/main/resources/org/sonar/l10n/openapi/rules/openapi/operations/OAR015.html index 0a0ac322..ca3714ab 100644 --- a/src/main/resources/org/sonar/l10n/openapi/rules/openapi/operations/OAR015.html +++ b/src/main/resources/org/sonar/l10n/openapi/rules/openapi/operations/OAR015.html @@ -1,5 +1,6 @@

A complex path may be a hint to detect wrong API definitions.

The number of parts of the path must be less than 4, when the number of parts of the route is equal or greater than 6 an error will be displayed.

+

Note: Path parameters (e.g. {customerId}) are excluded from the depth count — only literal resource name segments count toward the depth.

Noncompliant Code Example (OpenAPI 2)

 swagger: "2.0"
@@ -7,7 +8,7 @@ 

Noncompliant Code Example (OpenAPI 2)

title: Swagger Petstore version: "1.0" paths: - /customers/{customerId}/invoices/{invoiceId}/products/{productId}: # Noncompliant {{OAR015: Resources depth level should be smaller}} + /customers/{customerId}/invoices/{invoiceId}/products/details/versions: # Noncompliant {{OAR015: Resources depth level should be smaller}} get: parameters: - in: path @@ -18,10 +19,6 @@

Noncompliant Code Example (OpenAPI 2)

name: invoiceId type: integer required: true - - in: path - name: productId - type: integer - required: true responses: 200: description: OK @@ -53,19 +50,17 @@

Compliant Solution (OpenAPI 2)

responses: 200: description: OK - /invoices/{invoiceId}/products: + /customers/{customerId}/invoices/{invoiceId}/products/{productId}: get: parameters: + - in: path + name: customerId + type: integer + required: true - in: path name: invoiceId type: integer required: true - responses: - 200: - description: OK - /products/{productId}: - get: - parameters: - in: path name: productId type: integer @@ -81,7 +76,7 @@

Noncompliant Code Example (OpenAPI 3)

title: Swagger Petstore version: "1.0" paths: - /customers/{customerId}/invoices/{invoiceId}/products/{productId}: # Noncompliant {{OAR015: Resources depth level should be smaller}} + /customers/{customerId}/invoices/{invoiceId}/products/details/versions: # Noncompliant {{OAR015: Resources depth level should be smaller}} get: parameters: - name: customerId @@ -94,11 +89,6 @@

Noncompliant Code Example (OpenAPI 3)

required: true schema: type: integer - - name: productId - in: path - required: true - schema: - type: integer responses: 200: description: OK @@ -132,20 +122,19 @@

Compliant Solution (OpenAPI 3)

responses: 200: description: OK - /invoices/{invoiceId}/products: + /customers/{customerId}/invoices/{invoiceId}/products/{productId}: get: parameters: + - name: customerId + in: path + required: true + schema: + type: integer - name: invoiceId in: path required: true schema: type: integer - responses: - 200: - description: OK - /products/{productId}: - get: - parameters: - name: productId in: path required: true @@ -154,4 +143,4 @@

Compliant Solution (OpenAPI 3)

responses: 200: description: OK -
\ No newline at end of file +
diff --git a/src/main/resources/org/sonar/l10n/openapi/rules/openapi/resources/OAR014.html b/src/main/resources/org/sonar/l10n/openapi/rules/openapi/resources/OAR014.html index 8739cc7e..8888fbed 100644 --- a/src/main/resources/org/sonar/l10n/openapi/rules/openapi/resources/OAR014.html +++ b/src/main/resources/org/sonar/l10n/openapi/rules/openapi/resources/OAR014.html @@ -1,54 +1,32 @@

A complex path may be a hint to detect wrong API definitions.

The number of parts of the path must be less than 4, when the number of parts of the route is between 4 and 5 a warning will be displayed.

+

Note: Path parameters (e.g. {customerId}) are excluded from the depth count — only literal resource name segments count toward the depth.

Noncompliant Code Example (OpenAPI 2)

JSON

 {
-    "swagger": "2.0", 
+    "swagger": "2.0",
     "info": {
-        "title": "Swagger Petstore", 
+        "title": "Swagger Petstore",
         "version": "1.0"
-    }, 
+    },
     "paths": {
-        "/customers/{customerId}/invoices/{invoiceId}": {
+        "/customers/{customerId}/invoices/{invoiceId}/products/details": {
             "get": {
                 "parameters": [
                     {
-                        "in": "path", 
-                        "name": "customerId", 
-                        "type": "integer", 
+                        "in": "path",
+                        "name": "customerId",
+                        "type": "integer",
                         "required": true
-                    }, 
+                    },
                     {
-                        "in": "path", 
-                        "name": "invoiceId", 
-                        "type": "integer", 
+                        "in": "path",
+                        "name": "invoiceId",
+                        "type": "integer",
                         "required": true
                     }
-                ], 
-                "responses": {
-                    "200": {
-                        "description": "OK"
-                    }
-                }
-            }
-        }, 
-        "/customers/{customerId}/invoices/{invoiceId}/products": {
-            "get": {
-                "parameters": [
-                    {
-                        "in": "path", 
-                        "name": "customerId", 
-                        "type": "integer", 
-                        "required": true
-                    }, 
-                    {
-                        "in": "path", 
-                        "name": "invoiceId", 
-                        "type": "integer", 
-                        "required": true
-                    }
-                ], 
+                ],
                 "responses": {
                     "200": {
                         "description": "OK"
@@ -66,21 +44,7 @@ 

YAML

title: Swagger Petstore version: "1.0" paths: - /customers/{customerId}/invoices/{invoiceId}: - get: - parameters: - - in: path - name: customerId - type: integer - required: true - - in: path - name: invoiceId - type: integer - required: true - responses: - 200: - description: OK - /customers/{customerId}/invoices/{invoiceId}/products: + /customers/{customerId}/invoices/{invoiceId}/products/details: get: parameters: - in: path @@ -99,56 +63,79 @@

Compliant Solution (OpenAPI 2)

JSON

 {
-    "swagger": "2.0", 
+    "swagger": "2.0",
     "info": {
-        "title": "Swagger Petstore", 
+        "title": "Swagger Petstore",
         "version": "1.0"
-    }, 
+    },
     "paths": {
         "/customers/{customerId}/invoices": {
             "get": {
                 "parameters": [
                     {
-                        "in": "path", 
-                        "name": "customerId", 
-                        "type": "integer", 
+                        "in": "path",
+                        "name": "customerId",
+                        "type": "integer",
                         "required": true
                     }
-                ], 
+                ],
                 "responses": {
                     "200": {
                         "description": "OK"
                     }
                 }
             }
-        }, 
+        },
         "/invoices/{invoiceId}": {
             "get": {
                 "parameters": [
                     {
-                        "in": "path", 
-                        "name": "invoiceId", 
-                        "type": "integer", 
+                        "in": "path",
+                        "name": "invoiceId",
+                        "type": "integer",
                         "required": true
                     }
-                ], 
+                ],
                 "responses": {
                     "200": {
                         "description": "OK"
                     }
                 }
             }
-        }, 
+        },
         "/invoices/{invoiceId}/products": {
             "get": {
                 "parameters": [
                     {
-                        "in": "path", 
-                        "name": "invoiceId", 
-                        "type": "integer", 
+                        "in": "path",
+                        "name": "invoiceId",
+                        "type": "integer",
                         "required": true
                     }
-                ], 
+                ],
+                "responses": {
+                    "200": {
+                        "description": "OK"
+                    }
+                }
+            }
+        },
+        "/customers/{customerId}/invoices/{invoiceId}/products": {
+            "get": {
+                "parameters": [
+                    {
+                        "in": "path",
+                        "name": "customerId",
+                        "type": "integer",
+                        "required": true
+                    },
+                    {
+                        "in": "path",
+                        "name": "invoiceId",
+                        "type": "integer",
+                        "required": true
+                    }
+                ],
                 "responses": {
                     "200": {
                         "description": "OK"
@@ -196,64 +183,51 @@ 

YAML

responses: 200: description: OK + /customers/{customerId}/invoices/{invoiceId}/products: + get: + parameters: + - in: path + name: customerId + type: integer + required: true + - in: path + name: invoiceId + type: integer + required: true + responses: + 200: + description: OK

Noncompliant Code Example (OpenAPI 3)

JSON

 {
-    "openapi": "3.0.1", 
+    "openapi": "3.0.1",
     "info": {
-        "title": "Swagger Petstore", 
+        "title": "Swagger Petstore",
         "version": "1.0"
-    }, 
+    },
     "paths": {
-        "/customers/{customerId}/invoices/{invoiceId}": {
+        "/customers/{customerId}/invoices/{invoiceId}/products/details": {
             "get": {
                 "parameters": [
                     {
-                        "name": "customerId", 
-                        "in": "path", 
-                        "required": true, 
+                        "name": "customerId",
+                        "in": "path",
+                        "required": true,
                         "schema": {
                             "type": "integer"
                         }
-                    }, 
+                    },
                     {
-                        "name": "invoiceId", 
-                        "in": "path", 
-                        "required": true, 
+                        "name": "invoiceId",
+                        "in": "path",
+                        "required": true,
                         "schema": {
                             "type": "integer"
                         }
                     }
-                ], 
-                "responses": {
-                    "200": {
-                        "description": "OK"
-                    }
-                }
-            }
-        }, 
-        "/customers/{customerId}/invoices/{invoiceId}/products": {
-            "get": {
-                "parameters": [
-                    {
-                        "name": "customerId", 
-                        "in": "path", 
-                        "required": true, 
-                        "schema": {
-                            "type": "integer"
-                        }
-                    }, 
-                    {
-                        "name": "invoiceId", 
-                        "in": "path", 
-                        "required": true, 
-                        "schema": {
-                            "type": "integer"
-                        }
-                    }
-                ], 
+                ],
                 "responses": {
                     "200": {
                         "description": "OK"
@@ -271,23 +245,7 @@ 

YAML

title: Swagger Petstore version: "1.0" paths: - /customers/{customerId}/invoices/{invoiceId}: - get: - parameters: - - name: customerId - in: path - required: true - schema: - type: integer - - name: invoiceId - in: path - required: true - schema: - type: integer - responses: - 200: - description: OK - /customers/{customerId}/invoices/{invoiceId}/products: + /customers/{customerId}/invoices/{invoiceId}/products/details: get: parameters: - name: customerId @@ -308,62 +266,89 @@

Compliant Solution (OpenAPI 3)

JSON

 {
-    "openapi": "3.0.1", 
+    "openapi": "3.0.1",
     "info": {
-        "title": "Swagger Petstore", 
+        "title": "Swagger Petstore",
         "version": "1.0"
-    }, 
+    },
     "paths": {
         "/customers/{customerId}/invoices": {
             "get": {
                 "parameters": [
                     {
-                        "name": "customerId", 
-                        "in": "path", 
-                        "required": true, 
+                        "name": "customerId",
+                        "in": "path",
+                        "required": true,
                         "schema": {
                             "type": "integer"
                         }
                     }
-                ], 
+                ],
                 "responses": {
                     "200": {
                         "description": "OK"
                     }
                 }
             }
-        }, 
+        },
         "/invoices/{invoiceId}": {
             "get": {
                 "parameters": [
                     {
-                        "name": "invoiceId", 
-                        "in": "path", 
-                        "required": true, 
+                        "name": "invoiceId",
+                        "in": "path",
+                        "required": true,
                         "schema": {
                             "type": "integer"
                         }
                     }
-                ], 
+                ],
                 "responses": {
                     "200": {
                         "description": "OK"
                     }
                 }
             }
-        }, 
+        },
         "/invoices/{invoiceId}/products": {
             "get": {
                 "parameters": [
                     {
-                        "name": "invoiceId", 
-                        "in": "path", 
-                        "required": true, 
+                        "name": "invoiceId",
+                        "in": "path",
+                        "required": true,
+                        "schema": {
+                            "type": "integer"
+                        }
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "OK"
+                    }
+                }
+            }
+        },
+        "/customers/{customerId}/invoices/{invoiceId}/products": {
+            "get": {
+                "parameters": [
+                    {
+                        "name": "customerId",
+                        "in": "path",
+                        "required": true,
+                        "schema": {
+                            "type": "integer"
+                        }
+                    },
+                    {
+                        "name": "invoiceId",
+                        "in": "path",
+                        "required": true,
                         "schema": {
                             "type": "integer"
                         }
                     }
-                ], 
+                ],
                 "responses": {
                     "200": {
                         "description": "OK"
@@ -414,4 +399,20 @@ 

YAML

responses: 200: description: OK -
\ No newline at end of file + /customers/{customerId}/invoices/{invoiceId}/products: + get: + parameters: + - name: customerId + in: path + required: true + schema: + type: integer + - name: invoiceId + in: path + required: true + schema: + type: integer + responses: + 200: + description: OK +
diff --git a/src/main/resources/org/sonar/l10n/openapi/rules/openapi/resources/OAR015.html b/src/main/resources/org/sonar/l10n/openapi/rules/openapi/resources/OAR015.html index 850c3863..07e822bf 100644 --- a/src/main/resources/org/sonar/l10n/openapi/rules/openapi/resources/OAR015.html +++ b/src/main/resources/org/sonar/l10n/openapi/rules/openapi/resources/OAR015.html @@ -1,42 +1,23 @@

A complex path may be a hint to detect wrong API definitions.

The number of parts of the path must be less than 4, when the number of parts of the route is equal or greater than 6 an error will be displayed.

+

Note: Path parameters (e.g. {customerId}) are excluded from the depth count — only literal resource name segments count toward the depth.

Noncompliant Code Example (OpenAPI 2)

JSON

 {
-    "swagger": "2.0", 
+    "swagger": "2.0",
     "info": {
-        "title": "Swagger Petstore", 
+        "title": "Swagger Petstore",
         "version": "1.0"
-    }, 
+    },
     "paths": {
-        "/customers/{customerId}/invoices/{invoiceId}/products/{productId}": {
+        "/customers/{customerId}/invoices/{invoiceId}/products/details/versions": {
             "get": {
                 "parameters": [
-                    {
-                        "in": "path", 
-                        "name": "customerId", 
-                        "type": "integer", 
-                        "required": true
-                    }, 
-                    {
-                        "in": "path", 
-                        "name": "invoiceId", 
-                        "type": "integer", 
-                        "required": true
-                    }, 
-                    {
-                        "in": "path", 
-                        "name": "productId", 
-                        "type": "integer", 
-                        "required": true
-                    }
-                ], 
-                "responses": {
-                    "200": {
-                        "description": "OK"
-                    }
-                }
+                    { "in": "path", "name": "customerId", "type": "integer", "required": true },
+                    { "in": "path", "name": "invoiceId", "type": "integer", "required": true }
+                ],
+                "responses": { "200": { "description": "OK" } }
             }
         }
     }
@@ -49,7 +30,7 @@ 

YAML

title: Swagger Petstore version: "1.0" paths: - /customers/{customerId}/invoices/{invoiceId}/products/{productId}: + /customers/{customerId}/invoices/{invoiceId}/products/details/versions: get: parameters: - in: path @@ -60,10 +41,6 @@

YAML

name: invoiceId type: integer required: true - - in: path - name: productId - type: integer - required: true responses: 200: description: OK @@ -72,78 +49,36 @@

Compliant Solution (OpenAPI 2)

JSON

 {
-    "swagger": "2.0", 
+    "swagger": "2.0",
     "info": {
-        "title": "Swagger Petstore", 
+        "title": "Swagger Petstore",
         "version": "1.0"
-    }, 
+    },
     "paths": {
         "/customers/{customerId}/invoices": {
             "get": {
                 "parameters": [
-                    {
-                        "in": "path", 
-                        "name": "customerId", 
-                        "type": "integer", 
-                        "required": true
-                    }
-                ], 
-                "responses": {
-                    "200": {
-                        "description": "OK"
-                    }
-                }
+                    { "in": "path", "name": "customerId", "type": "integer", "required": true }
+                ],
+                "responses": { "200": { "description": "OK" } }
             }
-        }, 
+        },
         "/invoices/{invoiceId}": {
             "get": {
                 "parameters": [
-                    {
-                        "in": "path", 
-                        "name": "invoiceId", 
-                        "type": "integer", 
-                        "required": true
-                    }
-                ], 
-                "responses": {
-                    "200": {
-                        "description": "OK"
-                    }
-                }
+                    { "in": "path", "name": "invoiceId", "type": "integer", "required": true }
+                ],
+                "responses": { "200": { "description": "OK" } }
             }
-        }, 
-        "/invoices/{invoiceId}/products": {
-            "get": {
-                "parameters": [
-                    {
-                        "in": "path", 
-                        "name": "invoiceId", 
-                        "type": "integer", 
-                        "required": true
-                    }
-                ], 
-                "responses": {
-                    "200": {
-                        "description": "OK"
-                    }
-                }
-            }
-        }, 
-        "/products/{productId}": {
+        },
+        "/customers/{customerId}/invoices/{invoiceId}/products/{productId}": {
             "get": {
                 "parameters": [
-                    {
-                        "in": "path", 
-                        "name": "productId", 
-                        "type": "integer", 
-                        "required": true
-                    }
-                ], 
-                "responses": {
-                    "200": {
-                        "description": "OK"
-                    }
-                }
+                    { "in": "path", "name": "customerId", "type": "integer", "required": true },
+                    { "in": "path", "name": "invoiceId", "type": "integer", "required": true },
+                    { "in": "path", "name": "productId", "type": "integer", "required": true }
+                ],
+                "responses": { "200": { "description": "OK" } }
             }
         }
     }
@@ -176,19 +111,17 @@ 

YAML

responses: 200: description: OK - /invoices/{invoiceId}/products: + /customers/{customerId}/invoices/{invoiceId}/products/{productId}: get: parameters: + - in: path + name: customerId + type: integer + required: true - in: path name: invoiceId type: integer required: true - responses: - 200: - description: OK - /products/{productId}: - get: - parameters: - in: path name: productId type: integer @@ -201,45 +134,19 @@

Noncompliant Code Example (OpenAPI 3)

JSON

 {
-    "openapi": "3.0.1", 
+    "openapi": "3.0.1",
     "info": {
-        "title": "Swagger Petstore", 
+        "title": "Swagger Petstore",
         "version": "1.0"
-    }, 
+    },
     "paths": {
-        "/customers/{customerId}/invoices/{invoiceId}/products/{productId}": {
+        "/customers/{customerId}/invoices/{invoiceId}/products/details/versions": {
             "get": {
                 "parameters": [
-                    {
-                        "name": "customerId", 
-                        "in": "path", 
-                        "required": true, 
-                        "schema": {
-                            "type": "integer"
-                        }
-                    }, 
-                    {
-                        "name": "invoiceId", 
-                        "in": "path", 
-                        "required": true, 
-                        "schema": {
-                            "type": "integer"
-                        }
-                    }, 
-                    {
-                        "name": "productId", 
-                        "in": "path", 
-                        "required": true, 
-                        "schema": {
-                            "type": "integer"
-                        }
-                    }
-                ], 
-                "responses": {
-                    "200": {
-                        "description": "OK"
-                    }
-                }
+                    { "name": "customerId", "in": "path", "required": true, "schema": { "type": "integer" } },
+                    { "name": "invoiceId", "in": "path", "required": true, "schema": { "type": "integer" } }
+                ],
+                "responses": { "200": { "description": "OK" } }
             }
         }
     }
@@ -252,7 +159,7 @@ 

YAML

title: Swagger Petstore version: "1.0" paths: - /customers/{customerId}/invoices/{invoiceId}/products/{productId}: + /customers/{customerId}/invoices/{invoiceId}/products/details/versions: get: parameters: - name: customerId @@ -265,11 +172,6 @@

YAML

required: true schema: type: integer - - name: productId - in: path - required: true - schema: - type: integer responses: 200: description: OK @@ -278,86 +180,36 @@

Compliant Solution (OpenAPI 3)

JSON

 {
-    "openapi": "3.0.1", 
+    "openapi": "3.0.1",
     "info": {
-        "title": "Swagger Petstore", 
+        "title": "Swagger Petstore",
         "version": "1.0"
-    }, 
+    },
     "paths": {
         "/customers/{customerId}/invoices": {
             "get": {
                 "parameters": [
-                    {
-                        "name": "customerId", 
-                        "in": "path", 
-                        "required": true, 
-                        "schema": {
-                            "type": "integer"
-                        }
-                    }
-                ], 
-                "responses": {
-                    "200": {
-                        "description": "OK"
-                    }
-                }
+                    { "name": "customerId", "in": "path", "required": true, "schema": { "type": "integer" } }
+                ],
+                "responses": { "200": { "description": "OK" } }
             }
-        }, 
+        },
         "/invoices/{invoiceId}": {
             "get": {
                 "parameters": [
-                    {
-                        "name": "invoiceId", 
-                        "in": "path", 
-                        "required": true, 
-                        "schema": {
-                            "type": "integer"
-                        }
-                    }
-                ], 
-                "responses": {
-                    "200": {
-                        "description": "OK"
-                    }
-                }
+                    { "name": "invoiceId", "in": "path", "required": true, "schema": { "type": "integer" } }
+                ],
+                "responses": { "200": { "description": "OK" } }
             }
-        }, 
-        "/invoices/{invoiceId}/products": {
-            "get": {
-                "parameters": [
-                    {
-                        "name": "invoiceId", 
-                        "in": "path", 
-                        "required": true, 
-                        "schema": {
-                            "type": "integer"
-                        }
-                    }
-                ], 
-                "responses": {
-                    "200": {
-                        "description": "OK"
-                    }
-                }
-            }
-        }, 
-        "/products/{productId}": {
+        },
+        "/customers/{customerId}/invoices/{invoiceId}/products/{productId}": {
             "get": {
                 "parameters": [
-                    {
-                        "name": "productId", 
-                        "in": "path", 
-                        "required": true, 
-                        "schema": {
-                            "type": "integer"
-                        }
-                    }
-                ], 
-                "responses": {
-                    "200": {
-                        "description": "OK"
-                    }
-                }
+                    { "name": "customerId", "in": "path", "required": true, "schema": { "type": "integer" } },
+                    { "name": "invoiceId", "in": "path", "required": true, "schema": { "type": "integer" } },
+                    { "name": "productId", "in": "path", "required": true, "schema": { "type": "integer" } }
+                ],
+                "responses": { "200": { "description": "OK" } }
             }
         }
     }
@@ -392,20 +244,19 @@ 

YAML

responses: 200: description: OK - /invoices/{invoiceId}/products: + /customers/{customerId}/invoices/{invoiceId}/products/{productId}: get: parameters: + - name: customerId + in: path + required: true + schema: + type: integer - name: invoiceId in: path required: true schema: type: integer - responses: - 200: - description: OK - /products/{productId}: - get: - parameters: - name: productId in: path required: true @@ -414,4 +265,4 @@

YAML

responses: 200: description: OK -
\ No newline at end of file +
diff --git a/src/test/java/apiaddicts/sonar/openapi/checks/apim/wso2/OAR004ValidWso2ScopesRolesCheckTest.java b/src/test/java/apiaddicts/sonar/openapi/checks/apim/wso2/OAR004ValidWso2ScopesRolesCheckTest.java index e00e4a2f..2f85ad7c 100644 --- a/src/test/java/apiaddicts/sonar/openapi/checks/apim/wso2/OAR004ValidWso2ScopesRolesCheckTest.java +++ b/src/test/java/apiaddicts/sonar/openapi/checks/apim/wso2/OAR004ValidWso2ScopesRolesCheckTest.java @@ -55,6 +55,46 @@ public void verifyInV32WithInvalidRoles() { verifyV32("with-invalid-roles"); } + @Test + public void verifyInV2WithValidArrayRoles() { + verifyV2("with-valid-array-roles"); + } + + @Test + public void verifyInV2WithInvalidArrayRoles() { + verifyV2("with-invalid-array-roles"); + } + + @Test + public void verifyInV3WithValidArrayRoles() { + verifyV3("with-valid-array-roles"); + } + + @Test + public void verifyInV3WithInvalidArrayRoles() { + verifyV3("with-invalid-array-roles"); + } + + @Test + public void verifyInV31WithValidArrayRoles() { + verifyV31("with-valid-array-roles"); + } + + @Test + public void verifyInV31WithInvalidArrayRoles() { + verifyV31("with-invalid-array-roles"); + } + + @Test + public void verifyInV32WithValidArrayRoles() { + verifyV32("with-valid-array-roles"); + } + + @Test + public void verifyInV32WithInvalidArrayRoles() { + verifyV32("with-invalid-array-roles"); + } + @Override public void verifyRule() { assertRuleProperties("OAR004 - ValidWso2ScopesRoles - WSO2 scope roles value is not valid", RuleType.VULNERABILITY, Severity.BLOCKER, tags("api-manager", "vulnerability", "wso2")); diff --git a/src/test/resources/checks/v2/apim/wso2/OAR004/with-invalid-array-roles.json b/src/test/resources/checks/v2/apim/wso2/OAR004/with-invalid-array-roles.json new file mode 100644 index 00000000..c33df6db --- /dev/null +++ b/src/test/resources/checks/v2/apim/wso2/OAR004/with-invalid-array-roles.json @@ -0,0 +1,20 @@ +{ + "swagger" : "2.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/pets" : { } + }, + "x-wso2-security" : { + "apim" : { + "x-wso2-scopes" : [ { + "name" : "read", + "key" : "read", + "roles" : [ "ROLE_READ", "ROL€_V¡€U" ], # Noncompliant {{OAR004: WSO2 scope roles value is not valid}} + "description" : "Allows users to read records" + } ] + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v2/apim/wso2/OAR004/with-invalid-array-roles.yaml b/src/test/resources/checks/v2/apim/wso2/OAR004/with-invalid-array-roles.yaml new file mode 100644 index 00000000..cbfa1337 --- /dev/null +++ b/src/test/resources/checks/v2/apim/wso2/OAR004/with-invalid-array-roles.yaml @@ -0,0 +1,16 @@ +swagger: "2.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: {} + +x-wso2-security: + apim: + x-wso2-scopes: + - name: read + key: read + roles: + - ROLE_READ + - ROL€_V¡€U # Noncompliant {{OAR004: WSO2 scope roles value is not valid}} + description: Allows users to read records diff --git a/src/test/resources/checks/v2/apim/wso2/OAR004/with-valid-array-roles.json b/src/test/resources/checks/v2/apim/wso2/OAR004/with-valid-array-roles.json new file mode 100644 index 00000000..45e521d9 --- /dev/null +++ b/src/test/resources/checks/v2/apim/wso2/OAR004/with-valid-array-roles.json @@ -0,0 +1,20 @@ +{ + "swagger" : "2.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/pets" : { } + }, + "x-wso2-security" : { + "apim" : { + "x-wso2-scopes" : [ { + "name" : "read", + "key" : "read", + "roles" : [ "ROLE_READ", "ROLE_VIEW" ], + "description" : "Allows users to read records" + } ] + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v2/apim/wso2/OAR004/with-valid-array-roles.yaml b/src/test/resources/checks/v2/apim/wso2/OAR004/with-valid-array-roles.yaml new file mode 100644 index 00000000..7bf72080 --- /dev/null +++ b/src/test/resources/checks/v2/apim/wso2/OAR004/with-valid-array-roles.yaml @@ -0,0 +1,16 @@ +swagger: "2.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: {} + +x-wso2-security: + apim: + x-wso2-scopes: + - name: read + key: read + roles: + - ROLE_READ + - ROLE_VIEW + description: Allows users to read records diff --git a/src/test/resources/checks/v2/operations/OAR014/plain.json b/src/test/resources/checks/v2/operations/OAR014/plain.json index 1dc0ee29..7561c445 100644 --- a/src/test/resources/checks/v2/operations/OAR014/plain.json +++ b/src/test/resources/checks/v2/operations/OAR014/plain.json @@ -95,7 +95,7 @@ } } }, - "/one/{one}/two/{two}/three/{three}/four/{four}/five/{five}/six": { + "/one/{one}/two/{two}/three/{three}/four/{four}/five/{five}/six": { # Noncompliant {{OAR014: Resources depth level should be smaller}} "get": { "responses": { "default": { @@ -104,7 +104,7 @@ } } }, - "/one/{one}/two/{two}/three/{three}/four/{four}/five/{five}/six/{six}": { + "/one/{one}/two/{two}/three/{three}/four/{four}/five/{five}/six/{six}": { # Noncompliant {{OAR014: Resources depth level should be smaller}} "get": { "responses": { "default": { diff --git a/src/test/resources/checks/v2/operations/OAR014/plain.yaml b/src/test/resources/checks/v2/operations/OAR014/plain.yaml index 385ef638..abae063e 100644 --- a/src/test/resources/checks/v2/operations/OAR014/plain.yaml +++ b/src/test/resources/checks/v2/operations/OAR014/plain.yaml @@ -53,12 +53,12 @@ paths: responses: default: description: Ok - /one/{one}/two/{two}/three/{three}/four/{four}/five/{five}/six: + /one/{one}/two/{two}/three/{three}/four/{four}/five/{five}/six: # Noncompliant {{OAR014: Resources depth level should be smaller}} get: responses: default: description: Ok - /one/{one}/two/{two}/three/{three}/four/{four}/five/{five}/six/{six}: + /one/{one}/two/{two}/three/{three}/four/{four}/five/{five}/six/{six}: # Noncompliant {{OAR014: Resources depth level should be smaller}} get: responses: default: diff --git a/src/test/resources/checks/v2/operations/OAR015/plain.json b/src/test/resources/checks/v2/operations/OAR015/plain.json index 53082e2b..d8f8fc1d 100644 --- a/src/test/resources/checks/v2/operations/OAR015/plain.json +++ b/src/test/resources/checks/v2/operations/OAR015/plain.json @@ -123,4 +123,4 @@ } } } -} \ No newline at end of file +} diff --git a/src/test/resources/checks/v2/operations/OAR015/plain.yaml b/src/test/resources/checks/v2/operations/OAR015/plain.yaml index 8e617f60..19bce139 100644 --- a/src/test/resources/checks/v2/operations/OAR015/plain.yaml +++ b/src/test/resources/checks/v2/operations/OAR015/plain.yaml @@ -67,4 +67,4 @@ paths: get: responses: default: - description: Ok \ No newline at end of file + description: Ok diff --git a/src/test/resources/checks/v3/apim/wso2/OAR004/with-invalid-array-roles.json b/src/test/resources/checks/v3/apim/wso2/OAR004/with-invalid-array-roles.json new file mode 100644 index 00000000..48350b93 --- /dev/null +++ b/src/test/resources/checks/v3/apim/wso2/OAR004/with-invalid-array-roles.json @@ -0,0 +1,20 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/pets" : { } + }, + "x-wso2-security" : { + "apim" : { + "x-wso2-scopes" : [ { + "name" : "read", + "key" : "read", + "roles" : [ "ROLE_READ", "ROL€_V¡€U" ], # Noncompliant {{OAR004: WSO2 scope roles value is not valid}} + "description" : "Allows users to read records" + } ] + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v3/apim/wso2/OAR004/with-invalid-array-roles.yaml b/src/test/resources/checks/v3/apim/wso2/OAR004/with-invalid-array-roles.yaml new file mode 100644 index 00000000..2958720b --- /dev/null +++ b/src/test/resources/checks/v3/apim/wso2/OAR004/with-invalid-array-roles.yaml @@ -0,0 +1,16 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: {} + +x-wso2-security: + apim: + x-wso2-scopes: + - name: read + key: read + roles: + - ROLE_READ + - ROL€_V¡€U # Noncompliant {{OAR004: WSO2 scope roles value is not valid}} + description: Allows users to read records diff --git a/src/test/resources/checks/v3/apim/wso2/OAR004/with-valid-array-roles.json b/src/test/resources/checks/v3/apim/wso2/OAR004/with-valid-array-roles.json new file mode 100644 index 00000000..1be50d89 --- /dev/null +++ b/src/test/resources/checks/v3/apim/wso2/OAR004/with-valid-array-roles.json @@ -0,0 +1,20 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/pets" : { } + }, + "x-wso2-security" : { + "apim" : { + "x-wso2-scopes" : [ { + "name" : "read", + "key" : "read", + "roles" : [ "ROLE_READ", "ROLE_VIEW" ], + "description" : "Allows users to read records" + } ] + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v3/apim/wso2/OAR004/with-valid-array-roles.yaml b/src/test/resources/checks/v3/apim/wso2/OAR004/with-valid-array-roles.yaml new file mode 100644 index 00000000..c943d6f1 --- /dev/null +++ b/src/test/resources/checks/v3/apim/wso2/OAR004/with-valid-array-roles.yaml @@ -0,0 +1,16 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: {} + +x-wso2-security: + apim: + x-wso2-scopes: + - name: read + key: read + roles: + - ROLE_READ + - ROLE_VIEW + description: Allows users to read records diff --git a/src/test/resources/checks/v31/apim/OAR004/with-invalid-array-roles.json b/src/test/resources/checks/v31/apim/OAR004/with-invalid-array-roles.json new file mode 100644 index 00000000..8d4da38a --- /dev/null +++ b/src/test/resources/checks/v31/apim/OAR004/with-invalid-array-roles.json @@ -0,0 +1,20 @@ +{ + "openapi" : "3.1.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/pets" : { } + }, + "x-wso2-security" : { + "apim" : { + "x-wso2-scopes" : [ { + "name" : "read", + "key" : "read", + "roles" : [ "ROLE_READ", "ROL€_V¡€U" ], # Noncompliant {{OAR004: WSO2 scope roles value is not valid}} + "description" : "Allows users to read records" + } ] + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/apim/OAR004/with-invalid-array-roles.yaml b/src/test/resources/checks/v31/apim/OAR004/with-invalid-array-roles.yaml new file mode 100644 index 00000000..ba79bbe6 --- /dev/null +++ b/src/test/resources/checks/v31/apim/OAR004/with-invalid-array-roles.yaml @@ -0,0 +1,16 @@ +openapi: "3.1.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: {} + +x-wso2-security: + apim: + x-wso2-scopes: + - name: read + key: read + roles: + - ROLE_READ + - ROL€_V¡€U # Noncompliant {{OAR004: WSO2 scope roles value is not valid}} + description: Allows users to read records diff --git a/src/test/resources/checks/v31/apim/OAR004/with-valid-array-roles.json b/src/test/resources/checks/v31/apim/OAR004/with-valid-array-roles.json new file mode 100644 index 00000000..60b81451 --- /dev/null +++ b/src/test/resources/checks/v31/apim/OAR004/with-valid-array-roles.json @@ -0,0 +1,20 @@ +{ + "openapi" : "3.1.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/pets" : { } + }, + "x-wso2-security" : { + "apim" : { + "x-wso2-scopes" : [ { + "name" : "read", + "key" : "read", + "roles" : [ "ROLE_READ", "ROLE_VIEW" ], + "description" : "Allows users to read records" + } ] + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v31/apim/OAR004/with-valid-array-roles.yaml b/src/test/resources/checks/v31/apim/OAR004/with-valid-array-roles.yaml new file mode 100644 index 00000000..8db7ca63 --- /dev/null +++ b/src/test/resources/checks/v31/apim/OAR004/with-valid-array-roles.yaml @@ -0,0 +1,16 @@ +openapi: "3.1.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: {} + +x-wso2-security: + apim: + x-wso2-scopes: + - name: read + key: read + roles: + - ROLE_READ + - ROLE_VIEW + description: Allows users to read records diff --git a/src/test/resources/checks/v32/apim/OAR004/with-invalid-array-roles.json b/src/test/resources/checks/v32/apim/OAR004/with-invalid-array-roles.json new file mode 100644 index 00000000..8174b636 --- /dev/null +++ b/src/test/resources/checks/v32/apim/OAR004/with-invalid-array-roles.json @@ -0,0 +1,20 @@ +{ + "openapi" : "3.2.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/pets" : { } + }, + "x-wso2-security" : { + "apim" : { + "x-wso2-scopes" : [ { + "name" : "read", + "key" : "read", + "roles" : [ "ROLE_READ", "ROL€_V¡€U" ], # Noncompliant {{OAR004: WSO2 scope roles value is not valid}} + "description" : "Allows users to read records" + } ] + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/apim/OAR004/with-invalid-array-roles.yaml b/src/test/resources/checks/v32/apim/OAR004/with-invalid-array-roles.yaml new file mode 100644 index 00000000..d87427fd --- /dev/null +++ b/src/test/resources/checks/v32/apim/OAR004/with-invalid-array-roles.yaml @@ -0,0 +1,16 @@ +openapi: "3.2.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: {} + +x-wso2-security: + apim: + x-wso2-scopes: + - name: read + key: read + roles: + - ROLE_READ + - ROL€_V¡€U # Noncompliant {{OAR004: WSO2 scope roles value is not valid}} + description: Allows users to read records diff --git a/src/test/resources/checks/v32/apim/OAR004/with-valid-array-roles.json b/src/test/resources/checks/v32/apim/OAR004/with-valid-array-roles.json new file mode 100644 index 00000000..50a8ea65 --- /dev/null +++ b/src/test/resources/checks/v32/apim/OAR004/with-valid-array-roles.json @@ -0,0 +1,20 @@ +{ + "openapi" : "3.2.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/pets" : { } + }, + "x-wso2-security" : { + "apim" : { + "x-wso2-scopes" : [ { + "name" : "read", + "key" : "read", + "roles" : [ "ROLE_READ", "ROLE_VIEW" ], + "description" : "Allows users to read records" + } ] + } + } +} \ No newline at end of file diff --git a/src/test/resources/checks/v32/apim/OAR004/with-valid-array-roles.yaml b/src/test/resources/checks/v32/apim/OAR004/with-valid-array-roles.yaml new file mode 100644 index 00000000..b9e95562 --- /dev/null +++ b/src/test/resources/checks/v32/apim/OAR004/with-valid-array-roles.yaml @@ -0,0 +1,16 @@ +openapi: "3.2.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: {} + +x-wso2-security: + apim: + x-wso2-scopes: + - name: read + key: read + roles: + - ROLE_READ + - ROLE_VIEW + description: Allows users to read records From 10e0b97ba4a617aadee6308f5e74c2a570451f1b Mon Sep 17 00:00:00 2001 From: Melsy Huamani Date: Fri, 29 May 2026 10:01:23 -0500 Subject: [PATCH 19/28] update version and changelog --- CHANGELOG.md | 7 +++++++ pom.xml | 4 ++-- .../checks/apim/wso2/AbstractPatternWso2ScopesCheck.java | 9 +++++---- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c355422a..c1eed01a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [1.4.1-beta-3] - 2026-05-29 + +### Fixed + +- OAR004 - ValidWso2ScopesRoles - Fixed false negative where `roles` defined as a YAML/JSON array were not validated element by element. Updated `AbstractPatternWso2ScopesCheck.visitScope()` to iterate array elements via `fieldNode.elements()` and validate each one individually. Added test fixtures for array roles in v2, v3, v31 and v32 formats. +- OAR014 - ResourceLevelWithinNonSuggestedRange - Removed upper bound threshold: rule now fires for all depths ≥ 4 (previously only fired for depths 4–5), aligning with Spectral behavior. Updated v2 test fixtures to mark depth-6 paths as noncompliant. +- OAR015 - ResourceLevelMaxAllowed - Updated depth calculation algorithm in `AbstractResourceLevelCheck.matchLevel(String path)` to count only literal segments, explicitly excluding path parameters (e.g. `{customerId}`) and `/me` segments — matching Spectral's algorithm exactly. Previously used a `pathParts − literalParamPairs` formula that produced different results for paths starting with parameters, consecutive parameters, or containing `/me`. ## [1.4.1-beta-2] - 2026-05-28 diff --git a/pom.xml b/pom.xml index 9de5e121..47418aeb 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 org.apiaddicts.apitools.dosonarapi sonaropenapi-rules-community - 1.4.1-beta-2 + 1.4.1-beta-3 sonar-plugin SonarQube OpenAPI Community Rules @@ -64,7 +64,7 @@ 8.7.0.41497 6.7 - 1.2.1-beta-1 + 1.2.1-beta-2 1.22.0.848 20231013 4.13.2 diff --git a/src/main/java/apiaddicts/sonar/openapi/checks/apim/wso2/AbstractPatternWso2ScopesCheck.java b/src/main/java/apiaddicts/sonar/openapi/checks/apim/wso2/AbstractPatternWso2ScopesCheck.java index c6df9d14..fb482421 100644 --- a/src/main/java/apiaddicts/sonar/openapi/checks/apim/wso2/AbstractPatternWso2ScopesCheck.java +++ b/src/main/java/apiaddicts/sonar/openapi/checks/apim/wso2/AbstractPatternWso2ScopesCheck.java @@ -30,20 +30,21 @@ protected void visitFile(JsonNode root) { @Override protected void visitScope(JsonNode scope) { JsonNode fieldNode = scope.propertyMap().get(fieldName); - if (fieldNode == null || fieldNode.isNull() || fieldNode.isMissing()) return; + if (fieldNode == null || fieldNode.isNull() || fieldNode.isMissing()) + return; List elements = fieldNode.elements(); if (!elements.isEmpty()) { for (JsonNode element : elements) { String roleText = element.getTokenValue(); if (roleText != null && !pattern.matcher(roleText).matches()) { - addIssue(ruleKey, translate(messageKey), element.value()); + addIssue(ruleKey, translate(messageKey), element); } } } else { String fieldText = fieldNode.getTokenValue(); - if (!pattern.matcher(fieldText).matches()) { - addIssue(ruleKey, translate(messageKey), fieldNode.value()); + if (fieldText != null && !pattern.matcher(fieldText).matches()) { + addIssue(ruleKey, translate(messageKey), fieldNode); } } } From 91e5d7545d81b51c6c2bae0dae71285506ef46e6 Mon Sep 17 00:00:00 2001 From: Melsy Huamani Date: Sat, 30 May 2026 07:15:51 -0500 Subject: [PATCH 20/28] fix: oar017, oar020 and oar021 rules --- CHANGELOG.md | 7 + pom.xml | 2 +- .../operations/OAR017ResourcePathCheck.java | 51 ++--- .../AbstractQueryParameterCheck.java | 12 +- .../OAR020ExpandParameterCheck.java | 22 +- .../OAR021ExcludeParameterCheck.java | 23 +- .../rules/openapi/operations/OAR017.html | 13 +- .../rules/openapi/parameters/OAR020.html | 200 ++++++++++-------- .../rules/openapi/parameters/OAR021.html | 200 ++++++++++-------- .../rules/openapi/resources/OAR017.html | 13 +- .../rules/openapi/operations/OAR017.html | 13 +- .../rules/openapi/parameters/OAR020.html | 194 +++++++++-------- .../rules/openapi/parameters/OAR021.html | 194 +++++++++-------- .../rules/openapi/resources/OAR017.html | 13 +- .../OAR017ResourcePathCheckTest.java | 24 +++ .../OAR020ExpandParameterCheckTest.java | 17 ++ .../OAR021ExcludeParameterCheckTest.java | 17 ++ .../checks/v2/operations/OAR017/plain.json | 57 +++-- .../checks/v2/operations/OAR017/plain.yaml | 19 +- .../checks/v2/resources/OAR017/plain.yaml | 26 +-- .../checks/v3/operations/OAR017/plain.json | 53 +++-- .../checks/v3/operations/OAR017/plain.yaml | 23 +- .../checks/v3/resources/OAR017/plain.yaml | 8 +- .../checks/v31/operations/OAR017/plain.json | 53 +++-- .../checks/v31/operations/OAR017/plain.yaml | 23 +- .../checks/v31/resources/OAR017/plain.yaml | 8 +- .../checks/v32/operations/OAR017/plain.json | 53 +++-- .../checks/v32/operations/OAR017/plain.yaml | 23 +- .../checks/v32/resources/OAR017/plain.yaml | 8 +- 29 files changed, 765 insertions(+), 604 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c1eed01a..3ea1458b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [1.4.1-beta-4] - 2026-05-30 + +### Fixed + +- OAR020 - ExpandParameterCheck - Fixed false negative where GET operations on non-`/examples` paths (e.g. `/pets`, `/orders`) without a `parameters` block were not reported. Changed default path strategy from include-only `/examples` to exclude-all (empty exclude list), so the rule now applies to all collection GET endpoints. Added `/me` path exclusion and health-check path exclusion (`status`, `health`, `ping`) in `visitNode`, aligning with Spectral's filter. Added `without-parameters` test cases for v2, v3, v31 and v32. +- OAR021 - ExcludeParameterCheck - Same fix as OAR020 applied for `$exclude` parameter. Changed default path strategy to exclude-all, added `/me` and health-check exclusions, added `without-parameters` test cases. + ## [1.4.1-beta-3] - 2026-05-29 ### Fixed diff --git a/pom.xml b/pom.xml index 47418aeb..1c739495 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 org.apiaddicts.apitools.dosonarapi sonaropenapi-rules-community - 1.4.1-beta-3 + 1.4.1-beta-4 sonar-plugin SonarQube OpenAPI Community Rules diff --git a/src/main/java/apiaddicts/sonar/openapi/checks/operations/OAR017ResourcePathCheck.java b/src/main/java/apiaddicts/sonar/openapi/checks/operations/OAR017ResourcePathCheck.java index 1e667e3b..41796f8e 100644 --- a/src/main/java/apiaddicts/sonar/openapi/checks/operations/OAR017ResourcePathCheck.java +++ b/src/main/java/apiaddicts/sonar/openapi/checks/operations/OAR017ResourcePathCheck.java @@ -4,6 +4,7 @@ import com.google.common.collect.ImmutableSet; import com.sonar.sslr.api.AstNodeType; import java.util.Arrays; +import java.util.List; import java.util.Set; import java.util.stream.Stream; import org.apiaddicts.apitools.dosonarapi.api.v2.OpenApi2Grammar; @@ -19,7 +20,6 @@ public class OAR017ResourcePathCheck extends BaseCheck { public static final String KEY = "OAR017"; private static final String MESSAGE = "OAR017.error"; - private static final String MESSAGE_PATTERN = "OAR017.error-patterns"; public static final String EXCLUDE_PATTERNS = "get,me,search"; @RuleProperty( @@ -35,45 +35,46 @@ public Set subscribedKinds() { @Override public void visitNode(JsonNode node) { - visitV2Node(node); - } - - private void visitV2Node(JsonNode node) { String path = node.key().getTokenValue(); - if (!isCorrect(path,node)) addIssue(KEY, translate(MESSAGE), node.key()); + if (!isCorrect(path)) addIssue(KEY, translate(MESSAGE), node.key()); } - private boolean isCorrect(String path, JsonNode node) { + private boolean isCorrect(String path) { String[] parts = Stream.of(path.split("/")).filter(p -> !p.trim().isEmpty()).toArray(String[]::new); - String[] patterns = Stream.of(patternsString.split(",")).toArray(String[]::new); + List except = Arrays.asList(patternsString.split(",")); + if (parts.length == 0) return true; - boolean previousWasVariable = false; - boolean twoOrMoreVariablesInARow = false; + boolean previousIsVar; + String firstPart = parts[0]; + + if (except.contains(firstPart.trim())) { + previousIsVar = true; + } else if (isVariable(firstPart)) { + return false; + } else { + previousIsVar = false; + } - for (int i = 0; i < parts.length; i++) { - boolean currentIsVariable = isVariable(parts[i]); + for (int i = 1; i < parts.length; i++) { + String part = parts[i].trim(); - if(!currentIsVariable && Arrays.asList(patterns).contains(parts[i])){ - issuePatterns(parts[i],node); + if (except.contains(part)) { + previousIsVar = true; + continue; } - if (previousWasVariable && currentIsVariable) { - twoOrMoreVariablesInARow = true; - break; + boolean currentIsVariable = isVariable(part); + if (currentIsVariable == previousIsVar) { + return false; } - - previousWasVariable = currentIsVariable; + previousIsVar = currentIsVariable; } - return !twoOrMoreVariablesInARow; + return true; } private boolean isVariable(String part) { - return '{' == part.charAt(0) && '}' == part.charAt(part.length() - 1); - } - - private void issuePatterns(String pattern,JsonNode node){ - addIssue(KEY, translate(MESSAGE_PATTERN,pattern), node.key()); + return part.length() >= 2 && part.charAt(0) == '{' && part.charAt(part.length() - 1) == '}'; } } \ No newline at end of file diff --git a/src/main/java/apiaddicts/sonar/openapi/checks/parameters/AbstractQueryParameterCheck.java b/src/main/java/apiaddicts/sonar/openapi/checks/parameters/AbstractQueryParameterCheck.java index 9bf995c2..d8b133e0 100644 --- a/src/main/java/apiaddicts/sonar/openapi/checks/parameters/AbstractQueryParameterCheck.java +++ b/src/main/java/apiaddicts/sonar/openapi/checks/parameters/AbstractQueryParameterCheck.java @@ -114,10 +114,10 @@ protected boolean isRefParameter(JsonNode parameterNode) { protected boolean hasNamedRefParameter(JsonNode parameterNode) { String refValue = parameterNode.get("$ref").getTokenValue(); - JsonNode refParameterNode = resolveReference(refValue, rootNode); + JsonNode refParameterNode = resolveReference(refValue, rootNode); if (refParameterNode != null) { JsonNode nameNode = refParameterNode.get("name"); - JsonNode inNode = refParameterNode.get("in"); + JsonNode inNode = refParameterNode.get("in"); return inNode != null && "query".equals(inNode.getTokenValue()) && nameNode != null && parameterName.equals(nameNode.getTokenValue()); } return false; @@ -143,7 +143,7 @@ protected String getPath(JsonNode node) { protected boolean shouldIncludePath(String path) { if (paths.isEmpty()) { - return pathCheckStrategy.equals(PATH_STRATEGY_EXCLUDE); + return pathCheckStrategy.equals(PATH_STRATEGY_EXCLUDE); } if (pathCheckStrategy.equals(PATH_STRATEGY_EXCLUDE)) { return !paths.contains(path); @@ -172,8 +172,8 @@ protected Set parsePaths(String pathsStr) { } protected JsonNode resolveReference(String refValue, JsonNode root) { - if (refValue == null || !refValue.startsWith("#/")) { - return null; + if (refValue == null || !refValue.startsWith("#/")) { + return null; } String pathToReference = refValue.substring(2); @@ -182,7 +182,7 @@ protected JsonNode resolveReference(String refValue, JsonNode root) { JsonNode currentNode = root; for (String part : pathParts) { if (currentNode == null) { - return null; + return null; } currentNode = currentNode.get(part); } diff --git a/src/main/java/apiaddicts/sonar/openapi/checks/parameters/OAR020ExpandParameterCheck.java b/src/main/java/apiaddicts/sonar/openapi/checks/parameters/OAR020ExpandParameterCheck.java index 355ff4d4..299b6369 100644 --- a/src/main/java/apiaddicts/sonar/openapi/checks/parameters/OAR020ExpandParameterCheck.java +++ b/src/main/java/apiaddicts/sonar/openapi/checks/parameters/OAR020ExpandParameterCheck.java @@ -1,5 +1,6 @@ package apiaddicts.sonar.openapi.checks.parameters; +import org.apiaddicts.apitools.dosonarapi.sslr.yaml.grammar.JsonNode; import org.sonar.check.Rule; @Rule(key = OAR020ExpandParameterCheck.KEY) @@ -10,12 +11,21 @@ public class OAR020ExpandParameterCheck extends AbstractQueryParameterCheck { private static final String PARAM_NAME = "$expand"; public OAR020ExpandParameterCheck() { - super( - KEY, - MESSAGE, - PARAM_NAME, - false - ); + super(KEY, MESSAGE, PARAM_NAME, false); } + @Override + public void visitNode(JsonNode node) { + if (!"get".equals(node.key().getTokenValue())) return; + + String path = getPath(node); + + if (endsWithPathParam(path)) return; + if (path.contains("/me/") || path.endsWith("/me")) return; + if (path.contains("status") || path.contains("health") || path.contains("ping")) return; + + if (!hasParameterInNode(node)) { + addIssue(ruleKey, translate(messageKey, parameterName), node.key()); + } + } } \ No newline at end of file diff --git a/src/main/java/apiaddicts/sonar/openapi/checks/parameters/OAR021ExcludeParameterCheck.java b/src/main/java/apiaddicts/sonar/openapi/checks/parameters/OAR021ExcludeParameterCheck.java index 65d031db..19d8e1c1 100644 --- a/src/main/java/apiaddicts/sonar/openapi/checks/parameters/OAR021ExcludeParameterCheck.java +++ b/src/main/java/apiaddicts/sonar/openapi/checks/parameters/OAR021ExcludeParameterCheck.java @@ -1,5 +1,6 @@ package apiaddicts.sonar.openapi.checks.parameters; +import org.apiaddicts.apitools.dosonarapi.sslr.yaml.grammar.JsonNode; import org.sonar.check.Rule; @Rule(key = OAR021ExcludeParameterCheck.KEY) @@ -10,11 +11,21 @@ public class OAR021ExcludeParameterCheck extends AbstractQueryParameterCheck { private static final String PARAM_NAME = "$exclude"; public OAR021ExcludeParameterCheck() { - super( - KEY, - MESSAGE, - PARAM_NAME, - false - ); + super(KEY, MESSAGE, PARAM_NAME, false); + } + + @Override + public void visitNode(JsonNode node) { + if (!"get".equals(node.key().getTokenValue())) return; + + String path = getPath(node); + + if (endsWithPathParam(path)) return; + if (path.contains("/me/") || path.endsWith("/me")) return; + if (path.contains("status") || path.contains("health") || path.contains("ping")) return; + + if (!hasParameterInNode(node)) { + addIssue(ruleKey, translate(messageKey, parameterName), node.key()); + } } } \ No newline at end of file diff --git a/src/main/resources/org/sonar/l10n/es/openapi/rules/openapi/operations/OAR017.html b/src/main/resources/org/sonar/l10n/es/openapi/rules/openapi/operations/OAR017.html index d586b013..668d7d4e 100644 --- a/src/main/resources/org/sonar/l10n/es/openapi/rules/openapi/operations/OAR017.html +++ b/src/main/resources/org/sonar/l10n/es/openapi/rules/openapi/operations/OAR017.html @@ -1,13 +1,10 @@ -

Se valida que cada ruta alterna sus partes entre partes estáticas y variables, empezando por las partes estáticas.

-

Ejemplos:

+

Se valida que cada ruta alterna sus partes entre partes estáticas y variables, empezando por las partes estáticas. Esta regla es idéntica a la implementación Spectral.

+

Esta regla dispara cuando:

    -
  • /{id} -> Error
  • -
  • /facturas/{id}/{lineId} -> Error
  • -
  • /facturas/{id} -> Ok
  • -
  • /facturas/get -> Ok
  • -
  • /facturas/{id}/lineas/{lineId} -> Ok
  • -
  • /facturas/{id}/lineas/get -> Ok
  • +
  • Aparecen dos segmentos consecutivos del mismo tipo: dos segmentos estáticos (p.ej. /a/b) o dos parámetros de ruta (p.ej. /{a}/{b}).
  • +
  • El path empieza por un parámetro de ruta (p.ej. /{id}/items).
+

Configurable: exclude_patterns (por defecto: get,me,search) — segmentos tratados como pseudo-parámetros que no rompen la regla de alternación.

Ejemplo de código no compatible (OpenAPI 2)

 swagger: "2.0"
diff --git a/src/main/resources/org/sonar/l10n/es/openapi/rules/openapi/parameters/OAR020.html b/src/main/resources/org/sonar/l10n/es/openapi/rules/openapi/parameters/OAR020.html
index 577fc1d4..cc1a5895 100644
--- a/src/main/resources/org/sonar/l10n/es/openapi/rules/openapi/parameters/OAR020.html
+++ b/src/main/resources/org/sonar/l10n/es/openapi/rules/openapi/parameters/OAR020.html
@@ -1,101 +1,115 @@
-

El parámetro elegido debe definirse en esta operación. Por defecto, $expand

+

Toda operación GET de colección debe definir $expand como parámetro de consulta.

+

Se aplica a: operaciones GET en rutas de colección (rutas que no terminan en un parámetro de ruta como /{id}).

+

Excluidos automáticamente: endpoints de detalle (ruta termina en /{param}), rutas que contienen /me, y rutas de health-check que contienen status, health o ping.

+

Parámetros configurables:

+
    +
  • paths — lista de rutas a incluir/excluir separadas por coma (por defecto: /examples).
  • +
  • pathValidationStrategy/include o /exclude (por defecto: /include).
  • +

Ejemplo de código no compatible (OpenAPI 2)

-  swagger: "2.0"
-  info:
-    version: 1.0.0
-    title: Swagger Petstore
-  paths:
-    /pets:
-      get:
-        parameters: 
-          - in: query
-            name: other 
-            type: array
-            items:
-              type: string
-          - in: query
-            name: hola 
-            type: array
-            items:
-              type: string
-        responses:
-          206:
-            description: Ok
+swagger: "2.0"
+info:
+  version: 1.0.0
+  title: Swagger Petstore
+paths:
+  /pets:
+    get: # Noncompliant {{OAR020: $expand must be defined as a parameter in this operation}}
+      responses:
+        206:
+          description: Ok
+  /orders:
+    get: # Noncompliant {{OAR020: $expand must be defined as a parameter in this operation}}
+      parameters:
+        - in: query
+          name: other
+          type: array
+          items:
+            type: string
+      responses:
+        206:
+          description: Ok
 
-

Compliant Solution (OpenAPI 2)

+

Solución compatible (OpenAPI 2)

-  swagger: "2.0"
-  info:
-    version: 1.0.0
-    title: Swagger Petstore
-  paths:
-    /pets:
-      get:
-        parameters:
-          - in: query
-            name: $expand
-            type: array
-            items:
-              type: string
-          - in: query
-            name: $expand
-            type: array
-            items:
-              type: string
-        responses:
-          206:
-            description: Ok
+swagger: "2.0"
+info:
+  version: 1.0.0
+  title: Swagger Petstore
+paths:
+  /pets:
+    get:
+      parameters:
+        - in: query
+          name: $expand
+          type: array
+          items:
+            type: string
+      responses:
+        206:
+          description: Ok
+  /pets/{petId}:
+    get:
+      parameters:
+        - in: path
+          name: petId
+          type: integer
+          required: true
+      responses:
+        200:
+          description: Ok
 
-

Noncompliant Code Example (OpenAPI 3)

+

Ejemplo de código no compatible (OpenAPI 3)

-  openapi: "3.0.0"
-  info:
-    version: 1.0.0
-    title: Swagger Petstore
-  paths:
-    /pets:
-      get:
-        parameters: 
-          - in: query
-            name: other 
-            schema:
-              type: array
-              items:
-                type: string
-          - in: query
-            name: select 
-            schema:
-              type: array
-              items:
-                type: string
-        responses:
-          206:
-            description: Ok
+openapi: "3.0.0"
+info:
+  version: 1.0.0
+  title: Swagger Petstore
+paths:
+  /pets:
+    get: # Noncompliant {{OAR020: $expand must be defined as a parameter in this operation}}
+      responses:
+        "206":
+          description: Ok
+  /orders:
+    get: # Noncompliant {{OAR020: $expand must be defined as a parameter in this operation}}
+      parameters:
+        - in: query
+          name: other
+          schema:
+            type: string
+      responses:
+        "206":
+          description: Ok
 
-

Compliant Solution (OpenAPI 3)

+

Solución compatible (OpenAPI 3)

-  openapi: "3.0.0"
-  info:
-    version: 1.0.0
-    title: Swagger Petstore
-  paths:
-    /pets:
-      get:
-        parameters:
-          - in: query
-            name: $expand
-            schema:
-              type: array
-              items:
-                type: string
-          - in: query
-            name: $expand
-            schema:
-              type: array
-              items:
-                type: string
-        responses:
-          206:
-            description: Ok
-
\ No newline at end of file +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: + get: + parameters: + - in: query + name: $expand + schema: + type: array + items: + type: string + responses: + "206": + description: Ok + /pets/{petId}: + get: + parameters: + - name: petId + in: path + required: true + schema: + type: integer + responses: + "200": + description: Ok +
diff --git a/src/main/resources/org/sonar/l10n/es/openapi/rules/openapi/parameters/OAR021.html b/src/main/resources/org/sonar/l10n/es/openapi/rules/openapi/parameters/OAR021.html index 5ab8509d..d6fac197 100644 --- a/src/main/resources/org/sonar/l10n/es/openapi/rules/openapi/parameters/OAR021.html +++ b/src/main/resources/org/sonar/l10n/es/openapi/rules/openapi/parameters/OAR021.html @@ -1,101 +1,115 @@ -

El parámetro elegido debe definirse en esta operación. Por defecto, $exclude

+

Toda operación GET de colección debe definir $exclude como parámetro de consulta.

+

Se aplica a: operaciones GET en rutas de colección (rutas que no terminan en un parámetro de ruta como /{id}).

+

Excluidos automáticamente: endpoints de detalle (ruta termina en /{param}), rutas que contienen /me, y rutas de health-check que contienen status, health o ping.

+

Parámetros configurables:

+
    +
  • paths — lista de rutas a incluir/excluir separadas por coma (por defecto: /examples).
  • +
  • pathValidationStrategy/include o /exclude (por defecto: /include).
  • +

Ejemplo de código no compatible (OpenAPI 2)

-  swagger: "2.0"
-  info:
-    version: 1.0.0
-    title: Swagger Petstore
-  paths:
-    /pets:
-      get:
-        parameters: 
-          - in: query
-            name: other 
-            type: array
-            items:
-              type: string
-          - in: query
-            name: hola 
-            type: array
-            items:
-              type: string
-        responses:
-          206:
-            description: Ok
+swagger: "2.0"
+info:
+  version: 1.0.0
+  title: Swagger Petstore
+paths:
+  /pets:
+    get: # Noncompliant {{OAR021: $exclude must be defined as a parameter in this operation}}
+      responses:
+        206:
+          description: Ok
+  /orders:
+    get: # Noncompliant {{OAR021: $exclude must be defined as a parameter in this operation}}
+      parameters:
+        - in: query
+          name: other
+          type: array
+          items:
+            type: string
+      responses:
+        206:
+          description: Ok
 
-

Compliant Solution (OpenAPI 2)

+

Solución compatible (OpenAPI 2)

-  swagger: "2.0"
-  info:
-    version: 1.0.0
-    title: Swagger Petstore
-  paths:
-    /pets:
-      get:
-        parameters:
-          - in: query
-            name: $exclude
-            type: array
-            items:
-              type: string
-          - in: query
-            name: $exclude
-            type: array
-            items:
-              type: string
-        responses:
-          206:
-            description: Ok
+swagger: "2.0"
+info:
+  version: 1.0.0
+  title: Swagger Petstore
+paths:
+  /pets:
+    get:
+      parameters:
+        - in: query
+          name: $exclude
+          type: array
+          items:
+            type: string
+      responses:
+        206:
+          description: Ok
+  /pets/{petId}:
+    get:
+      parameters:
+        - in: path
+          name: petId
+          type: integer
+          required: true
+      responses:
+        200:
+          description: Ok
 
-

Noncompliant Code Example (OpenAPI 3)

+

Ejemplo de código no compatible (OpenAPI 3)

-  openapi: "3.0.0"
-  info:
-    version: 1.0.0
-    title: Swagger Petstore
-  paths:
-    /pets:
-      get:
-        parameters: 
-          - in: query
-            name: other 
-            schema:
-              type: array
-              items:
-                type: string
-          - in: query
-            name: select 
-            schema:
-              type: array
-              items:
-                type: string
-        responses:
-          206:
-            description: Ok
+openapi: "3.0.0"
+info:
+  version: 1.0.0
+  title: Swagger Petstore
+paths:
+  /pets:
+    get: # Noncompliant {{OAR021: $exclude must be defined as a parameter in this operation}}
+      responses:
+        "206":
+          description: Ok
+  /orders:
+    get: # Noncompliant {{OAR021: $exclude must be defined as a parameter in this operation}}
+      parameters:
+        - in: query
+          name: other
+          schema:
+            type: string
+      responses:
+        "206":
+          description: Ok
 
-

Compliant Solution (OpenAPI 3)

+

Solución compatible (OpenAPI 3)

-  openapi: "3.0.0"
-  info:
-    version: 1.0.0
-    title: Swagger Petstore
-  paths:
-    /pets:
-      get:
-        parameters:
-          - in: query
-            name: $exclude
-            schema:
-              type: array
-              items:
-                type: string
-          - in: query
-            name: $exclude
-            schema:
-              type: array
-              items:
-                type: string
-        responses:
-          206:
-            description: Ok
-
\ No newline at end of file +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: + get: + parameters: + - in: query + name: $exclude + schema: + type: array + items: + type: string + responses: + "206": + description: Ok + /pets/{petId}: + get: + parameters: + - name: petId + in: path + required: true + schema: + type: integer + responses: + "200": + description: Ok +
diff --git a/src/main/resources/org/sonar/l10n/es/openapi/rules/openapi/resources/OAR017.html b/src/main/resources/org/sonar/l10n/es/openapi/rules/openapi/resources/OAR017.html index 196607d8..b8177471 100644 --- a/src/main/resources/org/sonar/l10n/es/openapi/rules/openapi/resources/OAR017.html +++ b/src/main/resources/org/sonar/l10n/es/openapi/rules/openapi/resources/OAR017.html @@ -1,13 +1,10 @@ -

Se valida que cada ruta alterna sus partes entre partes estáticas y variables, empezando por las partes estáticas.

-

Ejemplos:

+

Se valida que cada ruta alterna sus partes entre partes estáticas y variables, empezando por las partes estáticas. Esta regla es idéntica a la implementación Spectral.

+

Esta regla dispara cuando:

    -
  • /{id} -> Error
  • -
  • /facturas/{id}/{lineId} -> Error
  • -
  • /facturas/{id} -> Ok
  • -
  • /facturas/get -> Ok
  • -
  • /facturas/{id}/lineas/{lineId} -> Ok
  • -
  • /facturas/{id}/lineas/get -> Ok
  • +
  • Aparecen dos segmentos consecutivos del mismo tipo: dos segmentos estáticos (p.ej. /a/b) o dos parámetros de ruta (p.ej. /{a}/{b}).
  • +
  • El path empieza por un parámetro de ruta (p.ej. /{id}/items).
+

Configurable: exclude_patterns (por defecto: get,me,search) — segmentos tratados como pseudo-parámetros que no rompen la regla de alternación.

Ejemplo de código no compatible (OpenAPI 2)

JSON

diff --git a/src/main/resources/org/sonar/l10n/openapi/rules/openapi/operations/OAR017.html b/src/main/resources/org/sonar/l10n/openapi/rules/openapi/operations/OAR017.html
index c235a74b..22bce347 100644
--- a/src/main/resources/org/sonar/l10n/openapi/rules/openapi/operations/OAR017.html
+++ b/src/main/resources/org/sonar/l10n/openapi/rules/openapi/operations/OAR017.html
@@ -1,13 +1,10 @@
-

It is validated that each route alternates its parts between static and variable parts, starting with the static parts.

-

Examples:

+

It is validated that each route alternates its parts between static and variable parts, starting with the static parts. This rule is identical to the Spectral implementation.

+

Specifically, this rule fires when:

    -
  • /{id} -> Error
  • -
  • /facturas/{id}/{lineId} -> Error
  • -
  • /facturas/{id} -> Ok
  • -
  • /facturas/get -> Ok
  • -
  • /facturas/{id}/lineas/{lineId} -> Ok
  • -
  • /facturas/{id}/lineas/get -> Ok
  • +
  • Two consecutive path segments of the same type appear: two static segments (e.g. /a/b) or two path parameters (e.g. /{a}/{b}).
  • +
  • The path starts with a path parameter (e.g. /{id}/items).
+

Configurable: exclude_patterns (default: get,me,search) — segments treated as pseudo-parameters that do not break the alternation rule.

Noncompliant Code Example (OpenAPI 2)

 swagger: "2.0"
diff --git a/src/main/resources/org/sonar/l10n/openapi/rules/openapi/parameters/OAR020.html b/src/main/resources/org/sonar/l10n/openapi/rules/openapi/parameters/OAR020.html
index e3581981..c8c7dd3e 100644
--- a/src/main/resources/org/sonar/l10n/openapi/rules/openapi/parameters/OAR020.html
+++ b/src/main/resources/org/sonar/l10n/openapi/rules/openapi/parameters/OAR020.html
@@ -1,101 +1,115 @@
-

The chosen parameter must be defined in this operation. By default, $expand

+

Every GET collection operation must define $expand as a query parameter.

+

Applies to: GET operations on collection paths (paths that do not end with a path parameter such as /{id}).

+

Excluded automatically: detail endpoints (path ends with /{param}), paths containing /me, and health-check paths containing status, health, or ping.

+

Configurable parameters:

+
    +
  • paths — list of explicit paths to include/exclude (default: /examples).
  • +
  • pathValidationStrategy/include or /exclude (default: /include).
  • +

Noncompliant Code Example (OpenAPI 2)

-  swagger: "2.0"
-  info:
-    version: 1.0.0
-    title: Swagger Petstore
-  paths:
-    /pets:
-      get:
-        parameters: 
-          - in: query
-            name: other # Noncompliant {{OAR020: $expand must be defined as a parameter in this operation}}
-            type: array
-            items:
-              type: string
-          - in: query
-            name: hola # Noncompliant {{OAR020: $expand must be defined as a parameter in this operation}}
-            type: array
-            items:
-              type: string
-        responses:
-          206:
-            description: Ok
+swagger: "2.0"
+info:
+  version: 1.0.0
+  title: Swagger Petstore
+paths:
+  /pets:
+    get: # Noncompliant {{OAR020: $expand must be defined as a parameter in this operation}}
+      responses:
+        206:
+          description: Ok
+  /orders:
+    get: # Noncompliant {{OAR020: $expand must be defined as a parameter in this operation}}
+      parameters:
+        - in: query
+          name: other
+          type: array
+          items:
+            type: string
+      responses:
+        206:
+          description: Ok
 

Compliant Solution (OpenAPI 2)

-  swagger: "2.0"
-  info:
-    version: 1.0.0
-    title: Swagger Petstore
-  paths:
-    /pets:
-      get:
-        parameters:
-          - in: query
-            name: $expand
-            type: array
-            items:
-              type: string
-          - in: query
-            name: $expand
-            type: array
-            items:
-              type: string
-        responses:
-          206:
-            description: Ok
+swagger: "2.0"
+info:
+  version: 1.0.0
+  title: Swagger Petstore
+paths:
+  /pets:
+    get:
+      parameters:
+        - in: query
+          name: $expand
+          type: array
+          items:
+            type: string
+      responses:
+        206:
+          description: Ok
+  /pets/{petId}:
+    get:
+      parameters:
+        - in: path
+          name: petId
+          type: integer
+          required: true
+      responses:
+        200:
+          description: Ok
 

Noncompliant Code Example (OpenAPI 3)

-  openapi: "3.0.0"
-  info:
-    version: 1.0.0
-    title: Swagger Petstore
-  paths:
-    /pets:
-      get:
-        parameters: 
-          - in: query
-            name: other # Noncompliant {{OAR020: $expand must be defined as a parameter in this operation}}
-            schema:
-              type: array
-              items:
-                type: string
-          - in: query
-            name: select # Noncompliant {{OAR020: $expand must be defined as a parameter in this operation}}
-            schema:
-              type: array
-              items:
-                type: string
-        responses:
-          206:
-            description: Ok
+openapi: "3.0.0"
+info:
+  version: 1.0.0
+  title: Swagger Petstore
+paths:
+  /pets:
+    get: # Noncompliant {{OAR020: $expand must be defined as a parameter in this operation}}
+      responses:
+        "206":
+          description: Ok
+  /orders:
+    get: # Noncompliant {{OAR020: $expand must be defined as a parameter in this operation}}
+      parameters:
+        - in: query
+          name: other
+          schema:
+            type: string
+      responses:
+        "206":
+          description: Ok
 

Compliant Solution (OpenAPI 3)

-  openapi: "3.0.0"
-  info:
-    version: 1.0.0
-    title: Swagger Petstore
-  paths:
-    /pets:
-      get:
-        parameters:
-          - in: query
-            name: $expand
-            schema:
-              type: array
-              items:
-                type: string
-          - in: query
-            name: $expand
-            schema:
-              type: array
-              items:
-                type: string
-        responses:
-          206:
-            description: Ok
-
\ No newline at end of file +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: + get: + parameters: + - in: query + name: $expand + schema: + type: array + items: + type: string + responses: + "206": + description: Ok + /pets/{petId}: + get: + parameters: + - name: petId + in: path + required: true + schema: + type: integer + responses: + "200": + description: Ok +
diff --git a/src/main/resources/org/sonar/l10n/openapi/rules/openapi/parameters/OAR021.html b/src/main/resources/org/sonar/l10n/openapi/rules/openapi/parameters/OAR021.html index c4bafab6..c39836cc 100644 --- a/src/main/resources/org/sonar/l10n/openapi/rules/openapi/parameters/OAR021.html +++ b/src/main/resources/org/sonar/l10n/openapi/rules/openapi/parameters/OAR021.html @@ -1,101 +1,115 @@ -

The chosen parameter must be defined in this operation. By default, $exclude

+

Every GET collection operation must define $exclude as a query parameter.

+

Applies to: GET operations on collection paths (paths that do not end with a path parameter such as /{id}).

+

Excluded automatically: detail endpoints (path ends with /{param}), paths containing /me, and health-check paths containing status, health, or ping.

+

Configurable parameters:

+
    +
  • paths — list of explicit paths to include/exclude (default: /examples).
  • +
  • pathValidationStrategy/include or /exclude (default: /include).
  • +

Noncompliant Code Example (OpenAPI 2)

-  swagger: "2.0"
-  info:
-    version: 1.0.0
-    title: Swagger Petstore
-  paths:
-    /pets:
-      get:
-        parameters: 
-          - in: query
-            name: other # Noncompliant {{OAR021: $exclude must be defined as a parameter in this operation}}
-            type: array
-            items:
-              type: string
-          - in: query
-            name: hola # Noncompliant {{OAR021: $exclude must be defined as a parameter in this operation}}
-            type: array
-            items:
-              type: string
-        responses:
-          206:
-            description: Ok
+swagger: "2.0"
+info:
+  version: 1.0.0
+  title: Swagger Petstore
+paths:
+  /pets:
+    get: # Noncompliant {{OAR021: $exclude must be defined as a parameter in this operation}}
+      responses:
+        206:
+          description: Ok
+  /orders:
+    get: # Noncompliant {{OAR021: $exclude must be defined as a parameter in this operation}}
+      parameters:
+        - in: query
+          name: other
+          type: array
+          items:
+            type: string
+      responses:
+        206:
+          description: Ok
 

Compliant Solution (OpenAPI 2)

-  swagger: "2.0"
-  info:
-    version: 1.0.0
-    title: Swagger Petstore
-  paths:
-    /pets:
-      get:
-        parameters:
-          - in: query
-            name: $exclude
-            type: array
-            items:
-              type: string
-          - in: query
-            name: $exclude
-            type: array
-            items:
-              type: string
-        responses:
-          206:
-            description: Ok
+swagger: "2.0"
+info:
+  version: 1.0.0
+  title: Swagger Petstore
+paths:
+  /pets:
+    get:
+      parameters:
+        - in: query
+          name: $exclude
+          type: array
+          items:
+            type: string
+      responses:
+        206:
+          description: Ok
+  /pets/{petId}:
+    get:
+      parameters:
+        - in: path
+          name: petId
+          type: integer
+          required: true
+      responses:
+        200:
+          description: Ok
 

Noncompliant Code Example (OpenAPI 3)

-  openapi: "3.0.0"
-  info:
-    version: 1.0.0
-    title: Swagger Petstore
-  paths:
-    /pets:
-      get:
-        parameters: 
-          - in: query
-            name: other # Noncompliant {{OAR021: $exclude must be defined as a parameter in this operation}}
-            schema:
-              type: array
-              items:
-                type: string
-          - in: query
-            name: select # Noncompliant {{OAR021: $exclude must be defined as a parameter in this operation}}
-            schema:
-              type: array
-              items:
-                type: string
-        responses:
-          206:
-            description: Ok
+openapi: "3.0.0"
+info:
+  version: 1.0.0
+  title: Swagger Petstore
+paths:
+  /pets:
+    get: # Noncompliant {{OAR021: $exclude must be defined as a parameter in this operation}}
+      responses:
+        "206":
+          description: Ok
+  /orders:
+    get: # Noncompliant {{OAR021: $exclude must be defined as a parameter in this operation}}
+      parameters:
+        - in: query
+          name: other
+          schema:
+            type: string
+      responses:
+        "206":
+          description: Ok
 

Compliant Solution (OpenAPI 3)

-  openapi: "3.0.0"
-  info:
-    version: 1.0.0
-    title: Swagger Petstore
-  paths:
-    /pets:
-      get:
-        parameters:
-          - in: query
-            name: $exclude
-            schema:
-              type: array
-              items:
-                type: string
-          - in: query
-            name: $exclude
-            schema:
-              type: array
-              items:
-                type: string
-        responses:
-          206:
-            description: Ok
-
\ No newline at end of file +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: + get: + parameters: + - in: query + name: $exclude + schema: + type: array + items: + type: string + responses: + "206": + description: Ok + /pets/{petId}: + get: + parameters: + - name: petId + in: path + required: true + schema: + type: integer + responses: + "200": + description: Ok +
diff --git a/src/main/resources/org/sonar/l10n/openapi/rules/openapi/resources/OAR017.html b/src/main/resources/org/sonar/l10n/openapi/rules/openapi/resources/OAR017.html index 309ef068..b33a7d6b 100644 --- a/src/main/resources/org/sonar/l10n/openapi/rules/openapi/resources/OAR017.html +++ b/src/main/resources/org/sonar/l10n/openapi/rules/openapi/resources/OAR017.html @@ -1,13 +1,10 @@ -

It is validated that each route alternates its parts between static and variable parts, starting with the static parts.

-

Examples:

+

It is validated that each route alternates its parts between static and variable parts, starting with the static parts. This rule is identical to the Spectral implementation.

+

Specifically, this rule fires when:

    -
  • /{id} -> Error
  • -
  • /facturas/{id}/{lineId} -> Error
  • -
  • /facturas/{id} -> Ok
  • -
  • /facturas/get -> Ok
  • -
  • /facturas/{id}/lineas/{lineId} -> Ok
  • -
  • /facturas/{id}/lineas/get -> Ok
  • +
  • Two consecutive path segments of the same type appear: two static segments (e.g. /a/b) or two path parameters (e.g. /{a}/{b}).
  • +
  • The path starts with a path parameter (e.g. /{id}/items).
+

Configurable: exclude_patterns (default: get,me,search) — segments treated as pseudo-parameters that do not break the alternation rule.

Noncompliant Code Example (OpenAPI 2)

JSON

diff --git a/src/test/java/apiaddicts/sonar/openapi/checks/operations/OAR017ResourcePathCheckTest.java b/src/test/java/apiaddicts/sonar/openapi/checks/operations/OAR017ResourcePathCheckTest.java
index a44b0219..88614748 100644
--- a/src/test/java/apiaddicts/sonar/openapi/checks/operations/OAR017ResourcePathCheckTest.java
+++ b/src/test/java/apiaddicts/sonar/openapi/checks/operations/OAR017ResourcePathCheckTest.java
@@ -37,6 +37,30 @@ public void verifyInV32() {
         verifyV32("plain");
     }
 
+    @Test
+    public void verifyInV2Resources() {
+        v2Path = getV2Path("resources");
+        verifyV2("plain");
+    }
+
+    @Test
+    public void verifyInV3Resources() {
+        v3Path = getV3Path("resources");
+        verifyV3("plain");
+    }
+
+    @Test
+    public void verifyInV31Resources() {
+        v31Path = getV31Path("resources");
+        verifyV31("plain");
+    }
+
+    @Test
+    public void verifyInV32Resources() {
+        v32Path = getV32Path("resources");
+        verifyV32("plain");
+    }
+
     @Override
     public void verifyRule() {
         assertRuleProperties("OAR017 - ResourcePath - Resource path should alternate static and parametrized parts", RuleType.BUG, Severity.MAJOR, tags("operations"));
diff --git a/src/test/java/apiaddicts/sonar/openapi/checks/parameters/OAR020ExpandParameterCheckTest.java b/src/test/java/apiaddicts/sonar/openapi/checks/parameters/OAR020ExpandParameterCheckTest.java
index 9b3b6ae7..ceea3c8f 100644
--- a/src/test/java/apiaddicts/sonar/openapi/checks/parameters/OAR020ExpandParameterCheckTest.java
+++ b/src/test/java/apiaddicts/sonar/openapi/checks/parameters/OAR020ExpandParameterCheckTest.java
@@ -126,6 +126,23 @@ public void verifyInV32ExpandNoDollar() {
         verifyV32("expand-no-dollar");
     }
 
+    @Test
+    public void verifyInV2WithoutParameters() {
+        verifyV2("without-parameters");
+    }
+    @Test
+    public void verifyInV3WithoutParameters() {
+        verifyV3("without-parameters");
+    }
+    @Test
+    public void verifyInV31WithoutParameters() {
+        verifyV31("without-parameters");
+    }
+    @Test
+    public void verifyInV32WithoutParameters() {
+        verifyV32("without-parameters");
+    }
+
     @Override
     public void verifyRule() {
         assertRuleProperties("OAR020 - ExpandParameter - the chosen parameter must be defined in this operation", RuleType.BUG, Severity.MINOR, tags("parameters"));
diff --git a/src/test/java/apiaddicts/sonar/openapi/checks/parameters/OAR021ExcludeParameterCheckTest.java b/src/test/java/apiaddicts/sonar/openapi/checks/parameters/OAR021ExcludeParameterCheckTest.java
index fb7047e4..6cce39f9 100644
--- a/src/test/java/apiaddicts/sonar/openapi/checks/parameters/OAR021ExcludeParameterCheckTest.java
+++ b/src/test/java/apiaddicts/sonar/openapi/checks/parameters/OAR021ExcludeParameterCheckTest.java
@@ -126,6 +126,23 @@ public void verifyInV32ExcludeNoDollar() {
         verifyV32("exclude-no-dollar");
     }
 
+    @Test
+    public void verifyInV2WithoutParameters() {
+        verifyV2("without-parameters");
+    }
+    @Test
+    public void verifyInV3WithoutParameters() {
+        verifyV3("without-parameters");
+    }
+    @Test
+    public void verifyInV31WithoutParameters() {
+        verifyV31("without-parameters");
+    }
+    @Test
+    public void verifyInV32WithoutParameters() {
+        verifyV32("without-parameters");
+    }
+
     @Override
     public void verifyRule() {
         assertRuleProperties("OAR021 - ExcludeParameter - the chosen parameter must be defined in this operation", RuleType.BUG, Severity.MINOR, tags("parameters"));
diff --git a/src/test/resources/checks/v2/operations/OAR017/plain.json b/src/test/resources/checks/v2/operations/OAR017/plain.json
index 90ee820f..360eff66 100644
--- a/src/test/resources/checks/v2/operations/OAR017/plain.json
+++ b/src/test/resources/checks/v2/operations/OAR017/plain.json
@@ -7,57 +7,48 @@
   "paths": {
     "/": {
       "get": {
-        "responses": {
-          "200": {
-            "description": "Ok"
-          }
-        }
+        "responses": { "200": { "description": "Ok" } }
       }
     },
     "/one": {
       "get": {
-        "responses": {
-          "200": {
-            "description": "Ok"
-          }
-        }
+        "responses": { "200": { "description": "Ok" } }
       }
     },
-    "/{one}": {
+    "/{one}": { # Noncompliant {{OAR017: Resource path should alternate static and parametrized parts}}
       "get": {
-        "responses": {
-          "200": {
-            "description": "Ok"
-          }
-        }
+        "responses": { "200": { "description": "Ok" } }
       }
     },
-    "/one/two": {
+    "/one/two": { # Noncompliant {{OAR017: Resource path should alternate static and parametrized parts}}
       "get": {
-        "responses": {
-          "200": {
-            "description": "Ok"
-          }
-        }
+        "responses": { "200": { "description": "Ok" } }
+      }
+    },
+    "/one/me": {
+      "get": {
+        "responses": { "200": { "description": "Ok" } }
+      }
+    },
+    "/one/me/three": {
+      "get": {
+        "responses": { "200": { "description": "Ok" } }
       }
     },
     "/one/{two}": {
       "get": {
-        "responses": {
-          "200": {
-            "description": "Ok"
-          }
-        }
+        "responses": { "200": { "description": "Ok" } }
       }
     },
     "/one/{two}/three": {
       "get": {
-        "responses": {
-          "200": {
-            "description": "Ok"
-          }
-        }
+        "responses": { "200": { "description": "Ok" } }
+      }
+    },
+    "/one/{two}/{three}": { # Noncompliant {{OAR017: Resource path should alternate static and parametrized parts}}
+      "get": {
+        "responses": { "200": { "description": "Ok" } }
       }
     }
   }
-}
\ No newline at end of file
+}
diff --git a/src/test/resources/checks/v2/operations/OAR017/plain.yaml b/src/test/resources/checks/v2/operations/OAR017/plain.yaml
index 66bf785d..81d61480 100644
--- a/src/test/resources/checks/v2/operations/OAR017/plain.yaml
+++ b/src/test/resources/checks/v2/operations/OAR017/plain.yaml
@@ -13,12 +13,12 @@ paths:
       responses:
         200:
           description: "Ok"
-  /{one}:
+  /{one}: # Noncompliant {{OAR017: Resource path should alternate static and parametrized parts}}
     get:
       responses:
         200:
           description: "Ok"
-  /one/two:
+  /one/two: # Noncompliant {{OAR017: Resource path should alternate static and parametrized parts}}
     get:
       responses:
         200:
@@ -33,3 +33,18 @@ paths:
       responses:
         200:
           description: "Ok"
+  /one/me:
+    get:
+      responses:
+        200:
+          description: "Ok"
+  /one/me/three:
+    get:
+      responses:
+        200:
+          description: "Ok"
+  /one/{two}/{three}: # Noncompliant {{OAR017: Resource path should alternate static and parametrized parts}}
+    get:
+      responses:
+        200:
+          description: "Ok"
diff --git a/src/test/resources/checks/v2/resources/OAR017/plain.yaml b/src/test/resources/checks/v2/resources/OAR017/plain.yaml
index af323291..2a16af5a 100644
--- a/src/test/resources/checks/v2/resources/OAR017/plain.yaml
+++ b/src/test/resources/checks/v2/resources/OAR017/plain.yaml
@@ -56,32 +56,8 @@ paths:
         200:
           description: Ok
 
-  /one/get:
+  /me/items/{id}:
     get:
       responses:
         200:
           description: Ok
-
-  /one/get/three/get: # Noncompliant {{OAR017: Resource path should alternate static and parametrized parts}}
-    get:
-      responses:
-        200:
-          description: Ok
-
-  /one/{two}/three/get:
-    get:
-      responses:
-        200:
-          description: Ok
-
-  /one/{two}/three/{four}/get: # Noncompliant {{OAR017: Resource path should alternate static and parametrized parts}}
-    get:
-      responses:
-        200:
-          description: Ok
-
-  /one/{two}/three/{four}/five/get:
-    get:
-      responses:
-        200:
-          description: Ok
\ No newline at end of file
diff --git a/src/test/resources/checks/v3/operations/OAR017/plain.json b/src/test/resources/checks/v3/operations/OAR017/plain.json
index 1c9602cb..fa47610d 100644
--- a/src/test/resources/checks/v3/operations/OAR017/plain.json
+++ b/src/test/resources/checks/v3/operations/OAR017/plain.json
@@ -5,50 +5,45 @@
     "title" : "Swagger Petstore"
   },
   "paths" : {
-    "/one/me" : { # Noncompliant {{OAR017: Pattern 'me' not allowed}}
+    "/{one}" : { # Noncompliant {{OAR017: Resource path should alternate static and parametrized parts}}
       "get" : {
-        "responses" : {
-          "200" : {
-            "description" : "Ok"
-          }
-        }
+        "responses" : { "200" : { "description" : "Ok" } }
       }
     },
-    "/{one}" : { 
+    "/one/two" : { # Noncompliant {{OAR017: Resource path should alternate static and parametrized parts}}
       "get" : {
-        "responses" : {
-          "200" : {
-            "description" : "Ok"
-          }
-        }
+        "responses" : { "200" : { "description" : "Ok" } }
       }
     },
-    "/one/two" : { 
+    "/one/me" : {
       "get" : {
-        "responses" : {
-          "200" : {
-            "description" : "Ok"
-          }
-        }
+        "responses" : { "200" : { "description" : "Ok" } }
+      }
+    },
+    "/one/me/three" : {
+      "get" : {
+        "responses" : { "200" : { "description" : "Ok" } }
       }
     },
     "/one/{two}" : {
       "get" : {
-        "responses" : {
-          "200" : {
-            "description" : "Ok"
-          }
-        }
+        "responses" : { "200" : { "description" : "Ok" } }
       }
     },
     "/one/{two}/three" : {
       "get" : {
-        "responses" : {
-          "200" : {
-            "description" : "Ok"
-          }
-        }
+        "responses" : { "200" : { "description" : "Ok" } }
+      }
+    },
+    "/one/{two}/{three}" : { # Noncompliant {{OAR017: Resource path should alternate static and parametrized parts}}
+      "get" : {
+        "responses" : { "200" : { "description" : "Ok" } }
+      }
+    },
+    "/me/items/{id}" : {
+      "get" : {
+        "responses" : { "200" : { "description" : "Ok" } }
       }
     }
   }
-}
\ No newline at end of file
+}
diff --git a/src/test/resources/checks/v3/operations/OAR017/plain.yaml b/src/test/resources/checks/v3/operations/OAR017/plain.yaml
index e1d0c120..d902e89e 100644
--- a/src/test/resources/checks/v3/operations/OAR017/plain.yaml
+++ b/src/test/resources/checks/v3/operations/OAR017/plain.yaml
@@ -3,17 +3,22 @@ info:
   version: 1.0.0
   title: Swagger Petstore
 paths:
-  /one/me: # Noncompliant {{OAR017: Pattern 'me' not allowed}}
+  /{one}: # Noncompliant {{OAR017: Resource path should alternate static and parametrized parts}}
     get:
       responses:
         200:
           description: Ok
-  /{one}:
+  /one/two: # Noncompliant {{OAR017: Resource path should alternate static and parametrized parts}}
     get:
       responses:
         200:
           description: Ok
-  /one/two:
+  /one/me:
+    get:
+      responses:
+        200:
+          description: Ok
+  /one/me/three:
     get:
       responses:
         200:
@@ -27,4 +32,14 @@ paths:
     get:
       responses:
         200:
-          description: Ok
\ No newline at end of file
+          description: Ok
+  /one/{two}/{three}: # Noncompliant {{OAR017: Resource path should alternate static and parametrized parts}}
+    get:
+      responses:
+        200:
+          description: Ok
+  /me/items/{id}:
+    get:
+      responses:
+        200:
+          description: Ok
diff --git a/src/test/resources/checks/v3/resources/OAR017/plain.yaml b/src/test/resources/checks/v3/resources/OAR017/plain.yaml
index 29c02541..f872fa73 100644
--- a/src/test/resources/checks/v3/resources/OAR017/plain.yaml
+++ b/src/test/resources/checks/v3/resources/OAR017/plain.yaml
@@ -49,4 +49,10 @@ paths:
     get:
       responses:
         200:
-          description: Ok
\ No newline at end of file
+          description: Ok
+
+  /me/items/{id}:
+    get:
+      responses:
+        200:
+          description: Ok
diff --git a/src/test/resources/checks/v31/operations/OAR017/plain.json b/src/test/resources/checks/v31/operations/OAR017/plain.json
index 53a7d191..40b9de7a 100644
--- a/src/test/resources/checks/v31/operations/OAR017/plain.json
+++ b/src/test/resources/checks/v31/operations/OAR017/plain.json
@@ -5,50 +5,45 @@
     "title" : "Swagger Petstore"
   },
   "paths" : {
-    "/one/me" : { # Noncompliant {{OAR017: Pattern 'me' not allowed}}
+    "/{one}" : { # Noncompliant {{OAR017: Resource path should alternate static and parametrized parts}}
       "get" : {
-        "responses" : {
-          "200" : {
-            "description" : "Ok"
-          }
-        }
+        "responses" : { "200" : { "description" : "Ok" } }
       }
     },
-    "/{one}" : { 
+    "/one/two" : { # Noncompliant {{OAR017: Resource path should alternate static and parametrized parts}}
       "get" : {
-        "responses" : {
-          "200" : {
-            "description" : "Ok"
-          }
-        }
+        "responses" : { "200" : { "description" : "Ok" } }
       }
     },
-    "/one/two" : { 
+    "/one/me" : {
       "get" : {
-        "responses" : {
-          "200" : {
-            "description" : "Ok"
-          }
-        }
+        "responses" : { "200" : { "description" : "Ok" } }
+      }
+    },
+    "/one/me/three" : {
+      "get" : {
+        "responses" : { "200" : { "description" : "Ok" } }
       }
     },
     "/one/{two}" : {
       "get" : {
-        "responses" : {
-          "200" : {
-            "description" : "Ok"
-          }
-        }
+        "responses" : { "200" : { "description" : "Ok" } }
       }
     },
     "/one/{two}/three" : {
       "get" : {
-        "responses" : {
-          "200" : {
-            "description" : "Ok"
-          }
-        }
+        "responses" : { "200" : { "description" : "Ok" } }
+      }
+    },
+    "/one/{two}/{three}" : { # Noncompliant {{OAR017: Resource path should alternate static and parametrized parts}}
+      "get" : {
+        "responses" : { "200" : { "description" : "Ok" } }
+      }
+    },
+    "/me/items/{id}" : {
+      "get" : {
+        "responses" : { "200" : { "description" : "Ok" } }
       }
     }
   }
-}
\ No newline at end of file
+}
diff --git a/src/test/resources/checks/v31/operations/OAR017/plain.yaml b/src/test/resources/checks/v31/operations/OAR017/plain.yaml
index 4d0c3ae4..72bb577e 100644
--- a/src/test/resources/checks/v31/operations/OAR017/plain.yaml
+++ b/src/test/resources/checks/v31/operations/OAR017/plain.yaml
@@ -3,17 +3,22 @@ info:
   version: 1.0.0
   title: Swagger Petstore
 paths:
-  /one/me: # Noncompliant {{OAR017: Pattern 'me' not allowed}}
+  /{one}: # Noncompliant {{OAR017: Resource path should alternate static and parametrized parts}}
     get:
       responses:
         200:
           description: Ok
-  /{one}:
+  /one/two: # Noncompliant {{OAR017: Resource path should alternate static and parametrized parts}}
     get:
       responses:
         200:
           description: Ok
-  /one/two:
+  /one/me:
+    get:
+      responses:
+        200:
+          description: Ok
+  /one/me/three:
     get:
       responses:
         200:
@@ -27,4 +32,14 @@ paths:
     get:
       responses:
         200:
-          description: Ok
\ No newline at end of file
+          description: Ok
+  /one/{two}/{three}: # Noncompliant {{OAR017: Resource path should alternate static and parametrized parts}}
+    get:
+      responses:
+        200:
+          description: Ok
+  /me/items/{id}:
+    get:
+      responses:
+        200:
+          description: Ok
diff --git a/src/test/resources/checks/v31/resources/OAR017/plain.yaml b/src/test/resources/checks/v31/resources/OAR017/plain.yaml
index 96278294..87dee561 100644
--- a/src/test/resources/checks/v31/resources/OAR017/plain.yaml
+++ b/src/test/resources/checks/v31/resources/OAR017/plain.yaml
@@ -49,4 +49,10 @@ paths:
     get:
       responses:
         200:
-          description: Ok
\ No newline at end of file
+          description: Ok
+
+  /me/items/{id}:
+    get:
+      responses:
+        200:
+          description: Ok
diff --git a/src/test/resources/checks/v32/operations/OAR017/plain.json b/src/test/resources/checks/v32/operations/OAR017/plain.json
index 96a1b033..ee93ff2b 100644
--- a/src/test/resources/checks/v32/operations/OAR017/plain.json
+++ b/src/test/resources/checks/v32/operations/OAR017/plain.json
@@ -5,50 +5,45 @@
     "title" : "Swagger Petstore"
   },
   "paths" : {
-    "/one/me" : { # Noncompliant {{OAR017: Pattern 'me' not allowed}}
+    "/{one}" : { # Noncompliant {{OAR017: Resource path should alternate static and parametrized parts}}
       "get" : {
-        "responses" : {
-          "200" : {
-            "description" : "Ok"
-          }
-        }
+        "responses" : { "200" : { "description" : "Ok" } }
       }
     },
-    "/{one}" : { 
+    "/one/two" : { # Noncompliant {{OAR017: Resource path should alternate static and parametrized parts}}
       "get" : {
-        "responses" : {
-          "200" : {
-            "description" : "Ok"
-          }
-        }
+        "responses" : { "200" : { "description" : "Ok" } }
       }
     },
-    "/one/two" : { 
+    "/one/me" : {
       "get" : {
-        "responses" : {
-          "200" : {
-            "description" : "Ok"
-          }
-        }
+        "responses" : { "200" : { "description" : "Ok" } }
+      }
+    },
+    "/one/me/three" : {
+      "get" : {
+        "responses" : { "200" : { "description" : "Ok" } }
       }
     },
     "/one/{two}" : {
       "get" : {
-        "responses" : {
-          "200" : {
-            "description" : "Ok"
-          }
-        }
+        "responses" : { "200" : { "description" : "Ok" } }
       }
     },
     "/one/{two}/three" : {
       "get" : {
-        "responses" : {
-          "200" : {
-            "description" : "Ok"
-          }
-        }
+        "responses" : { "200" : { "description" : "Ok" } }
+      }
+    },
+    "/one/{two}/{three}" : { # Noncompliant {{OAR017: Resource path should alternate static and parametrized parts}}
+      "get" : {
+        "responses" : { "200" : { "description" : "Ok" } }
+      }
+    },
+    "/me/items/{id}" : {
+      "get" : {
+        "responses" : { "200" : { "description" : "Ok" } }
       }
     }
   }
-}
\ No newline at end of file
+}
diff --git a/src/test/resources/checks/v32/operations/OAR017/plain.yaml b/src/test/resources/checks/v32/operations/OAR017/plain.yaml
index bbf9a02a..a623de5e 100644
--- a/src/test/resources/checks/v32/operations/OAR017/plain.yaml
+++ b/src/test/resources/checks/v32/operations/OAR017/plain.yaml
@@ -3,17 +3,22 @@ info:
   version: 1.0.0
   title: Swagger Petstore
 paths:
-  /one/me: # Noncompliant {{OAR017: Pattern 'me' not allowed}}
+  /{one}: # Noncompliant {{OAR017: Resource path should alternate static and parametrized parts}}
     get:
       responses:
         200:
           description: Ok
-  /{one}:
+  /one/two: # Noncompliant {{OAR017: Resource path should alternate static and parametrized parts}}
     get:
       responses:
         200:
           description: Ok
-  /one/two:
+  /one/me:
+    get:
+      responses:
+        200:
+          description: Ok
+  /one/me/three:
     get:
       responses:
         200:
@@ -27,4 +32,14 @@ paths:
     get:
       responses:
         200:
-          description: Ok
\ No newline at end of file
+          description: Ok
+  /one/{two}/{three}: # Noncompliant {{OAR017: Resource path should alternate static and parametrized parts}}
+    get:
+      responses:
+        200:
+          description: Ok
+  /me/items/{id}:
+    get:
+      responses:
+        200:
+          description: Ok
diff --git a/src/test/resources/checks/v32/resources/OAR017/plain.yaml b/src/test/resources/checks/v32/resources/OAR017/plain.yaml
index 2f9c2417..d3e714b9 100644
--- a/src/test/resources/checks/v32/resources/OAR017/plain.yaml
+++ b/src/test/resources/checks/v32/resources/OAR017/plain.yaml
@@ -49,4 +49,10 @@ paths:
     get:
       responses:
         200:
-          description: Ok
\ No newline at end of file
+          description: Ok
+
+  /me/items/{id}:
+    get:
+      responses:
+        200:
+          description: Ok

From eed41017f2302ab8b6f9642948c1f1aef0210b7c Mon Sep 17 00:00:00 2001
From: Melsy Huamani 
Date: Sat, 30 May 2026 13:06:14 -0500
Subject: [PATCH 21/28] fix: oar037 rule to valid formats

---
 .../checks/format/OAR037StringFormatCheck.java      |  4 ++--
 .../es/openapi/rules/openapi/format/OAR037.html     |  9 ++++++++-
 .../l10n/openapi/rules/openapi/format/OAR037.html   | 13 ++++++++++---
 .../checks/format/OAR037StringFormatCheckTest.java  |  2 +-
 .../resources/checks/v2/format/OAR037/plain.json    |  2 +-
 .../resources/checks/v2/format/OAR037/plain.yaml    |  2 +-
 .../resources/checks/v3/format/OAR037/complete.json |  2 +-
 .../resources/checks/v3/format/OAR037/complete.yaml |  2 +-
 .../checks/v31/format/OAR037/complete.json          |  2 +-
 .../checks/v31/format/OAR037/complete.yaml          |  2 +-
 .../checks/v32/format/OAR037/complete.json          |  2 +-
 .../checks/v32/format/OAR037/complete.yaml          |  2 +-
 12 files changed, 29 insertions(+), 15 deletions(-)

diff --git a/src/main/java/apiaddicts/sonar/openapi/checks/format/OAR037StringFormatCheck.java b/src/main/java/apiaddicts/sonar/openapi/checks/format/OAR037StringFormatCheck.java
index 9605a6e5..72ebeaeb 100644
--- a/src/main/java/apiaddicts/sonar/openapi/checks/format/OAR037StringFormatCheck.java
+++ b/src/main/java/apiaddicts/sonar/openapi/checks/format/OAR037StringFormatCheck.java
@@ -12,7 +12,7 @@ public class OAR037StringFormatCheck extends AbstractFormatCheck {
 
     public static final String KEY = "OAR037";
     private static final String MESSAGE = "OAR037.error";
-    private static final String DEFAULT_FORMATS_ALLOWED = "date,date-time,password,byte,binary,email,uuid,uri,hostname,ipv4,ipv6,HEX,HEX(16)";
+    private static final String DEFAULT_FORMATS_ALLOWED = "date,date-time,password,byte,binary,email,uuid,uri,hostname,ipv4,ipv6,HEX,HEX(16),json,xml,base64";
 
     @RuleProperty(
             key = "formats-allowed",
@@ -33,6 +33,6 @@ public void validate(String type, String format, JsonNode typeNode) {
     }
 
     private boolean isInvalidString(String type, String format, Set validFormats) {
-        return "string".equals(type) && (format != null && !validFormats.contains(format.toLowerCase()));
+        return "string".equals(type) && (format == null || !validFormats.contains(format.toLowerCase()));
     }
 }
\ No newline at end of file
diff --git a/src/main/resources/org/sonar/l10n/es/openapi/rules/openapi/format/OAR037.html b/src/main/resources/org/sonar/l10n/es/openapi/rules/openapi/format/OAR037.html
index 912b7292..0485b8b9 100644
--- a/src/main/resources/org/sonar/l10n/es/openapi/rules/openapi/format/OAR037.html
+++ b/src/main/resources/org/sonar/l10n/es/openapi/rules/openapi/format/OAR037.html
@@ -1,4 +1,7 @@
-

Una propiedad de tipo string con formato no válido puede provocar una implementación incorrecta de la API.

+

Una propiedad de tipo string sin formato, o con un formato no reconocido, puede provocar una implementación incorrecta de la API.

+

Esta regla dispara cuando el campo format está ausente o presente pero no es reconocido. Todo schema de tipo string debe declarar uno de los formatos válidos.

+

Formatos válidos: date, date-time, password, byte, binary, email, uuid, uri, hostname, ipv4, ipv6, HEX, HEX(16), json, xml, base64.

+

Configurable: formats-allowed — lista de formatos permitidos separados por coma (por defecto: la lista anterior).

Ejemplo de código no compatible (OpenAPI 2)

 swagger: "2.0"
@@ -16,6 +19,8 @@ 

Ejemplo de código no compatible (OpenAPI 2)

items: type: object properties: + name: + type: string date: type: string format: 'dd/mm/yyyy' @@ -60,6 +65,8 @@

Ejemplo de código no compatible (OpenAPI 3)

items: type: object properties: + name: + type: string date: type: string format: dd/mm/yyyy diff --git a/src/main/resources/org/sonar/l10n/openapi/rules/openapi/format/OAR037.html b/src/main/resources/org/sonar/l10n/openapi/rules/openapi/format/OAR037.html index 41a863f8..2ec09784 100644 --- a/src/main/resources/org/sonar/l10n/openapi/rules/openapi/format/OAR037.html +++ b/src/main/resources/org/sonar/l10n/openapi/rules/openapi/format/OAR037.html @@ -1,4 +1,7 @@ -

A string type with invalid format or without format may cause developers to use the wrong variable types in the API implementation.

+

A string schema without a format, or with an unrecognized format, may cause developers to use the wrong variable types in the API implementation.

+

This rule fires when the format field is absent or present but not recognized. Every string schema must declare one of the valid formats.

+

Valid formats: date, date-time, password, byte, binary, email, uuid, uri, hostname, ipv4, ipv6, HEX, HEX(16), json, xml, base64.

+

Configurable: formats-allowed — comma-separated list of allowed formats (default: the list above).

Noncompliant Code Example (OpenAPI 2)

 swagger: "2.0"
@@ -16,8 +19,10 @@ 

Noncompliant Code Example (OpenAPI 2)

items: type: object properties: + name: + type: string # Noncompliant {{OAR037: String types requires a valid format}} — no format date: - type: string # Noncompliant {{OAR037: String types requires a valid format}} + type: string # Noncompliant {{OAR037: String types requires a valid format}} — invalid format format: 'dd/mm/yyyy'

Compliant Solution (OpenAPI 2)

@@ -60,8 +65,10 @@

Noncompliant Code Example (OpenAPI 3)

items: type: object properties: + name: + type: string # Noncompliant {{OAR037: String types requires a valid format}} — no format date: - type: string # Noncompliant {{OAR037: String types requires a valid format}} + type: string # Noncompliant {{OAR037: String types requires a valid format}} — invalid format format: dd/mm/yyyy

Compliant Solution (OpenAPI 3)

diff --git a/src/test/java/apiaddicts/sonar/openapi/checks/format/OAR037StringFormatCheckTest.java b/src/test/java/apiaddicts/sonar/openapi/checks/format/OAR037StringFormatCheckTest.java index 90a639a7..ad43517b 100644 --- a/src/test/java/apiaddicts/sonar/openapi/checks/format/OAR037StringFormatCheckTest.java +++ b/src/test/java/apiaddicts/sonar/openapi/checks/format/OAR037StringFormatCheckTest.java @@ -68,7 +68,7 @@ public void verifyInV32WithNested() { @Override public void verifyParameters() { assertNumberOfParameters(1); - assertParameterProperties("formats-allowed", "date,date-time,password,byte,binary,email,uuid,uri,hostname,ipv4,ipv6,HEX,HEX(16)", RuleParamType.STRING); + assertParameterProperties("formats-allowed", "date,date-time,password,byte,binary,email,uuid,uri,hostname,ipv4,ipv6,HEX,HEX(16),json,xml,base64", RuleParamType.STRING); } @Override diff --git a/src/test/resources/checks/v2/format/OAR037/plain.json b/src/test/resources/checks/v2/format/OAR037/plain.json index 7a695aca..038c38a3 100644 --- a/src/test/resources/checks/v2/format/OAR037/plain.json +++ b/src/test/resources/checks/v2/format/OAR037/plain.json @@ -14,7 +14,7 @@ "type" : "object", "properties" : { "without" : { - "type" : "string" + "type" : "string" # Noncompliant {{OAR037: String types requires a valid format}} }, "date" : { "type" : "string", diff --git a/src/test/resources/checks/v2/format/OAR037/plain.yaml b/src/test/resources/checks/v2/format/OAR037/plain.yaml index e58efd2a..957f5bc1 100644 --- a/src/test/resources/checks/v2/format/OAR037/plain.yaml +++ b/src/test/resources/checks/v2/format/OAR037/plain.yaml @@ -12,7 +12,7 @@ paths: type: object properties: without: - type: string + type: string # Noncompliant {{OAR037: String types requires a valid format}} date: type: string format: date diff --git a/src/test/resources/checks/v3/format/OAR037/complete.json b/src/test/resources/checks/v3/format/OAR037/complete.json index dfefdf0b..b9e6416d 100644 --- a/src/test/resources/checks/v3/format/OAR037/complete.json +++ b/src/test/resources/checks/v3/format/OAR037/complete.json @@ -54,7 +54,7 @@ "type": "object", "properties": { "without": { - "type": "string" + "type": "string" # Noncompliant {{OAR037: String types requires a valid format}} }, "date": { "type": "string", diff --git a/src/test/resources/checks/v3/format/OAR037/complete.yaml b/src/test/resources/checks/v3/format/OAR037/complete.yaml index 2e7b6f3f..2120e544 100644 --- a/src/test/resources/checks/v3/format/OAR037/complete.yaml +++ b/src/test/resources/checks/v3/format/OAR037/complete.yaml @@ -37,7 +37,7 @@ paths: type: object properties: without: - type: string + type: string # Noncompliant {{OAR037: String types requires a valid format}} date: type: string format: date diff --git a/src/test/resources/checks/v31/format/OAR037/complete.json b/src/test/resources/checks/v31/format/OAR037/complete.json index 94e76d39..8c943299 100644 --- a/src/test/resources/checks/v31/format/OAR037/complete.json +++ b/src/test/resources/checks/v31/format/OAR037/complete.json @@ -54,7 +54,7 @@ "type": "object", "properties": { "without": { - "type": "string" + "type": "string" # Noncompliant {{OAR037: String types requires a valid format}} }, "date": { "type": "string", diff --git a/src/test/resources/checks/v31/format/OAR037/complete.yaml b/src/test/resources/checks/v31/format/OAR037/complete.yaml index cfcb826e..769a4793 100644 --- a/src/test/resources/checks/v31/format/OAR037/complete.yaml +++ b/src/test/resources/checks/v31/format/OAR037/complete.yaml @@ -37,7 +37,7 @@ paths: type: object properties: without: - type: string + type: string # Noncompliant {{OAR037: String types requires a valid format}} date: type: string format: date diff --git a/src/test/resources/checks/v32/format/OAR037/complete.json b/src/test/resources/checks/v32/format/OAR037/complete.json index 509a1a44..4b9f4508 100644 --- a/src/test/resources/checks/v32/format/OAR037/complete.json +++ b/src/test/resources/checks/v32/format/OAR037/complete.json @@ -54,7 +54,7 @@ "type": "object", "properties": { "without": { - "type": "string" + "type": "string" # Noncompliant {{OAR037: String types requires a valid format}} }, "date": { "type": "string", diff --git a/src/test/resources/checks/v32/format/OAR037/complete.yaml b/src/test/resources/checks/v32/format/OAR037/complete.yaml index f66402b0..2be1bfa4 100644 --- a/src/test/resources/checks/v32/format/OAR037/complete.yaml +++ b/src/test/resources/checks/v32/format/OAR037/complete.yaml @@ -37,7 +37,7 @@ paths: type: object properties: without: - type: string + type: string # Noncompliant {{OAR037: String types requires a valid format}} date: type: string format: date From 7107941d9ccf5a4eefea14b3966be0af39b7fc93 Mon Sep 17 00:00:00 2001 From: Melsy Huamani Date: Sat, 30 May 2026 16:51:23 -0500 Subject: [PATCH 22/28] fix: oar038 rule standard response --- CHANGELOG.md | 2 + .../OAR038StandardCreateResponseCheck.java | 30 ++++++++----- src/main/resources/messages/errors.properties | 1 + .../resources/messages/errors_es.properties | 1 + .../rules/openapi/operations/OAR038.html | 9 +++- .../rules/openapi/resources/OAR038.html | 9 +++- .../rules/openapi/operations/OAR038.html | 9 +++- .../rules/openapi/resources/OAR038.html | 9 +++- ...OAR038StandardCreateResponseCheckTest.java | 34 ++++++++++++++ .../operations/OAR038/valid-with-error.json | 39 ++++++++++++++++ .../operations/OAR038/valid-with-error.yaml | 24 ++++++++++ .../OAR038/with-invalid-property.json | 39 ++++++++++++++++ .../OAR038/with-invalid-property.yaml | 24 ++++++++++ .../v2/operations/OAR038/without-data.json | 2 +- .../v2/operations/OAR038/without-data.yaml | 2 +- .../v2/resources/OAR038/valid-with-error.json | 6 +++ .../v2/resources/OAR038/valid-with-error.yaml | 24 ++++++++++ .../OAR038/with-invalid-property.json | 7 +++ .../OAR038/with-invalid-property.yaml | 24 ++++++++++ .../v2/resources/OAR038/without-data.json | 2 +- .../v2/resources/OAR038/without-data.yaml | 2 +- .../operations/OAR038/valid-with-error.json | 32 +++++++++++++ .../operations/OAR038/valid-with-error.yaml | 27 +++++++++++ .../OAR038/with-invalid-property.json | 45 +++++++++++++++++++ .../OAR038/with-invalid-property.yaml | 27 +++++++++++ .../v3/operations/OAR038/without-data.json | 2 +- .../v3/operations/OAR038/without-data.yaml | 2 +- .../v3/resources/OAR038/valid-with-error.json | 1 + .../v3/resources/OAR038/valid-with-error.yaml | 27 +++++++++++ .../OAR038/with-invalid-property.json | 2 + .../OAR038/with-invalid-property.yaml | 27 +++++++++++ .../v3/resources/OAR038/without-data.json | 2 +- .../v3/resources/OAR038/without-data.yaml | 2 +- .../operations/OAR038/valid-with-error.json | 45 +++++++++++++++++++ .../operations/OAR038/valid-with-error.yaml | 27 +++++++++++ .../OAR038/with-invalid-property.json | 45 +++++++++++++++++++ .../OAR038/with-invalid-property.yaml | 27 +++++++++++ .../v31/operations/OAR038/without-data.json | 2 +- .../v31/operations/OAR038/without-data.yaml | 2 +- .../resources/OAR038/valid-with-error.json | 1 + .../resources/OAR038/valid-with-error.yaml | 27 +++++++++++ .../OAR038/with-invalid-property.json | 2 + .../OAR038/with-invalid-property.yaml | 27 +++++++++++ .../v31/resources/OAR038/without-data.json | 2 +- .../v31/resources/OAR038/without-data.yaml | 2 +- .../operations/OAR038/valid-with-error.json | 45 +++++++++++++++++++ .../operations/OAR038/valid-with-error.yaml | 27 +++++++++++ .../OAR038/with-invalid-property.json | 45 +++++++++++++++++++ .../OAR038/with-invalid-property.yaml | 27 +++++++++++ .../v32/operations/OAR038/without-data.json | 2 +- .../v32/operations/OAR038/without-data.yaml | 2 +- .../resources/OAR038/valid-with-error.json | 1 + .../resources/OAR038/valid-with-error.yaml | 27 +++++++++++ .../OAR038/with-invalid-property.json | 2 + .../OAR038/with-invalid-property.yaml | 27 +++++++++++ .../v32/resources/OAR038/without-data.json | 2 +- .../v32/resources/OAR038/without-data.yaml | 2 +- 57 files changed, 882 insertions(+), 31 deletions(-) create mode 100644 src/test/resources/checks/v2/operations/OAR038/valid-with-error.json create mode 100644 src/test/resources/checks/v2/operations/OAR038/valid-with-error.yaml create mode 100644 src/test/resources/checks/v2/operations/OAR038/with-invalid-property.json create mode 100644 src/test/resources/checks/v2/operations/OAR038/with-invalid-property.yaml create mode 100644 src/test/resources/checks/v2/resources/OAR038/valid-with-error.json create mode 100644 src/test/resources/checks/v2/resources/OAR038/valid-with-error.yaml create mode 100644 src/test/resources/checks/v2/resources/OAR038/with-invalid-property.json create mode 100644 src/test/resources/checks/v2/resources/OAR038/with-invalid-property.yaml create mode 100644 src/test/resources/checks/v3/operations/OAR038/valid-with-error.json create mode 100644 src/test/resources/checks/v3/operations/OAR038/valid-with-error.yaml create mode 100644 src/test/resources/checks/v3/operations/OAR038/with-invalid-property.json create mode 100644 src/test/resources/checks/v3/operations/OAR038/with-invalid-property.yaml create mode 100644 src/test/resources/checks/v3/resources/OAR038/valid-with-error.json create mode 100644 src/test/resources/checks/v3/resources/OAR038/valid-with-error.yaml create mode 100644 src/test/resources/checks/v3/resources/OAR038/with-invalid-property.json create mode 100644 src/test/resources/checks/v3/resources/OAR038/with-invalid-property.yaml create mode 100644 src/test/resources/checks/v31/operations/OAR038/valid-with-error.json create mode 100644 src/test/resources/checks/v31/operations/OAR038/valid-with-error.yaml create mode 100644 src/test/resources/checks/v31/operations/OAR038/with-invalid-property.json create mode 100644 src/test/resources/checks/v31/operations/OAR038/with-invalid-property.yaml create mode 100644 src/test/resources/checks/v31/resources/OAR038/valid-with-error.json create mode 100644 src/test/resources/checks/v31/resources/OAR038/valid-with-error.yaml create mode 100644 src/test/resources/checks/v31/resources/OAR038/with-invalid-property.json create mode 100644 src/test/resources/checks/v31/resources/OAR038/with-invalid-property.yaml create mode 100644 src/test/resources/checks/v32/operations/OAR038/valid-with-error.json create mode 100644 src/test/resources/checks/v32/operations/OAR038/valid-with-error.yaml create mode 100644 src/test/resources/checks/v32/operations/OAR038/with-invalid-property.json create mode 100644 src/test/resources/checks/v32/operations/OAR038/with-invalid-property.yaml create mode 100644 src/test/resources/checks/v32/resources/OAR038/valid-with-error.json create mode 100644 src/test/resources/checks/v32/resources/OAR038/valid-with-error.yaml create mode 100644 src/test/resources/checks/v32/resources/OAR038/with-invalid-property.json create mode 100644 src/test/resources/checks/v32/resources/OAR038/with-invalid-property.yaml diff --git a/CHANGELOG.md b/CHANGELOG.md index 3ea1458b..8a5f5dae 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - OAR020 - ExpandParameterCheck - Fixed false negative where GET operations on non-`/examples` paths (e.g. `/pets`, `/orders`) without a `parameters` block were not reported. Changed default path strategy from include-only `/examples` to exclude-all (empty exclude list), so the rule now applies to all collection GET endpoints. Added `/me` path exclusion and health-check path exclusion (`status`, `health`, `ping`) in `visitNode`, aligning with Spectral's filter. Added `without-parameters` test cases for v2, v3, v31 and v32. - OAR021 - ExcludeParameterCheck - Same fix as OAR020 applied for `$exclude` parameter. Changed default path strategy to exclude-all, added `/me` and health-check exclusions, added `without-parameters` test cases. +- OAR037 - StringFormatCheck - Fixed false negative where string schemas without a `format` field were not reported. Updated `isInvalidString` to also fire when `format == null`, aligning with Spectral behavior. +- OAR038 - StandardCreateResponseCheck - POST 201 responses must have a schema whose properties are named `data` or `error`, each with at least one sub-property. Fires with a distinct message when the property name is invalid vs. when sub-properties are missing. ## [1.4.1-beta-3] - 2026-05-29 diff --git a/src/main/java/apiaddicts/sonar/openapi/checks/operations/OAR038StandardCreateResponseCheck.java b/src/main/java/apiaddicts/sonar/openapi/checks/operations/OAR038StandardCreateResponseCheck.java index 31f5f7fa..6cfaa928 100644 --- a/src/main/java/apiaddicts/sonar/openapi/checks/operations/OAR038StandardCreateResponseCheck.java +++ b/src/main/java/apiaddicts/sonar/openapi/checks/operations/OAR038StandardCreateResponseCheck.java @@ -17,12 +17,14 @@ public class OAR038StandardCreateResponseCheck extends AbstractExplicitResponseC public static final String KEY = "OAR038"; private static final String DATA_PROPERTY = "data"; + private static final String ERROR_PROPERTY = "error"; @RuleProperty( key = "data-property", - description = "Data property in standard response.", + description = "Valid top-level property name for the standard response.", defaultValue = DATA_PROPERTY ) + @SuppressWarnings("unused") private String dataNode = DATA_PROPERTY; public OAR038StandardCreateResponseCheck() { @@ -34,20 +36,26 @@ protected void visitV2ExplicitNode(JsonNode node) { JsonNode schemaNode = node.get("schema"); if (schemaNode.isMissing()) { addIssue(KEY, translate("OAR038.error-required-schema"), node.key()); - } else { - schemaNode = resolve(schemaNode); - - Map properties = getAllProperties(schemaNode); + return; + } - validateProperty(properties, dataNode, TYPE_ANY, schemaNode.key()) - .ifPresent(this::validateData); + schemaNode = resolve(schemaNode); + Map properties = getAllProperties(schemaNode); + + for (Map.Entry entry : properties.entrySet()) { + String propName = entry.getKey(); + if (DATA_PROPERTY.equals(propName) || ERROR_PROPERTY.equals(propName)) { + Map subProps = getAllProperties(resolve(entry.getValue())); + if (subProps.isEmpty()) { + addIssue(KEY, translate("OAR038.error-required-one-property"), entry.getValue().key()); + } + } else { + addIssue(KEY, translate("OAR038.error"), entry.getValue().key()); + } } - } - private void validateData(JsonNode data) { - Map properties = getAllProperties(data); if (properties.isEmpty()) { - addIssue(KEY, translate("OAR038.error-required-one-property"), data.key()); + addIssue(KEY, translate("OAR038.error"), schemaNode.key()); } } } diff --git a/src/main/resources/messages/errors.properties b/src/main/resources/messages/errors.properties index b1294d7d..3b47830f 100644 --- a/src/main/resources/messages/errors.properties +++ b/src/main/resources/messages/errors.properties @@ -38,6 +38,7 @@ OAR033.error-header-required=''{0}'' header must be required OAR035.error=Response code {0} must be defined for operations with security schemes defined OAR036.error=Cookie use is forbidden as a session mechanism OAR037.error=String types requires a valid format +OAR038.error=''data'' or ''error'' property is required OAR038.error-required-schema=Response schema is required OAR038.error-required-one-property=At least you have to define the identifier property OAR039.error=Response code {0} must be defined diff --git a/src/main/resources/messages/errors_es.properties b/src/main/resources/messages/errors_es.properties index 29f1000a..738ba524 100644 --- a/src/main/resources/messages/errors_es.properties +++ b/src/main/resources/messages/errors_es.properties @@ -38,6 +38,7 @@ OAR033.error-header-required=La cabecera ''{0}'' debe ser obligatoria OAR035.error=El código de respuesta {0} debe estar definido cuando la operación tiene esquemas de seguridad definidos OAR036.error=El uso de cookies está prohibido como mecanismo de sesión OAR037.error=Las propiedades de tipo string deben definir un formato válido +OAR038.error=La propiedad ''data'' o ''error'' es obligatoria OAR038.error-required-schema=El esquema de respuesta es obligatorio OAR038.error-required-one-property=Se debe de definir al menos una propiedad OAR039.error=Código de respuesta {0} debe ser definido diff --git a/src/main/resources/org/sonar/l10n/es/openapi/rules/openapi/operations/OAR038.html b/src/main/resources/org/sonar/l10n/es/openapi/rules/openapi/operations/OAR038.html index 398febec..f26af29f 100644 --- a/src/main/resources/org/sonar/l10n/es/openapi/rules/openapi/operations/OAR038.html +++ b/src/main/resources/org/sonar/l10n/es/openapi/rules/openapi/operations/OAR038.html @@ -1,4 +1,11 @@ -

Una respuesta de creación de recurso debe contar con al menos un atributo.

+

El schema de la respuesta 201 de una operación POST debe tener propiedades llamadas data o error, y cada una debe tener al menos una sub-propiedad.

+

Esta regla dispara cuando:

+
    +
  • Una propiedad de nivel superior no se llama exactamente data o error (sensible a mayúsculas).
  • +
  • Una propiedad data o error no tiene sub-propiedades.
  • +
  • La respuesta 201 no tiene schema.
  • +
+

Configurable: data-property — nombre de propiedad válido (por defecto: data; también acepta error).

Ejemplo de código no compatible (OpenAPI 2)

 swagger: "2.0"
diff --git a/src/main/resources/org/sonar/l10n/es/openapi/rules/openapi/resources/OAR038.html b/src/main/resources/org/sonar/l10n/es/openapi/rules/openapi/resources/OAR038.html
index 63e1cae9..b746f554 100644
--- a/src/main/resources/org/sonar/l10n/es/openapi/rules/openapi/resources/OAR038.html
+++ b/src/main/resources/org/sonar/l10n/es/openapi/rules/openapi/resources/OAR038.html
@@ -1,4 +1,11 @@
-

Una respuesta de creación de recurso debe contar con al menos un atributo.

+

El schema de la respuesta 201 de una operación POST debe tener propiedades llamadas data o error, y cada una debe tener al menos una sub-propiedad.

+

Esta regla dispara cuando:

+
    +
  • Una propiedad de nivel superior no se llama exactamente data o error (sensible a mayúsculas).
  • +
  • Una propiedad data o error no tiene sub-propiedades.
  • +
  • La respuesta 201 no tiene schema.
  • +
+

Configurable: data-property — nombre de propiedad válido (por defecto: data; también acepta error).

Ejemplo de código no compatible (OpenAPI 2)

JSON

diff --git a/src/main/resources/org/sonar/l10n/openapi/rules/openapi/operations/OAR038.html b/src/main/resources/org/sonar/l10n/openapi/rules/openapi/operations/OAR038.html
index eed82fd6..485922da 100644
--- a/src/main/resources/org/sonar/l10n/openapi/rules/openapi/operations/OAR038.html
+++ b/src/main/resources/org/sonar/l10n/openapi/rules/openapi/operations/OAR038.html
@@ -1,4 +1,11 @@
-

A resource creation response must have at least one attribute.

+

The 201 response schema of a POST operation must have properties named data or error, and each must have at least one sub-property.

+

This rule fires when:

+
    +
  • A top-level property is not named exactly data or error (case-sensitive).
  • +
  • A data or error property has no sub-properties.
  • +
  • The 201 response has no schema.
  • +
+

Configurable: data-property — valid property name (default: data; also accepts error).

Noncompliant Code Example (OpenAPI 2)

 swagger: "2.0"
diff --git a/src/main/resources/org/sonar/l10n/openapi/rules/openapi/resources/OAR038.html b/src/main/resources/org/sonar/l10n/openapi/rules/openapi/resources/OAR038.html
index 63539536..579bfe9a 100644
--- a/src/main/resources/org/sonar/l10n/openapi/rules/openapi/resources/OAR038.html
+++ b/src/main/resources/org/sonar/l10n/openapi/rules/openapi/resources/OAR038.html
@@ -1,4 +1,11 @@
-

A resource creation response must have at least one attribute.

+

The 201 response schema of a POST operation must have properties named data or error, and each must have at least one sub-property.

+

This rule fires when:

+
    +
  • A top-level property is not named exactly data or error (case-sensitive).
  • +
  • A data or error property has no sub-properties.
  • +
  • The 201 response has no schema.
  • +
+

Configurable: data-property — valid property name (default: data; also accepts error).

Noncompliant Code Example (OpenAPI 2)

JSON

diff --git a/src/test/java/apiaddicts/sonar/openapi/checks/operations/OAR038StandardCreateResponseCheckTest.java b/src/test/java/apiaddicts/sonar/openapi/checks/operations/OAR038StandardCreateResponseCheckTest.java
index 68b6c83b..b637b138 100644
--- a/src/test/java/apiaddicts/sonar/openapi/checks/operations/OAR038StandardCreateResponseCheckTest.java
+++ b/src/test/java/apiaddicts/sonar/openapi/checks/operations/OAR038StandardCreateResponseCheckTest.java
@@ -127,6 +127,40 @@ public void verifyInV32WithoutSchema() {
         verifyV32("without-schema");
     }
 
+    @Test
+    public void verifyInV2WithErrorProperty() {
+        verifyV2("valid-with-error");
+    }
+    @Test
+    public void verifyInV3WithErrorProperty() {
+        verifyV3("valid-with-error");
+    }
+    @Test
+    public void verifyInV31WithErrorProperty() {
+        verifyV31("valid-with-error");
+    }
+    @Test
+    public void verifyInV32WithErrorProperty() {
+        verifyV32("valid-with-error");
+    }
+
+    @Test
+    public void verifyInV2WithInvalidProperty() {
+        verifyV2("with-invalid-property");
+    }
+    @Test
+    public void verifyInV3WithInvalidProperty() {
+        verifyV3("with-invalid-property");
+    }
+    @Test
+    public void verifyInV31WithInvalidProperty() {
+        verifyV31("with-invalid-property");
+    }
+    @Test
+    public void verifyInV32WithInvalidProperty() {
+        verifyV32("with-invalid-property");
+    }
+
     @Override
     public void verifyRule() {
         assertRuleProperties("OAR038 - StandardCreateResponse - Creation response schema must be compliant with the standard", RuleType.BUG, Severity.MAJOR, tags("operations"));
diff --git a/src/test/resources/checks/v2/operations/OAR038/valid-with-error.json b/src/test/resources/checks/v2/operations/OAR038/valid-with-error.json
new file mode 100644
index 00000000..ebd24923
--- /dev/null
+++ b/src/test/resources/checks/v2/operations/OAR038/valid-with-error.json
@@ -0,0 +1,39 @@
+{
+  "swagger" : "2.0",
+  "info" : {
+    "version" : "1.0.0",
+    "title" : "Swagger Petstore"
+  },
+  "paths" : {
+    "/endpoint" : {
+      "post" : {
+        "responses" : {
+          "201" : {
+            "description" : "Ok",
+            "schema" : {
+              "$ref" : "#/definitions/response"
+            }
+          },
+          "204" : {
+            "description" : "No content"
+          }
+        }
+      }
+    }
+  },
+  "definitions" : {
+    "response" : {
+      "type" : "object",
+      "properties" : {
+        "error" : {
+          "type" : "object",
+          "properties" : {
+            "message" : {
+              "type" : "string"
+            }
+          }
+        }
+      }
+    }
+  }
+}
diff --git a/src/test/resources/checks/v2/operations/OAR038/valid-with-error.yaml b/src/test/resources/checks/v2/operations/OAR038/valid-with-error.yaml
new file mode 100644
index 00000000..d553faaa
--- /dev/null
+++ b/src/test/resources/checks/v2/operations/OAR038/valid-with-error.yaml
@@ -0,0 +1,24 @@
+swagger: "2.0"
+info:
+  version: 1.0.0
+  title: Swagger Petstore
+paths:
+  /endpoint:
+    post:
+      responses:
+        201:
+          description: Ok
+          schema:
+            $ref: '#/definitions/response'
+        204:
+          description: No content
+
+definitions:
+  response:
+    type: object
+    properties:
+      error:
+        type: object
+        properties:
+          message:
+            type: string
diff --git a/src/test/resources/checks/v2/operations/OAR038/with-invalid-property.json b/src/test/resources/checks/v2/operations/OAR038/with-invalid-property.json
new file mode 100644
index 00000000..96b00628
--- /dev/null
+++ b/src/test/resources/checks/v2/operations/OAR038/with-invalid-property.json
@@ -0,0 +1,39 @@
+{
+  "swagger" : "2.0",
+  "info" : {
+    "version" : "1.0.0",
+    "title" : "Swagger Petstore"
+  },
+  "paths" : {
+    "/endpoint" : {
+      "post" : {
+        "responses" : {
+          "201" : {
+            "description" : "Ok",
+            "schema" : {
+              "$ref" : "#/definitions/response"
+            }
+          },
+          "204" : {
+            "description" : "No content"
+          }
+        }
+      }
+    }
+  },
+  "definitions" : {
+    "response" : {
+      "type" : "object",
+      "properties" : {
+        "invalid_name" : { # Noncompliant {{OAR038: 'data' or 'error' property is required}}
+          "type" : "object",
+          "properties" : {
+            "id" : {
+              "type" : "string"
+            }
+          }
+        }
+      }
+    }
+  }
+}
diff --git a/src/test/resources/checks/v2/operations/OAR038/with-invalid-property.yaml b/src/test/resources/checks/v2/operations/OAR038/with-invalid-property.yaml
new file mode 100644
index 00000000..f3683a63
--- /dev/null
+++ b/src/test/resources/checks/v2/operations/OAR038/with-invalid-property.yaml
@@ -0,0 +1,24 @@
+swagger: "2.0"
+info:
+  version: 1.0.0
+  title: Swagger Petstore
+paths:
+  /endpoint:
+    post:
+      responses:
+        201:
+          description: Ok
+          schema:
+            $ref: '#/definitions/response'
+        204:
+          description: No content
+
+definitions:
+  response:
+    type: object
+    properties:
+      invalid_name: # Noncompliant {{OAR038: 'data' or 'error' property is required}}
+        type: object
+        properties:
+          id:
+            type: string
diff --git a/src/test/resources/checks/v2/operations/OAR038/without-data.json b/src/test/resources/checks/v2/operations/OAR038/without-data.json
index 8bd0079f..f6c8a094 100644
--- a/src/test/resources/checks/v2/operations/OAR038/without-data.json
+++ b/src/test/resources/checks/v2/operations/OAR038/without-data.json
@@ -22,7 +22,7 @@
     }
   },
   "definitions" : {
-    "response" : { # Noncompliant {{OAR038: 'data' property is missing}}
+    "response" : { # Noncompliant {{OAR038: 'data' or 'error' property is required}}
       "type" : "object"
     }
   }
diff --git a/src/test/resources/checks/v2/operations/OAR038/without-data.yaml b/src/test/resources/checks/v2/operations/OAR038/without-data.yaml
index f62c4f51..0e284414 100644
--- a/src/test/resources/checks/v2/operations/OAR038/without-data.yaml
+++ b/src/test/resources/checks/v2/operations/OAR038/without-data.yaml
@@ -14,5 +14,5 @@ paths:
           description: No content
 
 definitions:
-  response: # Noncompliant {{OAR038: 'data' property is missing}}
+  response: # Noncompliant {{OAR038: 'data' or 'error' property is required}}
     type: object
\ No newline at end of file
diff --git a/src/test/resources/checks/v2/resources/OAR038/valid-with-error.json b/src/test/resources/checks/v2/resources/OAR038/valid-with-error.json
new file mode 100644
index 00000000..edd22520
--- /dev/null
+++ b/src/test/resources/checks/v2/resources/OAR038/valid-with-error.json
@@ -0,0 +1,6 @@
+{
+  "swagger": "2.0",
+  "info": { "version": "1.0.0", "title": "Swagger Petstore" },
+  "paths": { "/endpoint": { "post": { "responses": { "201": { "description": "Ok", "schema": { "$ref": "#/definitions/response" } }, "204": { "description": "No content" } } } } },
+  "definitions": { "response": { "type": "object", "properties": { "error": { "type": "object", "properties": { "message": { "type": "string" } } } } } }
+}
diff --git a/src/test/resources/checks/v2/resources/OAR038/valid-with-error.yaml b/src/test/resources/checks/v2/resources/OAR038/valid-with-error.yaml
new file mode 100644
index 00000000..d553faaa
--- /dev/null
+++ b/src/test/resources/checks/v2/resources/OAR038/valid-with-error.yaml
@@ -0,0 +1,24 @@
+swagger: "2.0"
+info:
+  version: 1.0.0
+  title: Swagger Petstore
+paths:
+  /endpoint:
+    post:
+      responses:
+        201:
+          description: Ok
+          schema:
+            $ref: '#/definitions/response'
+        204:
+          description: No content
+
+definitions:
+  response:
+    type: object
+    properties:
+      error:
+        type: object
+        properties:
+          message:
+            type: string
diff --git a/src/test/resources/checks/v2/resources/OAR038/with-invalid-property.json b/src/test/resources/checks/v2/resources/OAR038/with-invalid-property.json
new file mode 100644
index 00000000..dba7a4b4
--- /dev/null
+++ b/src/test/resources/checks/v2/resources/OAR038/with-invalid-property.json
@@ -0,0 +1,7 @@
+{
+  "swagger": "2.0",
+  "info": { "version": "1.0.0", "title": "Swagger Petstore" },
+  "paths": { "/endpoint": { "post": { "responses": { "201": { "description": "Ok", "schema": { "$ref": "#/definitions/response" } }, "204": { "description": "No content" } } } } },
+  "definitions": { "response": { "type": "object", "properties": { "invalid_name" : { # Noncompliant {{OAR038: 'data' or 'error' property is required}}
+    "type": "object", "properties": { "id": { "type": "string" } } } } } }
+}
diff --git a/src/test/resources/checks/v2/resources/OAR038/with-invalid-property.yaml b/src/test/resources/checks/v2/resources/OAR038/with-invalid-property.yaml
new file mode 100644
index 00000000..f3683a63
--- /dev/null
+++ b/src/test/resources/checks/v2/resources/OAR038/with-invalid-property.yaml
@@ -0,0 +1,24 @@
+swagger: "2.0"
+info:
+  version: 1.0.0
+  title: Swagger Petstore
+paths:
+  /endpoint:
+    post:
+      responses:
+        201:
+          description: Ok
+          schema:
+            $ref: '#/definitions/response'
+        204:
+          description: No content
+
+definitions:
+  response:
+    type: object
+    properties:
+      invalid_name: # Noncompliant {{OAR038: 'data' or 'error' property is required}}
+        type: object
+        properties:
+          id:
+            type: string
diff --git a/src/test/resources/checks/v2/resources/OAR038/without-data.json b/src/test/resources/checks/v2/resources/OAR038/without-data.json
index 8bd0079f..f6c8a094 100644
--- a/src/test/resources/checks/v2/resources/OAR038/without-data.json
+++ b/src/test/resources/checks/v2/resources/OAR038/without-data.json
@@ -22,7 +22,7 @@
     }
   },
   "definitions" : {
-    "response" : { # Noncompliant {{OAR038: 'data' property is missing}}
+    "response" : { # Noncompliant {{OAR038: 'data' or 'error' property is required}}
       "type" : "object"
     }
   }
diff --git a/src/test/resources/checks/v2/resources/OAR038/without-data.yaml b/src/test/resources/checks/v2/resources/OAR038/without-data.yaml
index f62c4f51..0e284414 100644
--- a/src/test/resources/checks/v2/resources/OAR038/without-data.yaml
+++ b/src/test/resources/checks/v2/resources/OAR038/without-data.yaml
@@ -14,5 +14,5 @@ paths:
           description: No content
 
 definitions:
-  response: # Noncompliant {{OAR038: 'data' property is missing}}
+  response: # Noncompliant {{OAR038: 'data' or 'error' property is required}}
     type: object
\ No newline at end of file
diff --git a/src/test/resources/checks/v3/operations/OAR038/valid-with-error.json b/src/test/resources/checks/v3/operations/OAR038/valid-with-error.json
new file mode 100644
index 00000000..ffa93065
--- /dev/null
+++ b/src/test/resources/checks/v3/operations/OAR038/valid-with-error.json
@@ -0,0 +1,32 @@
+{
+  "openapi": "3.0.0",
+  "info": { "version": "1.0.0", "title": "Swagger Petstore" },
+  "paths": {
+    "/endpoint": {
+      "post": {
+        "responses": {
+          "201": {
+            "description": "Ok",
+            "content": {
+              "application/json": { "schema": { "$ref": "#/components/schemas/response" } }
+            }
+          },
+          "204": { "description": "No content" }
+        }
+      }
+    }
+  },
+  "components": {
+    "schemas": {
+      "response": {
+        "type": "object",
+        "properties": {
+          "error": {
+            "type": "object",
+            "properties": { "message": { "type": "string" } }
+          }
+        }
+      }
+    }
+  }
+}
diff --git a/src/test/resources/checks/v3/operations/OAR038/valid-with-error.yaml b/src/test/resources/checks/v3/operations/OAR038/valid-with-error.yaml
new file mode 100644
index 00000000..7f162351
--- /dev/null
+++ b/src/test/resources/checks/v3/operations/OAR038/valid-with-error.yaml
@@ -0,0 +1,27 @@
+openapi: "3.0.0"
+info:
+  version: 1.0.0
+  title: Swagger Petstore
+paths:
+  /endpoint:
+    post:
+      responses:
+        201:
+          description: Ok
+          content:
+            application/json:
+              schema:
+                $ref: '#/components/schemas/response'
+        204:
+          description: No content
+
+components:
+  schemas:
+    response:
+      type: object
+      properties:
+        error:
+          type: object
+          properties:
+            message:
+              type: string
diff --git a/src/test/resources/checks/v3/operations/OAR038/with-invalid-property.json b/src/test/resources/checks/v3/operations/OAR038/with-invalid-property.json
new file mode 100644
index 00000000..673a756f
--- /dev/null
+++ b/src/test/resources/checks/v3/operations/OAR038/with-invalid-property.json
@@ -0,0 +1,45 @@
+{
+  "openapi" : "3.0.0",
+  "info" : {
+    "version" : "1.0.0",
+    "title" : "Swagger Petstore"
+  },
+  "paths" : {
+    "/endpoint" : {
+      "post" : {
+        "responses" : {
+          "201" : {
+            "description" : "Ok",
+            "content": {
+              "application/json":{
+                "schema" : {
+                  "$ref" : "#/components/schemas/response"
+                }
+              }
+            }
+          },
+          "204" : {
+            "description" : "No content"
+          }
+        }
+      }
+    }
+  },
+  "components": {
+    "schemas": {
+      "response" : {
+        "type" : "object",
+        "properties" : {
+          "invalid_name" : { # Noncompliant {{OAR038: 'data' or 'error' property is required}}
+            "type" : "object",
+            "properties" : {
+              "id" : {
+                "type" : "string"
+              }
+            }
+          }
+        }
+      }
+    }
+  }
+}
diff --git a/src/test/resources/checks/v3/operations/OAR038/with-invalid-property.yaml b/src/test/resources/checks/v3/operations/OAR038/with-invalid-property.yaml
new file mode 100644
index 00000000..ddfcbfac
--- /dev/null
+++ b/src/test/resources/checks/v3/operations/OAR038/with-invalid-property.yaml
@@ -0,0 +1,27 @@
+openapi: "3.0.0"
+info:
+  version: 1.0.0
+  title: Swagger Petstore
+paths:
+  /endpoint:
+    post:
+      responses:
+        201:
+          description: Ok
+          content:
+            application/json:
+              schema:
+                $ref: '#/components/schemas/response'
+        204:
+          description: No content
+
+components:
+  schemas:
+    response:
+      type: object
+      properties:
+        invalid_name: # Noncompliant {{OAR038: 'data' or 'error' property is required}}
+          type: object
+          properties:
+            id:
+              type: string
diff --git a/src/test/resources/checks/v3/operations/OAR038/without-data.json b/src/test/resources/checks/v3/operations/OAR038/without-data.json
index a6d5f9a6..dde773ef 100644
--- a/src/test/resources/checks/v3/operations/OAR038/without-data.json
+++ b/src/test/resources/checks/v3/operations/OAR038/without-data.json
@@ -27,7 +27,7 @@
   },
   "components": {
     "schemas" : {
-      "response" : { # Noncompliant {{OAR038: 'data' property is missing}}
+      "response" : { # Noncompliant {{OAR038: 'data' or 'error' property is required}}
         "type" : "object"
       }
     }
diff --git a/src/test/resources/checks/v3/operations/OAR038/without-data.yaml b/src/test/resources/checks/v3/operations/OAR038/without-data.yaml
index b64463dd..f3cefdaa 100644
--- a/src/test/resources/checks/v3/operations/OAR038/without-data.yaml
+++ b/src/test/resources/checks/v3/operations/OAR038/without-data.yaml
@@ -17,5 +17,5 @@ paths:
 
 components:
   schemas:
-    response: # Noncompliant {{OAR038: 'data' property is missing}}
+    response: # Noncompliant {{OAR038: 'data' or 'error' property is required}}
       type: object
\ No newline at end of file
diff --git a/src/test/resources/checks/v3/resources/OAR038/valid-with-error.json b/src/test/resources/checks/v3/resources/OAR038/valid-with-error.json
new file mode 100644
index 00000000..89ed754d
--- /dev/null
+++ b/src/test/resources/checks/v3/resources/OAR038/valid-with-error.json
@@ -0,0 +1 @@
+{"openapi":"3.0.0","info":{"version":"1.0.0","title":"Swagger Petstore"},"paths":{"/endpoint":{"post":{"responses":{"201":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/response"}}}},"204":{"description":"No content"}}}}},"components":{"schemas":{"response":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"}}}}}}}}
diff --git a/src/test/resources/checks/v3/resources/OAR038/valid-with-error.yaml b/src/test/resources/checks/v3/resources/OAR038/valid-with-error.yaml
new file mode 100644
index 00000000..7f162351
--- /dev/null
+++ b/src/test/resources/checks/v3/resources/OAR038/valid-with-error.yaml
@@ -0,0 +1,27 @@
+openapi: "3.0.0"
+info:
+  version: 1.0.0
+  title: Swagger Petstore
+paths:
+  /endpoint:
+    post:
+      responses:
+        201:
+          description: Ok
+          content:
+            application/json:
+              schema:
+                $ref: '#/components/schemas/response'
+        204:
+          description: No content
+
+components:
+  schemas:
+    response:
+      type: object
+      properties:
+        error:
+          type: object
+          properties:
+            message:
+              type: string
diff --git a/src/test/resources/checks/v3/resources/OAR038/with-invalid-property.json b/src/test/resources/checks/v3/resources/OAR038/with-invalid-property.json
new file mode 100644
index 00000000..6380046b
--- /dev/null
+++ b/src/test/resources/checks/v3/resources/OAR038/with-invalid-property.json
@@ -0,0 +1,2 @@
+{"openapi":"3.0.0","info":{"version":"1.0.0","title":"Swagger Petstore"},"paths":{"/endpoint":{"post":{"responses":{"201":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/response"}}}},"204":{"description":"No content"}}}}},"components":{"schemas":{"response":{"type":"object","properties":{"invalid_name" : { # Noncompliant {{OAR038: 'data' or 'error' property is required}}
+            "type":"object","properties":{"id":{"type":"string"}}}}}}}}}
diff --git a/src/test/resources/checks/v3/resources/OAR038/with-invalid-property.yaml b/src/test/resources/checks/v3/resources/OAR038/with-invalid-property.yaml
new file mode 100644
index 00000000..ddfcbfac
--- /dev/null
+++ b/src/test/resources/checks/v3/resources/OAR038/with-invalid-property.yaml
@@ -0,0 +1,27 @@
+openapi: "3.0.0"
+info:
+  version: 1.0.0
+  title: Swagger Petstore
+paths:
+  /endpoint:
+    post:
+      responses:
+        201:
+          description: Ok
+          content:
+            application/json:
+              schema:
+                $ref: '#/components/schemas/response'
+        204:
+          description: No content
+
+components:
+  schemas:
+    response:
+      type: object
+      properties:
+        invalid_name: # Noncompliant {{OAR038: 'data' or 'error' property is required}}
+          type: object
+          properties:
+            id:
+              type: string
diff --git a/src/test/resources/checks/v3/resources/OAR038/without-data.json b/src/test/resources/checks/v3/resources/OAR038/without-data.json
index a6d5f9a6..dde773ef 100644
--- a/src/test/resources/checks/v3/resources/OAR038/without-data.json
+++ b/src/test/resources/checks/v3/resources/OAR038/without-data.json
@@ -27,7 +27,7 @@
   },
   "components": {
     "schemas" : {
-      "response" : { # Noncompliant {{OAR038: 'data' property is missing}}
+      "response" : { # Noncompliant {{OAR038: 'data' or 'error' property is required}}
         "type" : "object"
       }
     }
diff --git a/src/test/resources/checks/v3/resources/OAR038/without-data.yaml b/src/test/resources/checks/v3/resources/OAR038/without-data.yaml
index b64463dd..f3cefdaa 100644
--- a/src/test/resources/checks/v3/resources/OAR038/without-data.yaml
+++ b/src/test/resources/checks/v3/resources/OAR038/without-data.yaml
@@ -17,5 +17,5 @@ paths:
 
 components:
   schemas:
-    response: # Noncompliant {{OAR038: 'data' property is missing}}
+    response: # Noncompliant {{OAR038: 'data' or 'error' property is required}}
       type: object
\ No newline at end of file
diff --git a/src/test/resources/checks/v31/operations/OAR038/valid-with-error.json b/src/test/resources/checks/v31/operations/OAR038/valid-with-error.json
new file mode 100644
index 00000000..997c05d9
--- /dev/null
+++ b/src/test/resources/checks/v31/operations/OAR038/valid-with-error.json
@@ -0,0 +1,45 @@
+{
+  "openapi" : "3.1.0",
+  "info" : {
+    "version" : "1.0.0",
+    "title" : "Swagger Petstore"
+  },
+  "paths" : {
+    "/endpoint" : {
+      "post" : {
+        "responses" : {
+          "201" : {
+            "description" : "Ok",
+            "content": {
+              "application/json":{
+                "schema" : {
+                  "$ref" : "#/components/schemas/response"
+                }
+              }
+            }
+          },
+          "204" : {
+            "description" : "No content"
+          }
+        }
+      }
+    }
+  },
+  "components": {
+    "schemas": {
+      "response" : {
+        "type" : "object",
+        "properties" : {
+          "error" : {
+            "type" : "object",
+            "properties" : {
+              "message" : {
+                "type" : "string"
+              }
+            }
+          }
+        }
+      }
+    }
+  }
+}
diff --git a/src/test/resources/checks/v31/operations/OAR038/valid-with-error.yaml b/src/test/resources/checks/v31/operations/OAR038/valid-with-error.yaml
new file mode 100644
index 00000000..a08e7401
--- /dev/null
+++ b/src/test/resources/checks/v31/operations/OAR038/valid-with-error.yaml
@@ -0,0 +1,27 @@
+openapi: "3.1.0"
+info:
+  version: 1.0.0
+  title: Swagger Petstore
+paths:
+  /endpoint:
+    post:
+      responses:
+        201:
+          description: Ok
+          content:
+            application/json:
+              schema:
+                $ref: '#/components/schemas/response'
+        204:
+          description: No content
+
+components:
+  schemas:
+    response:
+      type: object
+      properties:
+        error:
+          type: object
+          properties:
+            message:
+              type: string
diff --git a/src/test/resources/checks/v31/operations/OAR038/with-invalid-property.json b/src/test/resources/checks/v31/operations/OAR038/with-invalid-property.json
new file mode 100644
index 00000000..1c7aed73
--- /dev/null
+++ b/src/test/resources/checks/v31/operations/OAR038/with-invalid-property.json
@@ -0,0 +1,45 @@
+{
+  "openapi" : "3.1.0",
+  "info" : {
+    "version" : "1.0.0",
+    "title" : "Swagger Petstore"
+  },
+  "paths" : {
+    "/endpoint" : {
+      "post" : {
+        "responses" : {
+          "201" : {
+            "description" : "Ok",
+            "content": {
+              "application/json":{
+                "schema" : {
+                  "$ref" : "#/components/schemas/response"
+                }
+              }
+            }
+          },
+          "204" : {
+            "description" : "No content"
+          }
+        }
+      }
+    }
+  },
+  "components": {
+    "schemas": {
+      "response" : {
+        "type" : "object",
+        "properties" : {
+          "invalid_name" : { # Noncompliant {{OAR038: 'data' or 'error' property is required}}
+            "type" : "object",
+            "properties" : {
+              "id" : {
+                "type" : "string"
+              }
+            }
+          }
+        }
+      }
+    }
+  }
+}
diff --git a/src/test/resources/checks/v31/operations/OAR038/with-invalid-property.yaml b/src/test/resources/checks/v31/operations/OAR038/with-invalid-property.yaml
new file mode 100644
index 00000000..24c70642
--- /dev/null
+++ b/src/test/resources/checks/v31/operations/OAR038/with-invalid-property.yaml
@@ -0,0 +1,27 @@
+openapi: "3.1.0"
+info:
+  version: 1.0.0
+  title: Swagger Petstore
+paths:
+  /endpoint:
+    post:
+      responses:
+        201:
+          description: Ok
+          content:
+            application/json:
+              schema:
+                $ref: '#/components/schemas/response'
+        204:
+          description: No content
+
+components:
+  schemas:
+    response:
+      type: object
+      properties:
+        invalid_name: # Noncompliant {{OAR038: 'data' or 'error' property is required}}
+          type: object
+          properties:
+            id:
+              type: string
diff --git a/src/test/resources/checks/v31/operations/OAR038/without-data.json b/src/test/resources/checks/v31/operations/OAR038/without-data.json
index d326bab4..de142681 100644
--- a/src/test/resources/checks/v31/operations/OAR038/without-data.json
+++ b/src/test/resources/checks/v31/operations/OAR038/without-data.json
@@ -27,7 +27,7 @@
   },
   "components": {
     "schemas" : {
-      "response" : { # Noncompliant {{OAR038: 'data' property is missing}}
+      "response" : { # Noncompliant {{OAR038: 'data' or 'error' property is required}}
         "type" : "object"
       }
     }
diff --git a/src/test/resources/checks/v31/operations/OAR038/without-data.yaml b/src/test/resources/checks/v31/operations/OAR038/without-data.yaml
index ef46e463..ced39065 100644
--- a/src/test/resources/checks/v31/operations/OAR038/without-data.yaml
+++ b/src/test/resources/checks/v31/operations/OAR038/without-data.yaml
@@ -17,5 +17,5 @@ paths:
 
 components:
   schemas:
-    response: # Noncompliant {{OAR038: 'data' property is missing}}
+    response: # Noncompliant {{OAR038: 'data' or 'error' property is required}}
       type: object
\ No newline at end of file
diff --git a/src/test/resources/checks/v31/resources/OAR038/valid-with-error.json b/src/test/resources/checks/v31/resources/OAR038/valid-with-error.json
new file mode 100644
index 00000000..9324da59
--- /dev/null
+++ b/src/test/resources/checks/v31/resources/OAR038/valid-with-error.json
@@ -0,0 +1 @@
+{"openapi":"3.1.0","info":{"version":"1.0.0","title":"Swagger Petstore"},"paths":{"/endpoint":{"post":{"responses":{"201":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/response"}}}},"204":{"description":"No content"}}}}},"components":{"schemas":{"response":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"}}}}}}}}
diff --git a/src/test/resources/checks/v31/resources/OAR038/valid-with-error.yaml b/src/test/resources/checks/v31/resources/OAR038/valid-with-error.yaml
new file mode 100644
index 00000000..a08e7401
--- /dev/null
+++ b/src/test/resources/checks/v31/resources/OAR038/valid-with-error.yaml
@@ -0,0 +1,27 @@
+openapi: "3.1.0"
+info:
+  version: 1.0.0
+  title: Swagger Petstore
+paths:
+  /endpoint:
+    post:
+      responses:
+        201:
+          description: Ok
+          content:
+            application/json:
+              schema:
+                $ref: '#/components/schemas/response'
+        204:
+          description: No content
+
+components:
+  schemas:
+    response:
+      type: object
+      properties:
+        error:
+          type: object
+          properties:
+            message:
+              type: string
diff --git a/src/test/resources/checks/v31/resources/OAR038/with-invalid-property.json b/src/test/resources/checks/v31/resources/OAR038/with-invalid-property.json
new file mode 100644
index 00000000..54c365d1
--- /dev/null
+++ b/src/test/resources/checks/v31/resources/OAR038/with-invalid-property.json
@@ -0,0 +1,2 @@
+{"openapi":"3.1.0","info":{"version":"1.0.0","title":"Swagger Petstore"},"paths":{"/endpoint":{"post":{"responses":{"201":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/response"}}}},"204":{"description":"No content"}}}}},"components":{"schemas":{"response":{"type":"object","properties":{"invalid_name" : { # Noncompliant {{OAR038: 'data' or 'error' property is required}}
+            "type":"object","properties":{"id":{"type":"string"}}}}}}}}}
diff --git a/src/test/resources/checks/v31/resources/OAR038/with-invalid-property.yaml b/src/test/resources/checks/v31/resources/OAR038/with-invalid-property.yaml
new file mode 100644
index 00000000..24c70642
--- /dev/null
+++ b/src/test/resources/checks/v31/resources/OAR038/with-invalid-property.yaml
@@ -0,0 +1,27 @@
+openapi: "3.1.0"
+info:
+  version: 1.0.0
+  title: Swagger Petstore
+paths:
+  /endpoint:
+    post:
+      responses:
+        201:
+          description: Ok
+          content:
+            application/json:
+              schema:
+                $ref: '#/components/schemas/response'
+        204:
+          description: No content
+
+components:
+  schemas:
+    response:
+      type: object
+      properties:
+        invalid_name: # Noncompliant {{OAR038: 'data' or 'error' property is required}}
+          type: object
+          properties:
+            id:
+              type: string
diff --git a/src/test/resources/checks/v31/resources/OAR038/without-data.json b/src/test/resources/checks/v31/resources/OAR038/without-data.json
index d326bab4..de142681 100644
--- a/src/test/resources/checks/v31/resources/OAR038/without-data.json
+++ b/src/test/resources/checks/v31/resources/OAR038/without-data.json
@@ -27,7 +27,7 @@
   },
   "components": {
     "schemas" : {
-      "response" : { # Noncompliant {{OAR038: 'data' property is missing}}
+      "response" : { # Noncompliant {{OAR038: 'data' or 'error' property is required}}
         "type" : "object"
       }
     }
diff --git a/src/test/resources/checks/v31/resources/OAR038/without-data.yaml b/src/test/resources/checks/v31/resources/OAR038/without-data.yaml
index ef46e463..ced39065 100644
--- a/src/test/resources/checks/v31/resources/OAR038/without-data.yaml
+++ b/src/test/resources/checks/v31/resources/OAR038/without-data.yaml
@@ -17,5 +17,5 @@ paths:
 
 components:
   schemas:
-    response: # Noncompliant {{OAR038: 'data' property is missing}}
+    response: # Noncompliant {{OAR038: 'data' or 'error' property is required}}
       type: object
\ No newline at end of file
diff --git a/src/test/resources/checks/v32/operations/OAR038/valid-with-error.json b/src/test/resources/checks/v32/operations/OAR038/valid-with-error.json
new file mode 100644
index 00000000..c0c4fc97
--- /dev/null
+++ b/src/test/resources/checks/v32/operations/OAR038/valid-with-error.json
@@ -0,0 +1,45 @@
+{
+  "openapi" : "3.2.0",
+  "info" : {
+    "version" : "1.0.0",
+    "title" : "Swagger Petstore"
+  },
+  "paths" : {
+    "/endpoint" : {
+      "post" : {
+        "responses" : {
+          "201" : {
+            "description" : "Ok",
+            "content": {
+              "application/json":{
+                "schema" : {
+                  "$ref" : "#/components/schemas/response"
+                }
+              }
+            }
+          },
+          "204" : {
+            "description" : "No content"
+          }
+        }
+      }
+    }
+  },
+  "components": {
+    "schemas": {
+      "response" : {
+        "type" : "object",
+        "properties" : {
+          "error" : {
+            "type" : "object",
+            "properties" : {
+              "message" : {
+                "type" : "string"
+              }
+            }
+          }
+        }
+      }
+    }
+  }
+}
diff --git a/src/test/resources/checks/v32/operations/OAR038/valid-with-error.yaml b/src/test/resources/checks/v32/operations/OAR038/valid-with-error.yaml
new file mode 100644
index 00000000..9aaaed7e
--- /dev/null
+++ b/src/test/resources/checks/v32/operations/OAR038/valid-with-error.yaml
@@ -0,0 +1,27 @@
+openapi: "3.2.0"
+info:
+  version: 1.0.0
+  title: Swagger Petstore
+paths:
+  /endpoint:
+    post:
+      responses:
+        201:
+          description: Ok
+          content:
+            application/json:
+              schema:
+                $ref: '#/components/schemas/response'
+        204:
+          description: No content
+
+components:
+  schemas:
+    response:
+      type: object
+      properties:
+        error:
+          type: object
+          properties:
+            message:
+              type: string
diff --git a/src/test/resources/checks/v32/operations/OAR038/with-invalid-property.json b/src/test/resources/checks/v32/operations/OAR038/with-invalid-property.json
new file mode 100644
index 00000000..c0247b83
--- /dev/null
+++ b/src/test/resources/checks/v32/operations/OAR038/with-invalid-property.json
@@ -0,0 +1,45 @@
+{
+  "openapi" : "3.2.0",
+  "info" : {
+    "version" : "1.0.0",
+    "title" : "Swagger Petstore"
+  },
+  "paths" : {
+    "/endpoint" : {
+      "post" : {
+        "responses" : {
+          "201" : {
+            "description" : "Ok",
+            "content": {
+              "application/json":{
+                "schema" : {
+                  "$ref" : "#/components/schemas/response"
+                }
+              }
+            }
+          },
+          "204" : {
+            "description" : "No content"
+          }
+        }
+      }
+    }
+  },
+  "components": {
+    "schemas": {
+      "response" : {
+        "type" : "object",
+        "properties" : {
+          "invalid_name" : { # Noncompliant {{OAR038: 'data' or 'error' property is required}}
+            "type" : "object",
+            "properties" : {
+              "id" : {
+                "type" : "string"
+              }
+            }
+          }
+        }
+      }
+    }
+  }
+}
diff --git a/src/test/resources/checks/v32/operations/OAR038/with-invalid-property.yaml b/src/test/resources/checks/v32/operations/OAR038/with-invalid-property.yaml
new file mode 100644
index 00000000..f46de733
--- /dev/null
+++ b/src/test/resources/checks/v32/operations/OAR038/with-invalid-property.yaml
@@ -0,0 +1,27 @@
+openapi: "3.2.0"
+info:
+  version: 1.0.0
+  title: Swagger Petstore
+paths:
+  /endpoint:
+    post:
+      responses:
+        201:
+          description: Ok
+          content:
+            application/json:
+              schema:
+                $ref: '#/components/schemas/response'
+        204:
+          description: No content
+
+components:
+  schemas:
+    response:
+      type: object
+      properties:
+        invalid_name: # Noncompliant {{OAR038: 'data' or 'error' property is required}}
+          type: object
+          properties:
+            id:
+              type: string
diff --git a/src/test/resources/checks/v32/operations/OAR038/without-data.json b/src/test/resources/checks/v32/operations/OAR038/without-data.json
index 9a51222d..bc4b778d 100644
--- a/src/test/resources/checks/v32/operations/OAR038/without-data.json
+++ b/src/test/resources/checks/v32/operations/OAR038/without-data.json
@@ -27,7 +27,7 @@
   },
   "components": {
     "schemas" : {
-      "response" : { # Noncompliant {{OAR038: 'data' property is missing}}
+      "response" : { # Noncompliant {{OAR038: 'data' or 'error' property is required}}
         "type" : "object"
       }
     }
diff --git a/src/test/resources/checks/v32/operations/OAR038/without-data.yaml b/src/test/resources/checks/v32/operations/OAR038/without-data.yaml
index 47934fe1..910af91c 100644
--- a/src/test/resources/checks/v32/operations/OAR038/without-data.yaml
+++ b/src/test/resources/checks/v32/operations/OAR038/without-data.yaml
@@ -17,5 +17,5 @@ paths:
 
 components:
   schemas:
-    response: # Noncompliant {{OAR038: 'data' property is missing}}
+    response: # Noncompliant {{OAR038: 'data' or 'error' property is required}}
       type: object
\ No newline at end of file
diff --git a/src/test/resources/checks/v32/resources/OAR038/valid-with-error.json b/src/test/resources/checks/v32/resources/OAR038/valid-with-error.json
new file mode 100644
index 00000000..dd00601d
--- /dev/null
+++ b/src/test/resources/checks/v32/resources/OAR038/valid-with-error.json
@@ -0,0 +1 @@
+{"openapi":"3.2.0","info":{"version":"1.0.0","title":"Swagger Petstore"},"paths":{"/endpoint":{"post":{"responses":{"201":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/response"}}}},"204":{"description":"No content"}}}}},"components":{"schemas":{"response":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"}}}}}}}}
diff --git a/src/test/resources/checks/v32/resources/OAR038/valid-with-error.yaml b/src/test/resources/checks/v32/resources/OAR038/valid-with-error.yaml
new file mode 100644
index 00000000..9aaaed7e
--- /dev/null
+++ b/src/test/resources/checks/v32/resources/OAR038/valid-with-error.yaml
@@ -0,0 +1,27 @@
+openapi: "3.2.0"
+info:
+  version: 1.0.0
+  title: Swagger Petstore
+paths:
+  /endpoint:
+    post:
+      responses:
+        201:
+          description: Ok
+          content:
+            application/json:
+              schema:
+                $ref: '#/components/schemas/response'
+        204:
+          description: No content
+
+components:
+  schemas:
+    response:
+      type: object
+      properties:
+        error:
+          type: object
+          properties:
+            message:
+              type: string
diff --git a/src/test/resources/checks/v32/resources/OAR038/with-invalid-property.json b/src/test/resources/checks/v32/resources/OAR038/with-invalid-property.json
new file mode 100644
index 00000000..c3ce41b1
--- /dev/null
+++ b/src/test/resources/checks/v32/resources/OAR038/with-invalid-property.json
@@ -0,0 +1,2 @@
+{"openapi":"3.2.0","info":{"version":"1.0.0","title":"Swagger Petstore"},"paths":{"/endpoint":{"post":{"responses":{"201":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/response"}}}},"204":{"description":"No content"}}}}},"components":{"schemas":{"response":{"type":"object","properties":{"invalid_name" : { # Noncompliant {{OAR038: 'data' or 'error' property is required}}
+            "type":"object","properties":{"id":{"type":"string"}}}}}}}}}
diff --git a/src/test/resources/checks/v32/resources/OAR038/with-invalid-property.yaml b/src/test/resources/checks/v32/resources/OAR038/with-invalid-property.yaml
new file mode 100644
index 00000000..f46de733
--- /dev/null
+++ b/src/test/resources/checks/v32/resources/OAR038/with-invalid-property.yaml
@@ -0,0 +1,27 @@
+openapi: "3.2.0"
+info:
+  version: 1.0.0
+  title: Swagger Petstore
+paths:
+  /endpoint:
+    post:
+      responses:
+        201:
+          description: Ok
+          content:
+            application/json:
+              schema:
+                $ref: '#/components/schemas/response'
+        204:
+          description: No content
+
+components:
+  schemas:
+    response:
+      type: object
+      properties:
+        invalid_name: # Noncompliant {{OAR038: 'data' or 'error' property is required}}
+          type: object
+          properties:
+            id:
+              type: string
diff --git a/src/test/resources/checks/v32/resources/OAR038/without-data.json b/src/test/resources/checks/v32/resources/OAR038/without-data.json
index 9a51222d..bc4b778d 100644
--- a/src/test/resources/checks/v32/resources/OAR038/without-data.json
+++ b/src/test/resources/checks/v32/resources/OAR038/without-data.json
@@ -27,7 +27,7 @@
   },
   "components": {
     "schemas" : {
-      "response" : { # Noncompliant {{OAR038: 'data' property is missing}}
+      "response" : { # Noncompliant {{OAR038: 'data' or 'error' property is required}}
         "type" : "object"
       }
     }
diff --git a/src/test/resources/checks/v32/resources/OAR038/without-data.yaml b/src/test/resources/checks/v32/resources/OAR038/without-data.yaml
index 47934fe1..910af91c 100644
--- a/src/test/resources/checks/v32/resources/OAR038/without-data.yaml
+++ b/src/test/resources/checks/v32/resources/OAR038/without-data.yaml
@@ -17,5 +17,5 @@ paths:
 
 components:
   schemas:
-    response: # Noncompliant {{OAR038: 'data' property is missing}}
+    response: # Noncompliant {{OAR038: 'data' or 'error' property is required}}
       type: object
\ No newline at end of file

From 16486148282ee8eb24b49af334ab1b1189e71be1 Mon Sep 17 00:00:00 2001
From: Melsy Huamani 
Date: Sun, 31 May 2026 10:45:08 -0500
Subject: [PATCH 23/28] fix: oar066 exempt prefixes naming convention

---
 CHANGELOG.md                                   |  1 +
 .../OAR066SnakeCaseNamingConventionCheck.java  |  7 +++++++
 .../openapi/rules/openapi/format/OAR066.html   |  7 +++++++
 .../openapi/rules/openapi/format/OAR066.html   |  7 +++++++
 .../checks/v2/format/OAR066/valid.json         | 18 ++++++++++++++++++
 .../checks/v2/format/OAR066/valid.yaml         | 12 ++++++++++++
 .../checks/v3/format/OAR066/valid.json         |  8 +++++++-
 .../checks/v3/format/OAR066/valid.yaml         | 12 ++++++++++++
 .../checks/v31/format/OAR066/valid.json        |  8 +++++++-
 .../checks/v31/format/OAR066/valid.yaml        | 12 ++++++++++++
 .../checks/v32/format/OAR066/valid.json        |  8 +++++++-
 .../checks/v32/format/OAR066/valid.yaml        | 12 ++++++++++++
 12 files changed, 109 insertions(+), 3 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 8a5f5dae..b220fcad 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
 - OAR021 - ExcludeParameterCheck - Same fix as OAR020 applied for `$exclude` parameter. Changed default path strategy to exclude-all, added `/me` and health-check exclusions, added `without-parameters` test cases.
 - OAR037 - StringFormatCheck - Fixed false negative where string schemas without a `format` field were not reported. Updated `isInvalidString` to also fire when `format == null`, aligning with Spectral behavior.
 - OAR038 - StandardCreateResponseCheck - POST 201 responses must have a schema whose properties are named `data` or `error`, each with at least one sub-property. Fires with a distinct message when the property name is invalid vs. when sub-properties are missing.
+- OAR066 - SnakeCaseNamingConventionCheck - Fixed false positives on industry-standard property name prefixes. Skip properties whose names start with `@` or `x-`.
 
 ## [1.4.1-beta-3] - 2026-05-29
 
diff --git a/src/main/java/apiaddicts/sonar/openapi/checks/format/OAR066SnakeCaseNamingConventionCheck.java b/src/main/java/apiaddicts/sonar/openapi/checks/format/OAR066SnakeCaseNamingConventionCheck.java
index d67c1608..d59492b7 100644
--- a/src/main/java/apiaddicts/sonar/openapi/checks/format/OAR066SnakeCaseNamingConventionCheck.java
+++ b/src/main/java/apiaddicts/sonar/openapi/checks/format/OAR066SnakeCaseNamingConventionCheck.java
@@ -1,6 +1,7 @@
 package apiaddicts.sonar.openapi.checks.format;
 
 import org.sonar.check.Rule;
+import org.apiaddicts.apitools.dosonarapi.sslr.yaml.grammar.JsonNode;
 
 @Rule(key = OAR066SnakeCaseNamingConventionCheck.KEY)
 public class OAR066SnakeCaseNamingConventionCheck extends AbstractSchemaNamingConventionCheck {
@@ -11,4 +12,10 @@ public class OAR066SnakeCaseNamingConventionCheck extends AbstractSchemaNamingCo
     public OAR066SnakeCaseNamingConventionCheck() {
         super(KEY, MESSAGE, SNAKE_CASE);
     }
+
+    @Override
+    protected void validateNamingConvention(String name, JsonNode nameNode) {
+        if (name.startsWith("@") || name.startsWith("x-")) return;
+        super.validateNamingConvention(name, nameNode);
+    }
 }
\ No newline at end of file
diff --git a/src/main/resources/org/sonar/l10n/es/openapi/rules/openapi/format/OAR066.html b/src/main/resources/org/sonar/l10n/es/openapi/rules/openapi/format/OAR066.html
index 1121b63d..73f727e0 100644
--- a/src/main/resources/org/sonar/l10n/es/openapi/rules/openapi/format/OAR066.html
+++ b/src/main/resources/org/sonar/l10n/es/openapi/rules/openapi/format/OAR066.html
@@ -1,4 +1,11 @@
 

Los nombres de las propiedades del esquema RequestBody y Responses deben cumplir la convención de nomenclatura snake_case

+

Prefijos exentos

+

Los siguientes prefijos de nombres de propiedades que siguen convenciones estándar de industria no están sujetos a esta regla:

+
    +
  • Prefijo _ — campos estándar HAL/HATEOAS (_links, _embedded)
  • +
  • Prefijo @ — campos estándar JSON-LD W3C (@context, @type, @id)
  • +
  • Prefijo x- — convenciones de extensión OpenAPI (x-internal, x-campo-personalizado)
  • +

Ejemplo de código no compatible (OpenAPI 2)

   swagger: "2.0"
diff --git a/src/main/resources/org/sonar/l10n/openapi/rules/openapi/format/OAR066.html b/src/main/resources/org/sonar/l10n/openapi/rules/openapi/format/OAR066.html
index be3495ef..adb9055e 100644
--- a/src/main/resources/org/sonar/l10n/openapi/rules/openapi/format/OAR066.html
+++ b/src/main/resources/org/sonar/l10n/openapi/rules/openapi/format/OAR066.html
@@ -1,4 +1,11 @@
 

RequestBody and Responses schema property names must be compliant with the snake_case naming convention

+

Exempt Prefixes

+

The following industry-standard property name prefixes are not subject to this rule:

+
    +
  • _ prefix — HAL/HATEOAS standard fields (_links, _embedded)
  • +
  • @ prefix — JSON-LD W3C standard fields (@context, @type, @id)
  • +
  • x- prefix — OpenAPI extension conventions (x-internal, x-custom-field)
  • +

Noncompliant Code Example (OpenAPI 2)

   swagger: "2.0"
diff --git a/src/test/resources/checks/v2/format/OAR066/valid.json b/src/test/resources/checks/v2/format/OAR066/valid.json
index fdf47c6c..3a488b7a 100644
--- a/src/test/resources/checks/v2/format/OAR066/valid.json
+++ b/src/test/resources/checks/v2/format/OAR066/valid.json
@@ -20,6 +20,24 @@
                 },
                 "last_name": {
                   "type": "string"
+                },
+                "_links": {
+                  "type": "object"
+                },
+                "_embedded": {
+                  "type": "object"
+                },
+                "@context": {
+                  "type": "string"
+                },
+                "@type": {
+                  "type": "string"
+                },
+                "@id": {
+                  "type": "string"
+                },
+                "x-internal": {
+                  "type": "boolean"
                 }
               }
             }
diff --git a/src/test/resources/checks/v2/format/OAR066/valid.yaml b/src/test/resources/checks/v2/format/OAR066/valid.yaml
index 623f70ac..29831526 100644
--- a/src/test/resources/checks/v2/format/OAR066/valid.yaml
+++ b/src/test/resources/checks/v2/format/OAR066/valid.yaml
@@ -16,6 +16,18 @@ paths:
                 type: string
               last_name:
                 type: string
+              _links:
+                type: object
+              _embedded:
+                type: object
+              "@context":
+                type: string
+              "@type":
+                type: string
+              "@id":
+                type: string
+              x-internal:
+                type: boolean
       responses:
         '200':
           description: Success
diff --git a/src/test/resources/checks/v3/format/OAR066/valid.json b/src/test/resources/checks/v3/format/OAR066/valid.json
index 67217b92..302ebdaf 100644
--- a/src/test/resources/checks/v3/format/OAR066/valid.json
+++ b/src/test/resources/checks/v3/format/OAR066/valid.json
@@ -13,7 +13,13 @@
                 "schema": {
                   "type": "object",
                   "properties": {
-                    "last_name": { "type": "string" }
+                    "last_name": { "type": "string" },
+                    "_links": { "type": "object" },
+                    "_embedded": { "type": "object" },
+                    "@context": { "type": "string" },
+                    "@type": { "type": "string" },
+                    "@id": { "type": "string" },
+                    "x-internal": { "type": "boolean" }
                   }
                 }
               }
diff --git a/src/test/resources/checks/v3/format/OAR066/valid.yaml b/src/test/resources/checks/v3/format/OAR066/valid.yaml
index 04c50530..e0118af0 100644
--- a/src/test/resources/checks/v3/format/OAR066/valid.yaml
+++ b/src/test/resources/checks/v3/format/OAR066/valid.yaml
@@ -13,6 +13,18 @@ paths:
               properties:
                 last_name:
                   type: string
+                _links:
+                  type: object
+                _embedded:
+                  type: object
+                "@context":
+                  type: string
+                "@type":
+                  type: string
+                "@id":
+                  type: string
+                x-internal:
+                  type: boolean
       responses:
         '200':
           description: Success
diff --git a/src/test/resources/checks/v31/format/OAR066/valid.json b/src/test/resources/checks/v31/format/OAR066/valid.json
index bff3c33a..2684353a 100644
--- a/src/test/resources/checks/v31/format/OAR066/valid.json
+++ b/src/test/resources/checks/v31/format/OAR066/valid.json
@@ -13,7 +13,13 @@
                 "schema": {
                   "type": "object",
                   "properties": {
-                    "last_name": { "type": "string" }
+                    "last_name": { "type": "string" },
+                    "_links": { "type": "object" },
+                    "_embedded": { "type": "object" },
+                    "@context": { "type": "string" },
+                    "@type": { "type": "string" },
+                    "@id": { "type": "string" },
+                    "x-internal": { "type": "boolean" }
                   }
                 }
               }
diff --git a/src/test/resources/checks/v31/format/OAR066/valid.yaml b/src/test/resources/checks/v31/format/OAR066/valid.yaml
index d18e0971..6edab18e 100644
--- a/src/test/resources/checks/v31/format/OAR066/valid.yaml
+++ b/src/test/resources/checks/v31/format/OAR066/valid.yaml
@@ -13,6 +13,18 @@ paths:
               properties:
                 last_name:
                   type: string
+                _links:
+                  type: object
+                _embedded:
+                  type: object
+                "@context":
+                  type: string
+                "@type":
+                  type: string
+                "@id":
+                  type: string
+                x-internal:
+                  type: boolean
       responses:
         '200':
           description: Success
diff --git a/src/test/resources/checks/v32/format/OAR066/valid.json b/src/test/resources/checks/v32/format/OAR066/valid.json
index 7626b513..2d029065 100644
--- a/src/test/resources/checks/v32/format/OAR066/valid.json
+++ b/src/test/resources/checks/v32/format/OAR066/valid.json
@@ -13,7 +13,13 @@
                 "schema": {
                   "type": "object",
                   "properties": {
-                    "last_name": { "type": "string" }
+                    "last_name": { "type": "string" },
+                    "_links": { "type": "object" },
+                    "_embedded": { "type": "object" },
+                    "@context": { "type": "string" },
+                    "@type": { "type": "string" },
+                    "@id": { "type": "string" },
+                    "x-internal": { "type": "boolean" }
                   }
                 }
               }
diff --git a/src/test/resources/checks/v32/format/OAR066/valid.yaml b/src/test/resources/checks/v32/format/OAR066/valid.yaml
index f0f26121..96b29c72 100644
--- a/src/test/resources/checks/v32/format/OAR066/valid.yaml
+++ b/src/test/resources/checks/v32/format/OAR066/valid.yaml
@@ -13,6 +13,18 @@ paths:
               properties:
                 last_name:
                   type: string
+                _links:
+                  type: object
+                _embedded:
+                  type: object
+                "@context":
+                  type: string
+                "@type":
+                  type: string
+                "@id":
+                  type: string
+                x-internal:
+                  type: boolean
       responses:
         '200':
           description: Success

From 51992055af9275ceda399ef6ec86f6667ddac926 Mon Sep 17 00:00:00 2001
From: Melsy Huamani 
Date: Sun, 31 May 2026 11:13:55 -0500
Subject: [PATCH 24/28] fix: oar073 rate limit excluded paths

---
 CHANGELOG.md                                  |  5 +-
 .../checks/owasp/OAR073RateLimitCheck.java    |  2 +-
 .../openapi/rules/openapi/owasp/OAR073.html   | 11 ++++
 .../openapi/rules/openapi/owasp/OAR073.html   | 11 ++++
 .../owasp/OAR073RateLimitCheckTest.java       | 20 +++++++
 .../owasp/OAR073/health-check-excluded.json   | 57 +++++++++++++++++++
 .../owasp/OAR073/health-check-excluded.yaml   | 41 +++++++++++++
 .../owasp/OAR073/health-check-excluded.json   | 57 +++++++++++++++++++
 .../owasp/OAR073/health-check-excluded.yaml   | 41 +++++++++++++
 .../owasp/OAR073/health-check-excluded.json   | 57 +++++++++++++++++++
 .../owasp/OAR073/health-check-excluded.yaml   | 41 +++++++++++++
 .../owasp/OAR073/health-check-excluded.json   | 57 +++++++++++++++++++
 .../owasp/OAR073/health-check-excluded.yaml   | 41 +++++++++++++
 13 files changed, 438 insertions(+), 3 deletions(-)
 create mode 100644 src/test/resources/checks/v2/owasp/OAR073/health-check-excluded.json
 create mode 100644 src/test/resources/checks/v2/owasp/OAR073/health-check-excluded.yaml
 create mode 100644 src/test/resources/checks/v3/owasp/OAR073/health-check-excluded.json
 create mode 100644 src/test/resources/checks/v3/owasp/OAR073/health-check-excluded.yaml
 create mode 100644 src/test/resources/checks/v31/owasp/OAR073/health-check-excluded.json
 create mode 100644 src/test/resources/checks/v31/owasp/OAR073/health-check-excluded.yaml
 create mode 100644 src/test/resources/checks/v32/owasp/OAR073/health-check-excluded.json
 create mode 100644 src/test/resources/checks/v32/owasp/OAR073/health-check-excluded.yaml

diff --git a/CHANGELOG.md b/CHANGELOG.md
index b220fcad..18630630 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -5,15 +5,16 @@ All notable changes to this project will be documented in this file.
 The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
 and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
 
-## [1.4.1-beta-4] - 2026-05-30
+## [1.4.1-beta-4] - 2026-05-31
 
 ### Fixed
 
 - OAR020 - ExpandParameterCheck - Fixed false negative where GET operations on non-`/examples` paths (e.g. `/pets`, `/orders`) without a `parameters` block were not reported. Changed default path strategy from include-only `/examples` to exclude-all (empty exclude list), so the rule now applies to all collection GET endpoints. Added `/me` path exclusion and health-check path exclusion (`status`, `health`, `ping`) in `visitNode`, aligning with Spectral's filter. Added `without-parameters` test cases for v2, v3, v31 and v32.
 - OAR021 - ExcludeParameterCheck - Same fix as OAR020 applied for `$exclude` parameter. Changed default path strategy to exclude-all, added `/me` and health-check exclusions, added `without-parameters` test cases.
-- OAR037 - StringFormatCheck - Fixed false negative where string schemas without a `format` field were not reported. Updated `isInvalidString` to also fire when `format == null`, aligning with Spectral behavior.
+- OAR037 - StringFormatCheck - Fixed false negative where string schemas without a `format` field were not reported. Updated `isInvalidString` to also fire when `format == null`.
 - OAR038 - StandardCreateResponseCheck - POST 201 responses must have a schema whose properties are named `data` or `error`, each with at least one sub-property. Fires with a distinct message when the property name is invalid vs. when sub-properties are missing.
 - OAR066 - SnakeCaseNamingConventionCheck - Fixed false positives on industry-standard property name prefixes. Skip properties whose names start with `@` or `x-`.
+- OAR073 - RateLimitCheck - Extended default excluded paths from `/status, /health-check` to `/status, /health, /health-check, /ping, /liveness, /readiness` in `DEFAULT_PATHS`.
 
 ## [1.4.1-beta-3] - 2026-05-29
 
diff --git a/src/main/java/apiaddicts/sonar/openapi/checks/owasp/OAR073RateLimitCheck.java b/src/main/java/apiaddicts/sonar/openapi/checks/owasp/OAR073RateLimitCheck.java
index ace904c9..e0d16801 100644
--- a/src/main/java/apiaddicts/sonar/openapi/checks/owasp/OAR073RateLimitCheck.java
+++ b/src/main/java/apiaddicts/sonar/openapi/checks/owasp/OAR073RateLimitCheck.java
@@ -10,7 +10,7 @@ public class OAR073RateLimitCheck extends AbstractPathResponseCheck {
     private static final String MESSAGE = "OAR073.error";
 
     private static final String DEFAULT_PATH_STATUS = "/status";
-    private static final String DEFAULT_PATHS = DEFAULT_PATH_STATUS + ", /health-check";
+    private static final String DEFAULT_PATHS = DEFAULT_PATH_STATUS + ", /health, /health-check, /ping, /liveness, /readiness";
     private static final String DEFAULT_STRATEGY = "/exclude";
 
     public OAR073RateLimitCheck() {
diff --git a/src/main/resources/org/sonar/l10n/es/openapi/rules/openapi/owasp/OAR073.html b/src/main/resources/org/sonar/l10n/es/openapi/rules/openapi/owasp/OAR073.html
index 81835097..c76ad1b7 100644
--- a/src/main/resources/org/sonar/l10n/es/openapi/rules/openapi/owasp/OAR073.html
+++ b/src/main/resources/org/sonar/l10n/es/openapi/rules/openapi/owasp/OAR073.html
@@ -1,4 +1,15 @@
 

La API debería incluir una respuesta 429 (demasiadas solicitudes) para indicar la limitación de la tasa

+

Paths excluidos

+

Los siguientes paths de health-check están excluidos de esta regla por defecto:

+
    +
  • /status
  • +
  • /health
  • +
  • /health-check
  • +
  • /ping
  • +
  • /liveness
  • +
  • /readiness
  • +
+

Esta lista es configurable mediante el parámetro de regla paths.

Ejemplo de código no compatible (OpenAPI 2)

     swagger: '2.0'
diff --git a/src/main/resources/org/sonar/l10n/openapi/rules/openapi/owasp/OAR073.html b/src/main/resources/org/sonar/l10n/openapi/rules/openapi/owasp/OAR073.html
index a7449ba9..7165542f 100644
--- a/src/main/resources/org/sonar/l10n/openapi/rules/openapi/owasp/OAR073.html
+++ b/src/main/resources/org/sonar/l10n/openapi/rules/openapi/owasp/OAR073.html
@@ -1,4 +1,15 @@
 

API should include a 429 'Too Many Requests' response to indicate rate limiting

+

Excluded Paths

+

The following health-check paths are excluded from this rule by default:

+
    +
  • /status
  • +
  • /health
  • +
  • /health-check
  • +
  • /ping
  • +
  • /liveness
  • +
  • /readiness
  • +
+

This list is configurable via the paths rule parameter.

Noncompliant Code Example (OpenAPI 2)

     swagger: '2.0'
diff --git a/src/test/java/apiaddicts/sonar/openapi/checks/owasp/OAR073RateLimitCheckTest.java b/src/test/java/apiaddicts/sonar/openapi/checks/owasp/OAR073RateLimitCheckTest.java
index c622df05..8a9abd94 100644
--- a/src/test/java/apiaddicts/sonar/openapi/checks/owasp/OAR073RateLimitCheckTest.java
+++ b/src/test/java/apiaddicts/sonar/openapi/checks/owasp/OAR073RateLimitCheckTest.java
@@ -29,6 +29,11 @@ public void verifyInV2NorateLimit() {
         verifyV2("no-rate-limit");
     }
 
+    @Test
+    public void verifyInV2HealthCheckExcluded() {
+        verifyV2("health-check-excluded");
+    }
+
     @Test
     public void verifyInV3rateLimit() {
         verifyV3("rate-limit");
@@ -55,6 +60,21 @@ public void verifyInV32NorateLimit() {
         verifyV32("no-rate-limit");
     }
 
+    @Test
+    public void verifyInV3HealthCheckExcluded() {
+        verifyV3("health-check-excluded");
+    }
+
+    @Test
+    public void verifyInV31HealthCheckExcluded() {
+        verifyV31("health-check-excluded");
+    }
+
+    @Test
+    public void verifyInV32HealthCheckExcluded() {
+        verifyV32("health-check-excluded");
+    }
+
     @Override
     public void verifyRule() {
         assertRuleProperties("OAR073 - RateLimit - API should include a 429 response to indicate rate limiting", RuleType.VULNERABILITY, Severity.MAJOR, tags("owasp"));
diff --git a/src/test/resources/checks/v2/owasp/OAR073/health-check-excluded.json b/src/test/resources/checks/v2/owasp/OAR073/health-check-excluded.json
new file mode 100644
index 00000000..46061ed4
--- /dev/null
+++ b/src/test/resources/checks/v2/owasp/OAR073/health-check-excluded.json
@@ -0,0 +1,57 @@
+{
+  "swagger": "2.0",
+  "info": {
+    "version": "1.0.0",
+    "title": "Health Check Excluded Paths API"
+  },
+  "paths": {
+    "/status": {
+      "get": {
+        "summary": "Health check - excluded from rate limit rule",
+        "responses": {
+          "200": { "description": "OK" }
+        }
+      }
+    },
+    "/health": {
+      "get": {
+        "summary": "Health endpoint - excluded from rate limit rule",
+        "responses": {
+          "200": { "description": "OK" }
+        }
+      }
+    },
+    "/health-check": {
+      "get": {
+        "summary": "Health check endpoint - excluded from rate limit rule",
+        "responses": {
+          "200": { "description": "OK" }
+        }
+      }
+    },
+    "/ping": {
+      "get": {
+        "summary": "Ping endpoint - excluded from rate limit rule",
+        "responses": {
+          "200": { "description": "OK" }
+        }
+      }
+    },
+    "/liveness": {
+      "get": {
+        "summary": "Liveness probe - excluded from rate limit rule",
+        "responses": {
+          "200": { "description": "OK" }
+        }
+      }
+    },
+    "/readiness": {
+      "get": {
+        "summary": "Readiness probe - excluded from rate limit rule",
+        "responses": {
+          "200": { "description": "OK" }
+        }
+      }
+    }
+  }
+}
diff --git a/src/test/resources/checks/v2/owasp/OAR073/health-check-excluded.yaml b/src/test/resources/checks/v2/owasp/OAR073/health-check-excluded.yaml
new file mode 100644
index 00000000..6e800d56
--- /dev/null
+++ b/src/test/resources/checks/v2/owasp/OAR073/health-check-excluded.yaml
@@ -0,0 +1,41 @@
+swagger: '2.0'
+info:
+  version: 1.0.0
+  title: Health Check Excluded Paths API
+paths:
+  /status:
+    get:
+      summary: Health check - excluded from rate limit rule
+      responses:
+        '200':
+          description: OK
+  /health:
+    get:
+      summary: Health endpoint - excluded from rate limit rule
+      responses:
+        '200':
+          description: OK
+  /health-check:
+    get:
+      summary: Health check endpoint - excluded from rate limit rule
+      responses:
+        '200':
+          description: OK
+  /ping:
+    get:
+      summary: Ping endpoint - excluded from rate limit rule
+      responses:
+        '200':
+          description: OK
+  /liveness:
+    get:
+      summary: Liveness probe - excluded from rate limit rule
+      responses:
+        '200':
+          description: OK
+  /readiness:
+    get:
+      summary: Readiness probe - excluded from rate limit rule
+      responses:
+        '200':
+          description: OK
diff --git a/src/test/resources/checks/v3/owasp/OAR073/health-check-excluded.json b/src/test/resources/checks/v3/owasp/OAR073/health-check-excluded.json
new file mode 100644
index 00000000..8e1fc58e
--- /dev/null
+++ b/src/test/resources/checks/v3/owasp/OAR073/health-check-excluded.json
@@ -0,0 +1,57 @@
+{
+  "openapi": "3.0.0",
+  "info": {
+    "version": "1.0.0",
+    "title": "Health Check Excluded Paths API"
+  },
+  "paths": {
+    "/status": {
+      "get": {
+        "summary": "Health check - excluded from rate limit rule",
+        "responses": {
+          "200": { "description": "OK" }
+        }
+      }
+    },
+    "/health": {
+      "get": {
+        "summary": "Health endpoint - excluded from rate limit rule",
+        "responses": {
+          "200": { "description": "OK" }
+        }
+      }
+    },
+    "/health-check": {
+      "get": {
+        "summary": "Health check endpoint - excluded from rate limit rule",
+        "responses": {
+          "200": { "description": "OK" }
+        }
+      }
+    },
+    "/ping": {
+      "get": {
+        "summary": "Ping endpoint - excluded from rate limit rule",
+        "responses": {
+          "200": { "description": "OK" }
+        }
+      }
+    },
+    "/liveness": {
+      "get": {
+        "summary": "Liveness probe - excluded from rate limit rule",
+        "responses": {
+          "200": { "description": "OK" }
+        }
+      }
+    },
+    "/readiness": {
+      "get": {
+        "summary": "Readiness probe - excluded from rate limit rule",
+        "responses": {
+          "200": { "description": "OK" }
+        }
+      }
+    }
+  }
+}
diff --git a/src/test/resources/checks/v3/owasp/OAR073/health-check-excluded.yaml b/src/test/resources/checks/v3/owasp/OAR073/health-check-excluded.yaml
new file mode 100644
index 00000000..b114cdb8
--- /dev/null
+++ b/src/test/resources/checks/v3/owasp/OAR073/health-check-excluded.yaml
@@ -0,0 +1,41 @@
+openapi: "3.0.0"
+info:
+  version: 1.0.0
+  title: Health Check Excluded Paths API
+paths:
+  /status:
+    get:
+      summary: Health check - excluded from rate limit rule
+      responses:
+        '200':
+          description: OK
+  /health:
+    get:
+      summary: Health endpoint - excluded from rate limit rule
+      responses:
+        '200':
+          description: OK
+  /health-check:
+    get:
+      summary: Health check endpoint - excluded from rate limit rule
+      responses:
+        '200':
+          description: OK
+  /ping:
+    get:
+      summary: Ping endpoint - excluded from rate limit rule
+      responses:
+        '200':
+          description: OK
+  /liveness:
+    get:
+      summary: Liveness probe - excluded from rate limit rule
+      responses:
+        '200':
+          description: OK
+  /readiness:
+    get:
+      summary: Readiness probe - excluded from rate limit rule
+      responses:
+        '200':
+          description: OK
diff --git a/src/test/resources/checks/v31/owasp/OAR073/health-check-excluded.json b/src/test/resources/checks/v31/owasp/OAR073/health-check-excluded.json
new file mode 100644
index 00000000..247b5684
--- /dev/null
+++ b/src/test/resources/checks/v31/owasp/OAR073/health-check-excluded.json
@@ -0,0 +1,57 @@
+{
+  "openapi": "3.1.0",
+  "info": {
+    "version": "1.0.0",
+    "title": "Health Check Excluded Paths API"
+  },
+  "paths": {
+    "/status": {
+      "get": {
+        "summary": "Health check - excluded from rate limit rule",
+        "responses": {
+          "200": { "description": "OK" }
+        }
+      }
+    },
+    "/health": {
+      "get": {
+        "summary": "Health endpoint - excluded from rate limit rule",
+        "responses": {
+          "200": { "description": "OK" }
+        }
+      }
+    },
+    "/health-check": {
+      "get": {
+        "summary": "Health check endpoint - excluded from rate limit rule",
+        "responses": {
+          "200": { "description": "OK" }
+        }
+      }
+    },
+    "/ping": {
+      "get": {
+        "summary": "Ping endpoint - excluded from rate limit rule",
+        "responses": {
+          "200": { "description": "OK" }
+        }
+      }
+    },
+    "/liveness": {
+      "get": {
+        "summary": "Liveness probe - excluded from rate limit rule",
+        "responses": {
+          "200": { "description": "OK" }
+        }
+      }
+    },
+    "/readiness": {
+      "get": {
+        "summary": "Readiness probe - excluded from rate limit rule",
+        "responses": {
+          "200": { "description": "OK" }
+        }
+      }
+    }
+  }
+}
diff --git a/src/test/resources/checks/v31/owasp/OAR073/health-check-excluded.yaml b/src/test/resources/checks/v31/owasp/OAR073/health-check-excluded.yaml
new file mode 100644
index 00000000..49ed31d1
--- /dev/null
+++ b/src/test/resources/checks/v31/owasp/OAR073/health-check-excluded.yaml
@@ -0,0 +1,41 @@
+openapi: "3.1.0"
+info:
+  version: 1.0.0
+  title: Health Check Excluded Paths API
+paths:
+  /status:
+    get:
+      summary: Health check - excluded from rate limit rule
+      responses:
+        '200':
+          description: OK
+  /health:
+    get:
+      summary: Health endpoint - excluded from rate limit rule
+      responses:
+        '200':
+          description: OK
+  /health-check:
+    get:
+      summary: Health check endpoint - excluded from rate limit rule
+      responses:
+        '200':
+          description: OK
+  /ping:
+    get:
+      summary: Ping endpoint - excluded from rate limit rule
+      responses:
+        '200':
+          description: OK
+  /liveness:
+    get:
+      summary: Liveness probe - excluded from rate limit rule
+      responses:
+        '200':
+          description: OK
+  /readiness:
+    get:
+      summary: Readiness probe - excluded from rate limit rule
+      responses:
+        '200':
+          description: OK
diff --git a/src/test/resources/checks/v32/owasp/OAR073/health-check-excluded.json b/src/test/resources/checks/v32/owasp/OAR073/health-check-excluded.json
new file mode 100644
index 00000000..ed73cfe4
--- /dev/null
+++ b/src/test/resources/checks/v32/owasp/OAR073/health-check-excluded.json
@@ -0,0 +1,57 @@
+{
+  "openapi": "3.2.0",
+  "info": {
+    "version": "1.0.0",
+    "title": "Health Check Excluded Paths API"
+  },
+  "paths": {
+    "/status": {
+      "get": {
+        "summary": "Health check - excluded from rate limit rule",
+        "responses": {
+          "200": { "description": "OK" }
+        }
+      }
+    },
+    "/health": {
+      "get": {
+        "summary": "Health endpoint - excluded from rate limit rule",
+        "responses": {
+          "200": { "description": "OK" }
+        }
+      }
+    },
+    "/health-check": {
+      "get": {
+        "summary": "Health check endpoint - excluded from rate limit rule",
+        "responses": {
+          "200": { "description": "OK" }
+        }
+      }
+    },
+    "/ping": {
+      "get": {
+        "summary": "Ping endpoint - excluded from rate limit rule",
+        "responses": {
+          "200": { "description": "OK" }
+        }
+      }
+    },
+    "/liveness": {
+      "get": {
+        "summary": "Liveness probe - excluded from rate limit rule",
+        "responses": {
+          "200": { "description": "OK" }
+        }
+      }
+    },
+    "/readiness": {
+      "get": {
+        "summary": "Readiness probe - excluded from rate limit rule",
+        "responses": {
+          "200": { "description": "OK" }
+        }
+      }
+    }
+  }
+}
diff --git a/src/test/resources/checks/v32/owasp/OAR073/health-check-excluded.yaml b/src/test/resources/checks/v32/owasp/OAR073/health-check-excluded.yaml
new file mode 100644
index 00000000..d76f6c73
--- /dev/null
+++ b/src/test/resources/checks/v32/owasp/OAR073/health-check-excluded.yaml
@@ -0,0 +1,41 @@
+openapi: "3.2.0"
+info:
+  version: 1.0.0
+  title: Health Check Excluded Paths API
+paths:
+  /status:
+    get:
+      summary: Health check - excluded from rate limit rule
+      responses:
+        '200':
+          description: OK
+  /health:
+    get:
+      summary: Health endpoint - excluded from rate limit rule
+      responses:
+        '200':
+          description: OK
+  /health-check:
+    get:
+      summary: Health check endpoint - excluded from rate limit rule
+      responses:
+        '200':
+          description: OK
+  /ping:
+    get:
+      summary: Ping endpoint - excluded from rate limit rule
+      responses:
+        '200':
+          description: OK
+  /liveness:
+    get:
+      summary: Liveness probe - excluded from rate limit rule
+      responses:
+        '200':
+          description: OK
+  /readiness:
+    get:
+      summary: Readiness probe - excluded from rate limit rule
+      responses:
+        '200':
+          description: OK

From 9aca07b9a340dada391975132bbd6fa1cad208c4 Mon Sep 17 00:00:00 2001
From: Melsy Huamani 
Date: Tue, 2 Jun 2026 09:37:29 -0500
Subject: [PATCH 25/28] fix: oar028 rule similar to other param rules

---
 CHANGELOG.md                                  |   6 +
 .../AbstractQueryParameterCheck.java          |   2 +-
 .../OAR028FilterParameterCheck.java           | 105 +++---------------
 .../rules/openapi/parameters/OAR028.html      |  44 ++------
 .../rules/openapi/parameters/OAR028.html      |  38 ++-----
 .../OAR028FilterParameterCheckTest.java       |  11 +-
 .../OAR028/exclude-noncompliant.json          |   8 +-
 .../OAR028/exclude-noncompliant.yaml          |   8 +-
 .../v2/parameters/OAR028/plain-without.json   |  10 +-
 .../v2/parameters/OAR028/plain-without.yaml   |  10 +-
 .../parameters/OAR028/components-param.json   |   5 +-
 .../parameters/OAR028/components-param.yaml   |   4 +-
 .../OAR028/exclude-noncompliant.json          |   8 +-
 .../OAR028/exclude-noncompliant.yaml          |   8 +-
 .../v3/parameters/OAR028/plain-without.json   |  10 +-
 .../v3/parameters/OAR028/plain-without.yaml   |  10 +-
 .../parameters/OAR028/components-param.json   |   5 +-
 .../parameters/OAR028/components-param.yaml   |   4 +-
 .../OAR028/exclude-noncompliant.json          |   8 +-
 .../OAR028/exclude-noncompliant.yaml          |   8 +-
 .../v31/parameters/OAR028/plain-without.json  |  10 +-
 .../v31/parameters/OAR028/plain-without.yaml  |  10 +-
 .../parameters/OAR028/components-param.json   |   5 +-
 .../parameters/OAR028/components-param.yaml   |   4 +-
 .../OAR028/exclude-noncompliant.json          |   8 +-
 .../OAR028/exclude-noncompliant.yaml          |   8 +-
 .../v32/parameters/OAR028/plain-without.json  |  10 +-
 .../v32/parameters/OAR028/plain-without.yaml  |  10 +-
 28 files changed, 145 insertions(+), 232 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 18630630..58000b39 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
 The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
 and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
 
+## [1.4.1-beta-5] - 2026-06-02
+
+### Fixed
+
+- OAR028 - FilterParameterCheck - Rewritten to extend `AbstractQueryParameterCheck`. Fires exactly once per GET operation when `$filter` query parameter is absent; does not fire if `$filter` is present alongside other parameters; resolves `$filter` referenced via `$ref` to components. Covers ALL collection GET endpoints except `/me` paths, terminal `/{id}` paths and health-check paths (`status`, `health`, `ping`).
+
 ## [1.4.1-beta-4] - 2026-05-31
 
 ### Fixed
diff --git a/src/main/java/apiaddicts/sonar/openapi/checks/parameters/AbstractQueryParameterCheck.java b/src/main/java/apiaddicts/sonar/openapi/checks/parameters/AbstractQueryParameterCheck.java
index d8b133e0..c5f31e28 100644
--- a/src/main/java/apiaddicts/sonar/openapi/checks/parameters/AbstractQueryParameterCheck.java
+++ b/src/main/java/apiaddicts/sonar/openapi/checks/parameters/AbstractQueryParameterCheck.java
@@ -25,7 +25,7 @@ public abstract class AbstractQueryParameterCheck extends BaseCheck {
 
     protected final String ruleKey;
     protected final String messageKey;
-    protected final String parameterName;
+    protected String parameterName;
     protected final boolean applyToParameterizedPaths;
 
     protected Set paths;
diff --git a/src/main/java/apiaddicts/sonar/openapi/checks/parameters/OAR028FilterParameterCheck.java b/src/main/java/apiaddicts/sonar/openapi/checks/parameters/OAR028FilterParameterCheck.java
index 9ddd2738..84f9dd0b 100644
--- a/src/main/java/apiaddicts/sonar/openapi/checks/parameters/OAR028FilterParameterCheck.java
+++ b/src/main/java/apiaddicts/sonar/openapi/checks/parameters/OAR028FilterParameterCheck.java
@@ -1,118 +1,45 @@
 package apiaddicts.sonar.openapi.checks.parameters;
 
-import java.util.Set;
-import java.util.stream.Collectors;
-
-import org.apiaddicts.apitools.dosonarapi.api.v2.OpenApi2Grammar;
-import org.apiaddicts.apitools.dosonarapi.api.v3.OpenApi3Grammar;
-import org.apiaddicts.apitools.dosonarapi.api.v31.OpenApi31Grammar;
-import org.apiaddicts.apitools.dosonarapi.api.v32.OpenApi32Grammar;
 import org.apiaddicts.apitools.dosonarapi.sslr.yaml.grammar.JsonNode;
 import org.sonar.check.Rule;
 import org.sonar.check.RuleProperty;
-import apiaddicts.sonar.openapi.checks.BaseCheck;
-
-import com.google.common.collect.ImmutableSet;
-import com.sonar.sslr.api.AstNode;
-import com.sonar.sslr.api.AstNodeType;
-
-import java.util.Arrays;
-import java.util.HashSet;
 
 @Rule(key = OAR028FilterParameterCheck.KEY)
-public class OAR028FilterParameterCheck extends BaseCheck {
+public class OAR028FilterParameterCheck extends AbstractQueryParameterCheck {
 
     public static final String KEY = "OAR028";
     private static final String MESSAGE = "OAR028.error";
-    private static final String DEFAULT_PATH = "/examples";
-    private static final String PATH_STRATEGY = "/include";
-    private static final String PARAM_NAME = "$filter";
-
-    private static final String PATH_STRATEGY_EXCLUDE = "/exclude";
-    private static final String PATH_STRATEGY_INCLUDE = "/include";
-
-    @RuleProperty(
-        key = "paths",
-        description = "List of explicit paths to include/exclude from this rule separated by comma",
-        defaultValue = DEFAULT_PATH
-    )
-    private String pathsStr = DEFAULT_PATH;
-
-    @RuleProperty(
-        key = "pathValidationStrategy",
-        description = "Path validation strategy (include/exclude)",
-        defaultValue = PATH_STRATEGY
-    )
-    private String pathCheckStrategy = PATH_STRATEGY;
+    private static final String DEFAULT_PARAM_NAME = "$filter";
 
     @RuleProperty(
         key = "parameterName",
-        description = "Name of the parameter to be checked",
-        defaultValue = PARAM_NAME
+        description = "Name of the query parameter to be checked",
+        defaultValue = DEFAULT_PARAM_NAME
     )
-    private String parameterName = PARAM_NAME;
-
-    private Set paths;
+    private String filterParamName = DEFAULT_PARAM_NAME;
 
-    @Override
-    public Set subscribedKinds() {
-        return ImmutableSet.of(OpenApi2Grammar.PARAMETER, OpenApi3Grammar.PARAMETER, OpenApi31Grammar.PARAMETER, OpenApi32Grammar.PARAMETER);
+    public OAR028FilterParameterCheck() {
+        super(KEY, MESSAGE, DEFAULT_PARAM_NAME, false);
     }
 
     @Override
     protected void visitFile(JsonNode root) {
-        paths = parsePaths(pathsStr);
+        this.parameterName = filterParamName;
         super.visitFile(root);
     }
 
     @Override
     public void visitNode(JsonNode node) {
-        visitParameterNode(node);
-    }
-
-    public void visitParameterNode(JsonNode node) {
-        JsonNode inNode = node.get("in");
-        JsonNode nameNode = node.get("name");
-
-        if (inNode != null && nameNode != null) {
-            if (!"query".equals(inNode.getTokenValue())) {
-                return;
-            }
-            String path = getPath(node);
-            if (shouldExcludePath(path) && !parameterName.equals(nameNode.getTokenValue())) {
-                addIssue(KEY, translate(MESSAGE, parameterName), nameNode);
-            }
-        }
-    }
+        if (!"get".equals(node.key().getTokenValue())) return;
 
-    private String getPath(JsonNode node) {
-        StringBuilder pathBuilder = new StringBuilder();
-        AstNode pathNode = node.getFirstAncestor(OpenApi2Grammar.PATH, OpenApi3Grammar.PATH, OpenApi31Grammar.PATH, OpenApi32Grammar.PATH);
-        if (pathNode != null) {
-            while (pathNode.getType() != OpenApi2Grammar.PATH && pathNode.getType() != OpenApi3Grammar.PATH && pathNode.getType() != OpenApi31Grammar.PATH && pathNode.getType() != OpenApi32Grammar.PATH) {
-                pathNode = pathNode.getParent();
-            }
-            pathBuilder.append(((JsonNode) pathNode).key().getTokenValue());
-        }
-        return pathBuilder.toString();
-    }
+        String path = getPath(node);
 
-    private boolean shouldExcludePath(String path) {
-        if (pathCheckStrategy.equals(PATH_STRATEGY_EXCLUDE)) {
-            return !paths.contains(path);
-        } else if (pathCheckStrategy.equals(PATH_STRATEGY_INCLUDE)) {
-            return paths.contains(path);
-        }
-        return false;
-    }
+        if (endsWithPathParam(path)) return;
+        if (path.contains("/me/") || path.endsWith("/me")) return;
+        if (path.contains("status") || path.contains("health") || path.contains("ping")) return;
 
-    private Set parsePaths(String pathsStr) {
-        if (!pathsStr.trim().isEmpty()) {
-            return Arrays.stream(pathsStr.split(","))
-                .map(String::trim)
-                .collect(Collectors.toSet());
-        } else {
-            return new HashSet<>();
+        if (!hasParameterInNode(node)) {
+            addIssue(ruleKey, translate(messageKey, parameterName), node.key());
         }
     }
-}
\ No newline at end of file
+}
diff --git a/src/main/resources/org/sonar/l10n/es/openapi/rules/openapi/parameters/OAR028.html b/src/main/resources/org/sonar/l10n/es/openapi/rules/openapi/parameters/OAR028.html
index 0319e27e..18e944be 100644
--- a/src/main/resources/org/sonar/l10n/es/openapi/rules/openapi/parameters/OAR028.html
+++ b/src/main/resources/org/sonar/l10n/es/openapi/rules/openapi/parameters/OAR028.html
@@ -1,4 +1,4 @@
-

The chosen parameter must be defined in this operation. By default, $filter

+

El parámetro de consulta $filter debe estar presente en las operaciones GET de colección. Se genera un único issue por operación a la que le falta el parámetro $filter.

Ejemplo de código no compatible (OpenAPI 2)

   swagger: "2.0"
@@ -7,15 +7,10 @@ 

Ejemplo de código no compatible (OpenAPI 2)

title: Swagger Petstore paths: /pets: - get: - parameters: - - in: query - name: other - type: array - items: - type: string + get: # Noncompliant {{OAR028: $filter must be defined as a parameter in this operation}} + parameters: - in: query - name: hola + name: other type: array items: type: string @@ -23,7 +18,7 @@

Ejemplo de código no compatible (OpenAPI 2)

206: description: Ok
-

Compliant Solution (OpenAPI 2)

+

Solución compatible (OpenAPI 2)

   swagger: "2.0"
   info:
@@ -38,16 +33,11 @@ 

Compliant Solution (OpenAPI 2)

type: array items: type: string - - in: query - name: $filter - type: array - items: - type: string responses: 206: description: Ok
-

Noncompliant Code Example (OpenAPI 3)

+

Ejemplo de código no compatible (OpenAPI 3)

   openapi: "3.0.0"
   info:
@@ -55,16 +45,10 @@ 

Noncompliant Code Example (OpenAPI 3)

title: Swagger Petstore paths: /pets: - get: - parameters: - - in: query - name: other - schema: - type: array - items: - type: string + get: # Noncompliant {{OAR028: $filter must be defined as a parameter in this operation}} + parameters: - in: query - name: select + name: other schema: type: array items: @@ -73,7 +57,7 @@

Noncompliant Code Example (OpenAPI 3)

206: description: Ok
-

Compliant Solution (OpenAPI 3)

+

Solución compatible (OpenAPI 3)

   openapi: "3.0.0"
   info:
@@ -89,13 +73,7 @@ 

Compliant Solution (OpenAPI 3)

type: array items: type: string - - in: query - name: $filter - schema: - type: array - items: - type: string responses: 206: description: Ok -
\ No newline at end of file +
diff --git a/src/main/resources/org/sonar/l10n/openapi/rules/openapi/parameters/OAR028.html b/src/main/resources/org/sonar/l10n/openapi/rules/openapi/parameters/OAR028.html index 228f3060..d7e0171a 100644 --- a/src/main/resources/org/sonar/l10n/openapi/rules/openapi/parameters/OAR028.html +++ b/src/main/resources/org/sonar/l10n/openapi/rules/openapi/parameters/OAR028.html @@ -1,4 +1,4 @@ -

The chosen parameter must be defined in this operation. By default, $filter

+

The $filter query parameter must be present in GET collection operations. One issue is raised per operation missing the $filter parameter.

Noncompliant Code Example (OpenAPI 2)

   swagger: "2.0"
@@ -7,15 +7,10 @@ 

Noncompliant Code Example (OpenAPI 2)

title: Swagger Petstore paths: /pets: - get: - parameters: - - in: query - name: other # Noncompliant {{OAR028: $filter must be defined as a parameter in this operation}} - type: array - items: - type: string + get: # Noncompliant {{OAR028: $filter must be defined as a parameter in this operation}} + parameters: - in: query - name: hola # Noncompliant {{OAR028: $filter must be defined as a parameter in this operation}} + name: other type: array items: type: string @@ -38,11 +33,6 @@

Compliant Solution (OpenAPI 2)

type: array items: type: string - - in: query - name: $filter - type: array - items: - type: string responses: 206: description: Ok @@ -55,16 +45,10 @@

Noncompliant Code Example (OpenAPI 3)

title: Swagger Petstore paths: /pets: - get: - parameters: - - in: query - name: other # Noncompliant {{OAR028: $filter must be defined as a parameter in this operation}} - schema: - type: array - items: - type: string + get: # Noncompliant {{OAR028: $filter must be defined as a parameter in this operation}} + parameters: - in: query - name: select # Noncompliant {{OAR028: $filter must be defined as a parameter in this operation}} + name: other schema: type: array items: @@ -89,13 +73,7 @@

Compliant Solution (OpenAPI 3)

type: array items: type: string - - in: query - name: $filter - schema: - type: array - items: - type: string responses: 206: description: Ok -
\ No newline at end of file +
diff --git a/src/test/java/apiaddicts/sonar/openapi/checks/parameters/OAR028FilterParameterCheckTest.java b/src/test/java/apiaddicts/sonar/openapi/checks/parameters/OAR028FilterParameterCheckTest.java index c37d4ca8..226df4d4 100644 --- a/src/test/java/apiaddicts/sonar/openapi/checks/parameters/OAR028FilterParameterCheckTest.java +++ b/src/test/java/apiaddicts/sonar/openapi/checks/parameters/OAR028FilterParameterCheckTest.java @@ -162,7 +162,16 @@ public void verifyInV32HeaderIgnored() { private void setField(String name, String value) { try { - java.lang.reflect.Field f = OAR028FilterParameterCheck.class.getDeclaredField(name); + java.lang.reflect.Field f = null; + Class clazz = check.getClass(); + while (clazz != null && f == null) { + try { + f = clazz.getDeclaredField(name); + } catch (NoSuchFieldException e) { + clazz = clazz.getSuperclass(); + } + } + if (f == null) throw new NoSuchFieldException(name); f.setAccessible(true); f.set(check, value); } catch (Exception e) { diff --git a/src/test/resources/checks/v2/parameters/OAR028/exclude-noncompliant.json b/src/test/resources/checks/v2/parameters/OAR028/exclude-noncompliant.json index 01030ba9..6debb878 100644 --- a/src/test/resources/checks/v2/parameters/OAR028/exclude-noncompliant.json +++ b/src/test/resources/checks/v2/parameters/OAR028/exclude-noncompliant.json @@ -5,18 +5,18 @@ "title" : "Swagger Petstore" }, "paths" : { - "/status" : { - "get" : { + "/orders" : { + "get" : { # Noncompliant {{OAR028: $filter must be defined as a parameter in this operation}} "parameters" : [ { "in" : "query", - "name" : "other", # Noncompliant {{OAR028: $filter must be defined as a parameter in this operation}} + "name" : "other", "type" : "array", "items" : { "type" : "string" } }, { "in" : "query", - "name" : "select", # Noncompliant {{OAR028: $filter must be defined as a parameter in this operation}} + "name" : "select", "type" : "array", "items" : { "type" : "string" diff --git a/src/test/resources/checks/v2/parameters/OAR028/exclude-noncompliant.yaml b/src/test/resources/checks/v2/parameters/OAR028/exclude-noncompliant.yaml index 5b5548d1..9f45515e 100644 --- a/src/test/resources/checks/v2/parameters/OAR028/exclude-noncompliant.yaml +++ b/src/test/resources/checks/v2/parameters/OAR028/exclude-noncompliant.yaml @@ -3,16 +3,16 @@ info: version: 1.0.0 title: Swagger Petstore paths: - /status: - get: + /orders: + get: # Noncompliant {{OAR028: $filter must be defined as a parameter in this operation}} parameters: - in: query - name: other # Noncompliant {{OAR028: $filter must be defined as a parameter in this operation}} + name: other type: array items: type: string - in: query - name: select # Noncompliant {{OAR028: $filter must be defined as a parameter in this operation}} + name: select type: array items: type: string diff --git a/src/test/resources/checks/v2/parameters/OAR028/plain-without.json b/src/test/resources/checks/v2/parameters/OAR028/plain-without.json index 79714f09..030fcb40 100644 --- a/src/test/resources/checks/v2/parameters/OAR028/plain-without.json +++ b/src/test/resources/checks/v2/parameters/OAR028/plain-without.json @@ -6,17 +6,17 @@ }, "paths" : { "/examples" : { - "get" : { - "parameters" : [ { + "get" : { # Noncompliant {{OAR028: $filter must be defined as a parameter in this operation}} + "parameters" : [ { "in" : "query", - "name" : "other", # Noncompliant {{OAR028: $filter must be defined as a parameter in this operation}} + "name" : "other", "type" : "array", "items" : { "type" : "string" } }, { "in" : "query", - "name" : "hola", # Noncompliant {{OAR028: $filter must be defined as a parameter in this operation}} + "name" : "hola", "type" : "array", "items" : { "type" : "string" @@ -30,4 +30,4 @@ } } } -} \ No newline at end of file +} diff --git a/src/test/resources/checks/v2/parameters/OAR028/plain-without.yaml b/src/test/resources/checks/v2/parameters/OAR028/plain-without.yaml index 6f972993..80432464 100644 --- a/src/test/resources/checks/v2/parameters/OAR028/plain-without.yaml +++ b/src/test/resources/checks/v2/parameters/OAR028/plain-without.yaml @@ -4,18 +4,18 @@ info: title: Swagger Petstore paths: /examples: - get: - parameters: + get: # Noncompliant {{OAR028: $filter must be defined as a parameter in this operation}} + parameters: - in: query - name: other # Noncompliant {{OAR028: $filter must be defined as a parameter in this operation}} + name: other type: array items: type: string - in: query - name: hola # Noncompliant {{OAR028: $filter must be defined as a parameter in this operation}} + name: hola type: array items: type: string responses: 206: - description: Ok \ No newline at end of file + description: Ok diff --git a/src/test/resources/checks/v3/parameters/OAR028/components-param.json b/src/test/resources/checks/v3/parameters/OAR028/components-param.json index 38b3f30a..8e540684 100644 --- a/src/test/resources/checks/v3/parameters/OAR028/components-param.json +++ b/src/test/resources/checks/v3/parameters/OAR028/components-param.json @@ -8,7 +8,7 @@ "parameters" : { "filterParam" : { "in" : "query", - "name" : "other", + "name" : "$filter", "schema" : { "type" : "string" } @@ -18,6 +18,9 @@ "paths" : { "/examples" : { "get" : { + "parameters" : [ + { "$ref" : "#/components/parameters/filterParam" } + ], "responses" : { "200" : { "description" : "Ok" diff --git a/src/test/resources/checks/v3/parameters/OAR028/components-param.yaml b/src/test/resources/checks/v3/parameters/OAR028/components-param.yaml index 18bc4ac4..a553d250 100644 --- a/src/test/resources/checks/v3/parameters/OAR028/components-param.yaml +++ b/src/test/resources/checks/v3/parameters/OAR028/components-param.yaml @@ -6,12 +6,14 @@ components: parameters: filterParam: in: query - name: other + name: $filter schema: type: string paths: /examples: get: + parameters: + - $ref: '#/components/parameters/filterParam' responses: 200: description: Ok diff --git a/src/test/resources/checks/v3/parameters/OAR028/exclude-noncompliant.json b/src/test/resources/checks/v3/parameters/OAR028/exclude-noncompliant.json index ec73f987..67435d01 100644 --- a/src/test/resources/checks/v3/parameters/OAR028/exclude-noncompliant.json +++ b/src/test/resources/checks/v3/parameters/OAR028/exclude-noncompliant.json @@ -5,11 +5,11 @@ "title" : "Swagger Petstore" }, "paths" : { - "/status" : { - "get" : { + "/orders" : { + "get" : { # Noncompliant {{OAR028: $filter must be defined as a parameter in this operation}} "parameters" : [ { "in" : "query", - "name" : "other", # Noncompliant {{OAR028: $filter must be defined as a parameter in this operation}} + "name" : "other", "schema" : { "type" : "array", "items" : { @@ -18,7 +18,7 @@ } }, { "in" : "query", - "name" : "select", # Noncompliant {{OAR028: $filter must be defined as a parameter in this operation}} + "name" : "select", "schema" : { "type" : "array", "items" : { diff --git a/src/test/resources/checks/v3/parameters/OAR028/exclude-noncompliant.yaml b/src/test/resources/checks/v3/parameters/OAR028/exclude-noncompliant.yaml index bc7139de..0d212700 100644 --- a/src/test/resources/checks/v3/parameters/OAR028/exclude-noncompliant.yaml +++ b/src/test/resources/checks/v3/parameters/OAR028/exclude-noncompliant.yaml @@ -3,17 +3,17 @@ info: version: 1.0.0 title: Swagger Petstore paths: - /status: - get: + /orders: + get: # Noncompliant {{OAR028: $filter must be defined as a parameter in this operation}} parameters: - in: query - name: other # Noncompliant {{OAR028: $filter must be defined as a parameter in this operation}} + name: other schema: type: array items: type: string - in: query - name: select # Noncompliant {{OAR028: $filter must be defined as a parameter in this operation}} + name: select schema: type: array items: diff --git a/src/test/resources/checks/v3/parameters/OAR028/plain-without.json b/src/test/resources/checks/v3/parameters/OAR028/plain-without.json index 56ec4af2..d1b165a9 100644 --- a/src/test/resources/checks/v3/parameters/OAR028/plain-without.json +++ b/src/test/resources/checks/v3/parameters/OAR028/plain-without.json @@ -6,10 +6,10 @@ }, "paths" : { "/examples" : { - "get" : { - "parameters" : [ { + "get" : { # Noncompliant {{OAR028: $filter must be defined as a parameter in this operation}} + "parameters" : [ { "in" : "query", - "name" : "other", # Noncompliant {{OAR028: $filter must be defined as a parameter in this operation}} + "name" : "other", "schema": { "type" : "array", "items" : { @@ -18,7 +18,7 @@ } }, { "in" : "query", - "name" : "select", # Noncompliant {{OAR028: $filter must be defined as a parameter in this operation}} + "name" : "select", "schema": { "type" : "array", "items" : { @@ -34,4 +34,4 @@ } } } -} \ No newline at end of file +} diff --git a/src/test/resources/checks/v3/parameters/OAR028/plain-without.yaml b/src/test/resources/checks/v3/parameters/OAR028/plain-without.yaml index e756f798..ddafd313 100644 --- a/src/test/resources/checks/v3/parameters/OAR028/plain-without.yaml +++ b/src/test/resources/checks/v3/parameters/OAR028/plain-without.yaml @@ -4,20 +4,20 @@ info: title: Swagger Petstore paths: /examples: - get: - parameters: + get: # Noncompliant {{OAR028: $filter must be defined as a parameter in this operation}} + parameters: - in: query - name: other # Noncompliant {{OAR028: $filter must be defined as a parameter in this operation}} + name: other schema: type: array items: type: string - in: query - name: select # Noncompliant {{OAR028: $filter must be defined as a parameter in this operation}} + name: select schema: type: array items: type: string responses: 206: - description: Ok \ No newline at end of file + description: Ok diff --git a/src/test/resources/checks/v31/parameters/OAR028/components-param.json b/src/test/resources/checks/v31/parameters/OAR028/components-param.json index 6c2a7460..e2bdbec7 100644 --- a/src/test/resources/checks/v31/parameters/OAR028/components-param.json +++ b/src/test/resources/checks/v31/parameters/OAR028/components-param.json @@ -8,7 +8,7 @@ "parameters" : { "filterParam" : { "in" : "query", - "name" : "other", + "name" : "$filter", "schema" : { "type" : "string" } @@ -18,6 +18,9 @@ "paths" : { "/examples" : { "get" : { + "parameters" : [ + { "$ref" : "#/components/parameters/filterParam" } + ], "responses" : { "200" : { "description" : "Ok" diff --git a/src/test/resources/checks/v31/parameters/OAR028/components-param.yaml b/src/test/resources/checks/v31/parameters/OAR028/components-param.yaml index f9bd9cd6..bb953926 100644 --- a/src/test/resources/checks/v31/parameters/OAR028/components-param.yaml +++ b/src/test/resources/checks/v31/parameters/OAR028/components-param.yaml @@ -6,12 +6,14 @@ components: parameters: filterParam: in: query - name: other + name: $filter schema: type: string paths: /examples: get: + parameters: + - $ref: '#/components/parameters/filterParam' responses: 200: description: Ok diff --git a/src/test/resources/checks/v31/parameters/OAR028/exclude-noncompliant.json b/src/test/resources/checks/v31/parameters/OAR028/exclude-noncompliant.json index 5fa3e557..8d4f6f29 100644 --- a/src/test/resources/checks/v31/parameters/OAR028/exclude-noncompliant.json +++ b/src/test/resources/checks/v31/parameters/OAR028/exclude-noncompliant.json @@ -5,11 +5,11 @@ "title" : "Swagger Petstore" }, "paths" : { - "/status" : { - "get" : { + "/orders" : { + "get" : { # Noncompliant {{OAR028: $filter must be defined as a parameter in this operation}} "parameters" : [ { "in" : "query", - "name" : "other", # Noncompliant {{OAR028: $filter must be defined as a parameter in this operation}} + "name" : "other", "schema" : { "type" : "array", "items" : { @@ -18,7 +18,7 @@ } }, { "in" : "query", - "name" : "select", # Noncompliant {{OAR028: $filter must be defined as a parameter in this operation}} + "name" : "select", "schema" : { "type" : "array", "items" : { diff --git a/src/test/resources/checks/v31/parameters/OAR028/exclude-noncompliant.yaml b/src/test/resources/checks/v31/parameters/OAR028/exclude-noncompliant.yaml index 3abbe1cf..e52b9300 100644 --- a/src/test/resources/checks/v31/parameters/OAR028/exclude-noncompliant.yaml +++ b/src/test/resources/checks/v31/parameters/OAR028/exclude-noncompliant.yaml @@ -3,17 +3,17 @@ info: version: 1.0.0 title: Swagger Petstore paths: - /status: - get: + /orders: + get: # Noncompliant {{OAR028: $filter must be defined as a parameter in this operation}} parameters: - in: query - name: other # Noncompliant {{OAR028: $filter must be defined as a parameter in this operation}} + name: other schema: type: array items: type: string - in: query - name: select # Noncompliant {{OAR028: $filter must be defined as a parameter in this operation}} + name: select schema: type: array items: diff --git a/src/test/resources/checks/v31/parameters/OAR028/plain-without.json b/src/test/resources/checks/v31/parameters/OAR028/plain-without.json index 3fca9b30..f265f5d3 100644 --- a/src/test/resources/checks/v31/parameters/OAR028/plain-without.json +++ b/src/test/resources/checks/v31/parameters/OAR028/plain-without.json @@ -6,10 +6,10 @@ }, "paths" : { "/examples" : { - "get" : { - "parameters" : [ { + "get" : { # Noncompliant {{OAR028: $filter must be defined as a parameter in this operation}} + "parameters" : [ { "in" : "query", - "name" : "other", # Noncompliant {{OAR028: $filter must be defined as a parameter in this operation}} + "name" : "other", "schema": { "type" : "array", "items" : { @@ -18,7 +18,7 @@ } }, { "in" : "query", - "name" : "select", # Noncompliant {{OAR028: $filter must be defined as a parameter in this operation}} + "name" : "select", "schema": { "type" : "array", "items" : { @@ -34,4 +34,4 @@ } } } -} \ No newline at end of file +} diff --git a/src/test/resources/checks/v31/parameters/OAR028/plain-without.yaml b/src/test/resources/checks/v31/parameters/OAR028/plain-without.yaml index 5d404776..ef729a42 100644 --- a/src/test/resources/checks/v31/parameters/OAR028/plain-without.yaml +++ b/src/test/resources/checks/v31/parameters/OAR028/plain-without.yaml @@ -4,20 +4,20 @@ info: title: Swagger Petstore paths: /examples: - get: - parameters: + get: # Noncompliant {{OAR028: $filter must be defined as a parameter in this operation}} + parameters: - in: query - name: other # Noncompliant {{OAR028: $filter must be defined as a parameter in this operation}} + name: other schema: type: array items: type: string - in: query - name: select # Noncompliant {{OAR028: $filter must be defined as a parameter in this operation}} + name: select schema: type: array items: type: string responses: 206: - description: Ok \ No newline at end of file + description: Ok diff --git a/src/test/resources/checks/v32/parameters/OAR028/components-param.json b/src/test/resources/checks/v32/parameters/OAR028/components-param.json index c73f7b32..4100117a 100644 --- a/src/test/resources/checks/v32/parameters/OAR028/components-param.json +++ b/src/test/resources/checks/v32/parameters/OAR028/components-param.json @@ -8,7 +8,7 @@ "parameters" : { "filterParam" : { "in" : "query", - "name" : "other", + "name" : "$filter", "schema" : { "type" : "string" } @@ -18,6 +18,9 @@ "paths" : { "/examples" : { "get" : { + "parameters" : [ + { "$ref" : "#/components/parameters/filterParam" } + ], "responses" : { "200" : { "description" : "Ok" diff --git a/src/test/resources/checks/v32/parameters/OAR028/components-param.yaml b/src/test/resources/checks/v32/parameters/OAR028/components-param.yaml index c1e954e8..3c123daa 100644 --- a/src/test/resources/checks/v32/parameters/OAR028/components-param.yaml +++ b/src/test/resources/checks/v32/parameters/OAR028/components-param.yaml @@ -6,12 +6,14 @@ components: parameters: filterParam: in: query - name: other + name: $filter schema: type: string paths: /examples: get: + parameters: + - $ref: '#/components/parameters/filterParam' responses: 200: description: Ok diff --git a/src/test/resources/checks/v32/parameters/OAR028/exclude-noncompliant.json b/src/test/resources/checks/v32/parameters/OAR028/exclude-noncompliant.json index 958ffb1a..dd5444b7 100644 --- a/src/test/resources/checks/v32/parameters/OAR028/exclude-noncompliant.json +++ b/src/test/resources/checks/v32/parameters/OAR028/exclude-noncompliant.json @@ -5,11 +5,11 @@ "title" : "Swagger Petstore" }, "paths" : { - "/status" : { - "get" : { + "/orders" : { + "get" : { # Noncompliant {{OAR028: $filter must be defined as a parameter in this operation}} "parameters" : [ { "in" : "query", - "name" : "other", # Noncompliant {{OAR028: $filter must be defined as a parameter in this operation}} + "name" : "other", "schema" : { "type" : "array", "items" : { @@ -18,7 +18,7 @@ } }, { "in" : "query", - "name" : "select", # Noncompliant {{OAR028: $filter must be defined as a parameter in this operation}} + "name" : "select", "schema" : { "type" : "array", "items" : { diff --git a/src/test/resources/checks/v32/parameters/OAR028/exclude-noncompliant.yaml b/src/test/resources/checks/v32/parameters/OAR028/exclude-noncompliant.yaml index 343b26ef..95435d14 100644 --- a/src/test/resources/checks/v32/parameters/OAR028/exclude-noncompliant.yaml +++ b/src/test/resources/checks/v32/parameters/OAR028/exclude-noncompliant.yaml @@ -3,17 +3,17 @@ info: version: 1.0.0 title: Swagger Petstore paths: - /status: - get: + /orders: + get: # Noncompliant {{OAR028: $filter must be defined as a parameter in this operation}} parameters: - in: query - name: other # Noncompliant {{OAR028: $filter must be defined as a parameter in this operation}} + name: other schema: type: array items: type: string - in: query - name: select # Noncompliant {{OAR028: $filter must be defined as a parameter in this operation}} + name: select schema: type: array items: diff --git a/src/test/resources/checks/v32/parameters/OAR028/plain-without.json b/src/test/resources/checks/v32/parameters/OAR028/plain-without.json index 6d78ca42..9936131d 100644 --- a/src/test/resources/checks/v32/parameters/OAR028/plain-without.json +++ b/src/test/resources/checks/v32/parameters/OAR028/plain-without.json @@ -6,10 +6,10 @@ }, "paths" : { "/examples" : { - "get" : { - "parameters" : [ { + "get" : { # Noncompliant {{OAR028: $filter must be defined as a parameter in this operation}} + "parameters" : [ { "in" : "query", - "name" : "other", # Noncompliant {{OAR028: $filter must be defined as a parameter in this operation}} + "name" : "other", "schema": { "type" : "array", "items" : { @@ -18,7 +18,7 @@ } }, { "in" : "query", - "name" : "select", # Noncompliant {{OAR028: $filter must be defined as a parameter in this operation}} + "name" : "select", "schema": { "type" : "array", "items" : { @@ -34,4 +34,4 @@ } } } -} \ No newline at end of file +} diff --git a/src/test/resources/checks/v32/parameters/OAR028/plain-without.yaml b/src/test/resources/checks/v32/parameters/OAR028/plain-without.yaml index 59f530dd..d31d6d18 100644 --- a/src/test/resources/checks/v32/parameters/OAR028/plain-without.yaml +++ b/src/test/resources/checks/v32/parameters/OAR028/plain-without.yaml @@ -4,20 +4,20 @@ info: title: Swagger Petstore paths: /examples: - get: - parameters: + get: # Noncompliant {{OAR028: $filter must be defined as a parameter in this operation}} + parameters: - in: query - name: other # Noncompliant {{OAR028: $filter must be defined as a parameter in this operation}} + name: other schema: type: array items: type: string - in: query - name: select # Noncompliant {{OAR028: $filter must be defined as a parameter in this operation}} + name: select schema: type: array items: type: string responses: 206: - description: Ok \ No newline at end of file + description: Ok From 2ce04612a769245a612a205cb7cf7303dc9702cc Mon Sep 17 00:00:00 2001 From: Melsy Huamani Date: Tue, 2 Jun 2026 13:01:54 -0500 Subject: [PATCH 26/28] fix: last issues in oar037, oar031 --- .../openapi/checks/examples/OAR031ExamplesCheck.java | 3 ++- .../sonar/openapi/checks/format/AbstractFormatCheck.java | 9 +++++++-- .../l10n/es/openapi/rules/openapi/format/OAR037.html | 8 ++++---- src/test/resources/checks/v2/examples/OAR031/valid.yaml | 2 +- .../checks/v2/examples/OAR031/without-examples.yaml | 2 +- 5 files changed, 15 insertions(+), 9 deletions(-) diff --git a/src/main/java/apiaddicts/sonar/openapi/checks/examples/OAR031ExamplesCheck.java b/src/main/java/apiaddicts/sonar/openapi/checks/examples/OAR031ExamplesCheck.java index c98fdeae..e63b1aed 100644 --- a/src/main/java/apiaddicts/sonar/openapi/checks/examples/OAR031ExamplesCheck.java +++ b/src/main/java/apiaddicts/sonar/openapi/checks/examples/OAR031ExamplesCheck.java @@ -216,7 +216,8 @@ private void visitSchemaNode2(JsonNode responseNode) { if (props.isMissing() || !props.isObject()) return; props.propertyMap().forEach((key, propertyNode) -> { - if (propertyNode.get(EXAMPLE).isMissing()) { + JsonNode type = getType(propertyNode); + if (!type.isMissing() && !isObjectType(type) && !isArrayType(type) && !isSchemaCovered(propertyNode)) { addIssue(KEY, translate("OAR031.error-property"), handleExternalRef.getTrueNode(propertyNode.key())); } }); diff --git a/src/main/java/apiaddicts/sonar/openapi/checks/format/AbstractFormatCheck.java b/src/main/java/apiaddicts/sonar/openapi/checks/format/AbstractFormatCheck.java index af276003..5d4d728b 100644 --- a/src/main/java/apiaddicts/sonar/openapi/checks/format/AbstractFormatCheck.java +++ b/src/main/java/apiaddicts/sonar/openapi/checks/format/AbstractFormatCheck.java @@ -27,8 +27,13 @@ private void visitV2Node(JsonNode node) { JsonNode typeNode = node.get("type"); String type = typeNode.getTokenValue(); JsonNode formatNode = node.get("format"); - String format = formatNode.isMissing() ? null : formatNode.getTokenValue(); - validate(type, format, typeNode); + if (formatNode.isMissing()) { + validate(type, null, typeNode); + return; + } + String format = formatNode.getTokenValue(); + if (format == null || format.isBlank()) return; + validate(type, format.trim(), typeNode); } public abstract void validate(String type, String format, JsonNode typeNode); diff --git a/src/main/resources/org/sonar/l10n/es/openapi/rules/openapi/format/OAR037.html b/src/main/resources/org/sonar/l10n/es/openapi/rules/openapi/format/OAR037.html index 0485b8b9..7f3e14a0 100644 --- a/src/main/resources/org/sonar/l10n/es/openapi/rules/openapi/format/OAR037.html +++ b/src/main/resources/org/sonar/l10n/es/openapi/rules/openapi/format/OAR037.html @@ -20,9 +20,9 @@

Ejemplo de código no compatible (OpenAPI 2)

type: object properties: name: - type: string + type: string # No conforme {{OAR037: Las propiedades de tipo string deben definir un formato válido}} — format ausente date: - type: string + type: string # No conforme {{OAR037: Las propiedades de tipo string deben definir un formato válido}} — format inválido format: 'dd/mm/yyyy'

Solución compatible (OpenAPI 2)

@@ -66,9 +66,9 @@

Ejemplo de código no compatible (OpenAPI 3)

type: object properties: name: - type: string + type: string # No conforme {{OAR037: Las propiedades de tipo string deben definir un formato válido}} — format ausente date: - type: string + type: string # No conforme {{OAR037: Las propiedades de tipo string deben definir un formato válido}} — format inválido format: dd/mm/yyyy

Solución compatible (OpenAPI 3)

diff --git a/src/test/resources/checks/v2/examples/OAR031/valid.yaml b/src/test/resources/checks/v2/examples/OAR031/valid.yaml index 21990b09..abb84e89 100644 --- a/src/test/resources/checks/v2/examples/OAR031/valid.yaml +++ b/src/test/resources/checks/v2/examples/OAR031/valid.yaml @@ -51,7 +51,7 @@ definitions: size: type: integer example: 1 - pets: # Noncompliant {{OAR031: Properties must have an example defined}} + pets: type: array items: $ref: '#/definitions/pet' diff --git a/src/test/resources/checks/v2/examples/OAR031/without-examples.yaml b/src/test/resources/checks/v2/examples/OAR031/without-examples.yaml index b877dfa4..cfb67cc7 100644 --- a/src/test/resources/checks/v2/examples/OAR031/without-examples.yaml +++ b/src/test/resources/checks/v2/examples/OAR031/without-examples.yaml @@ -48,7 +48,7 @@ definitions: properties: size: # Noncompliant {{OAR031: Properties must have an example defined}} type: integer - pets: # Noncompliant {{OAR031: Properties must have an example defined}} + pets: type: array items: $ref: '#/definitions/pet' From 1d9c54cfa86e294f3dc3e4c9ec0a1d5c0180b835 Mon Sep 17 00:00:00 2001 From: Melsy Huamani Date: Tue, 2 Jun 2026 14:21:22 -0500 Subject: [PATCH 27/28] fix: sonar duplicated code and update coverage --- pom.xml | 2 +- ...AbstractCollectionQueryParameterCheck.java | 30 +++++++++ .../OAR020ExpandParameterCheck.java | 18 +----- .../OAR021ExcludeParameterCheck.java | 18 +----- .../OAR028FilterParameterCheck.java | 17 +---- .../examples/OAR031ExamplesCheckTest.java | 17 +++++ .../format/OAR037StringFormatCheckTest.java | 5 ++ .../OAR028FilterParameterCheckTest.java | 17 +++++ .../v2/examples/OAR031/allof-schema.json | 48 ++++++++++++++ .../v2/examples/OAR031/allof-schema.yaml | 29 +++++++++ .../checks/v2/format/OAR037/blank-format.json | 27 ++++++++ .../checks/v2/format/OAR037/blank-format.yaml | 16 +++++ .../v2/parameters/OAR028/me-health-ping.json | 63 +++++++++++++++++++ .../v2/parameters/OAR028/me-health-ping.yaml | 35 +++++++++++ .../v3/examples/OAR031/allof-schema.json | 55 ++++++++++++++++ .../v3/examples/OAR031/allof-schema.yaml | 33 ++++++++++ .../v3/parameters/OAR028/me-health-ping.json | 63 +++++++++++++++++++ .../v3/parameters/OAR028/me-health-ping.yaml | 35 +++++++++++ .../v31/examples/OAR031/allof-schema.json | 55 ++++++++++++++++ .../v31/examples/OAR031/allof-schema.yaml | 33 ++++++++++ .../v31/parameters/OAR028/me-health-ping.json | 63 +++++++++++++++++++ .../v31/parameters/OAR028/me-health-ping.yaml | 35 +++++++++++ .../v32/examples/OAR031/allof-schema.json | 55 ++++++++++++++++ .../v32/examples/OAR031/allof-schema.yaml | 33 ++++++++++ .../v32/parameters/OAR028/me-health-ping.json | 63 +++++++++++++++++++ .../v32/parameters/OAR028/me-health-ping.yaml | 35 +++++++++++ 26 files changed, 849 insertions(+), 51 deletions(-) create mode 100644 src/main/java/apiaddicts/sonar/openapi/checks/parameters/AbstractCollectionQueryParameterCheck.java create mode 100644 src/test/resources/checks/v2/examples/OAR031/allof-schema.json create mode 100644 src/test/resources/checks/v2/examples/OAR031/allof-schema.yaml create mode 100644 src/test/resources/checks/v2/format/OAR037/blank-format.json create mode 100644 src/test/resources/checks/v2/format/OAR037/blank-format.yaml create mode 100644 src/test/resources/checks/v2/parameters/OAR028/me-health-ping.json create mode 100644 src/test/resources/checks/v2/parameters/OAR028/me-health-ping.yaml create mode 100644 src/test/resources/checks/v3/examples/OAR031/allof-schema.json create mode 100644 src/test/resources/checks/v3/examples/OAR031/allof-schema.yaml create mode 100644 src/test/resources/checks/v3/parameters/OAR028/me-health-ping.json create mode 100644 src/test/resources/checks/v3/parameters/OAR028/me-health-ping.yaml create mode 100644 src/test/resources/checks/v31/examples/OAR031/allof-schema.json create mode 100644 src/test/resources/checks/v31/examples/OAR031/allof-schema.yaml create mode 100644 src/test/resources/checks/v31/parameters/OAR028/me-health-ping.json create mode 100644 src/test/resources/checks/v31/parameters/OAR028/me-health-ping.yaml create mode 100644 src/test/resources/checks/v32/examples/OAR031/allof-schema.json create mode 100644 src/test/resources/checks/v32/examples/OAR031/allof-schema.yaml create mode 100644 src/test/resources/checks/v32/parameters/OAR028/me-health-ping.json create mode 100644 src/test/resources/checks/v32/parameters/OAR028/me-health-ping.yaml diff --git a/pom.xml b/pom.xml index 1c739495..43f67785 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 org.apiaddicts.apitools.dosonarapi sonaropenapi-rules-community - 1.4.1-beta-4 + 1.4.1-beta-5 sonar-plugin SonarQube OpenAPI Community Rules diff --git a/src/main/java/apiaddicts/sonar/openapi/checks/parameters/AbstractCollectionQueryParameterCheck.java b/src/main/java/apiaddicts/sonar/openapi/checks/parameters/AbstractCollectionQueryParameterCheck.java new file mode 100644 index 00000000..0eef8f02 --- /dev/null +++ b/src/main/java/apiaddicts/sonar/openapi/checks/parameters/AbstractCollectionQueryParameterCheck.java @@ -0,0 +1,30 @@ +package apiaddicts.sonar.openapi.checks.parameters; + +import org.apiaddicts.apitools.dosonarapi.sslr.yaml.grammar.JsonNode; + +public abstract class AbstractCollectionQueryParameterCheck extends AbstractQueryParameterCheck { + + protected AbstractCollectionQueryParameterCheck( + String ruleKey, + String messageKey, + String parameterName, + boolean applyToParameterizedPaths + ) { + super(ruleKey, messageKey, parameterName, applyToParameterizedPaths); + } + + @Override + public void visitNode(JsonNode node) { + if (!"get".equals(node.key().getTokenValue())) return; + + String path = getPath(node); + + if (endsWithPathParam(path)) return; + if (path.contains("/me/") || path.endsWith("/me")) return; + if (path.contains("status") || path.contains("health") || path.contains("ping")) return; + + if (!hasParameterInNode(node)) { + addIssue(ruleKey, translate(messageKey, parameterName), node.key()); + } + } +} diff --git a/src/main/java/apiaddicts/sonar/openapi/checks/parameters/OAR020ExpandParameterCheck.java b/src/main/java/apiaddicts/sonar/openapi/checks/parameters/OAR020ExpandParameterCheck.java index 299b6369..fdac58e8 100644 --- a/src/main/java/apiaddicts/sonar/openapi/checks/parameters/OAR020ExpandParameterCheck.java +++ b/src/main/java/apiaddicts/sonar/openapi/checks/parameters/OAR020ExpandParameterCheck.java @@ -1,10 +1,9 @@ package apiaddicts.sonar.openapi.checks.parameters; -import org.apiaddicts.apitools.dosonarapi.sslr.yaml.grammar.JsonNode; import org.sonar.check.Rule; @Rule(key = OAR020ExpandParameterCheck.KEY) -public class OAR020ExpandParameterCheck extends AbstractQueryParameterCheck { +public class OAR020ExpandParameterCheck extends AbstractCollectionQueryParameterCheck { public static final String KEY = "OAR020"; private static final String MESSAGE = "OAR020.error"; @@ -13,19 +12,4 @@ public class OAR020ExpandParameterCheck extends AbstractQueryParameterCheck { public OAR020ExpandParameterCheck() { super(KEY, MESSAGE, PARAM_NAME, false); } - - @Override - public void visitNode(JsonNode node) { - if (!"get".equals(node.key().getTokenValue())) return; - - String path = getPath(node); - - if (endsWithPathParam(path)) return; - if (path.contains("/me/") || path.endsWith("/me")) return; - if (path.contains("status") || path.contains("health") || path.contains("ping")) return; - - if (!hasParameterInNode(node)) { - addIssue(ruleKey, translate(messageKey, parameterName), node.key()); - } - } } \ No newline at end of file diff --git a/src/main/java/apiaddicts/sonar/openapi/checks/parameters/OAR021ExcludeParameterCheck.java b/src/main/java/apiaddicts/sonar/openapi/checks/parameters/OAR021ExcludeParameterCheck.java index 19d8e1c1..a8b52bfc 100644 --- a/src/main/java/apiaddicts/sonar/openapi/checks/parameters/OAR021ExcludeParameterCheck.java +++ b/src/main/java/apiaddicts/sonar/openapi/checks/parameters/OAR021ExcludeParameterCheck.java @@ -1,10 +1,9 @@ package apiaddicts.sonar.openapi.checks.parameters; -import org.apiaddicts.apitools.dosonarapi.sslr.yaml.grammar.JsonNode; import org.sonar.check.Rule; @Rule(key = OAR021ExcludeParameterCheck.KEY) -public class OAR021ExcludeParameterCheck extends AbstractQueryParameterCheck { +public class OAR021ExcludeParameterCheck extends AbstractCollectionQueryParameterCheck { public static final String KEY = "OAR021"; private static final String MESSAGE = "OAR021.error"; @@ -13,19 +12,4 @@ public class OAR021ExcludeParameterCheck extends AbstractQueryParameterCheck { public OAR021ExcludeParameterCheck() { super(KEY, MESSAGE, PARAM_NAME, false); } - - @Override - public void visitNode(JsonNode node) { - if (!"get".equals(node.key().getTokenValue())) return; - - String path = getPath(node); - - if (endsWithPathParam(path)) return; - if (path.contains("/me/") || path.endsWith("/me")) return; - if (path.contains("status") || path.contains("health") || path.contains("ping")) return; - - if (!hasParameterInNode(node)) { - addIssue(ruleKey, translate(messageKey, parameterName), node.key()); - } - } } \ No newline at end of file diff --git a/src/main/java/apiaddicts/sonar/openapi/checks/parameters/OAR028FilterParameterCheck.java b/src/main/java/apiaddicts/sonar/openapi/checks/parameters/OAR028FilterParameterCheck.java index 84f9dd0b..703e56e9 100644 --- a/src/main/java/apiaddicts/sonar/openapi/checks/parameters/OAR028FilterParameterCheck.java +++ b/src/main/java/apiaddicts/sonar/openapi/checks/parameters/OAR028FilterParameterCheck.java @@ -5,7 +5,7 @@ import org.sonar.check.RuleProperty; @Rule(key = OAR028FilterParameterCheck.KEY) -public class OAR028FilterParameterCheck extends AbstractQueryParameterCheck { +public class OAR028FilterParameterCheck extends AbstractCollectionQueryParameterCheck { public static final String KEY = "OAR028"; private static final String MESSAGE = "OAR028.error"; @@ -27,19 +27,4 @@ protected void visitFile(JsonNode root) { this.parameterName = filterParamName; super.visitFile(root); } - - @Override - public void visitNode(JsonNode node) { - if (!"get".equals(node.key().getTokenValue())) return; - - String path = getPath(node); - - if (endsWithPathParam(path)) return; - if (path.contains("/me/") || path.endsWith("/me")) return; - if (path.contains("status") || path.contains("health") || path.contains("ping")) return; - - if (!hasParameterInNode(node)) { - addIssue(ruleKey, translate(messageKey, parameterName), node.key()); - } - } } diff --git a/src/test/java/apiaddicts/sonar/openapi/checks/examples/OAR031ExamplesCheckTest.java b/src/test/java/apiaddicts/sonar/openapi/checks/examples/OAR031ExamplesCheckTest.java index 5b1e4ce7..5cea16f8 100644 --- a/src/test/java/apiaddicts/sonar/openapi/checks/examples/OAR031ExamplesCheckTest.java +++ b/src/test/java/apiaddicts/sonar/openapi/checks/examples/OAR031ExamplesCheckTest.java @@ -90,6 +90,23 @@ public void verifyInV32NestedProperties() { verifyV32("nested-properties-examples.yaml"); } + @Test + public void verifyInV2AllOfSchema() { + verifyV2("allof-schema"); + } + @Test + public void verifyInV3AllOfSchema() { + verifyV3("allof-schema"); + } + @Test + public void verifyInV31AllOfSchema() { + verifyV31("allof-schema"); + } + @Test + public void verifyInV32AllOfSchema() { + verifyV32("allof-schema"); + } + @Override public void verifyRule() { assertRuleProperties("OAR031 - Examples - Responses, Request Body, Parameters and Properties must have an example defined", RuleType.BUG, Severity.MAJOR, tags("examples")); diff --git a/src/test/java/apiaddicts/sonar/openapi/checks/format/OAR037StringFormatCheckTest.java b/src/test/java/apiaddicts/sonar/openapi/checks/format/OAR037StringFormatCheckTest.java index ad43517b..ad561e9b 100644 --- a/src/test/java/apiaddicts/sonar/openapi/checks/format/OAR037StringFormatCheckTest.java +++ b/src/test/java/apiaddicts/sonar/openapi/checks/format/OAR037StringFormatCheckTest.java @@ -65,6 +65,11 @@ public void verifyInV32WithNested() { verifyV3("with-$ref"); } + @Test + public void verifyInV2BlankFormat() { + verifyV2("blank-format"); + } + @Override public void verifyParameters() { assertNumberOfParameters(1); diff --git a/src/test/java/apiaddicts/sonar/openapi/checks/parameters/OAR028FilterParameterCheckTest.java b/src/test/java/apiaddicts/sonar/openapi/checks/parameters/OAR028FilterParameterCheckTest.java index 226df4d4..e2d9350f 100644 --- a/src/test/java/apiaddicts/sonar/openapi/checks/parameters/OAR028FilterParameterCheckTest.java +++ b/src/test/java/apiaddicts/sonar/openapi/checks/parameters/OAR028FilterParameterCheckTest.java @@ -160,6 +160,23 @@ public void verifyInV32HeaderIgnored() { verifyV32("header-ignored"); } + @Test + public void verifyInV2MeHealthPing() { + verifyV2("me-health-ping"); + } + @Test + public void verifyInV3MeHealthPing() { + verifyV3("me-health-ping"); + } + @Test + public void verifyInV31MeHealthPing() { + verifyV31("me-health-ping"); + } + @Test + public void verifyInV32MeHealthPing() { + verifyV32("me-health-ping"); + } + private void setField(String name, String value) { try { java.lang.reflect.Field f = null; diff --git a/src/test/resources/checks/v2/examples/OAR031/allof-schema.json b/src/test/resources/checks/v2/examples/OAR031/allof-schema.json new file mode 100644 index 00000000..177244f6 --- /dev/null +++ b/src/test/resources/checks/v2/examples/OAR031/allof-schema.json @@ -0,0 +1,48 @@ +{ + "swagger" : "2.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "definitions" : { + "BaseEntity" : { + "type" : "object", + "properties" : { + "id" : { + "type" : "integer", + "example" : 1 + } + } + }, + "Pet" : { + "allOf" : [ { + "$ref" : "#/definitions/BaseEntity" + } ], + "properties" : { + "name" : { + "type" : "string", + "example" : "Fluffy" + } + } + } + }, + "paths" : { + "/pets" : { + "get" : { + "responses" : { + "200" : { + "description" : "Ok", + "schema" : { + "$ref" : "#/definitions/Pet" + }, + "examples" : { + "application/json" : { + "name" : "Fluffy" + } + } + } + } + } + } + } +} diff --git a/src/test/resources/checks/v2/examples/OAR031/allof-schema.yaml b/src/test/resources/checks/v2/examples/OAR031/allof-schema.yaml new file mode 100644 index 00000000..fefb074b --- /dev/null +++ b/src/test/resources/checks/v2/examples/OAR031/allof-schema.yaml @@ -0,0 +1,29 @@ +swagger: "2.0" +info: + version: 1.0.0 + title: Swagger Petstore +definitions: + BaseEntity: + type: object + properties: + id: + type: integer + example: 1 + Pet: + allOf: + - $ref: '#/definitions/BaseEntity' + properties: + name: + type: string + example: "Fluffy" +paths: + /pets: + get: + responses: + 200: + description: Ok + schema: + $ref: '#/definitions/Pet' + examples: + application/json: + name: Fluffy diff --git a/src/test/resources/checks/v2/format/OAR037/blank-format.json b/src/test/resources/checks/v2/format/OAR037/blank-format.json new file mode 100644 index 00000000..05b6299e --- /dev/null +++ b/src/test/resources/checks/v2/format/OAR037/blank-format.json @@ -0,0 +1,27 @@ +{ + "swagger" : "2.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/invoices" : { + "get" : { + "responses" : { + "200" : { + "description" : "A invoice.", + "schema" : { + "type" : "object", + "properties" : { + "blank_format" : { + "type" : "string", + "format" : "" + } + } + } + } + } + } + } + } +} diff --git a/src/test/resources/checks/v2/format/OAR037/blank-format.yaml b/src/test/resources/checks/v2/format/OAR037/blank-format.yaml new file mode 100644 index 00000000..00464338 --- /dev/null +++ b/src/test/resources/checks/v2/format/OAR037/blank-format.yaml @@ -0,0 +1,16 @@ +swagger: "2.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /invoices: + get: + responses: + 200: + description: A invoice. + schema: + type: object + properties: + blank_format: + type: string + format: "" diff --git a/src/test/resources/checks/v2/parameters/OAR028/me-health-ping.json b/src/test/resources/checks/v2/parameters/OAR028/me-health-ping.json new file mode 100644 index 00000000..25e15525 --- /dev/null +++ b/src/test/resources/checks/v2/parameters/OAR028/me-health-ping.json @@ -0,0 +1,63 @@ +{ + "swagger" : "2.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/examples" : { + "post" : { + "responses" : { + "206" : { + "description" : "Ok" + } + } + } + }, + "/pets/{id}" : { + "get" : { + "responses" : { + "206" : { + "description" : "Ok" + } + } + } + }, + "/users/me" : { + "get" : { + "responses" : { + "206" : { + "description" : "Ok" + } + } + } + }, + "/users/me/settings" : { + "get" : { + "responses" : { + "206" : { + "description" : "Ok" + } + } + } + }, + "/health" : { + "get" : { + "responses" : { + "206" : { + "description" : "Ok" + } + } + } + }, + "/ping" : { + "get" : { + "responses" : { + "206" : { + "description" : "Ok" + } + } + } + } + } +} diff --git a/src/test/resources/checks/v2/parameters/OAR028/me-health-ping.yaml b/src/test/resources/checks/v2/parameters/OAR028/me-health-ping.yaml new file mode 100644 index 00000000..50c39dc6 --- /dev/null +++ b/src/test/resources/checks/v2/parameters/OAR028/me-health-ping.yaml @@ -0,0 +1,35 @@ +swagger: "2.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /examples: + post: + responses: + 206: + description: Ok + /pets/{id}: + get: + responses: + 206: + description: Ok + /users/me: + get: + responses: + 206: + description: Ok + /users/me/settings: + get: + responses: + 206: + description: Ok + /health: + get: + responses: + 206: + description: Ok + /ping: + get: + responses: + 206: + description: Ok diff --git a/src/test/resources/checks/v3/examples/OAR031/allof-schema.json b/src/test/resources/checks/v3/examples/OAR031/allof-schema.json new file mode 100644 index 00000000..92f78ec7 --- /dev/null +++ b/src/test/resources/checks/v3/examples/OAR031/allof-schema.json @@ -0,0 +1,55 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "components" : { + "schemas" : { + "BaseEntity" : { + "type" : "object", + "properties" : { + "id" : { + "type" : "integer", + "example" : 1 + } + } + }, + "Pet" : { + "allOf" : [ { + "$ref" : "#/components/schemas/BaseEntity" + } ], + "properties" : { + "name" : { + "type" : "string", + "example" : "Fluffy" + } + } + } + } + }, + "paths" : { + "/pets" : { + "get" : { + "responses" : { + "200" : { + "description" : "Ok", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/Pet" + }, + "example" : { + "name" : "Fluffy" + } + } + } + }, + "204" : { + "description" : "No content" + } + } + } + } + } +} diff --git a/src/test/resources/checks/v3/examples/OAR031/allof-schema.yaml b/src/test/resources/checks/v3/examples/OAR031/allof-schema.yaml new file mode 100644 index 00000000..d3ebc8df --- /dev/null +++ b/src/test/resources/checks/v3/examples/OAR031/allof-schema.yaml @@ -0,0 +1,33 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +components: + schemas: + BaseEntity: + type: object + properties: + id: + type: integer + example: 1 + Pet: + allOf: + - $ref: '#/components/schemas/BaseEntity' + properties: + name: + type: string + example: "Fluffy" +paths: + /pets: + get: + responses: + 200: + description: Ok + content: + application/json: + schema: + $ref: '#/components/schemas/Pet' + example: + name: Fluffy + 204: + description: No content diff --git a/src/test/resources/checks/v3/parameters/OAR028/me-health-ping.json b/src/test/resources/checks/v3/parameters/OAR028/me-health-ping.json new file mode 100644 index 00000000..a257ab40 --- /dev/null +++ b/src/test/resources/checks/v3/parameters/OAR028/me-health-ping.json @@ -0,0 +1,63 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/examples" : { + "post" : { + "responses" : { + "206" : { + "description" : "Ok" + } + } + } + }, + "/pets/{id}" : { + "get" : { + "responses" : { + "206" : { + "description" : "Ok" + } + } + } + }, + "/users/me" : { + "get" : { + "responses" : { + "206" : { + "description" : "Ok" + } + } + } + }, + "/users/me/settings" : { + "get" : { + "responses" : { + "206" : { + "description" : "Ok" + } + } + } + }, + "/health" : { + "get" : { + "responses" : { + "206" : { + "description" : "Ok" + } + } + } + }, + "/ping" : { + "get" : { + "responses" : { + "206" : { + "description" : "Ok" + } + } + } + } + } +} diff --git a/src/test/resources/checks/v3/parameters/OAR028/me-health-ping.yaml b/src/test/resources/checks/v3/parameters/OAR028/me-health-ping.yaml new file mode 100644 index 00000000..495e15e9 --- /dev/null +++ b/src/test/resources/checks/v3/parameters/OAR028/me-health-ping.yaml @@ -0,0 +1,35 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /examples: + post: + responses: + 206: + description: Ok + /pets/{id}: + get: + responses: + 206: + description: Ok + /users/me: + get: + responses: + 206: + description: Ok + /users/me/settings: + get: + responses: + 206: + description: Ok + /health: + get: + responses: + 206: + description: Ok + /ping: + get: + responses: + 206: + description: Ok diff --git a/src/test/resources/checks/v31/examples/OAR031/allof-schema.json b/src/test/resources/checks/v31/examples/OAR031/allof-schema.json new file mode 100644 index 00000000..0155d35a --- /dev/null +++ b/src/test/resources/checks/v31/examples/OAR031/allof-schema.json @@ -0,0 +1,55 @@ +{ + "openapi" : "3.1.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "components" : { + "schemas" : { + "BaseEntity" : { + "type" : "object", + "properties" : { + "id" : { + "type" : "integer", + "example" : 1 + } + } + }, + "Pet" : { + "allOf" : [ { + "$ref" : "#/components/schemas/BaseEntity" + } ], + "properties" : { + "name" : { + "type" : "string", + "example" : "Fluffy" + } + } + } + } + }, + "paths" : { + "/pets" : { + "get" : { + "responses" : { + "200" : { + "description" : "Ok", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/Pet" + }, + "example" : { + "name" : "Fluffy" + } + } + } + }, + "204" : { + "description" : "No content" + } + } + } + } + } +} diff --git a/src/test/resources/checks/v31/examples/OAR031/allof-schema.yaml b/src/test/resources/checks/v31/examples/OAR031/allof-schema.yaml new file mode 100644 index 00000000..771b7e0d --- /dev/null +++ b/src/test/resources/checks/v31/examples/OAR031/allof-schema.yaml @@ -0,0 +1,33 @@ +openapi: "3.1.0" +info: + version: 1.0.0 + title: Swagger Petstore +components: + schemas: + BaseEntity: + type: object + properties: + id: + type: integer + example: 1 + Pet: + allOf: + - $ref: '#/components/schemas/BaseEntity' + properties: + name: + type: string + example: "Fluffy" +paths: + /pets: + get: + responses: + 200: + description: Ok + content: + application/json: + schema: + $ref: '#/components/schemas/Pet' + example: + name: Fluffy + 204: + description: No content diff --git a/src/test/resources/checks/v31/parameters/OAR028/me-health-ping.json b/src/test/resources/checks/v31/parameters/OAR028/me-health-ping.json new file mode 100644 index 00000000..e23d51ba --- /dev/null +++ b/src/test/resources/checks/v31/parameters/OAR028/me-health-ping.json @@ -0,0 +1,63 @@ +{ + "openapi" : "3.1.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/examples" : { + "post" : { + "responses" : { + "206" : { + "description" : "Ok" + } + } + } + }, + "/pets/{id}" : { + "get" : { + "responses" : { + "206" : { + "description" : "Ok" + } + } + } + }, + "/users/me" : { + "get" : { + "responses" : { + "206" : { + "description" : "Ok" + } + } + } + }, + "/users/me/settings" : { + "get" : { + "responses" : { + "206" : { + "description" : "Ok" + } + } + } + }, + "/health" : { + "get" : { + "responses" : { + "206" : { + "description" : "Ok" + } + } + } + }, + "/ping" : { + "get" : { + "responses" : { + "206" : { + "description" : "Ok" + } + } + } + } + } +} diff --git a/src/test/resources/checks/v31/parameters/OAR028/me-health-ping.yaml b/src/test/resources/checks/v31/parameters/OAR028/me-health-ping.yaml new file mode 100644 index 00000000..927f40dd --- /dev/null +++ b/src/test/resources/checks/v31/parameters/OAR028/me-health-ping.yaml @@ -0,0 +1,35 @@ +openapi: "3.1.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /examples: + post: + responses: + 206: + description: Ok + /pets/{id}: + get: + responses: + 206: + description: Ok + /users/me: + get: + responses: + 206: + description: Ok + /users/me/settings: + get: + responses: + 206: + description: Ok + /health: + get: + responses: + 206: + description: Ok + /ping: + get: + responses: + 206: + description: Ok diff --git a/src/test/resources/checks/v32/examples/OAR031/allof-schema.json b/src/test/resources/checks/v32/examples/OAR031/allof-schema.json new file mode 100644 index 00000000..48d27955 --- /dev/null +++ b/src/test/resources/checks/v32/examples/OAR031/allof-schema.json @@ -0,0 +1,55 @@ +{ + "openapi" : "3.2.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "components" : { + "schemas" : { + "BaseEntity" : { + "type" : "object", + "properties" : { + "id" : { + "type" : "integer", + "example" : 1 + } + } + }, + "Pet" : { + "allOf" : [ { + "$ref" : "#/components/schemas/BaseEntity" + } ], + "properties" : { + "name" : { + "type" : "string", + "example" : "Fluffy" + } + } + } + } + }, + "paths" : { + "/pets" : { + "get" : { + "responses" : { + "200" : { + "description" : "Ok", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/Pet" + }, + "example" : { + "name" : "Fluffy" + } + } + } + }, + "204" : { + "description" : "No content" + } + } + } + } + } +} diff --git a/src/test/resources/checks/v32/examples/OAR031/allof-schema.yaml b/src/test/resources/checks/v32/examples/OAR031/allof-schema.yaml new file mode 100644 index 00000000..388704e9 --- /dev/null +++ b/src/test/resources/checks/v32/examples/OAR031/allof-schema.yaml @@ -0,0 +1,33 @@ +openapi: "3.2.0" +info: + version: 1.0.0 + title: Swagger Petstore +components: + schemas: + BaseEntity: + type: object + properties: + id: + type: integer + example: 1 + Pet: + allOf: + - $ref: '#/components/schemas/BaseEntity' + properties: + name: + type: string + example: "Fluffy" +paths: + /pets: + get: + responses: + 200: + description: Ok + content: + application/json: + schema: + $ref: '#/components/schemas/Pet' + example: + name: Fluffy + 204: + description: No content diff --git a/src/test/resources/checks/v32/parameters/OAR028/me-health-ping.json b/src/test/resources/checks/v32/parameters/OAR028/me-health-ping.json new file mode 100644 index 00000000..400ffab2 --- /dev/null +++ b/src/test/resources/checks/v32/parameters/OAR028/me-health-ping.json @@ -0,0 +1,63 @@ +{ + "openapi" : "3.2.0", + "info" : { + "version" : "1.0.0", + "title" : "Swagger Petstore" + }, + "paths" : { + "/examples" : { + "post" : { + "responses" : { + "206" : { + "description" : "Ok" + } + } + } + }, + "/pets/{id}" : { + "get" : { + "responses" : { + "206" : { + "description" : "Ok" + } + } + } + }, + "/users/me" : { + "get" : { + "responses" : { + "206" : { + "description" : "Ok" + } + } + } + }, + "/users/me/settings" : { + "get" : { + "responses" : { + "206" : { + "description" : "Ok" + } + } + } + }, + "/health" : { + "get" : { + "responses" : { + "206" : { + "description" : "Ok" + } + } + } + }, + "/ping" : { + "get" : { + "responses" : { + "206" : { + "description" : "Ok" + } + } + } + } + } +} diff --git a/src/test/resources/checks/v32/parameters/OAR028/me-health-ping.yaml b/src/test/resources/checks/v32/parameters/OAR028/me-health-ping.yaml new file mode 100644 index 00000000..8b22e1e8 --- /dev/null +++ b/src/test/resources/checks/v32/parameters/OAR028/me-health-ping.yaml @@ -0,0 +1,35 @@ +openapi: "3.2.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /examples: + post: + responses: + 206: + description: Ok + /pets/{id}: + get: + responses: + 206: + description: Ok + /users/me: + get: + responses: + 206: + description: Ok + /users/me/settings: + get: + responses: + 206: + description: Ok + /health: + get: + responses: + 206: + description: Ok + /ping: + get: + responses: + 206: + description: Ok From e6478e1e080d1c8bebaca3f99e12a2bbd7502a8c Mon Sep 17 00:00:00 2001 From: Sebastian Diaz Torres Date: Thu, 4 Jun 2026 11:42:28 -0500 Subject: [PATCH 28/28] feat: Release 1.4.1 --- CHANGELOG.md | 25 +++++++++++++++++++++++++ pom.xml | 4 ++-- 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 58000b39..2908a60c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,31 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [1.4.1] - 2026-06-04 + +### Added + +- Add OpenAPI language support without YAML and JSON conflicts. + +### Changed + +- Bump plugin version to `1.4.1`. +- Update `sonaropenapi.version` to `1.2.1`. +- Reference `openapi-front-end` and `openapi-test-tools` dependencies via `${sonaropenapi.version}` property instead of hardcoded version. + +### Fixed + +- OAR004 - ValidWso2ScopesRoles - Fixed false negative where `roles` defined as a YAML/JSON array were not validated element by element. Updated `AbstractPatternWso2ScopesCheck.visitScope()` to iterate array elements via `fieldNode.elements()` and validate each one individually. Added test fixtures for array roles in v2, v3, v31 and v32 formats. +- OAR014 - ResourceLevelWithinNonSuggestedRange - Removed upper bound threshold: rule now fires for all depths ≥ 4 (previously only fired for depths 4–5), aligning with Spectral behavior. Updated v2 test fixtures to mark depth-6 paths as noncompliant. +- OAR015 - ResourceLevelMaxAllowed - Updated depth calculation algorithm in `AbstractResourceLevelCheck.matchLevel(String path)` to count only literal segments, explicitly excluding path parameters (e.g. `{customerId}`) and `/me` segments — matching Spectral's algorithm exactly. Previously used a `pathParts − literalParamPairs` formula that produced different results for paths starting with parameters, consecutive parameters, or containing `/me`. +- OAR020 - ExpandParameterCheck - Fixed false negative where GET operations on non-`/examples` paths (e.g. `/pets`, `/orders`) without a `parameters` block were not reported. Changed default path strategy from include-only `/examples` to exclude-all (empty exclude list), so the rule now applies to all collection GET endpoints. Added `/me` path exclusion and health-check path exclusion (`status`, `health`, `ping`) in `visitNode`, aligning with Spectral's filter. Added `without-parameters` test cases for v2, v3, v31 and v32. +- OAR021 - ExcludeParameterCheck - Same fix as OAR020 applied for `$exclude` parameter. Changed default path strategy to exclude-all, added `/me` and health-check exclusions, added `without-parameters` test cases. +- OAR028 - FilterParameterCheck - Rewritten to extend `AbstractQueryParameterCheck`. Fires exactly once per GET operation when `$filter` query parameter is absent; does not fire if `$filter` is present alongside other parameters; resolves `$filter` referenced via `$ref` to components. Covers ALL collection GET endpoints except `/me` paths, terminal `/{id}` paths and health-check paths (`status`, `health`, `ping`). +- OAR037 - StringFormatCheck - Fixed false negative where string schemas without a `format` field were not reported. Updated `isInvalidString` to also fire when `format == null`. +- OAR038 - StandardCreateResponseCheck - POST 201 responses must have a schema whose properties are named `data` or `error`, each with at least one sub-property. Fires with a distinct message when the property name is invalid vs. when sub-properties are missing. +- OAR066 - SnakeCaseNamingConventionCheck - Fixed false positives on industry-standard property name prefixes. Skip properties whose names start with `@` or `x-`. +- OAR073 - RateLimitCheck - Extended default excluded paths from `/status, /health-check` to `/status, /health, /health-check, /ping, /liveness, /readiness` in `DEFAULT_PATHS`. + ## [1.4.1-beta-5] - 2026-06-02 ### Fixed diff --git a/pom.xml b/pom.xml index 43f67785..264be0bf 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 org.apiaddicts.apitools.dosonarapi sonaropenapi-rules-community - 1.4.1-beta-5 + 1.4.1 sonar-plugin SonarQube OpenAPI Community Rules @@ -64,7 +64,7 @@ 8.7.0.41497 6.7 - 1.2.1-beta-2 + 1.2.1 1.22.0.848 20231013 4.13.2