openapi: 3.0.3
info:
  title: Interface API Gamma Refonte
  description: Interface API Gamma Refonte
  version: 1.0.0
  contact:
    name: DGDDI - Douane Française
    url: https://www.douane.gouv.fr/

paths:
  # Chemin facultatif
  /917:
    post:
      summary: Définition d'un message 917
      operationId: message917
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BodyType917'
      parameters:
        - $ref: '../api/headerHttp.yaml#/components/parameters/messageId'
      responses:
        '200':
          description: OK
          content:
            text/plain:
              schema:
                $ref: '../api/retourHttp.yaml#/components/schemas/retour200'


components:
  schemas:
    BodyType917:
      type: object
      properties:
        XmlNegativeAcknowledgement:
          $ref: '#/components/schemas/XmlNegativeAcknowledgementType'
      required:
        - XmlNegativeAcknowledgement

    XmlNegativeAcknowledgementType:
      type: object
      properties:
        Attributes:
          $ref: '#/components/schemas/AttributesType917'
        XmlError:
          type: array
          maxItems: 999
          items:
            $ref: '#/components/schemas/XmlErrorType'
      required:
        - XmlError

    AttributesType917:
      type: object
      description: |
        | Nom de l'élément            | Référentiels | Règles | Conditions |
        |-----------------------------|--------------|--------|------------|
        | AdministrativeReferenceCode |              |        |            |
        | SequenceNumber              |              |        |            |
      properties:
        AdministrativeReferenceCode:
          $ref: '../ie/types.yaml#/components/schemas/AdministrativeReferenceCodeType'
        SequenceNumber:
          $ref: '../ie/types.yaml#/components/schemas/SequenceNumberType'
      required:
        - AdministrativeReferenceCode
        - SequenceNumber

    XmlErrorType:
      type: object
      description: |
        | Nom de l'élément       | Référentiels | Règles     | Conditions |
        |------------------------|--------------|------------|------------|
        | ErrorReason            |              | FR_RG_R019 |            |
        | ErrorLocation          |              | FR_RG_R020 |            |
      properties:
        ErrorReason:
          $ref: '../ie/types.yaml#/components/schemas/ErrorReasonType'
        ErrorLocation:
          $ref: '../ie/types.yaml#/components/schemas/ErrorLocationType'
      required:
        - ErrorReason
