Hello, I am working with API Gateway using openapi.yaml (NSwag generated C# client)
<OpenApiReference Include="Model\MilestoneOpenapi.yaml" ClassName="APIGatewayClient" CodeGenerator="NSwagCSharp" Namespace="Milestone" />
-
Where can I find most recent openapi definition? https://download.milestonesys.com/ApiGateway/openapi.yaml seems to be not up to date with 2022 R2. Please consider per VMS version file versioning.
-
Almost all queries failing (on deserializing relations) since openapi expects type array but query returns object.
relations:
type: array
items:
$ref: '#/components/schemas/links_ptzPresets'
"relations": {
"parent": {
"type": "cameras",
"id": "da7292ad-xxxx-49a0-bb86-0316b035e234"
},
"self": {
"type": "ptzPresets",
"id": "7484408d-xxxx-4b25-8720-f5ee1d8f3415"
}
}
- This is hard to work when sometimes API return array and sometimes it return object. Can you always return array but with one element inside? For example:
// https://...:443/api/rest/v1/cameras/....1/streams
{
"array": [
{
"displayName": "Streams",
"stream": [
{
"displayName": "Stream #1",
"name": "Stream #1",
....
}
// https://...:443/api/rest/v1/cameras/....2/streams
{
"array": [
{
"displayName": "Streams",
"stream": {
"displayName": "Video stream 1",
"name": "Video stream 1",
"streamReferenceId": "28DC44C3-079E-4C94-8EC9-60363451EB40",
"liveDefault": true,
"liveMode": "WhenNeeded",
"record": true
},
...
}
- According to openapi getOneptzPresetsInAcameras should return “array” but it does return “data”
// https://....:443/api/rest/v1/cameras/.../ptzpresets/.....3
{
"data": {
"displayName": "Home",
"id": "75fa0e5e-a9c5-406b-ab29-5f20ead5efb3",
...
}
// Openapi:
responses:
'200':
description: OK
content:
'application/json':
schema:
type: object
properties:
array:
type: array
items:
$ref: '#/components/schemas/ptzPresets'