apinf / api-harvester

API harvester
Other
0 stars 0 forks source link

Desired JSON data model #4

Open kyyberi opened 7 years ago

kyyberi commented 7 years ago

What is the desired data model coming out from harvesting so that it's easily used in reading the content in when using Catalog REST API POST method?

@nnn might know something from code level.

kyyberi commented 7 years ago

Example JSON configuration for API in apinf.io, which does not fit in all situations.

{
    "_id": "9nuJDa2vLQNaxmJQh",
    "latestMonitoringStatusCode": "-1",
    "name": "Ampersand test",
    "description": "test",
    "url": "https://api.apinf.io",
    "lifecycleStatus": "design",
    "managerIds": [
        "gYwfyAcuKxQ9udgSt"
    ],
    "authorizedUserIds": [],
    "created_at": "2017-02-27T12:48:57.148Z",
    "bookmarkCount": 1,
    "isPublic": true,
    "updated_at": "2017-03-24T01:05:09.405Z",
    "submit_methods": [
        "get",
        "post",
        "delete",
        "put"
    ],
    "documentationFileId": "2a1822480ff90cdc31600561"
}
kyyberi commented 7 years ago

Perhaps something like this.

{
    "_id": "null", (default is null)
    "latestMonitoringStatusCode": "0", (this is default)
    "name": "Ampersand test", (API name)
        "organizationName":"name of the organization",
    "description": "test", (Description field, around 200 chars)
    "url": "https://api.apinf.io", (API root)
        "specFile": { 
              "url":"Swagger file url", (default is null)
              "type":"swagger"
         },
    "lifecycleStatus": "production", (default is 'production')
    "managerIds": [], (default is empty array)
    "authorizedUserIds": [], (default is empty array)
    "created_at": "2017-02-27T12:48:57.148Z", (when created from harvester point of view)
    "bookmarkCount": 0, (default is 0)
    "isPublic": true, (default is true)
    "updated_at": "2017-03-24T01:05:09.405Z", (when updated from harvester point of view)
    "submit_methods": [], (default is empty array)
    "documentationFileId": "2a1822480ff90cdc31600561" (default is null)
}
kyyberi commented 7 years ago

https://github.com/apinf/api-harvester/blob/master/data-models-as-json.md