openapi: 3.0.3
info:
  title: Api til virksomhed.
  description: Api til at hente stamdata om virksomheder.
  version: 0.5.16
servers:
- url: http://localhost:8080
paths:
  /virksomheder/{cvrNummer}:
    parameters:
    - $ref: '#/components/parameters/cvrNummerParameter'
    get:
      tags:
      - virksomhed
      operationId: getVirksomhed
      summary: Hent virksomhed med cvrnummer.
      responses:
        '200':
          description: Information om virksomheden med CVR-nummer.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/virksomhed'
          links:
            self:
              operationId: hentVirksomhed
              parameters:
                cvrNummer: $request.path.cvrNummer
        default:
          $ref: '#/components/responses/genericErrorResponse'
security:
- bearerAuth: [
    ]
components:
  parameters:
    cvrNummerParameter:
      name: cvrNummer
      in: path
      required: true
      schema:
        $ref: '#/components/schemas/cvrNummer'
      description: Virksomhedens CVR-nummer.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
  schemas:
    virksomhed:
      properties:
        cvrnummer:
          $ref: '#/components/schemas/cvrNummer'
        navn:
          type: string
        adresse:
          $ref: '#/components/schemas/darAdresse'
        reklamebeskyttet:
          type: boolean
    darAdresse:
      x-namespace: dk.domstol.oas.common
      description: Repræsentation af adresse fra Dansk Adresse Register (DAR).
      required:
      - id
      - adresselinje
      - postnummer
      - by
      properties:
        id:
          $ref: '#/components/schemas/id'
        adresselinje:
          type: string
        postnummer:
          type: string
        by:
          type: string
        retskredsId:
          $ref: '#/components/schemas/retskredsId'
    apiError:
      x-namespace: dk.domstol.oas.common
      required:
      - code
      - status
      - message
      - path
      - timestamp
      properties:
        code:
          description: Human readable HTTP status message.
          type: string
        status:
          description: HTTP status code.
          type: integer
        message:
          description: Message describing the error.
          type: string
        path:
          description: The path of the error.
          type: string
        timestamp:
          description: Date and time of the error.
          type: string
          format: date-time
        details:
          description: Detailed description of the error(s).
          type: array
          items:
            $ref: '#/components/schemas/details'
    details:
      type: string
    id:
      type: string
      format: uuid
    cvrNummer:
      type: string
      pattern: ^[1-9][0-9]{7}$
    retskredsId:
      type: string
      pattern: ^\d{4}$
  headers: {
    }
  responses:
    genericErrorResponse:
      description: Svar ved fejl.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/apiError'
  requestBodies: {
    }
