Browse Source

spec_templates: Implement query parameters for method parameters

pull/57/head
jld3103 2 years ago
parent
commit
feddef0284
No known key found for this signature in database
GPG Key ID: 9062417B9E8EB7B3
  1. 119
      packages/spec_templates/bin/generate.dart
  2. 50
      packages/spec_templates/lib/method_parameter.dart
  3. 9
      packages/spec_templates/lib/openapi_spec.dart
  4. 829
      specs/templates/core.json
  5. 662
      specs/templates/news.json
  6. 270
      specs/templates/notes.json
  7. 71
      specs/templates/notifications.json
  8. 374
      specs/templates/provisioning_api.json
  9. 82
      specs/templates/user_status.json

119
packages/spec_templates/bin/generate.dart

@ -125,11 +125,9 @@ Future main(final List<String> args) async {
RegExp('\\/\\*\\*((?:(?!\\/\\*\\*).)*?)\\*\\/(?:(?!\\*\\/).)*?public function $methodName\\(([^\\)]*)\\)'); RegExp('\\/\\*\\*((?:(?!\\/\\*\\*).)*?)\\*\\/(?:(?!\\*\\/).)*?public function $methodName\\(([^\\)]*)\\)');
final match = reg.allMatches(controllerContent).single; final match = reg.allMatches(controllerContent).single;
final methodParameters = _getMethodParameters( final docParameters = <String>[];
controllerName, var current = '';
methodName, for (final docLine in match
match.group(2)!.split(',').map((final s) => s.trim()).where((final s) => s.isNotEmpty).toList(),
match
.group(1)! .group(1)!
.split('*') .split('*')
.map((final s) { .map((final s) {
@ -139,27 +137,36 @@ Future main(final List<String> args) async {
} }
return r; return r;
}) })
.where((final s) => s.isNotEmpty && s.startsWith('@param')) .where((final s) => s.isNotEmpty)
.toList(), .toList()) {
); if (docLine.startsWith('@')) {
if (current != '') {
docParameters.add(current);
}
}
final operation = Operation( if (docLine.startsWith('@return')) {
operationID: '${name.replaceAll('#', '-').toLowerCase()}-TODO', current = '';
responses: { break;
200: Response( }
description: '',
content: { if (docLine.startsWith('@param')) {
'application/json': MediaType( current = docLine;
schema: { } else if (current != '') {
'type': 'string', current += ' $docLine';
}, }
), }
}, if (current != '') {
), docParameters.add(current);
}, }
final methodParameters = _getMethodParameters(
controllerName,
methodName,
match.group(2)!.split(',').map((final s) => s.trim()).where((final s) => s.isNotEmpty).toList(),
docParameters,
); );
if (paths[url] == null) {
final parameterNames = RegExp('{[^}]*}').allMatches(url).map((final m) { final parameterNames = RegExp('{[^}]*}').allMatches(url).map((final m) {
final t = m.group(0)!; final t = m.group(0)!;
return t.substring(1, t.length - 1); return t.substring(1, t.length - 1);
@ -192,11 +199,73 @@ Future main(final List<String> args) async {
), ),
); );
} }
final queryParameters = <MethodParameter>[];
for (final methodParameter in methodParameters) {
var found = false;
for (final parameter in parameters) {
if (parameter.name == methodParameter.name) {
found = true;
break;
}
}
if (!found) {
queryParameters.add(methodParameter);
}
}
if (paths[url] == null) {
paths[url] = Path( paths[url] = Path(
parameters: parameters, parameters: parameters,
); );
} }
/*
for (final bodyParameter in queryParameters) ...{
bodyParameter.name: {
if (bodyParameter.description != null) ...{
'description': bodyParameter.description,
},
'type': bodyParameter.openAPIType ?? 'TODO',
if (bodyParameter.defaultValue != null) ...{
'default': bodyParameter.defaultValue,
},
}
},
*/
final operation = Operation(
operationID: '${name.replaceAll('#', '-').toLowerCase()}-TODO',
parameters: queryParameters.isNotEmpty
? queryParameters
.map<Parameter>(
(final queryParameter) => Parameter(
name: queryParameter.name,
in_: 'query',
description: queryParameter.description,
required: !queryParameter.nullable && queryParameter.defaultValue == null,
schema: {
'type': queryParameter.openAPIType ?? 'TODO',
if (queryParameter.defaultValue != null) ...{
'default': queryParameter.defaultValue,
},
},
),
)
.toList()
: null,
responses: {
200: Response(
description: '',
content: {
'application/json': MediaType(
schema: {
'type': 'string',
},
),
},
),
},
);
switch (verb) { switch (verb) {
case 'DELETE': case 'DELETE':
paths[url]!.delete = operation; paths[url]!.delete = operation;
@ -355,8 +424,8 @@ List<MethodParameter> _getMethodParameters(
type = 'string'; type = 'string';
continue; continue;
} }
print( throw Exception(
'WARNING: Can not determine reliable type for "$docType" for parameter "$name" of method "$methodName" in controller "$controllerName"', 'Can not determine reliable type for "$docType" for parameter "$name" of method "$methodName" in controller "$controllerName"',
); );
} else { } else {
type = nonNullableParts.single; type = nonNullableParts.single;

50
packages/spec_templates/lib/method_parameter.dart

@ -5,14 +5,17 @@ class MethodParameter {
required this.type, required this.type,
required this.nullable, required this.nullable,
required this.name, required this.name,
required this.defaultValue, required final String? defaultValue,
required this.description, required this.description,
required this.controllerName, required this.controllerName,
required this.methodName, required this.methodName,
}) { }) {
if (type == null) { if (defaultValue == 'null') {
if (defaultValue != null && defaultValue != 'null') { nullable = true;
if (int.tryParse(defaultValue!) != null) { }
if (type == null && defaultValue != null && defaultValue != 'null') {
nullable = false;
if (int.tryParse(defaultValue) != null) {
type = 'int'; type = 'int';
} }
if (defaultValue == 'true' || defaultValue == 'false') { if (defaultValue == 'true' || defaultValue == 'false') {
@ -21,16 +24,30 @@ class MethodParameter {
if (defaultValue == "''" || defaultValue == '""') { if (defaultValue == "''" || defaultValue == '""') {
type = 'string'; type = 'string';
} }
if (defaultValue != null) { if (defaultValue == '[]') {
nullable = false; type = 'array';
}
} }
if (type == null) { if (type == null) {
print( throw Exception(
'WARNING: Unknown type for parameter "$name" with default value "$defaultValue" of method "$methodName" in controller "$controllerName"', 'Unknown type for parameter "$name" with default value "$defaultValue" of method "$methodName" in controller "$controllerName"',
); );
} }
} else { if (defaultValue != null && defaultValue != 'null') {
print('WARNING: Unknown type for parameter "$name" of method "$methodName" in controller "$controllerName"'); switch (type) {
case 'int':
this.defaultValue = int.tryParse(defaultValue);
break;
case 'bool':
this.defaultValue = defaultValue == 'true';
break;
case 'string':
this.defaultValue = defaultValue.substring(1, defaultValue.length - 1);
break;
case 'array':
break;
default:
throw Exception('Unknown way to parse default value for type "$type"');
} }
} }
} }
@ -38,7 +55,7 @@ class MethodParameter {
String? type; String? type;
bool nullable; bool nullable;
final String name; final String name;
final String? defaultValue; dynamic defaultValue;
final String? description; final String? description;
final String controllerName; final String controllerName;
@ -49,15 +66,18 @@ class MethodParameter {
if (type == 'string') { if (type == 'string') {
return 'string'; return 'string';
} }
if (type == 'int') { if (type == 'int' || type == 'integer') {
return 'integer'; return 'integer';
} }
if (type == 'bool') { if (type == 'bool' || type == 'boolean') {
return 'boolean'; return 'boolean';
} }
if (type == 'array') {
return 'array';
}
print( throw Exception(
'WARNING: Could not infer OpenAPI type from type "$type" for parameter "$name" of method "$methodName" in controller "$controllerName"', 'Could not infer OpenAPI type from type "$type" for parameter "$name" of method "$methodName" in controller "$controllerName"',
); );
} }
return null; return null;

9
packages/spec_templates/lib/openapi_spec.dart

@ -184,11 +184,17 @@ class Parameter {
class Operation { class Operation {
Operation({ Operation({
required this.responses, required this.responses,
this.parameters,
this.operationID, this.operationID,
}); });
Map<String, dynamic> toMap() => { Map<String, dynamic> toMap() => {
if (operationID != null) 'operationId': operationID, if (operationID != null) ...{
'operationId': operationID,
},
if (parameters != null) ...{
'parameters': parameters!.map((final p) => p.toMap()).toList(),
},
'responses': responses.map( 'responses': responses.map(
(final key, final value) => MapEntry( (final key, final value) => MapEntry(
key.toString(), key.toString(),
@ -198,6 +204,7 @@ class Operation {
}; };
final Map<dynamic, Response> responses; final Map<dynamic, Response> responses;
final List<Parameter>? parameters;
final String? operationID; final String? operationID;
} }

829
specs/templates/core.json

File diff suppressed because it is too large Load Diff

662
specs/templates/news.json

@ -53,6 +53,24 @@
}, },
"post": { "post": {
"operationId": "folder-create-TODO", "operationId": "folder-create-TODO",
"parameters": [
{
"name": "folderName",
"in": "query",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "parent",
"in": "query",
"required": false,
"schema": {
"type": "integer"
}
}
],
"responses": { "responses": {
"200": { "200": {
"description": "", "description": "",
@ -135,6 +153,17 @@
], ],
"post": { "post": {
"operationId": "folder-rename-TODO", "operationId": "folder-rename-TODO",
"parameters": [
{
"name": "folderName",
"in": "query",
"description": "The new name of the folder",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": { "responses": {
"200": { "200": {
"description": "", "description": "",
@ -162,6 +191,16 @@
], ],
"post": { "post": {
"operationId": "folder-read-TODO", "operationId": "folder-read-TODO",
"parameters": [
{
"name": "maxItemId",
"in": "query",
"required": true,
"schema": {
"type": "integer"
}
}
],
"responses": { "responses": {
"200": { "200": {
"description": "", "description": "",
@ -189,6 +228,16 @@
], ],
"post": { "post": {
"operationId": "folder-open-TODO", "operationId": "folder-open-TODO",
"parameters": [
{
"name": "open",
"in": "query",
"required": true,
"schema": {
"type": "boolean"
}
}
],
"responses": { "responses": {
"200": { "200": {
"description": "", "description": "",
@ -221,6 +270,57 @@
}, },
"post": { "post": {
"operationId": "feed-create-TODO", "operationId": "feed-create-TODO",
"parameters": [
{
"name": "url",
"in": "query",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "parentFolderId",
"in": "query",
"required": false,
"schema": {
"type": "integer"
}
},
{
"name": "title",
"in": "query",
"required": false,
"schema": {
"type": "string"
}
},
{
"name": "user",
"in": "query",
"required": false,
"schema": {
"type": "string"
}
},
{
"name": "password",
"in": "query",
"required": false,
"schema": {
"type": "string"
}
},
{
"name": "fullDiscover",
"in": "query",
"required": false,
"schema": {
"type": "boolean",
"default": true
}
}
],
"responses": { "responses": {
"200": { "200": {
"description": "", "description": "",
@ -263,6 +363,57 @@
}, },
"patch": { "patch": {
"operationId": "feed-patch-TODO", "operationId": "feed-patch-TODO",
"parameters": [
{
"name": "pinned",
"in": "query",
"required": false,
"schema": {
"type": "boolean"
}
},
{
"name": "fullTextEnabled",
"in": "query",
"required": false,
"schema": {
"type": "boolean"
}
},
{
"name": "updateMode",
"in": "query",
"required": false,
"schema": {
"type": "integer"
}
},
{
"name": "ordering",
"in": "query",
"required": false,
"schema": {
"type": "integer"
}
},
{
"name": "folderId",
"in": "query",
"required": false,
"schema": {
"type": "integer",
"default": -1
}
},
{
"name": "title",
"in": "query",
"required": false,
"schema": {
"type": "string"
}
}
],
"responses": { "responses": {
"200": { "200": {
"description": "", "description": "",
@ -317,6 +468,16 @@
], ],
"post": { "post": {
"operationId": "feed-read-TODO", "operationId": "feed-read-TODO",
"parameters": [
{
"name": "highestItemId",
"in": "query",
"required": true,
"schema": {
"type": "integer"
}
}
],
"responses": { "responses": {
"200": { "200": {
"description": "", "description": "",
@ -378,6 +539,16 @@
"/feeds/import/articles": { "/feeds/import/articles": {
"post": { "post": {
"operationId": "feed-import-TODO", "operationId": "feed-import-TODO",
"parameters": [
{
"name": "json",
"in": "query",
"required": true,
"schema": {
"type": "array"
}
}
],
"responses": { "responses": {
"200": { "200": {
"description": "", "description": "",
@ -395,6 +566,69 @@
"/items": { "/items": {
"get": { "get": {
"operationId": "item-index-TODO", "operationId": "item-index-TODO",
"parameters": [
{
"name": "type",
"in": "query",
"required": false,
"schema": {
"type": "integer",
"default": 3
}
},
{
"name": "id",
"in": "query",
"required": false,
"schema": {
"type": "integer",
"default": 0
}
},
{
"name": "limit",
"in": "query",
"required": false,
"schema": {
"type": "integer",
"default": 50
}
},
{
"name": "offset",
"in": "query",
"required": false,
"schema": {
"type": "integer",
"default": 0
}
},
{
"name": "showAll",
"in": "query",
"required": false,
"schema": {
"type": "boolean"
}
},
{
"name": "oldestFirst",
"in": "query",
"required": false,
"schema": {
"type": "boolean"
}
},
{
"name": "search",
"in": "query",
"required": false,
"schema": {
"type": "string",
"default": ""
}
}
],
"responses": { "responses": {
"200": { "200": {
"description": "", "description": "",
@ -412,6 +646,33 @@
"/items/new": { "/items/new": {
"get": { "get": {
"operationId": "item-new_items-TODO", "operationId": "item-new_items-TODO",
"parameters": [
{
"name": "type",
"in": "query",
"required": true,
"schema": {
"type": "integer"
}
},
{
"name": "id",
"in": "query",
"required": true,
"schema": {
"type": "integer"
}
},
{
"name": "lastModified",
"in": "query",
"required": false,
"schema": {
"type": "integer",
"default": 0
}
}
],
"responses": { "responses": {
"200": { "200": {
"description": "", "description": "",
@ -429,6 +690,16 @@
"/items/read": { "/items/read": {
"post": { "post": {
"operationId": "item-readall-TODO", "operationId": "item-readall-TODO",
"parameters": [
{
"name": "highestItemId",
"in": "query",
"required": true,
"schema": {
"type": "integer"
}
}
],
"responses": { "responses": {
"200": { "200": {
"description": "", "description": "",
@ -456,6 +727,17 @@
], ],
"post": { "post": {
"operationId": "item-read-TODO", "operationId": "item-read-TODO",
"parameters": [
{
"name": "isRead",
"in": "query",
"required": false,
"schema": {
"type": "boolean",
"default": true
}
}
],
"responses": { "responses": {
"200": { "200": {
"description": "", "description": "",
@ -473,6 +755,17 @@
"/items/read/multiple": { "/items/read/multiple": {
"post": { "post": {
"operationId": "item-read_multiple-TODO", "operationId": "item-read_multiple-TODO",
"parameters": [
{
"name": "itemIds",
"in": "query",
"description": "item ids",
"required": true,
"schema": {
"type": "array"
}
}
],
"responses": { "responses": {
"200": { "200": {
"description": "", "description": "",
@ -508,6 +801,16 @@
], ],
"post": { "post": {
"operationId": "item-star-TODO", "operationId": "item-star-TODO",
"parameters": [
{
"name": "isStarred",
"in": "query",
"required": true,
"schema": {
"type": "boolean"
}
}
],
"responses": { "responses": {
"200": { "200": {
"description": "", "description": "",
@ -746,6 +1049,16 @@
}, },
"post": { "post": {
"operationId": "folder_api-create-TODO", "operationId": "folder_api-create-TODO",
"parameters": [
{
"name": "name",
"in": "query",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": { "responses": {
"200": { "200": {
"description": "", "description": "",
@ -781,6 +1094,16 @@
], ],
"put": { "put": {
"operationId": "folder_api-update-TODO", "operationId": "folder_api-update-TODO",
"parameters": [
{
"name": "name",
"in": "query",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": { "responses": {
"200": { "200": {
"description": "", "description": "",
@ -832,6 +1155,17 @@
], ],
"post": { "post": {
"operationId": "folder_api-read-TODO", "operationId": "folder_api-read-TODO",
"parameters": [
{
"name": "newestItemId",
"in": "query",
"description": "The newest read item",
"required": true,
"schema": {
"type": "integer"
}
}
],
"responses": { "responses": {
"200": { "200": {
"description": "", "description": "",
@ -860,6 +1194,17 @@
], ],
"put": { "put": {
"operationId": "folder_api-read-TODO", "operationId": "folder_api-read-TODO",
"parameters": [
{
"name": "newestItemId",
"in": "query",
"description": "The newest read item",
"required": true,
"schema": {
"type": "integer"
}
}
],
"responses": { "responses": {
"200": { "200": {
"description": "", "description": "",
@ -902,6 +1247,24 @@
}, },
"post": { "post": {
"operationId": "feed_api-create-TODO", "operationId": "feed_api-create-TODO",
"parameters": [
{
"name": "url",
"in": "query",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "folderId",
"in": "query",
"required": false,
"schema": {
"type": "integer"
}
}
],
"responses": { "responses": {
"200": { "200": {
"description": "", "description": "",
@ -937,6 +1300,16 @@
], ],
"put": { "put": {
"operationId": "feed_api-update-TODO", "operationId": "feed_api-update-TODO",
"parameters": [
{
"name": "userId",
"in": "query",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": { "responses": {
"200": { "200": {
"description": "", "description": "",
@ -1014,6 +1387,16 @@
], ],
"post": { "post": {
"operationId": "feed_api-move-TODO", "operationId": "feed_api-move-TODO",
"parameters": [
{
"name": "folderId",
"in": "query",
"required": false,
"schema": {
"type": "integer"
}
}
],
"responses": { "responses": {
"200": { "200": {
"description": "", "description": "",
@ -1041,6 +1424,16 @@
], ],
"put": { "put": {
"operationId": "feed_api-move-TODO", "operationId": "feed_api-move-TODO",
"parameters": [
{
"name": "folderId",
"in": "query",
"required": false,
"schema": {
"type": "integer"
}
}
],
"responses": { "responses": {
"200": { "200": {
"description": "", "description": "",
@ -1076,6 +1469,16 @@
], ],
"post": { "post": {
"operationId": "feed_api-rename-TODO", "operationId": "feed_api-rename-TODO",
"parameters": [
{
"name": "feedTitle",
"in": "query",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": { "responses": {
"200": { "200": {
"description": "", "description": "",
@ -1103,6 +1506,16 @@
], ],
"put": { "put": {
"operationId": "feed_api-rename-TODO", "operationId": "feed_api-rename-TODO",
"parameters": [
{
"name": "feedTitle",
"in": "query",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": { "responses": {
"200": { "200": {
"description": "", "description": "",
@ -1138,6 +1551,16 @@
], ],
"post": { "post": {
"operationId": "feed_api-read-TODO", "operationId": "feed_api-read-TODO",
"parameters": [
{
"name": "newestItemId",
"in": "query",
"required": true,
"schema": {
"type": "integer"
}
}
],
"responses": { "responses": {
"200": { "200": {
"description": "", "description": "",
@ -1165,6 +1588,16 @@
], ],
"put": { "put": {
"operationId": "feed_api-read-TODO", "operationId": "feed_api-read-TODO",
"parameters": [
{
"name": "newestItemId",
"in": "query",
"required": true,
"schema": {
"type": "integer"
}
}
],
"responses": { "responses": {
"200": { "200": {
"description": "", "description": "",
@ -1192,6 +1625,24 @@
], ],
"get": { "get": {
"operationId": "feed_api-update-TODO", "operationId": "feed_api-update-TODO",
"parameters": [
{
"name": "userId",
"in": "query",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "feedId",
"in": "query",
"required": true,
"schema": {
"type": "integer"
}
}
],
"responses": { "responses": {
"200": { "200": {
"description": "", "description": "",
@ -1219,6 +1670,62 @@
], ],
"get": { "get": {
"operationId": "item_api-index-TODO", "operationId": "item_api-index-TODO",
"parameters": [
{
"name": "type",
"in": "query",
"required": false,
"schema": {
"type": "integer",
"default": 3
}
},
{
"name": "id",
"in": "query",
"required": false,
"schema": {
"type": "integer",
"default": 0
}
},
{
"name": "getRead",
"in": "query",
"required": false,
"schema": {
"type": "boolean",
"default": true
}
},
{
"name": "batchSize",
"in": "query",
"required": false,
"schema": {
"type": "integer",
"default": -1
}
},
{
"name": "offset",
"in": "query",
"required": false,
"schema": {
"type": "integer",
"default": 0
}
},
{
"name": "oldestFirst",
"in": "query",
"required": false,
"schema": {
"type": "boolean",
"default": false
}
}
],
"responses": { "responses": {
"200": { "200": {
"description": "", "description": "",
@ -1246,6 +1753,35 @@
], ],
"get": { "get": {
"operationId": "item_api-updated-TODO", "operationId": "item_api-updated-TODO",
"parameters": [
{
"name": "type",
"in": "query",
"required": false,
"schema": {
"type": "integer",
"default": 3
}
},
{
"name": "id",
"in": "query",
"required": false,
"schema": {
"type": "integer",
"default": 0
}
},
{
"name": "lastModified",
"in": "query",
"required": false,
"schema": {
"type": "integer",
"default": 0
}
}
],
"responses": { "responses": {
"200": { "200": {
"description": "", "description": "",
@ -1397,6 +1933,16 @@
], ],
"post": { "post": {
"operationId": "item_api-read_all-TODO", "operationId": "item_api-read_all-TODO",
"parameters": [
{
"name": "newestItemId",
"in": "query",
"required": true,
"schema": {
"type": "integer"
}
}
],
"responses": { "responses": {
"200": { "200": {
"description": "", "description": "",
@ -1414,6 +1960,16 @@
"/api/v1-2/items/read": { "/api/v1-2/items/read": {
"put": { "put": {
"operationId": "item_api-read_all-TODO", "operationId": "item_api-read_all-TODO",
"parameters": [
{
"name": "newestItemId",
"in": "query",
"required": true,
"schema": {
"type": "integer"
}
}
],
"responses": { "responses": {
"200": { "200": {
"description": "", "description": "",
@ -1441,6 +1997,17 @@
], ],
"post": { "post": {
"operationId": "item_api-read_multiple_by_ids-TODO", "operationId": "item_api-read_multiple_by_ids-TODO",
"parameters": [
{
"name": "itemIds",
"in": "query",
"description": "item ids",
"required": true,
"schema": {
"type": "array"
}
}
],
"responses": { "responses": {
"200": { "200": {
"description": "", "description": "",
@ -1458,6 +2025,17 @@
"/api/v1-2/items/read/multiple": { "/api/v1-2/items/read/multiple": {
"put": { "put": {
"operationId": "item_api-read_multiple-TODO", "operationId": "item_api-read_multiple-TODO",
"parameters": [
{
"name": "items",
"in": "query",
"description": "item ids",
"required": true,
"schema": {
"type": "array"
}
}
],
"responses": { "responses": {
"200": { "200": {
"description": "", "description": "",
@ -1485,6 +2063,17 @@
], ],
"post": { "post": {
"operationId": "item_api-unread_multiple_by_ids-TODO", "operationId": "item_api-unread_multiple_by_ids-TODO",
"parameters": [
{
"name": "itemIds",
"in": "query",
"description": "item ids",
"required": true,
"schema": {
"type": "array"
}
}
],
"responses": { "responses": {
"200": { "200": {
"description": "", "description": "",
@ -1502,6 +2091,17 @@
"/api/v1-2/items/unread/multiple": { "/api/v1-2/items/unread/multiple": {
"put": { "put": {
"operationId": "item_api-unread_multiple-TODO", "operationId": "item_api-unread_multiple-TODO",
"parameters": [
{
"name": "items",
"in": "query",
"description": "item ids",
"required": true,
"schema": {
"type": "array"
}
}
],
"responses": { "responses": {
"200": { "200": {
"description": "", "description": "",
@ -1669,6 +2269,16 @@
], ],
"post": { "post": {
"operationId": "item_api-star_multiple_by_item_ids-TODO", "operationId": "item_api-star_multiple_by_item_ids-TODO",
"parameters": [
{
"name": "itemIds",
"in": "query",
"required": true,
"schema": {
"type": "array"
}
}
],
"responses": { "responses": {
"200": { "200": {
"description": "", "description": "",
@ -1686,6 +2296,17 @@
"/api/v1-2/items/star/multiple": { "/api/v1-2/items/star/multiple": {
"put": { "put": {
"operationId": "item_api-star_multiple-TODO", "operationId": "item_api-star_multiple-TODO",
"parameters": [
{
"name": "items",
"in": "query",
"description": "items",
"required": true,
"schema": {
"type": "array"
}
}
],
"responses": { "responses": {
"200": { "200": {
"description": "", "description": "",
@ -1713,6 +2334,16 @@
], ],
"post": { "post": {
"operationId": "item_api-unstar_multiple_by_item_ids-TODO", "operationId": "item_api-unstar_multiple_by_item_ids-TODO",
"parameters": [
{
"name": "itemIds",
"in": "query",
"required": true,
"schema": {
"type": "array"
}
}
],
"responses": { "responses": {
"200": { "200": {
"description": "", "description": "",
@ -1730,6 +2361,17 @@
"/api/v1-2/items/unstar/multiple": { "/api/v1-2/items/unstar/multiple": {
"put": { "put": {
"operationId": "item_api-unstar_multiple-TODO", "operationId": "item_api-unstar_multiple-TODO",
"parameters": [
{
"name": "items",
"in": "query",
"description": "items",
"required": true,
"schema": {
"type": "array"
}
}
],
"responses": { "responses": {
"200": { "200": {
"description": "", "description": "",
@ -1747,6 +2389,16 @@
"/api/v2/folders": { "/api/v2/folders": {
"post": { "post": {
"operationId": "folder_api_v2-create-TODO", "operationId": "folder_api_v2-create-TODO",
"parameters": [
{
"name": "name",
"in": "query",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": { "responses": {
"200": { "200": {
"description": "", "description": "",
@ -1789,6 +2441,16 @@
}, },
"patch": { "patch": {
"operationId": "folder_api_v2-update-TODO", "operationId": "folder_api_v2-update-TODO",
"parameters": [
{
"name": "name",
"in": "query",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": { "responses": {
"200": { "200": {
"description": "", "description": "",

270
specs/templates/notes.json

@ -38,6 +38,17 @@
"/notes": { "/notes": {
"get": { "get": {
"operationId": "notes-index-TODO", "operationId": "notes-index-TODO",
"parameters": [
{
"name": "pruneBefore",
"in": "query",
"required": false,
"schema": {
"type": "integer",
"default": 0
}
}
],
"responses": { "responses": {
"200": { "200": {
"description": "", "description": "",
@ -53,6 +64,16 @@
}, },
"post": { "post": {
"operationId": "notes-create-TODO", "operationId": "notes-create-TODO",
"parameters": [
{
"name": "category",
"in": "query",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": { "responses": {
"200": { "200": {
"description": "", "description": "",
@ -112,6 +133,16 @@
}, },
"put": { "put": {
"operationId": "notes-update-TODO", "operationId": "notes-update-TODO",
"parameters": [
{
"name": "content",
"in": "query",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": { "responses": {
"200": { "200": {
"description": "", "description": "",
@ -144,6 +175,56 @@
"/notes/undo": { "/notes/undo": {
"post": { "post": {
"operationId": "notes-undo-TODO", "operationId": "notes-undo-TODO",
"parameters": [
{
"name": "id",
"in": "query",
"required": true,
"schema": {
"type": "integer"
}
},
{
"name": "title",
"in": "query",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "content",
"in": "query",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "category",
"in": "query",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "modified",
"in": "query",
"required": true,
"schema": {
"type": "integer"
}
},
{
"name": "favorite",
"in": "query",
"required": true,
"schema": {
"type": "boolean"
}
}
],
"responses": { "responses": {
"200": { "200": {
"description": "", "description": "",
@ -206,6 +287,40 @@
], ],
"put": { "put": {
"operationId": "notes-updateproperty-TODO", "operationId": "notes-updateproperty-TODO",
"parameters": [
{
"name": "modified",
"in": "query",
"required": false,
"schema": {
"type": "integer"
}
},
{
"name": "title",
"in": "query",
"required": false,
"schema": {
"type": "string"
}
},
{
"name": "category",
"in": "query",
"required": false,
"schema": {
"type": "string"
}
},
{
"name": "favorite",
"in": "query",
"required": false,
"schema": {
"type": "boolean"
}
}
],
"responses": { "responses": {
"200": { "200": {
"description": "", "description": "",
@ -233,6 +348,16 @@
], ],
"get": { "get": {
"operationId": "notes-getattachment-TODO", "operationId": "notes-getattachment-TODO",
"parameters": [
{
"name": "path",
"in": "query",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": { "responses": {
"200": { "200": {
"description": "", "description": "",
@ -307,6 +432,51 @@
], ],
"get": { "get": {
"operationId": "notes_api-index-TODO", "operationId": "notes_api-index-TODO",
"parameters": [
{
"name": "category",
"in": "query",
"required": false,
"schema": {
"type": "string"
}
},
{
"name": "exclude",
"in": "query",
"required": false,
"schema": {
"type": "string",
"default": ""
}
},
{
"name": "pruneBefore",
"in": "query",
"required": false,
"schema": {
"type": "integer",
"default": 0
}
},
{
"name": "chunkSize",
"in": "query",
"required": false,
"schema": {
"type": "integer",
"default": 0
}
},
{
"name": "chunkCursor",
"in": "query",
"required": false,
"schema": {
"type": "string"
}
}
],
"responses": { "responses": {
"200": { "200": {
"description": "", "description": "",
@ -322,6 +492,53 @@
}, },
"post": { "post": {
"operationId": "notes_api-create-TODO", "operationId": "notes_api-create-TODO",
"parameters": [
{
"name": "category",
"in": "query",
"required": false,
"schema": {
"type": "string",
"default": ""
}
},
{
"name": "title",
"in": "query",
"required": false,
"schema": {
"type": "string",
"default": ""
}
},
{
"name": "content",
"in": "query",
"required": false,
"schema": {
"type": "string",
"default": ""
}
},
{
"name": "modified",
"in": "query",
"required": false,
"schema": {
"type": "integer",
"default": 0
}
},
{
"name": "favorite",
"in": "query",
"required": false,
"schema": {
"type": "boolean",
"default": false
}
}
],
"responses": { "responses": {
"200": { "200": {
"description": "", "description": "",
@ -357,6 +574,17 @@
], ],
"get": { "get": {
"operationId": "notes_api-get-TODO", "operationId": "notes_api-get-TODO",
"parameters": [
{
"name": "exclude",
"in": "query",
"required": false,
"schema": {
"type": "string",
"default": ""
}
}
],
"responses": { "responses": {
"200": { "200": {
"description": "", "description": "",
@ -372,6 +600,48 @@
}, },
"put": { "put": {
"operationId": "notes_api-update-TODO", "operationId": "notes_api-update-TODO",
"parameters": [
{
"name": "content",
"in": "query",
"required": false,
"schema": {
"type": "string"
}
},
{
"name": "modified",
"in": "query",
"required": false,
"schema": {
"type": "integer"
}
},
{
"name": "title",
"in": "query",
"required": false,
"schema": {
"type": "string"
}
},
{
"name": "category",
"in": "query",
"required": false,
"schema": {
"type": "string"
}
},
{
"name": "favorite",
"in": "query",
"required": false,
"schema": {
"type": "boolean"
}
}
],
"responses": { "responses": {
"200": { "200": {
"description": "", "description": "",

71
specs/templates/notifications.json

@ -140,6 +140,32 @@
], ],
"post": { "post": {
"operationId": "push-registerdevice-TODO", "operationId": "push-registerdevice-TODO",
"parameters": [
{
"name": "pushTokenHash",
"in": "query",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "devicePublicKey",
"in": "query",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "proxyServer",
"in": "query",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": { "responses": {
"200": { "200": {
"description": "", "description": "",
@ -190,6 +216,25 @@
], ],
"post": { "post": {
"operationId": "api-generatenotification-TODO", "operationId": "api-generatenotification-TODO",
"parameters": [
{
"name": "shortMessage",
"in": "query",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "longMessage",
"in": "query",
"required": false,
"schema": {
"type": "string",
"default": ""
}
}
],
"responses": { "responses": {
"200": { "200": {
"description": "", "description": "",
@ -217,6 +262,32 @@
], ],
"post": { "post": {
"operationId": "settings-personal-TODO", "operationId": "settings-personal-TODO",
"parameters": [
{
"name": "batchSetting",
"in": "query",
"required": true,
"schema": {
"type": "integer"
}
},
{
"name": "soundNotification",
"in": "query",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "soundTalk",
"in": "query",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": { "responses": {
"200": { "200": {
"description": "", "description": "",

374
specs/templates/provisioning_api.json

@ -38,6 +38,16 @@
"/ocs/v1.php/apps/provisioning_api/apps": { "/ocs/v1.php/apps/provisioning_api/apps": {
"get": { "get": {
"operationId": "apps-getapps-TODO", "operationId": "apps-getapps-TODO",
"parameters": [
{
"name": "filter",
"in": "query",
"required": false,
"schema": {
"type": "string"
}
}
],
"responses": { "responses": {
"200": { "200": {
"description": "", "description": "",
@ -112,6 +122,34 @@
"/ocs/v1.php/apps/provisioning_api/groups": { "/ocs/v1.php/apps/provisioning_api/groups": {
"get": { "get": {
"operationId": "groups-getgroups-TODO", "operationId": "groups-getgroups-TODO",
"parameters": [
{
"name": "search",
"in": "query",
"required": false,
"schema": {
"type": "string",
"default": ""
}
},
{
"name": "limit",
"in": "query",
"required": false,
"schema": {
"type": "integer"
}
},
{
"name": "offset",
"in": "query",
"required": false,
"schema": {
"type": "integer",
"default": 0
}
}
],
"responses": { "responses": {
"200": { "200": {
"description": "", "description": "",
@ -127,6 +165,25 @@
}, },
"post": { "post": {
"operationId": "groups-addgroup-TODO", "operationId": "groups-addgroup-TODO",
"parameters": [
{
"name": "groupid",
"in": "query",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "displayname",
"in": "query",
"required": false,
"schema": {
"type": "string",
"default": ""
}
}
],
"responses": { "responses": {
"200": { "200": {
"description": "", "description": "",
@ -144,6 +201,34 @@
"/ocs/v1.php/apps/provisioning_api/groups/details": { "/ocs/v1.php/apps/provisioning_api/groups/details": {
"get": { "get": {
"operationId": "groups-getgroupsdetails-TODO", "operationId": "groups-getgroupsdetails-TODO",
"parameters": [
{
"name": "search",
"in": "query",
"required": false,
"schema": {
"type": "string",
"default": ""
}
},
{
"name": "limit",
"in": "query",
"required": false,
"schema": {
"type": "integer"
}
},
{
"name": "offset",
"in": "query",
"required": false,
"schema": {
"type": "integer",
"default": 0
}
}
],
"responses": { "responses": {
"200": { "200": {
"description": "", "description": "",
@ -198,6 +283,34 @@
], ],
"get": { "get": {
"operationId": "groups-getgroupusersdetails-TODO", "operationId": "groups-getgroupusersdetails-TODO",
"parameters": [
{
"name": "search",
"in": "query",
"required": false,
"schema": {
"type": "string",
"default": ""
}
},
{
"name": "limit",
"in": "query",
"required": false,
"schema": {
"type": "integer"
}
},
{
"name": "offset",
"in": "query",
"required": false,
"schema": {
"type": "integer",
"default": 0
}
}
],
"responses": { "responses": {
"200": { "200": {
"description": "", "description": "",
@ -267,6 +380,24 @@
}, },
"put": { "put": {
"operationId": "groups-updategroup-TODO", "operationId": "groups-updategroup-TODO",
"parameters": [
{
"name": "key",
"in": "query",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "value",
"in": "query",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": { "responses": {
"200": { "200": {
"description": "", "description": "",
@ -299,6 +430,34 @@
"/ocs/v1.php/apps/provisioning_api/users": { "/ocs/v1.php/apps/provisioning_api/users": {
"get": { "get": {
"operationId": "users-getusers-TODO", "operationId": "users-getusers-TODO",
"parameters": [
{
"name": "search",
"in": "query",
"required": false,
"schema": {
"type": "string",
"default": ""
}
},
{
"name": "limit",
"in": "query",
"required": false,
"schema": {
"type": "integer"
}
},
{
"name": "offset",
"in": "query",
"required": false,
"schema": {
"type": "integer",
"default": 0
}
}
],
"responses": { "responses": {
"200": { "200": {
"description": "", "description": "",
@ -314,6 +473,77 @@
}, },
"post": { "post": {
"operationId": "users-adduser-TODO", "operationId": "users-adduser-TODO",
"parameters": [
{
"name": "userid",
"in": "query",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "password",
"in": "query",
"required": false,
"schema": {
"type": "string",
"default": ""
}
},
{
"name": "displayName",
"in": "query",
"required": false,
"schema": {
"type": "string",
"default": ""
}
},
{
"name": "email",
"in": "query",
"required": false,
"schema": {
"type": "string",
"default": ""
}
},
{
"name": "groups",
"in": "query",
"required": true,
"schema": {
"type": "array"
}
},
{
"name": "subadmin",
"in": "query",
"required": true,
"schema": {
"type": "array"
}
},
{
"name": "quota",
"in": "query",
"required": false,
"schema": {
"type": "string",
"default": ""
}
},
{
"name": "language",
"in": "query",
"required": false,
"schema": {
"type": "string",
"default": ""
}
}
],
"responses": { "responses": {
"200": { "200": {
"description": "", "description": "",
@ -331,6 +561,34 @@
"/ocs/v1.php/apps/provisioning_api/users/details": { "/ocs/v1.php/apps/provisioning_api/users/details": {
"get": { "get": {
"operationId": "users-getusersdetails-TODO", "operationId": "users-getusersdetails-TODO",
"parameters": [
{
"name": "search",
"in": "query",
"required": false,
"schema": {
"type": "string",
"default": ""
}
},
{
"name": "limit",
"in": "query",
"required": false,
"schema": {
"type": "integer"
}
},
{
"name": "offset",
"in": "query",
"required": false,
"schema": {
"type": "integer",
"default": 0
}
}
],
"responses": { "responses": {
"200": { "200": {
"description": "", "description": "",
@ -348,6 +606,24 @@
"/ocs/v1.php/apps/provisioning_api/users/search/by-phone": { "/ocs/v1.php/apps/provisioning_api/users/search/by-phone": {
"post": { "post": {
"operationId": "users-searchbyphonenumbers-TODO", "operationId": "users-searchbyphonenumbers-TODO",
"parameters": [
{
"name": "location",
"in": "query",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "search",
"in": "query",
"required": true,
"schema": {
"type": "array"
}
}
],
"responses": { "responses": {
"200": { "200": {
"description": "", "description": "",
@ -390,6 +666,24 @@
}, },
"put": { "put": {
"operationId": "users-edituser-TODO", "operationId": "users-edituser-TODO",
"parameters": [
{
"name": "key",
"in": "query",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "value",
"in": "query",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": { "responses": {
"200": { "200": {
"description": "", "description": "",
@ -501,6 +795,24 @@
], ],
"put": { "put": {
"operationId": "users-editusermultivalue-TODO", "operationId": "users-editusermultivalue-TODO",
"parameters": [
{
"name": "key",
"in": "query",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "value",
"in": "query",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": { "responses": {
"200": { "200": {
"description": "", "description": "",
@ -624,6 +936,17 @@
}, },
"post": { "post": {
"operationId": "users-addtogroup-TODO", "operationId": "users-addtogroup-TODO",
"parameters": [
{
"name": "groupid",
"in": "query",
"required": false,
"schema": {
"type": "string",
"default": ""
}
}
],
"responses": { "responses": {
"200": { "200": {
"description": "", "description": "",
@ -639,6 +962,16 @@
}, },
"delete": { "delete": {
"operationId": "users-removefromgroup-TODO", "operationId": "users-removefromgroup-TODO",
"parameters": [
{
"name": "groupid",
"in": "query",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": { "responses": {
"200": { "200": {
"description": "", "description": "",
@ -681,6 +1014,16 @@
}, },
"post": { "post": {
"operationId": "users-addsubadmin-TODO", "operationId": "users-addsubadmin-TODO",
"parameters": [
{
"name": "groupid",
"in": "query",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": { "responses": {
"200": { "200": {
"description": "", "description": "",
@ -696,6 +1039,16 @@
}, },
"delete": { "delete": {
"operationId": "users-removesubadmin-TODO", "operationId": "users-removesubadmin-TODO",
"parameters": [
{
"name": "groupid",
"in": "query",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": { "responses": {
"200": { "200": {
"description": "", "description": "",
@ -802,6 +1155,17 @@
], ],
"get": { "get": {
"operationId": "appconfig-getvalue-TODO", "operationId": "appconfig-getvalue-TODO",
"parameters": [
{
"name": "defaultValue",
"in": "query",
"required": false,
"schema": {
"type": "string",
"default": ""
}
}
],
"responses": { "responses": {
"200": { "200": {
"description": "", "description": "",
@ -817,6 +1181,16 @@
}, },
"post": { "post": {
"operationId": "appconfig-setvalue-TODO", "operationId": "appconfig-setvalue-TODO",
"parameters": [
{
"name": "value",
"in": "query",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": { "responses": {
"200": { "200": {
"description": "", "description": "",

82
specs/templates/user_status.json

@ -38,6 +38,24 @@
"/ocs/v1.php/apps/user_status/api/v1/statuses": { "/ocs/v1.php/apps/user_status/api/v1/statuses": {
"get": { "get": {
"operationId": "statuses-findall-TODO", "operationId": "statuses-findall-TODO",
"parameters": [
{
"name": "limit",
"in": "query",
"required": false,
"schema": {
"type": "integer"
}
},
{
"name": "offset",
"in": "query",
"required": false,
"schema": {
"type": "integer"
}
}
],
"responses": { "responses": {
"200": { "200": {
"description": "", "description": "",
@ -99,6 +117,16 @@
"/ocs/v1.php/apps/user_status/api/v1/user_status/status": { "/ocs/v1.php/apps/user_status/api/v1/user_status/status": {
"put": { "put": {
"operationId": "userstatus-setstatus-TODO", "operationId": "userstatus-setstatus-TODO",
"parameters": [
{
"name": "statusType",
"in": "query",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": { "responses": {
"200": { "200": {
"description": "", "description": "",
@ -116,6 +144,24 @@
"/ocs/v1.php/apps/user_status/api/v1/user_status/message/predefined": { "/ocs/v1.php/apps/user_status/api/v1/user_status/message/predefined": {
"put": { "put": {
"operationId": "userstatus-setpredefinedmessage-TODO", "operationId": "userstatus-setpredefinedmessage-TODO",
"parameters": [
{
"name": "messageId",
"in": "query",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "clearAt",
"in": "query",
"required": false,
"schema": {
"type": "integer"
}
}
],
"responses": { "responses": {
"200": { "200": {
"description": "", "description": "",
@ -133,6 +179,32 @@
"/ocs/v1.php/apps/user_status/api/v1/user_status/message/custom": { "/ocs/v1.php/apps/user_status/api/v1/user_status/message/custom": {
"put": { "put": {
"operationId": "userstatus-setcustommessage-TODO", "operationId": "userstatus-setcustommessage-TODO",
"parameters": [
{
"name": "statusIcon",
"in": "query",
"required": false,
"schema": {
"type": "string"
}
},
{
"name": "message",
"in": "query",
"required": false,
"schema": {
"type": "string"
}
},
{
"name": "clearAt",
"in": "query",
"required": false,
"schema": {
"type": "integer"
}
}
],
"responses": { "responses": {
"200": { "200": {
"description": "", "description": "",
@ -184,6 +256,16 @@
"/apps/user_status/heartbeat": { "/apps/user_status/heartbeat": {
"put": { "put": {
"operationId": "heartbeat-heartbeat-TODO", "operationId": "heartbeat-heartbeat-TODO",
"parameters": [
{
"name": "status",
"in": "query",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": { "responses": {
"200": { "200": {
"description": "", "description": "",

Loading…
Cancel
Save