Commit 3ba1f8b4 authored by daniel-gonzalez-sanchez's avatar daniel-gonzalez-sanchez
Browse files

Adding a folder for defining examples of custom OpenAPI schemas that are...

Adding a folder for defining examples of custom OpenAPI schemas that are compliant with the NGSI-LD OAS.
parent d6b7f9e2
Loading
Loading
Loading
Loading
+39 −0
Original line number Diff line number Diff line
openapi: 3.0.3
info:
  title: Example schemas for a temperature sensor
  version: 0.0.1
  description: |
    Example schemas compliant with the NGSI-LD OAS V1.6.1 metamodel according to ETSI GS CIM 009 V1.6.1.
paths: {}
components:
  schemas:
    TemperatureSensor:
      description: | 
        NGSI-LD Entity Type that represents a temperature sensor.
      allOf:
        - $ref: 'https://forge.etsi.org/rep/cim/NGSI-LD/-/raw/1.6.1/ngsi-ld-api.yaml#/components/schemas/Entity'
        - type: object
          properties:
            type:
              description: NGSI-LD Entity identifier. It has to be TemperatureSensor.
              type: string
              enum:
                - TemperatureSensor
              default: TemperatureSensor
            temperature:
              $ref: '#/components/schemas/Temperature'
        - required:
            - type
            - temperature
    Temperature:
      description: | 
        NGSI-LD Property Type. The temperature measurement.
      allOf:
        - $ref: 'https://forge.etsi.org/rep/cim/NGSI-LD/-/raw/1.6.1/ngsi-ld-api.yaml#/components/schemas/Property'
        - type: object
          properties: 
            value:
              type: number
          required:
            - value 
      additionalProperties: false
 No newline at end of file