Skip to content

Add Minimal Openapi Specification #12

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

Merged

Conversation

m-linner-ericsson
Copy link
Member

@m-linner-ericsson m-linner-ericsson commented Jul 16, 2021

Applicable Issues

Action Point from the TC meetings e.g. https://github.com/eiffel-community/community/blob/master/meetings/MEETINGS_TC_2021.md#action-items

Description of the Change

As the ER from Ericsson is not yet open-sourced this API aims as a bridge for those that wish to use the Ericsson ER as a Docker image or use e.g. REMReM and create their own implementation. It is intended as a minimal API that should be supported by event repositories.

The suggested API is based on what REMReM which relies heavily on the ER /events endpoint (see https://github.com/eiffel-community/eiffel-remrem-generate/blob/master/wiki/markdown/usage/service.md#lookups for more information)

To see a preview load the API in the Swagger online editor

Alternate Designs

None

Benefits

Describing a minimal API that should be supported by all Event Repositories

Possible Drawbacks

N/A

Sign-off

Developer's Certificate of Origin 1.1

By making a contribution to this project, I certify that:

(a) The contribution was created in whole or in part by me and I
have the right to submit it under the open source license
indicated in the file; or

(b) The contribution is based upon previous work that, to the best
of my knowledge, is covered under an appropriate open source
license and I have the right under that license to submit that
work with modifications, whether created in whole or in part
by me, under the same open source license (unless I am
permitted to submit under a different license), as indicated
in the file; or

(c) The contribution was provided directly to me by some other
person who certified (a), (b) or (c) and I have not modified
it.

(d) I understand and agree that this project and the contribution
are public and that a record of the contribution (including all
personal information I submit with it, including my sign-off) is
maintained indefinitely and may be redistributed consistent with
this project or the open source license(s) involved.

Signed-off-by: Mattias Linnér mattias.linner@ericsson.com

@m-linner-ericsson m-linner-ericsson changed the title Add endpoint with call parameters Add Minimal Openapi Specification Jul 19, 2021
Copy link
Member Author

@m-linner-ericsson m-linner-ericsson left a comment

Choose a reason for hiding this comment

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

First batch of replies, edit and fixes will come later

@m-linner-ericsson m-linner-ericsson self-assigned this Dec 1, 2021
Copy link
Member

@magnusbaeck magnusbaeck left a comment

Choose a reason for hiding this comment

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

I've gone through the spec and made some additional comments on top of the old ones that haven't been resolved.

* GET /events
	- Remove parameter pageStartItem
	- Remove parameter pageNo
	- Remove parameter shallow
	- Remove parameter lazy
	- Remove parameter readable
	- Removed extra slash from examples in explanation texts
	- Removed explanation of use of RegExp
	- Add explanation of how the example object turns into parameters
	- Remove text/html return type
	- Add example of returned Eiffel event
	- Change text for 400 return

* Remove GET search/{id}

* POST search/{id}
	- Remove defaults for limit
	- Remove defaults for levels
	- Remove parameter tree
	- Reword description of request body
	- Remove status code 201
	- Explain dlt and ult
@m-linner-ericsson
Copy link
Member Author

Thanks for all the comments @magnusbaeck! I hope I have now answered them all.

Copy link
Member

@magnusbaeck magnusbaeck left a comment

Choose a reason for hiding this comment

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

Thanks for the updates! I think we're starting to converge.

- Limit to one tag
- Spelling fixes

* GET /events
	- Drop all type of filter comparators but `=`
	- Add required for pageSize and totalNumberItems in return value
	- Adjust total return items to 1
	- Use real Eiffel event as an example

* GET /event
	- Use simpler Eiffel event as an example
	- Make example as a common component

* POST /search
	- Use real Eiffel event as return example
@m-linner-ericsson
Copy link
Member Author

@magnusbaeck Thanks again for your comments. Next round 😃

Copy link
Member

@magnusbaeck magnusbaeck left a comment

Choose a reason for hiding this comment

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

I find it very difficult to track all GitHub comments, but I think I've resolved all threads except one where I'd like to get a clarification.

Copy link
Member

@magnusbaeck magnusbaeck left a comment

Choose a reason for hiding this comment

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

I'm basically okay with the spec now, but apart from a question that came up I don't want to approve the PR since I'm not a maintainer but happen to have approval powers since I'm a TC member.

Copy link
Member

@magnusbaeck magnusbaeck left a comment

Choose a reason for hiding this comment

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

I was just about to say LGTM but found a couple of things from earlier discussions that weren't actually addressed (see open conversations).

- Improve /events endpoint
    - Remove reference to "!" key
    - Rewrite "No comparator"
    - Improve explanation for multiple query keys
- Improve /search endpoint
    - Explain "-1" and add default
    - Add missing link types
    - Add example of linked upstream/downstream
    - Add 400 error code
- Improve language
@m-linner-ericsson
Copy link
Member Author

Thanks @magnusbaeck for the patience with this! From what i gather we have the following conversation ongoing which should be addressed now:

  • I'm sure there are other problems that would result in a 400 response...
  • To what extent are you actually using operators other than =?...
  • I'm not sure it's a great idea to be able to ask for unlimited amounts of data...

Co-authored-by: Emil Bäckmark <emil.backmark@ericsson.com>
Co-authored-by: Magnus Bäck <magnus@noun.se>
@m-linner-ericsson
Copy link
Member Author

@magnusbaeck Thanks for you patience with this. I hope we have now sorted out all issues.

@e-backmark-ericsson
Copy link
Member

From TC meeting Nov 16:

  • The API should not dictate an enum to be used for dl/ul link types, but instead a regexp with UPPERCASE and underscores
  • The API can include the help text with all avaliable link_types until there is a list of link types generated at release of a new event protocol edition

Copy link
Member

@magnusbaeck magnusbaeck left a comment

Choose a reason for hiding this comment

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

🎉

@m-linner-ericsson m-linner-ericsson merged commit 0af58fb into eiffel-community:master Jan 18, 2024
@m-linner-ericsson m-linner-ericsson deleted the add_openapi_spec branch January 18, 2024 15:36
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.

5 participants