camaraproject / RegionDeviceCount

Repository to describe, develop, document and test the RegionDeviceCount API family
Apache License 2.0
2 stars 2 forks source link

API yaml for RUC #6

Closed chinaunicomyangfan closed 3 months ago

chinaunicomyangfan commented 7 months ago

Problem description add Initial yaml version for RegionUserCount

Expected action discuss and give opinion

https://github.com/camaraproject/RegionUserCount/pull/5

bigludo7 commented 7 months ago

Hello @chinaunicomyangfan

For your consideration Probably we should align the area model with the one used in Device location to provide consistency btw our API. Look for example in location-retrieval.yaml where we have following model:

    Area:
      type: object
      properties:
        areaType:
          $ref: "#/components/schemas/AreaType"
      required:
        - areaType
      discriminator:
        propertyName: areaType
        mapping:
          CIRCLE: "#/components/schemas/Circle"
          POLYGON: "#/components/schemas/Polygon"

    AreaType:
      type: string
      description: |
        Type of this area.
        CIRCLE - The area is defined as a circle.
        POLYGON - The area is defined as a polygon.
      enum:
        - CIRCLE
        - POLYGON

    Circle:
      description: Circular area
      allOf:
        - $ref: "#/components/schemas/Area"
        - type: object
          required:
            - center
            - radius
          properties:
            center:
              $ref: "#/components/schemas/Point"
            radius:
              type: number
              description: Distance from the center in meters
              minimum: 1

    Polygon:
      allOf:
        - $ref: "#/components/schemas/Area"
        - type: object
          required:
            - boundary
          properties:
            boundary:
              $ref: "#/components/schemas/PointList"

    PointList:
      type: array
      items:
        $ref: "#/components/schemas/Point"
      minItems: 3
      maxItems: 15

    Point:
      type: object
      description: Coordinates (latitude, longitude) defining a location in a map
      required:
        - latitude
        - longitude
      properties:
        latitude:
          $ref: "#/components/schemas/Latitude"
        longitude:
          $ref: "#/components/schemas/Longitude"
      example:
        latitude: 50.735851
        longitude: 7.10066

    Latitude:
      description: Latitude component of a location
      type: number
      format: double
      minimum: -90
      maximum: 90

    Longitude:
      description: Longitude component of location
      type: number
      format: double
      minimum: -180
      maximum: 180

It absolutely not change our API function but provided consistency between CAMARA API.

chinaunicomyangfan commented 6 months ago

@bigludo7 Thanks! I will modify the yaml file to maintain consistency

ShutingQing commented 6 months ago

Hello @chinaunicomyangfan

For your consideration Probably we should align the area model with the one used in Device location to provide consistency btw our API. Look for example in location-retrieval.yaml where we have following model:

    Area:
      type: object
      properties:
        areaType:
          $ref: "#/components/schemas/AreaType"
      required:
        - areaType
      discriminator:
        propertyName: areaType
        mapping:
          CIRCLE: "#/components/schemas/Circle"
          POLYGON: "#/components/schemas/Polygon"

    AreaType:
      type: string
      description: |
        Type of this area.
        CIRCLE - The area is defined as a circle.
        POLYGON - The area is defined as a polygon.
      enum:
        - CIRCLE
        - POLYGON

    Circle:
      description: Circular area
      allOf:
        - $ref: "#/components/schemas/Area"
        - type: object
          required:
            - center
            - radius
          properties:
            center:
              $ref: "#/components/schemas/Point"
            radius:
              type: number
              description: Distance from the center in meters
              minimum: 1

    Polygon:
      allOf:
        - $ref: "#/components/schemas/Area"
        - type: object
          required:
            - boundary
          properties:
            boundary:
              $ref: "#/components/schemas/PointList"

    PointList:
      type: array
      items:
        $ref: "#/components/schemas/Point"
      minItems: 3
      maxItems: 15

    Point:
      type: object
      description: Coordinates (latitude, longitude) defining a location in a map
      required:
        - latitude
        - longitude
      properties:
        latitude:
          $ref: "#/components/schemas/Latitude"
        longitude:
          $ref: "#/components/schemas/Longitude"
      example:
        latitude: 50.735851
        longitude: 7.10066

    Latitude:
      description: Latitude component of a location
      type: number
      format: double
      minimum: -90
      maximum: 90

    Longitude:
      description: Longitude component of location
      type: number
      format: double
      minimum: -180
      maximum: 180

It absolutely not change our API function but provided consistency between CAMARA API.

That's pretty helpful. 👍 @bigludo7 I think we should also refer this in Network Slice Booking API yaml.

chinaunicomyangfan commented 6 months ago

The parameter area has been modified.PR is here