diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..e789678 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,16 @@ +# Please see the documentation for all configuration options: +# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file +version: 2 +updates: + - package-ecosystem: "maven" + directory: "/" + schedule: + interval: "weekly" + groups: + maven: + patterns: + - "*" + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "weekly" diff --git a/.github/workflows/dependabot-auto-merge.yml b/.github/workflows/dependabot-auto-merge.yml new file mode 100644 index 0000000..0b66bbc --- /dev/null +++ b/.github/workflows/dependabot-auto-merge.yml @@ -0,0 +1,8 @@ +name: dependabot-auto-merge +on: + pull_request: + types: [opened] +jobs: + dependabot: + uses: belgif/workflows/.github/workflows/dependabot-auto-merge-workflow.yml@main + secrets: inherit diff --git a/pom.xml b/pom.xml index e15a3f3..a99e5e3 100644 --- a/pom.xml +++ b/pom.xml @@ -15,10 +15,27 @@ + + io.github.belgif.rest.guide.validator + belgif-rest-guide-validator-maven-plugin + 2.2.1 + + + + validate + + + + + + src/main/openapi/problem/v1/problem-v1.yaml + + + org.apache.maven.plugins maven-assembly-plugin - 3.3.0 + 3.7.1 create-distribution @@ -29,7 +46,6 @@ true - src/main/assembly/swagger.xml src/main/assembly/openapi.xml @@ -39,12 +55,12 @@ org.apache.maven.plugins maven-deploy-plugin - 2.8.2 + 3.1.3 org.apache.maven.plugins maven-gpg-plugin - 1.6 + 3.2.7 verify diff --git a/src/main/assembly/swagger.xml b/src/main/assembly/swagger.xml deleted file mode 100644 index 05793d6..0000000 --- a/src/main/assembly/swagger.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - swagger - - zip - - false - - - src/main/swagger - belgif - - **/*beta/** - - true - - - \ No newline at end of file diff --git a/src/main/openapi/problem/v1/problem-v1.yaml b/src/main/openapi/problem/v1/problem-v1.yaml index 384fbdb..b39c065 100644 --- a/src/main/openapi/problem/v1/problem-v1.yaml +++ b/src/main/openapi/problem/v1/problem-v1.yaml @@ -1,7 +1,7 @@ openapi: 3.0.0 info: title: problem types - version: ${project.version} + version: "${project.version}" license: name: Apache 2.0 url: https://www.apache.org/licenses/LICENSE-2.0.html diff --git a/src/main/swagger/problem/v1/problem-v1.yaml b/src/main/swagger/problem/v1/problem-v1.yaml deleted file mode 100644 index b119472..0000000 --- a/src/main/swagger/problem/v1/problem-v1.yaml +++ /dev/null @@ -1,147 +0,0 @@ -swagger: "2.0" -info: - title: problem types - version: ${project.version} - license: - name: Apache 2.0 - url: https://www.apache.org/licenses/LICENSE-2.0.html -paths: {} -responses: - ProblemResponse: - description: a problem - schema: - $ref: "#/definitions/Problem" - InputValidationProblemResponse: - description: A problem caused by invalid input - schema: - $ref: "#/definitions/InputValidationProblem" -definitions: - Problem: - description: | - A Problem Details object (RFC 9457). - - Additional properties specific to the problem type may be present. - type: object - properties: - type: - type: string - format: uri - description: An absolute URI that identifies the problem type - default: about:blank # kept for backwards-compatibility, type will be mandatory in problem-v2 - href: - type: string - format: uri - description: An absolute URI that, when dereferenced, provides human-readable documentation for the problem type (e.g. using HTML). - title: - type: string - description: A short summary of the problem type. Written in English and readable for engineers (usually not suited for non technical stakeholders and not localized). - example: Service Unavailable - status: - type: integer - format: int32 - description: The HTTP status code generated by the origin server for this occurrence of the problem. - minimum: 400 - maximum: 600 - exclusiveMaximum: true - example: 503 - detail: - type: string - description: A human-readable explanation specific to this occurrence of the problem - instance: - type: string - format: uri - description: An absolute URI reference that identifies the specific occurrence of the problem. It may or may not yield further information if dereferenced. - example: - type: urn:problem-type:exampleOrganization:exampleProblem # "exampleOrganization" should be a short identifier for the organization that defines the problem type. "belgif" is used for problem types standardized in the Belgif REST guide - href: "https://www.belgif.be/specification/rest/api-guide/#standardized-problem-types" # optional, should refer to documentation of the problem type, either of a belgif standardized or a custom problem type - title: Description of the type of problem that occurred - status: 400 # HTTP response status, appropriate for the problem type - detail: Description of specific occurrence of the problem - instance: urn:uuid:123e4567-e89b-12d3-a456-426614174000 - InvalidParamProblem: - x-deprecated: true # deprecated by InputValidationProblem - description: Problem details for invalid input parameter(s) - type: object - allOf: - - $ref: "#/definitions/Problem" - properties: - invalidParams: - type: array - description: An array of parameter OpenAPI violations - items: - $ref: "#/definitions/InvalidParam" - InvalidParam: - x-deprecated: true # deprecated by InputValidationIssue (within an InputValidationProblem) - type: object - properties: - in: - description: The location of the invalid parameter (cfr Swagger parameters) - type: string - enum: - - body - - path - - query - - header - name: - description: The name of the invalid parameter - type: string - reason: - description: A message explaining the violation - type: string - value: - description: The value of the erroneous parameter - # no type specified, allowing any type. This is valid OpenAPI 2.0 even though some editors may indicate an error (issue #25) - InputValidationProblem: - type: object - allOf: - - $ref: "#/definitions/Problem" - properties: - issues: - type: array - items: - $ref: "#/definitions/InputValidationIssue" - example: - type: urn:problem-type:belgif:badRequest - href: https://www.belgif.be/specification/rest/api-guide/problems/badRequest.html - title: Bad Request - status: 400 - detail: "The input message is incorrect" - instance: urn:uuid:123456-1234-1235-4567489798 - issues: - - type: urn:problem-type:belgif:input-validation:schemaViolation # type is mandatory, can be a standard belgif issue type or a custom one - # href: (TODO: provide dereferenceable link with documentation for standard belgif input validation problems) - detail: exampleNumericProperty with value xyz should be numeric # detail is optional - in: path - name: exampleNumericProperty - value: abc - - type: urn:problem-type:belgif:input-validation:schemaViolation - title: "Input isn't valid with respect to schema" - detail: "examplePropertyWithPattern a2345678901 doesn't match pattern '^\\d{11}$'" - in: body - name: items[0].examplePropertyWithPattern # location within the body - value: "a2345678901" - InputValidationIssue: - type: object - description: | - An issue detected during input validation. - - `status` is usually not present. - `href`, if present, refers to documentation of the issue type. - Additional properties specific to the issue type may be present. - allOf: - - $ref: "#/definitions/Problem" - properties: - in: - type: string - description: The location of the invalid input - enum: - - body - - header - - path - - query - name: - type: string - description: The name of the invalid input - value: - description: The value of the erroneous input - # no type specified, allowing any type. This is valid in OpenAPI even though some editors may indicate an error \ No newline at end of file