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

Open API spec files #1

Open
kyyberi opened this issue Nov 8, 2017 · 14 comments
Open

Open API spec files #1

kyyberi opened this issue Nov 8, 2017 · 14 comments

Comments

@kyyberi
Copy link

kyyberi commented Nov 8, 2017

The repository is logical place to look for Open API spec (yaml) files for all the FIWARE standardized APIs. Yet there's currently none. If the files are not collected here, then at least add to readme where the files are.

@fgalan
Copy link
Contributor

fgalan commented Nov 8, 2017

They are in the gh-pages branch (https://github.com/Fiware/specifications/tree/gh-pages) which maps with the automatic web server provided by github.io, e.g: http://fiware.github.io/specifications/ngsiv2/stable/

You are right: the README.md at master branch should explain that.

@kyyberi
Copy link
Author

kyyberi commented Nov 8, 2017

Thank you for answer and more information. I looked at the sources and I only find API Blueprint references:

var embed = new Apiary.Embed({
      apiBlueprint: "FORMAT: 1A\nHOST: http://orion.lab.fiware.org\nTITLE: FIWARE-NGSI v2 

I was expecting to find spec files in Open API format, https://github.com/OAI/OpenAPI-Specification

@juliozinga
Copy link

A simple question. Where is the source of this content: http://fiware.github.io/specifications/ngsiv2/stable/ ?
I suggest you have examples for python3.
And I would like to contribute to these examples.

@fgalan
Copy link
Contributor

fgalan commented Jan 8, 2018

Sources are here in .apib format:

https://github.com/telefonicaid/fiware-orion/tree/master/doc/apiary/v2

However, the stable documents shoudn't be touched, as they correspond to "frozen" RC versions of the NGSIv2 API. If you plan to contribute focus on the following ones:

Typically, the second one (cookbook) was aimed at examples. However, it has not been touched (last time 2 years ago ;). Thus, probably it is obsolete and it would be a good contribution to review it, update it and expand it. Maybe @jmcanterafonseca have some feedback regarding this.

Regarding Python3, note that .apib are agnostic with regards with programming language. Thus, I'm not sure that is a good place for such examples.

@jmcanterafonseca
Copy link
Contributor

jmcanterafonseca commented Jan 16, 2018

We are going to migrate progressively to the Swagger Open API Format with the help of tools like https://apimatic.io/transformer

Open API Specifications will be hosted by this repository

We will start with NGSIv2 specification and IDAS specification. Then owner of other GEs will be asked to perform their migration

@fgalan
Copy link
Contributor

fgalan commented Jan 16, 2018

Open API Specifications will be hosted by this repository

You mean the HTML render of the specification? Or the source (i.e. .apib equivalent in the swagger world)?

@jmcanterafonseca
Copy link
Contributor

jmcanterafonseca commented Jan 16, 2018

First version of the NGSIv2 specification in Open API Format can be found at

http://fiware.github.io/specifications/OpenAPI/ngsiv2/ngsiv2-openapi.json

Please note that further tweakings might be needed and contributions from the Community at that respect are welcome

@fgalan
Copy link
Contributor

fgalan commented Jan 16, 2018

How do you ensure that the ngsiv2-openspai.json keeps synced with current .apib? The risk of forking (i.e. modifications in some place not applied to the other) is high... Source should be only one, the others be automatic derivations.

@jmcanterafonseca
Copy link
Contributor

@fgalan there is no longer rendering of Swagger specs as Swagger provides a Swagger UI viewer. We will deploy an instance of the viewer on the FIWARE Lab so anyone can easily browse the Swagger specs.

Idea is to have swagger.lab.fiware.org for this purpose.

@jason-fox
Copy link
Member

Following on from @jmcanterafonseca - a forwarding to the Swagger UI viewer at https://swagger.lab.fiware.org/ is now in place - http://fiware.github.io/specifications/OpenAPI/ngsiv2 (without the JSON file name) will display the latest raw Swagger file from master.

I have updated the README on both gh-pages and master to add visible links to the specs.

@fgalan
Copy link
Contributor

fgalan commented May 8, 2018

I have one doubt:

Looking to http://fiware.github.io/specifications/OpenAPI/ngsiv2 how do you ensure that a change in https://github.com/telefonicaid/fiware-orion/blob/master/doc/apiary/v2/fiware-ngsiv2-reference.apib (the source of the NGSIv2 specification) is propagated to that web page? For instance, if a new method is defined or a new parameter added to an existing method.

(In fact, is the same concern expressed at #1 (comment) but reformulated in a diferent way :)

@jason-fox
Copy link
Member

jason-fox commented May 8, 2018

Currently a change in fiware-ngsiv2-reference.apib calls a sync function to update the swagger file on master https://raw.githubusercontent.com/Fiware/specifications/master/OpenAPI/ngsiv2/ngsiv2-openapi.json which is created by an apiamatic translation (Apiary to Swagger). Currently, the same file is also copied to the gh-pages branch.

This means that:

  1. The master branch of specifications contains only Swagger files e.g
  • on master - ../OpenAPI/ngsiv2/ngsiv2-openapi.json will be the latest generated swagger file.
  1. The gh-pages branch of specifications contains HTML and other assets
  • on gh-pages - ../ngsiv2/index.html holds the generated Apiary documentation
  • on gh-pages - ../OpenAPI/ngsiv2/index.html is a forwarding file (which references the specification file on the master branch) and will always display a swagger UI for the latest generated swagger file.
  • on gh-pages - ../OpenAPI/ngsiv2/ngsiv2-openapi.json will be a copy of the latest generated swagger file.

I'm not entirely sure if it is necessary to maintain the gh-pages copy of the swagger file - i.e. the link http://fiware.github.io/specifications/OpenAPI/ngsiv2/ngsiv2-openapi.json as a direct JSON representation of the spec but it works as a URL shortener. If this duplicate copy is not needed then the the JSON representations on gh-pages should be deleted to avoid confusion.

@jmcanterafonseca
Copy link
Contributor

@jason-fox if we properly configure this repo gh-pages can be removed

@caa06d9c could you take care of reconfiguring and testing everything?

@caa06d9c
Copy link

ok

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

No branches or pull requests

6 participants