Commit aebf4299 authored by Ignacio Dominguez Martinez-Casanueva's avatar Ignacio Dominguez Martinez-Casanueva
Browse files

Define Input and Output models for Subscriptions and Registrations

parent 000750f8
Loading
Loading
Loading
Loading
+41 −41
Original line number Diff line number Diff line
@@ -37,7 +37,7 @@ paths:
      requestBody:
        description: |
          Payload body in the request contains a JSON-LD object which represents the entity that is to be created.
        $ref: '#/components/requestBodies/Entity.Input'
        $ref: '#/components/requestBodies/Entity'
      responses:
        '201':
          description: |
@@ -280,7 +280,7 @@ paths:
      requestBody:
        description: |
          Entity Fragment containing a complete representation of the Attributes to be merged.
        $ref: '#/components/requestBodies/EntityFragment.Input'
        $ref: '#/components/requestBodies/EntityFragment'
      responses:
        '204':
          description: |
@@ -316,7 +316,7 @@ paths:
      requestBody:
        description: |
          Entity Fragment containing a complete representation of the Entity to be replaced.
        $ref: '#/components/requestBodies/EntityFragment.Input'
        $ref: '#/components/requestBodies/EntityFragment'
      responses:
        '204':
          description: |
@@ -355,7 +355,7 @@ paths:
        - $ref: '#/components/parameters/Headers.ngsildTenant'
      requestBody:
        description: Entity Fragment containing a complete representation of the Attributes to be added.
        $ref: '#/components/requestBodies/EntityFragment.Input'
        $ref: '#/components/requestBodies/EntityFragment'
      responses:
        '204':
          description: |
@@ -391,7 +391,7 @@ paths:
        - $ref: '#/components/parameters/Headers.ngsildTenant'
      requestBody:
        description: Entity Fragment containing a complete representation of the Attributes to be updated.
        $ref: '#/components/requestBodies/EntityFragment.Input'
        $ref: '#/components/requestBodies/EntityFragment'
      responses:
        '204':
          description: |
@@ -532,7 +532,7 @@ paths:
        description: |
          Payload body in the request contains a JSON-LD object which represents
          the context source registration that is to be created.
        $ref: '#/components/requestBodies/CsourceRegistration'
        $ref: '#/components/requestBodies/CsourceRegistration.Input'
      responses:
        '201':
          description: |
@@ -610,7 +610,7 @@ paths:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/CsourceRegistrationStatus'
                  $ref: '#/components/schemas/CsourceRegistration.Output'
            application/json+ld:
              schema:
                allOf:
@@ -622,7 +622,7 @@ paths:
                        $ref:  '#/components/schemas/LdContext'
                  - type: array
                    items:
                      $ref: '#/components/schemas/CsourceRegistrationStatus'
                      $ref: '#/components/schemas/CsourceRegistration.Output'
        '400':
          $ref: '#/components/responses/BadRequest'
  /csourceRegistrations/{registrationId}:
@@ -653,7 +653,7 @@ paths:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CsourceRegistrationStatus'
                $ref: '#/components/schemas/CsourceRegistration.Output'
            application/json+ld:
              schema:
                allOf:
@@ -663,7 +663,7 @@ paths:
                    properties:
                      '@context':
                        $ref:  '#/components/schemas/LdContext'
                  - $ref: '#/components/schemas/CsourceRegistrationStatus'
                  - $ref: '#/components/schemas/CsourceRegistration.Output'
        '400':
          headers:
            NGSILD-Warning:
@@ -800,7 +800,7 @@ paths:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/SubscriptionStatus'
                  $ref: '#/components/schemas/Subscription.Output'
            application/json+ld:
              schema:
                allOf:
@@ -812,7 +812,7 @@ paths:
                        $ref:  '#/components/schemas/LdContext'
                  - type: array
                    items:
                      $ref: '#/components/schemas/SubscriptionStatus'
                      $ref: '#/components/schemas/Subscription.Output'
        '400':
          $ref: '#/components/responses/BadRequest'
  /subscriptions/{subscriptionId}:
@@ -843,7 +843,7 @@ paths:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SubscriptionStatus'
                $ref: '#/components/schemas/Subscription.Output'
            application/json+ld:
              schema:
                allOf:
@@ -853,7 +853,7 @@ paths:
                    properties:
                      '@context':
                        $ref:  '#/components/schemas/LdContext'
                  - $ref: '#/components/schemas/SubscriptionStatus'
                  - $ref: '#/components/schemas/Subscription.Output'
        '400':
          headers:
            NGSILD-Warning:
@@ -996,7 +996,7 @@ paths:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/SubscriptionStatus'
                  $ref: '#/components/schemas/Subscription.Output'
            application/json+ld:
              schema:
                allOf:
@@ -1008,7 +1008,7 @@ paths:
                        $ref:  '#/components/schemas/LdContext'
                  - type: array
                    items:
                      $ref: '#/components/schemas/SubscriptionStatus'
                      $ref: '#/components/schemas/Subscription.Output'
        '400':
          $ref: '#/components/responses/BadRequest'
  /csourceSubscriptions/{subscriptionId}:
@@ -1043,7 +1043,7 @@ paths:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SubscriptionStatus'
                $ref: '#/components/schemas/Subscription.Output'
            application/json+ld:
              schema:
                allOf:
@@ -1053,7 +1053,7 @@ paths:
                    properties:
                      '@context':
                        $ref:  '#/components/schemas/LdContext'
                  - $ref: '#/components/schemas/SubscriptionStatus'
                  - $ref: '#/components/schemas/Subscription.Output'
        '400':
          headers:
            NGSILD-Warning:
@@ -1480,7 +1480,7 @@ paths:
        description: |
          Payload body in the request contains a JSON-LD object which represents the
          temporal representation of the entity that is to be created (or updated).
        $ref: '#/components/requestBodies/EntityTemporal.Input'
        $ref: '#/components/requestBodies/EntityTemporal'
      responses:
        '201':
          description: |
@@ -1681,7 +1681,7 @@ paths:
      requestBody:
        description: |
          EntityTemporal Fragment containing a complete representation of the Attribute instances to be added.
        $ref: '#/components/requestBodies/EntityTemporalFragment.Input'
        $ref: '#/components/requestBodies/EntityTemporalFragment'
      responses:
        '204':
          description: |
@@ -1755,7 +1755,7 @@ paths:
        - $ref: '#/components/parameters/Headers.ngsildTenant'
      requestBody:
        description: Entity Fragment containing the elements of the attribute to be updated.
        $ref: '#/components/requestBodies/EntityTemporalFragment.Input'
        $ref: '#/components/requestBodies/EntityTemporalFragment'
      responses:
        '204':
          description: |
@@ -2856,16 +2856,16 @@ components:
                properties:
                  '@context':
                    $ref:  '#/components/schemas/LdContext'
    CsourceRegistration:
    CsourceRegistration.Input:
      required: true
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/CsourceRegistration'
            $ref: '#/components/schemas/CsourceRegistration.Input'
        application/json+ld:
          schema:
            allOf:
              - $ref: '#/components/schemas/CsourceRegistration'
              - $ref: '#/components/schemas/CsourceRegistration.Input'
              - type: object
                required:
                  - '@context'
@@ -2888,7 +2888,7 @@ components:
                properties:
                  '@context':
                    $ref:  '#/components/schemas/LdContext'
    Entity.Input:
    Entity:
      required: true
      content:
        application/json:
@@ -2924,7 +2924,7 @@ components:
              - type: array
                items:
                  $ref: '#/components/schemas/Entity.Input'
    EntityFragment.Input:
    EntityFragment:
      required: true
      content:
        application/json:
@@ -2940,7 +2940,7 @@ components:
                properties:
                  '@context':
                    $ref:  '#/components/schemas/LdContext'
    EntityTemporal.Input:
    EntityTemporal:
      required: true
      content:
        application/json:
@@ -2956,7 +2956,7 @@ components:
                properties:
                  '@context':
                    $ref:  '#/components/schemas/LdContext'
    EntityTemporalFragment.Input:
    EntityTemporalFragment:
      required: true
      content:
        application/json:
@@ -3009,11 +3009,11 @@ components:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Subscription'
            $ref: '#/components/schemas/Subscription.Input'
        application/json+ld:
          schema:
            allOf:
              - $ref: '#/components/schemas/Subscription'
              - $ref: '#/components/schemas/Subscription.Input'
              - type: object
                required:
                  - '@context'
@@ -3673,16 +3673,16 @@ components:
          $ref: '#/components/schemas/RegistrationManagementInfo'
      additionalProperties:
        $ref: '#/components/schemas/AnyValue'
    CsourceRegistration:
    CsourceRegistration.Input:
      allOf:
        - $ref: '#/components/schemas/CsourceRegistrationFragment'
        - required:
          - type
          - information
          - endpoint
    CsourceRegistrationStatus:
    CsourceRegistration.Output:
      allOf:
        - $ref: '#/components/schemas/CsourceRegistration'
        - $ref: '#/components/schemas/CsourceRegistration.Input'
        - type: object
          properties:
            # Clause 5.2.2 Common members
@@ -3766,7 +3766,7 @@ components:
          format: date-time
      required:
        - startAt
    SubscriptionCommon:
    Subscription.Common:
      description: |
        5.2.12 represents a Context Subscription.
      type: object
@@ -3859,7 +3859,7 @@ components:
          type: string
    SubscriptionFragment.Periodic:
      allOf:
        - $ref: '#/components/schemas/SubscriptionCommon'
        - $ref: '#/components/schemas/Subscription.Common'
        - properties:
            timeInterval:
              description: |
@@ -3869,7 +3869,7 @@ components:
              minimum: 1
    SubscriptionFragment.OnChange:
      allOf:
        - $ref: '#/components/schemas/SubscriptionCommon'
        - $ref: '#/components/schemas/Subscription.Common'
        - properties:
            watchedAttributes:
              description: |
@@ -3902,13 +3902,13 @@ components:
        - required:
          - type
          - notification
    Subscription:
    Subscription.Input:
      oneOf:
        - $ref: '#/components/schemas/Subscription.Periodic'
        - $ref: '#/components/schemas/Subscription.OnChange'
    SubscriptionStatus:
    Subscription.Output:
      allOf:
        - $ref: '#/components/schemas/Subscription'
        - $ref: '#/components/schemas/Subscription.Input'
        - type: object
          properties:
            # Clause 5.2.2 Common members. System-generated.
@@ -4846,10 +4846,10 @@ components:
            The content of the notification as NGSI-LD entities. See clause 5.2.4.
          type: array
          items:
            $ref: '#/components/schemas/CsourceRegistration'
            $ref: '#/components/schemas/CsourceRegistration.Input'
        triggerReason:
          description: |
            Indicates whether the Csources in the CsourceRegistration(s) in data are newly matching
            Indicates whether the Csources in the CsourceRegistration.Input(s) in data are newly matching
            (initial notification or creation), have been updated (but still match) or do not match any longer.

            • "newlyMatching" - describes the case that the notified Context Source Registration(s) newly