components:
  headers:
    API-Version:
      description: De API-versie van de response
      example: 1.0.0
      explode: false
      schema:
        example: 1.0.0
        type: string
      style: simple
  responses:
    "404":
      description: Resource does not exist
      headers:
        API-Version:
          $ref: '#/components/headers/API-Version'
  schemas:
    ModelsKeycloakClientResult:
      example:
        apiKey: apiKey
      properties:
        apiKey:
          type: string
      type: object
    ModelsLintMessage:
      example:
        code: code
        createdAt: "2000-01-23T04:56:07.000Z"
        id: id
        infos:
        - id: id
          lintMessageId: lintMessageId
          message: message
          path: path
        - id: id
          lintMessageId: lintMessageId
          message: message
          path: path
        severity: severity
      properties:
        code:
          type: string
        createdAt:
          format: date-time
          type: string
        id:
          type: string
        infos:
          items:
            $ref: '#/components/schemas/ModelsLintMessageInfo'
          type: array
        severity:
          type: string
      type: object
    ModelsLintMessageInfo:
      example:
        id: id
        lintMessageId: lintMessageId
        message: message
        path: path
      properties:
        id:
          type: string
        lintMessageId:
          type: string
        message:
          type: string
        path:
          type: string
      type: object
    ModelsLintResult:
      example:
        apiId: apiId
        createdAt: "2000-01-23T04:56:07.000Z"
        failures: 0
        id: id
        messages:
        - code: code
          createdAt: "2000-01-23T04:56:07.000Z"
          id: id
          infos:
          - id: id
            lintMessageId: lintMessageId
            message: message
            path: path
          - id: id
            lintMessageId: lintMessageId
            message: message
            path: path
          severity: severity
        - code: code
          createdAt: "2000-01-23T04:56:07.000Z"
          id: id
          infos:
          - id: id
            lintMessageId: lintMessageId
            message: message
            path: path
          - id: id
            lintMessageId: lintMessageId
            message: message
            path: path
          severity: severity
        rulesetVersion: "2.1"
        score: 6
        successes: true
      properties:
        apiId:
          type: string
        createdAt:
          format: date-time
          type: string
        failures:
          format: int32
          type: integer
        id:
          type: string
        messages:
          items:
            $ref: '#/components/schemas/ModelsLintMessage'
          type: array
        rulesetVersion:
          description: De gebruikte ruleset-versie voor validatie.
          type: string
        score:
          format: int32
          type: integer
        successes:
          type: boolean
      type: object
    OasInput:
      example:
        oasBody: oasBody
        oasUrl: oasUrl
        targetVersion: "3.1"
      properties:
        oasBody:
          type: string
        oasUrl:
          type: string
        targetVersion:
          description: 'Doelversie. Voor conversie: 3.0 of 3.1. Voor validatie: 2.0
            of 2.1.'
          type: string
      type: object
    UntrustClientInput:
      example:
        email: email
      properties:
        email:
          type: string
      type: object
  securitySchemes:
    apiKey:
      description: Read-only API keys for tools endpoints can be requested at https://apis.developer.overheid.nl/apis/key-aanvragen.
      in: header
      name: X-Api-Key
      type: apiKey
    clientCredentials:
      flows:
        clientCredentials:
          scopes:
            tools: Access to tools endpoints
          tokenUrl: https://auth.developer.overheid.nl/realms/don/protocol/openid-connect/token
      type: oauth2
info:
  contact:
    email: developer.overheid@geonovum.nl
    name: Team developer.overheid.nl
    url: https://github.com/developer-overheid-nl/don-tools-api/issues
  description: |-
    API to access the tools endpoints of developer.overheid.nl.

    ## Auth

    This API provides tools endpoints that can be accessed with either an API key or a client credentials token.

    ### API key

    Using an API key, you can access the tools endpoints.
    These requests can also be made from the browser.
    Request a read-only API key at https://apis.developer.overheid.nl/apis/key-aanvragen.
    Simply pass the obtained API key with each request using the `X-Api-Key` header.

    ### Client credentials token

    Using a client credentials token, you can access the tools endpoints.
    To obtain the token, perform a `POST` request to `https://auth.developer.overheid.nl/realms/don/protocol/openid-connect/token` with the following Form URL Encoded body:
    - `grant_type`: `client_credentials`
    - `scope`: `tools`
    - `client_id`: the client id you received from us
    - `client_secret`: the client secret you received from us

    Pass the obtained token with each request using the `Authorization` header. Example:

    `Authorization`: `Bearer {ACCESS_TOKEN}` (replace `{ACCESS_TOKEN}` with the obtained `access_token`)
  title: Tools API v1
  version: 1.0.0
openapi: 3.0.1
paths:
  /v1/arazzo/markdown:
    post:
      description: 'Genereert alleen de Markdown-uitvoer van een Arazzo specificatie.
        Body: { oasUrl|oasBody }'
      operationId: arazzoMarkdown
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OasInput'
      responses:
        "200":
          content:
            text/markdown:
              schema:
                type: string
          description: OK
          headers:
            API-Version:
              description: De API-versie van de response
              explode: false
              schema:
                type: string
              style: simple
        "404":
          $ref: '#/components/responses/404'
      security:
      - apiKey: []
        clientCredentials: []
      summary: Arazzo Markdown (POST)
      tags:
      - Tools
      x-eov-operation-handler: controllers/ToolsController
  /v1/arazzo/mermaid:
    post:
      description: 'Genereert alleen de Mermaid flowchart van een Arazzo specificatie.
        Body: { oasUrl|oasBody }'
      operationId: arazzoMermaid
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OasInput'
      responses:
        "200":
          content:
            text/plain:
              schema:
                type: string
          description: OK
          headers:
            API-Version:
              description: De API-versie van de response
              explode: false
              schema:
                type: string
              style: simple
        "404":
          $ref: '#/components/responses/404'
      security:
      - apiKey: []
        clientCredentials: []
      summary: Arazzo Mermaid (POST)
      tags:
      - Tools
      x-eov-operation-handler: controllers/ToolsController
  /v1/auth/clients:
    post:
      description: Maak een client aan via de admin API. Body bevat Email.
      operationId: untrustClient
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UntrustClientInput'
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ModelsKeycloakClientResult'
          description: OK
          headers:
            API-Version:
              description: De API-versie van de response
              explode: false
              schema:
                type: string
              style: simple
        "404":
          $ref: '#/components/responses/404'
      security:
      - apiKey: []
        clientCredentials: []
      summary: Maak client (POST)
      tags:
      - Tools
      x-eov-operation-handler: controllers/ToolsController
  /v1/oas/bundle:
    post:
      description: 'Bundelt een OpenAPI specificatie en lost externe verwijzingen
        op. Body: { oasUrl } of { oasBody }.'
      operationId: bundleOAS
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OasInput'
      responses:
        "200":
          description: OK
          headers:
            API-Version:
              description: De API-versie van de response
              explode: false
              schema:
                type: string
              style: simple
        "404":
          $ref: '#/components/responses/404'
      security:
      - apiKey: []
        clientCredentials: []
      summary: Bundle OpenAPI
      tags:
      - Tools
      x-eov-operation-handler: controllers/ToolsController
  /v1/oas/convert:
    post:
      description: 'Converteert OpenAPI naar de laatst ondersteunde versie (standaard
        3.1). Meegegeven targetVersion (3.0 of 3.1) bepaalt het doel. Body: { oasUrl
        } of { oasBody } (stringified JSON of YAML).'
      operationId: convertOAS
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OasInput'
      responses:
        "200":
          description: OK
          headers:
            API-Version:
              description: De API-versie van de response
              explode: false
              schema:
                type: string
              style: simple
        "404":
          $ref: '#/components/responses/404'
      security:
      - apiKey: []
        clientCredentials: []
      summary: Converteer OpenAPI 3.0/3.1
      tags:
      - Tools
      x-eov-operation-handler: controllers/ToolsController
      x-original-operationId: ConvertOAS
  /v1/oas/generate:
    post:
      description: 'Genereert een boilerplate OpenAPI specificatie op basis van JSON-invoer.
        Body: { oasUrl } of { oasBody } (stringified JSON).'
      operationId: generateOAS
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OasInput'
      responses:
        "200":
          content:
            application/json:
              schema:
                type: object
          description: OK
          headers:
            API-Version:
              description: De API-versie van de response
              explode: false
              schema:
                type: string
              style: simple
        "404":
          $ref: '#/components/responses/404'
      security:
      - apiKey: []
        clientCredentials: []
      summary: Generate OpenAPI
      tags:
      - Tools
      x-eov-operation-handler: controllers/ToolsController
      x-original-operationId: GenerateOAS
  /v1/oas/postman:
    post:
      description: 'Converteert OpenAPI naar Postman Collection JSON. Body: { oasUrl
        } of { oasBody } (stringified JSON of YAML).'
      operationId: createPostmanCollection
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OasInput'
      responses:
        "200":
          description: OK
          headers:
            API-Version:
              description: De API-versie van de response
              explode: false
              schema:
                type: string
              style: simple
        "404":
          $ref: '#/components/responses/404'
      security:
      - apiKey: []
        clientCredentials: []
      summary: Maak Postman-collectie (POST)
      tags:
      - Tools
      x-eov-operation-handler: controllers/ToolsController
      x-original-operationId: CreatePostmanCollection
  /v1/oas/validate:
    post:
      description: 'Valideert een OpenAPI specificatie met de DON ADR ruleset. Standaard
        wordt ruleset 2.1 gebruikt; geef targetVersion "2.0" of "2.1" mee om een versie
        te kiezen. Body: { oasUrl } of { oasBody } (stringified JSON of YAML).'
      operationId: validatorOpenAPIPost
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OasInput'
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ModelsLintResult'
          description: OK
          headers:
            API-Version:
              description: De API-versie van de response
              explode: false
              schema:
                type: string
              style: simple
        "404":
          $ref: '#/components/responses/404'
      security:
      - apiKey: []
        clientCredentials: []
      summary: Validate OpenAPI (POST)
      tags:
      - Tools
      x-eov-operation-handler: controllers/ToolsController
servers:
- description: Production
  url: https://api.developer.overheid.nl/tools/v1
- description: Test
  url: https://api.don.apps.digilab.network/tools/v1
tags:
- description: Tools API V1 routes
  name: API v1
- description: Conversies en hulpmiddelen
  name: Tools
