FSN#40005 Documenteren API2 volgens OpenAPI Specification. Alleen de single-XML klopt nu nog niet

svn path=/Website/trunk/; revision=33321
This commit is contained in:
Jos Groot Lipman
2017-03-29 21:55:55 +00:00
parent 7a4c8c3315
commit 44f229d2c2

View File

@@ -37,6 +37,8 @@
"type":"integer",
"format":"int64"
};
if (fld == "id")
prop["readOnly"] = true; // Wordt nog genegeerd door Swagger-ui 2.0
break;
case "float":
case "currency":
@@ -102,7 +104,7 @@
"200": {
"description": "A list of " + model.records_title,
"schema": {
"$ref": "#/schema/" + model.records_name
"$ref": "#/schema/{0}".format(model.records_name)
}
}
},
@@ -114,7 +116,7 @@
]
}
};
result["schema"]["fields"][model.record_name] = swaggerschema(model);
result["schema"]["fields"][model.record_name + "fields"] = swaggerschema(model);
result["schema"][model.records_name] =
{
"type": "object",
@@ -122,17 +124,26 @@
"total_count": {
"type":"integer",
"format":"int64",
"example": 10
"example": 10,
"xml": {
"attribute": true
}
},
"limit": {
"type":"integer",
"format":"int64",
"example": S("qp_maxrows")
"example": S("qp_maxrows"),
"xml": {
"attribute": true
}
},
"offset": {
"type":"integer",
"format":"int64",
"example": 0 // Doen we altijd nog
"example": 0, // Doen we altijd nog
"xml": {
"attribute": true
}
}
}
}
@@ -140,7 +151,7 @@
{
"type": "array",
"items": {
"$ref": "#/schema/fields/" + model.record_name
"$ref": "#/schema/fields/" + model.record_name + "fields"
}
};
@@ -150,7 +161,7 @@
};
result["schema"][model.record_name ]["properties"][model.record_name] =
{
"$ref": "#/schema/fields/" + model.record_name
"$ref": "#/schema/fields/" + model.record_name + "fields"
}
if (getQParamInt("single", 0) == 1)
@@ -178,7 +189,7 @@
}
};
}
if (getQParamInt("single", 0) == 1 && model["REST_POST"])
if (getQParamInt("single", 0) == 0 && model["REST_POST"])
{
result["post"] = {
"tags":[