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\\(([^\\)]*)\\)');
final match = reg.allMatches(controllerContent).single;
final methodParameters = _getMethodParameters(
controllerName,
methodName,
match.group(2)!.split(',').map((final s) => s.trim()).where((final s) => s.isNotEmpty).toList(),
match
final docParameters = <String>[];
var current = '';
for (final docLine in match
.group(1)!
.split('*')
.map((final s) {
@ -139,27 +137,36 @@ Future main(final List<String> args) async {
}
return r;
})
.where((final s) => s.isNotEmpty && s.startsWith('@param'))
.toList(),
);
.where((final s) => s.isNotEmpty)
.toList()) {
if (docLine.startsWith('@')) {
if (current != '') {
docParameters.add(current);
}
}
final operation = Operation(
operationID: '${name.replaceAll('#', '-').toLowerCase()}-TODO',
responses: {
200: Response(
description: '',
content: {
'application/json': MediaType(
schema: {
'type': 'string',
},
),
},
),
},
if (docLine.startsWith('@return')) {
current = '';
break;
}
if (docLine.startsWith('@param')) {
current = docLine;
} else if (current != '') {
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 t = m.group(0)!;
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(
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) {
case 'DELETE':
paths[url]!.delete = operation;
@ -355,8 +424,8 @@ List<MethodParameter> _getMethodParameters(
type = 'string';
continue;
}
print(
'WARNING: Can not determine reliable type for "$docType" for parameter "$name" of method "$methodName" in controller "$controllerName"',
throw Exception(
'Can not determine reliable type for "$docType" for parameter "$name" of method "$methodName" in controller "$controllerName"',
);
} else {
type = nonNullableParts.single;

50
packages/spec_templates/lib/method_parameter.dart

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

9
packages/spec_templates/lib/openapi_spec.dart

@ -184,11 +184,17 @@ class Parameter {
class Operation {
Operation({
required this.responses,
this.parameters,
this.operationID,
});
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(
(final key, final value) => MapEntry(
key.toString(),
@ -198,6 +204,7 @@ class Operation {
};
final Map<dynamic, Response> responses;
final List<Parameter>? parameters;
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": {
"operationId": "folder-create-TODO",
"parameters": [
{
"name": "folderName",
"in": "query",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "parent",
"in": "query",
"required": false,
"schema": {
"type": "integer"
}
}
],
"responses": {
"200": {
"description": "",
@ -135,6 +153,17 @@
],
"post": {
"operationId": "folder-rename-TODO",
"parameters": [
{
"name": "folderName",
"in": "query",
"description": "The new name of the folder",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "",
@ -162,6 +191,16 @@
],
"post": {
"operationId": "folder-read-TODO",
"parameters": [
{
"name": "maxItemId",
"in": "query",
"required": true,
"schema": {
"type": "integer"
}
}
],
"responses": {
"200": {
"description": "",
@ -189,6 +228,16 @@
],
"post": {
"operationId": "folder-open-TODO",
"parameters": [
{
"name": "open",
"in": "query",
"required": true,
"schema": {
"type": "boolean"
}
}
],
"responses": {
"200": {
"description": "",
@ -221,6 +270,57 @@
},
"post": {
"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": {
"200": {
"description": "",
@ -263,6 +363,57 @@
},
"patch": {
"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": {
"200": {
"description": "",
@ -317,6 +468,16 @@
],
"post": {
"operationId": "feed-read-TODO",
"parameters": [
{
"name": "highestItemId",
"in": "query",
"required": true,
"schema": {
"type": "integer"
}
}
],
"responses": {
"200": {
"description": "",
@ -378,6 +539,16 @@
"/feeds/import/articles": {
"post": {
"operationId": "feed-import-TODO",
"parameters": [
{
"name": "json",
"in": "query",
"required": true,
"schema": {
"type": "array"
}
}
],
"responses": {
"200": {
"description": "",
@ -395,6 +566,69 @@
"/items": {
"get": {
"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": {
"200": {
"description": "",
@ -412,6 +646,33 @@
"/items/new": {
"get": {
"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": {
"200": {
"description": "",
@ -429,6 +690,16 @@
"/items/read": {
"post": {
"operationId": "item-readall-TODO",
"parameters": [
{
"name": "highestItemId",
"in": "query",
"required": true,
"schema": {
"type": "integer"
}
}
],
"responses": {
"200": {
"description": "",
@ -456,6 +727,17 @@
],
"post": {
"operationId": "item-read-TODO",
"parameters": [
{
"name": "isRead",
"in": "query",
"required": false,
"schema": {
"type": "boolean",
"default": true
}
}
],
"responses": {
"200": {
"description": "",
@ -473,6 +755,17 @@
"/items/read/multiple": {
"post": {
"operationId": "item-read_multiple-TODO",
"parameters": [
{
"name": "itemIds",
"in": "query",
"description": "item ids",
"required": true,
"schema": {
"type": "array"
}
}
],
"responses": {
"200": {
"description": "",
@ -508,6 +801,16 @@
],
"post": {
"operationId": "item-star-TODO",
"parameters": [
{
"name": "isStarred",
"in": "query",
"required": true,
"schema": {
"type": "boolean"
}
}
],
"responses": {
"200": {
"description": "",
@ -746,6 +1049,16 @@
},
"post": {
"operationId": "folder_api-create-TODO",
"parameters": [
{
"name": "name",
"in": "query",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "",
@ -781,6 +1094,16 @@
],
"put": {
"operationId": "folder_api-update-TODO",
"parameters": [
{
"name": "name",
"in": "query",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "",
@ -832,6 +1155,17 @@
],
"post": {
"operationId": "folder_api-read-TODO",
"parameters": [
{
"name": "newestItemId",
"in": "query",
"description": "The newest read item",
"required": true,
"schema": {
"type": "integer"
}
}
],
"responses": {
"200": {
"description": "",
@ -860,6 +1194,17 @@
],
"put": {
"operationId": "folder_api-read-TODO",
"parameters": [
{
"name": "newestItemId",
"in": "query",
"description": "The newest read item",
"required": true,
"schema": {
"type": "integer"
}
}
],
"responses": {
"200": {
"description": "",
@ -902,6 +1247,24 @@
},
"post": {
"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": {
"200": {
"description": "",
@ -937,6 +1300,16 @@
],
"put": {
"operationId": "feed_api-update-TODO",
"parameters": [
{
"name": "userId",
"in": "query",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "",
@ -1014,6 +1387,16 @@
],
"post": {
"operationId": "feed_api-move-TODO",
"parameters": [
{
"name": "folderId",
"in": "query",
"required": false,
"schema": {
"type": "integer"
}
}
],
"responses": {
"200": {
"description": "",
@ -1041,6 +1424,16 @@
],
"put": {
"operationId": "feed_api-move-TODO",
"parameters": [
{
"name": "folderId",
"in": "query",
"required": false,
"schema": {
"type": "integer"
}
}
],
"responses": {
"200": {
"description": "",
@ -1076,6 +1469,16 @@
],
"post": {
"operationId": "feed_api-rename-TODO",
"parameters": [
{
"name": "feedTitle",
"in": "query",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "",
@ -1103,6 +1506,16 @@
],
"put": {
"operationId": "feed_api-rename-TODO",
"parameters": [
{
"name": "feedTitle",
"in": "query",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "",
@ -1138,6 +1551,16 @@
],
"post": {
"operationId": "feed_api-read-TODO",
"parameters": [
{
"name": "newestItemId",
"in": "query",
"required": true,
"schema": {
"type": "integer"
}
}
],
"responses": {
"200": {
"description": "",
@ -1165,6 +1588,16 @@
],
"put": {
"operationId": "feed_api-read-TODO",
"parameters": [
{
"name": "newestItemId",
"in": "query",
"required": true,
"schema": {
"type": "integer"
}
}
],
"responses": {
"200": {
"description": "",
@ -1192,6 +1625,24 @@
],
"get": {
"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": {
"200": {
"description": "",
@ -1219,6 +1670,62 @@
],
"get": {
"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": {
"200": {
"description": "",
@ -1246,6 +1753,35 @@
],
"get": {
"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": {
"200": {
"description": "",
@ -1397,6 +1933,16 @@
],
"post": {
"operationId": "item_api-read_all-TODO",
"parameters": [
{
"name": "newestItemId",
"in": "query",
"required": true,
"schema": {
"type": "integer"
}
}
],
"responses": {
"200": {
"description": "",
@ -1414,6 +1960,16 @@
"/api/v1-2/items/read": {
"put": {
"operationId": "item_api-read_all-TODO",
"parameters": [
{
"name": "newestItemId",
"in": "query",
"required": true,
"schema": {
"type": "integer"
}
}
],
"responses": {
"200": {
"description": "",
@ -1441,6 +1997,17 @@
],
"post": {
"operationId": "item_api-read_multiple_by_ids-TODO",
"parameters": [
{
"name": "itemIds",
"in": "query",
"description": "item ids",
"required": true,
"schema": {
"type": "array"
}
}
],
"responses": {
"200": {
"description": "",
@ -1458,6 +2025,17 @@
"/api/v1-2/items/read/multiple": {
"put": {
"operationId": "item_api-read_multiple-TODO",
"parameters": [
{
"name": "items",
"in": "query",
"description": "item ids",
"required": true,
"schema": {
"type": "array"
}
}
],
"responses": {
"200": {
"description": "",
@ -1485,6 +2063,17 @@
],
"post": {
"operationId": "item_api-unread_multiple_by_ids-TODO",
"parameters": [
{
"name": "itemIds",
"in": "query",
"description": "item ids",
"required": true,
"schema": {
"type": "array"
}
}
],
"responses": {
"200": {
"description": "",
@ -1502,6 +2091,17 @@
"/api/v1-2/items/unread/multiple": {
"put": {
"operationId": "item_api-unread_multiple-TODO",
"parameters": [
{
"name": "items",
"in": "query",
"description": "item ids",
"required": true,
"schema": {
"type": "array"
}
}
],
"responses": {
"200": {
"description": "",
@ -1669,6 +2269,16 @@
],
"post": {
"operationId": "item_api-star_multiple_by_item_ids-TODO",
"parameters": [
{
"name": "itemIds",
"in": "query",
"required": true,
"schema": {
"type": "array"
}
}
],
"responses": {
"200": {
"description": "",
@ -1686,6 +2296,17 @@
"/api/v1-2/items/star/multiple": {
"put": {
"operationId": "item_api-star_multiple-TODO",
"parameters": [
{
"name": "items",
"in": "query",
"description": "items",
"required": true,
"schema": {
"type": "array"
}
}
],
"responses": {
"200": {
"description": "",
@ -1713,6 +2334,16 @@
],
"post": {
"operationId": "item_api-unstar_multiple_by_item_ids-TODO",
"parameters": [
{
"name": "itemIds",
"in": "query",
"required": true,
"schema": {
"type": "array"
}
}
],
"responses": {
"200": {
"description": "",
@ -1730,6 +2361,17 @@
"/api/v1-2/items/unstar/multiple": {
"put": {
"operationId": "item_api-unstar_multiple-TODO",
"parameters": [
{
"name": "items",
"in": "query",
"description": "items",
"required": true,
"schema": {
"type": "array"
}
}
],
"responses": {
"200": {
"description": "",
@ -1747,6 +2389,16 @@
"/api/v2/folders": {
"post": {
"operationId": "folder_api_v2-create-TODO",
"parameters": [
{
"name": "name",
"in": "query",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "",
@ -1789,6 +2441,16 @@
},
"patch": {
"operationId": "folder_api_v2-update-TODO",
"parameters": [
{
"name": "name",
"in": "query",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "",

270
specs/templates/notes.json

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

71
specs/templates/notifications.json

@ -140,6 +140,32 @@
],
"post": {
"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": {
"200": {
"description": "",
@ -190,6 +216,25 @@
],
"post": {
"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": {
"200": {
"description": "",
@ -217,6 +262,32 @@
],
"post": {
"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": {
"200": {
"description": "",

374
specs/templates/provisioning_api.json

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

82
specs/templates/user_status.json

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

Loading…
Cancel
Save