Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create location-subscriptions.yaml #1

Conversation

chia2017
Copy link
Owner

What type of PR is this?

Add one of the following kinds:

  • bug
  • correction
  • enhancement/feature
  • cleanup
  • documentation
  • subproject management
  • tests

What this PR does / why we need it:

Which issue(s) this PR fixes:

Fixes #

Special notes for reviewers:

Changelog input

 release-note

Additional documentation

This section can be blank.

docs

url: https://github.com/camaraproject/
security:
- oAuth2ClientCredentials: []
- three_legged:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this three_legged auth is not used anywhere

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we do not need it , we can remove this line

default: http://localhost:9091
description: API root
basePath:
default: locationSubscription/v0

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

uri should be defined in lower case with hyphen

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did not find it in the guidline, so I change it to location-subscription/v0

openapi: 3.0.3
info:
title: Device location subscription event API
description: Service Enabling Network Function API which create, retrieve and delete subscription event for device location

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the API doesn't create/delete/etc. events, but subscriptions for events

maybe:
... subscriptions for events related to the location of a device

This property should contain a detailed documentation also, see qod api. But we could add it later during the review process in Camara too.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

like this: Service Enabling Network Function API which create, retrieve and delete subscriptions for events related to the location of a device?

content:
application/json:
schema:
$ref: '#/components/schemas/EventSubscriptionInfo'

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That doesn't look like a list.

parameters:
- name: eventSubscriptionsId
in: path
description: delete a given event subscription by ID

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's not correct.

'503':
$ref: '#/components/responses/Generic503'

/eventNotifications:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

uri's are in lowercase with hyphen

actually I would add as callback within POST /event-notifications... I've commented on a similar PR in CAMARA, if we change there we should change it here too.

authorizationCode:
authorizationUrl: https://auth.example.com/authorize
tokenUrl: https://auth.example.com/token
scopes:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure we need scopes here, since we have only 1 scope the event handling

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So should I delete it?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can have the authorizationCode flow but without scopes, as for the clientCredentials flow

Event:
description: The event being notified
anyOf:
- $ref: '#/components/schemas/FindLocationDeviceEvent'

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does FindLocationDeviceEvent mean? We have 2 events area entered and area left. So we can make 2 events AreaEnteredEvent, AreaLeftEvent or just one like AreaEvent, but I tend to 2 events.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is just a sample which return point(longlitude, latitude) of device. But I can instead of it make two another event as we mentioned.

- point
properties:
point:
$ref: "#/components/schemas/Point"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does that point in the area-entered/left-event mean?

eventType:
$ref: "#/components/schemas/EventType"
required:
- eventType

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't we need some area information in the request? Otherwise I don't understand how it should work.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The previous comment is still valid. And also which device is considered?

resolved review comments
removed extra boolean variables
Copy link

@akoshunyadi akoshunyadi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still, the basic functionality is not clear. Please take some time to understand and fix it.

longitude: 7.10066
accuracy: 50

Point:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not used anywhere

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you Point is not used?! if you check line 211, point is used as a property of Circle object

scopes: {}

schemas:
Area:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not used anywhere

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Regarding Area in line 191, it is used as property of AreaLeft object in line 415 and as a property of AreaEntered object in line 424 is used.

eventType:
$ref: "#/components/schemas/EventType"
required:
- eventType

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The previous comment is still valid. And also which device is considered?

code/API_definitions/location-subscriptions.yaml Outdated Show resolved Hide resolved
content:
application/json:
schema:
type: array

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better create a SubscriptionInfoList type

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I changed EventSubscriptionInfo to SubscriptionInfo, actually here SubscriptionInfoList does not make sence, only SubscriptionInfo is enough

code/API_definitions/location-subscriptions.yaml Outdated Show resolved Hide resolved
code/API_definitions/location-subscriptions.yaml Outdated Show resolved Hide resolved
Changed yaml file based on last review comments
Resolved review comments
@chia2017 chia2017 merged commit f81540b into define-new-location-subscriptions-api-with-event-subscription-endpoint Jul 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants