bcgov / TheOrgBook

A public repository of verifiable claims about organizations. A key component of the Verifiable Organization Network.
http://von.pathfinder.gov.bc.ca
Apache License 2.0
78 stars 66 forks source link

API schema seems outdated. #883

Closed wsong-fv closed 4 years ago

wsong-fv commented 4 years ago

The API schema seems outdated, mostly the wrapper on the outside of the results. For example, if I query /v2/search/credential/topic, the schema says that I should expect a wrapper with the format

count* | integer
next | string($uri)x-nullable: true
previous | string($uri)x-nullable: true
results*

However in reality the wrapper contains a lot more variables:

{
  "total": 200,
  "page_size": 10,
  "page": 1,
  "first_index": 1,
  "last_index": 10,
  "next": "https://www.orgbook.gov.bc.ca/api/v2/search/credential/topic?inactive=false&latest=true&name=bakery&page=2&revoked=false",
  "previous": null,
  "results":

For some other endpoints it's even worse, the schema doesn't specify any wrapper at all. For example, /v2/search/autocomplete's schema says that it should return a type of CredentialAutocomplete a singular object.

However, in reality, the returned json has a wrapper:

{
  "total": 10,
  "first_index": 1,
  "last_index": 10,
  "results": [
    {

and also returns a list of CredentialAutocomplete, instead of just one.

I also want to ask about the difference between the openapi schema available on the vonx url, versus the openapi 3.0 schema available in the github?

swcurran commented 4 years ago

@ianco - could you take a first look at this and either handle it or pass it to someone on the team that can address it? Thanks!

ianco commented 4 years ago

Looking now ...

ianco commented 4 years ago

Confirmed that we need to update the swagger definitions (for both v2 and v3)

I suggest we do these updates in the aries-vcr repository, I don't think it's pragmatic to also update the old TheOrgBook repo, @swcurran thoughts?

swcurran commented 4 years ago

I think that unless we have set date for launching Aries-VCR version of OrgBook, we have to do TOB as well. I'd love to have the new version launched, but the goalposts seem to keep moving.

What is the effort to update TOB? If it is just to generate the file, verify it basically works and relaunch, I would say we do that if Aries VCR isn't going up by end of next week.

ianco commented 4 years ago

I'll see if I can make the changes in OrgBook and then port the changes over to aries-vcr

I don't think the v2 api has changed much