|
|
@ -92,6 +92,7 @@ namespace Squidex.Controllers.ContentApi.Generator |
|
|
GenerateSchemaGetOperation(), |
|
|
GenerateSchemaGetOperation(), |
|
|
GenerateSchemaUpdateOperation(), |
|
|
GenerateSchemaUpdateOperation(), |
|
|
GenerateSchemaPatchOperation(), |
|
|
GenerateSchemaPatchOperation(), |
|
|
|
|
|
GenerateSchemaRestoreOperation(), |
|
|
GenerateSchemaPublishOperation(), |
|
|
GenerateSchemaPublishOperation(), |
|
|
GenerateSchemaUnpublishOperation(), |
|
|
GenerateSchemaUnpublishOperation(), |
|
|
GenerateSchemaDeleteOperation() |
|
|
GenerateSchemaDeleteOperation() |
|
|
@ -109,6 +110,7 @@ namespace Squidex.Controllers.ContentApi.Generator |
|
|
{ |
|
|
{ |
|
|
operation.OperationId = $"Query{schemaKey}Contents"; |
|
|
operation.OperationId = $"Query{schemaKey}Contents"; |
|
|
operation.Summary = $"Queries {schemaName} contents."; |
|
|
operation.Summary = $"Queries {schemaName} contents."; |
|
|
|
|
|
operation.Security = ReaderSecurity; |
|
|
|
|
|
|
|
|
operation.Description = SchemaQueryDescription; |
|
|
operation.Description = SchemaQueryDescription; |
|
|
|
|
|
|
|
|
@ -119,8 +121,6 @@ namespace Squidex.Controllers.ContentApi.Generator |
|
|
operation.AddQueryParameter("orderby", JsonObjectType.String, "Optional OData order definition."); |
|
|
operation.AddQueryParameter("orderby", JsonObjectType.String, "Optional OData order definition."); |
|
|
|
|
|
|
|
|
operation.AddResponse("200", $"{schemaName} content retrieved.", CreateContentsSchema(schemaName, contentSchema)); |
|
|
operation.AddResponse("200", $"{schemaName} content retrieved.", CreateContentsSchema(schemaName, contentSchema)); |
|
|
|
|
|
|
|
|
operation.Security = ReaderSecurity; |
|
|
|
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@ -130,10 +130,9 @@ namespace Squidex.Controllers.ContentApi.Generator |
|
|
{ |
|
|
{ |
|
|
operation.OperationId = $"Get{schemaKey}Content"; |
|
|
operation.OperationId = $"Get{schemaKey}Content"; |
|
|
operation.Summary = $"Get a {schemaName} content."; |
|
|
operation.Summary = $"Get a {schemaName} content."; |
|
|
|
|
|
operation.Security = ReaderSecurity; |
|
|
|
|
|
|
|
|
operation.AddResponse("200", $"{schemaName} content found.", contentSchema); |
|
|
operation.AddResponse("200", $"{schemaName} content found.", contentSchema); |
|
|
|
|
|
|
|
|
operation.Security = ReaderSecurity; |
|
|
|
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@ -143,13 +142,12 @@ namespace Squidex.Controllers.ContentApi.Generator |
|
|
{ |
|
|
{ |
|
|
operation.OperationId = $"Create{schemaKey}Content"; |
|
|
operation.OperationId = $"Create{schemaKey}Content"; |
|
|
operation.Summary = $"Create a {schemaName} content."; |
|
|
operation.Summary = $"Create a {schemaName} content."; |
|
|
|
|
|
operation.Security = EditorSecurity; |
|
|
|
|
|
|
|
|
operation.AddBodyParameter("data", dataSchema, SchemaBodyDescription); |
|
|
operation.AddBodyParameter("data", dataSchema, SchemaBodyDescription); |
|
|
operation.AddQueryParameter("publish", JsonObjectType.Boolean, "Set to true to autopublish content."); |
|
|
operation.AddQueryParameter("publish", JsonObjectType.Boolean, "Set to true to autopublish content."); |
|
|
|
|
|
|
|
|
operation.AddResponse("201", $"{schemaName} created.", contentSchema); |
|
|
operation.AddResponse("201", $"{schemaName} created.", contentSchema); |
|
|
|
|
|
|
|
|
operation.Security = EditorSecurity; |
|
|
|
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@ -159,12 +157,11 @@ namespace Squidex.Controllers.ContentApi.Generator |
|
|
{ |
|
|
{ |
|
|
operation.OperationId = $"Update{schemaKey}Content"; |
|
|
operation.OperationId = $"Update{schemaKey}Content"; |
|
|
operation.Summary = $"Update a {schemaName} content."; |
|
|
operation.Summary = $"Update a {schemaName} content."; |
|
|
|
|
|
operation.Security = EditorSecurity; |
|
|
|
|
|
|
|
|
operation.AddBodyParameter("data", dataSchema, SchemaBodyDescription); |
|
|
operation.AddBodyParameter("data", dataSchema, SchemaBodyDescription); |
|
|
|
|
|
|
|
|
operation.AddResponse("201", $"{schemaName} element updated.", dataSchema); |
|
|
operation.AddResponse("201", $"{schemaName} element updated.", dataSchema); |
|
|
|
|
|
|
|
|
operation.Security = EditorSecurity; |
|
|
|
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@ -174,12 +171,11 @@ namespace Squidex.Controllers.ContentApi.Generator |
|
|
{ |
|
|
{ |
|
|
operation.OperationId = $"Path{schemaKey}Content"; |
|
|
operation.OperationId = $"Path{schemaKey}Content"; |
|
|
operation.Summary = $"Patchs a {schemaName} content."; |
|
|
operation.Summary = $"Patchs a {schemaName} content."; |
|
|
|
|
|
operation.Security = EditorSecurity; |
|
|
|
|
|
|
|
|
operation.AddBodyParameter("data", contentSchema, SchemaBodyDescription); |
|
|
operation.AddBodyParameter("data", contentSchema, SchemaBodyDescription); |
|
|
|
|
|
|
|
|
operation.AddResponse("201", $"{schemaName} element patched.", dataSchema); |
|
|
operation.AddResponse("201", $"{schemaName} element patched.", dataSchema); |
|
|
|
|
|
|
|
|
operation.Security = EditorSecurity; |
|
|
|
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@ -189,10 +185,9 @@ namespace Squidex.Controllers.ContentApi.Generator |
|
|
{ |
|
|
{ |
|
|
operation.OperationId = $"Publish{schemaKey}Content"; |
|
|
operation.OperationId = $"Publish{schemaKey}Content"; |
|
|
operation.Summary = $"Publish a {schemaName} content."; |
|
|
operation.Summary = $"Publish a {schemaName} content."; |
|
|
|
|
|
operation.Security = EditorSecurity; |
|
|
|
|
|
|
|
|
operation.AddResponse("204", $"{schemaName} element published."); |
|
|
operation.AddResponse("204", $"{schemaName} element published."); |
|
|
|
|
|
|
|
|
operation.Security = EditorSecurity; |
|
|
|
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@ -202,10 +197,21 @@ namespace Squidex.Controllers.ContentApi.Generator |
|
|
{ |
|
|
{ |
|
|
operation.OperationId = $"Unpublish{schemaKey}Content"; |
|
|
operation.OperationId = $"Unpublish{schemaKey}Content"; |
|
|
operation.Summary = $"Unpublish a {schemaName} content."; |
|
|
operation.Summary = $"Unpublish a {schemaName} content."; |
|
|
|
|
|
operation.Security = EditorSecurity; |
|
|
|
|
|
|
|
|
operation.AddResponse("204", $"{schemaName} element unpublished."); |
|
|
operation.AddResponse("204", $"{schemaName} element unpublished."); |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private SwaggerOperations GenerateSchemaRestoreOperation() |
|
|
|
|
|
{ |
|
|
|
|
|
return AddOperation(SwaggerOperationMethod.Put, schemaName, $"{appPath}/{schemaPath}/{{id}}/restore", operation => |
|
|
|
|
|
{ |
|
|
|
|
|
operation.OperationId = $"Restore{schemaKey}Content"; |
|
|
|
|
|
operation.Summary = $"Restore a {schemaName} content."; |
|
|
operation.Security = EditorSecurity; |
|
|
operation.Security = EditorSecurity; |
|
|
|
|
|
|
|
|
|
|
|
operation.AddResponse("204", $"{schemaName} element restored."); |
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@ -215,10 +221,9 @@ namespace Squidex.Controllers.ContentApi.Generator |
|
|
{ |
|
|
{ |
|
|
operation.OperationId = $"Delete{schemaKey}Content"; |
|
|
operation.OperationId = $"Delete{schemaKey}Content"; |
|
|
operation.Summary = $"Delete a {schemaName} content."; |
|
|
operation.Summary = $"Delete a {schemaName} content."; |
|
|
|
|
|
operation.Security = EditorSecurity; |
|
|
|
|
|
|
|
|
operation.AddResponse("204", $"{schemaName} content deleted."); |
|
|
operation.AddResponse("204", $"{schemaName} content deleted."); |
|
|
|
|
|
|
|
|
operation.Security = EditorSecurity; |
|
|
|
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|