create-zuplo-api
Advanced tools
Comparing version
{ | ||
"policies": [] | ||
"policies": [ | ||
{ | ||
"handler": { | ||
"export": "MockApiInboundPolicy", | ||
"module": "$import(@zuplo/runtime)", | ||
"options": {} | ||
}, | ||
"name": "mock-api-inbound", | ||
"policyType": "mock-api-inbound" | ||
} | ||
] | ||
} |
@@ -8,24 +8,278 @@ { | ||
"paths": { | ||
"/hello": { | ||
"x-zuplo-path": { | ||
"pathMode": "open-api" | ||
}, | ||
"/todos": { | ||
"get": { | ||
"summary": "Hello World", | ||
"description": "This is the first route to say hello", | ||
"summary": "Get all todos", | ||
"description": "**Retrieves a complete list of all todo items** from the system. This endpoint returns all todos regardless of their completion status or owner, making it useful for displaying comprehensive todo lists or performing bulk operations.", | ||
"responses": { | ||
"200": { | ||
"description": "A list of todos", | ||
"content": { | ||
"application/json": { | ||
"schema": { | ||
"type": "array", | ||
"items": { | ||
"$ref": "#/components/schemas/Todo" | ||
} | ||
}, | ||
"examples": { | ||
"mixed_todos": { | ||
"summary": "A list of todos with different completion states", | ||
"value": [ | ||
{ | ||
"id": 1, | ||
"title": "Buy groceries", | ||
"completed": false, | ||
"userId": 123 | ||
}, | ||
{ | ||
"id": 2, | ||
"title": "Write documentation", | ||
"completed": true, | ||
"userId": 456 | ||
}, | ||
{ | ||
"id": 3, | ||
"title": "Review pull requests", | ||
"completed": false, | ||
"userId": 123 | ||
} | ||
] | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"operationId": "1e0edd2a-8d53-4355-805f-54b7e5555725", | ||
"x-zuplo-route": { | ||
"corsPolicy": "none", | ||
"handler": { | ||
"export": "default", | ||
"module": "$import(./modules/hello-world)", | ||
"options": {} | ||
"export": "urlForwardHandler", | ||
"module": "$import(@zuplo/runtime)", | ||
"options": { | ||
"baseUrl": "https://todo-mock-main-b63f096.zuplo.app" | ||
} | ||
} | ||
}, | ||
"tags": ["Todo"] | ||
}, | ||
"post": { | ||
"summary": "Create a new todo", | ||
"description": "**Creates a new todo item** with the provided details. The todo will be assigned a unique ID automatically and can include a title, completion status, and user association. This is the primary endpoint for adding new tasks to the system.", | ||
"requestBody": { | ||
"required": true, | ||
"content": { | ||
"application/json": { | ||
"schema": { | ||
"$ref": "#/components/schemas/CreateTodo" | ||
} | ||
} | ||
} | ||
}, | ||
"responses": { | ||
"201": { | ||
"description": "Todo created successfully", | ||
"content": { | ||
"application/json": { | ||
"schema": { | ||
"$ref": "#/components/schemas/Todo" | ||
}, | ||
"examples": { | ||
"new_todo": { | ||
"summary": "A newly created todo", | ||
"value": { | ||
"id": 4, | ||
"title": "Deploy application", | ||
"completed": false, | ||
"userId": 789 | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"policies": { | ||
"inbound": [] | ||
"400": { | ||
"description": "Invalid request body" | ||
} | ||
}, | ||
"operationId": "004ff0e0-30cf-41a7-9e9f-zuplo35e3f725" | ||
"operationId": "55ee860b-fe7e-4d66-a228-bb5320c3305d", | ||
"x-zuplo-route": { | ||
"corsPolicy": "none", | ||
"handler": { | ||
"export": "urlForwardHandler", | ||
"module": "$import(@zuplo/runtime)", | ||
"options": { | ||
"baseUrl": "https://todo-mock-main-b63f096.zuplo.app" | ||
} | ||
} | ||
}, | ||
"tags": ["Todo"] | ||
} | ||
}, | ||
"/todos/{id}": { | ||
"put": { | ||
"summary": "Update a todo", | ||
"description": "**Updates an existing todo item** by its unique identifier. You can modify any combination of the todo's properties including title, completion status, and user assignment. All changes are applied atomically to ensure data consistency.", | ||
"parameters": [ | ||
{ | ||
"name": "id", | ||
"in": "path", | ||
"required": true, | ||
"schema": { | ||
"type": "integer" | ||
}, | ||
"description": "The todo ID" | ||
} | ||
], | ||
"requestBody": { | ||
"required": true, | ||
"content": { | ||
"application/json": { | ||
"schema": { | ||
"$ref": "#/components/schemas/UpdateTodo" | ||
} | ||
} | ||
} | ||
}, | ||
"responses": { | ||
"200": { | ||
"description": "Todo updated successfully", | ||
"content": { | ||
"application/json": { | ||
"schema": { | ||
"$ref": "#/components/schemas/Todo" | ||
}, | ||
"examples": { | ||
"updated_todo": { | ||
"summary": "A todo that has been updated", | ||
"value": { | ||
"id": 1, | ||
"title": "Buy groceries and cook dinner", | ||
"completed": true, | ||
"userId": 123 | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"400": { | ||
"description": "Invalid request body" | ||
}, | ||
"404": { | ||
"description": "Todo not found" | ||
} | ||
}, | ||
"operationId": "4569a607-338e-4d66-80f7-17f911778b1d", | ||
"x-zuplo-route": { | ||
"corsPolicy": "none", | ||
"handler": { | ||
"export": "urlForwardHandler", | ||
"module": "$import(@zuplo/runtime)", | ||
"options": { | ||
"baseUrl": "https://todo-mock-main-b63f096.zuplo.app" | ||
} | ||
} | ||
}, | ||
"tags": ["Todo"] | ||
}, | ||
"delete": { | ||
"summary": "Delete a todo", | ||
"description": "**Permanently removes a todo item** from the system using its unique identifier. This operation cannot be undone, so use with caution. The endpoint will return a 404 error if the specified todo does not exist.", | ||
"parameters": [ | ||
{ | ||
"name": "id", | ||
"in": "path", | ||
"required": true, | ||
"schema": { | ||
"type": "integer" | ||
}, | ||
"description": "The todo ID" | ||
} | ||
], | ||
"responses": { | ||
"204": { | ||
"description": "Todo deleted successfully" | ||
}, | ||
"404": { | ||
"description": "Todo not found" | ||
} | ||
}, | ||
"operationId": "888a8d15-aa30-45fe-8957-b07a8bcdd7ca", | ||
"x-zuplo-route": { | ||
"corsPolicy": "none", | ||
"handler": { | ||
"export": "urlForwardHandler", | ||
"module": "$import(@zuplo/runtime)", | ||
"options": { | ||
"baseUrl": "https://todo-mock-main-b63f096.zuplo.app" | ||
} | ||
} | ||
}, | ||
"tags": ["Todo"] | ||
} | ||
} | ||
}, | ||
"components": { | ||
"schemas": { | ||
"Todo": { | ||
"type": "object", | ||
"properties": { | ||
"id": { | ||
"type": "integer", | ||
"description": "The todo ID" | ||
}, | ||
"title": { | ||
"type": "string", | ||
"description": "The todo title" | ||
}, | ||
"completed": { | ||
"type": "boolean", | ||
"description": "Whether the todo is completed" | ||
}, | ||
"userId": { | ||
"type": "integer", | ||
"description": "The user ID who owns the todo" | ||
} | ||
}, | ||
"required": ["id", "title", "completed", "userId"] | ||
}, | ||
"CreateTodo": { | ||
"type": "object", | ||
"properties": { | ||
"title": { | ||
"type": "string", | ||
"description": "The todo title" | ||
}, | ||
"completed": { | ||
"type": "boolean", | ||
"description": "Whether the todo is completed", | ||
"default": false | ||
}, | ||
"userId": { | ||
"type": "integer", | ||
"description": "The user ID who owns the todo" | ||
} | ||
}, | ||
"required": ["title", "userId"] | ||
}, | ||
"UpdateTodo": { | ||
"type": "object", | ||
"properties": { | ||
"title": { | ||
"type": "string", | ||
"description": "The todo title" | ||
}, | ||
"completed": { | ||
"type": "boolean", | ||
"description": "Whether the todo is completed" | ||
}, | ||
"userId": { | ||
"type": "integer", | ||
"description": "The user ID who owns the todo" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
@@ -18,11 +18,4 @@ { | ||
"url": "https://cdn.zuplo.com/schemas/sidebar.json" | ||
}, | ||
{ | ||
"fileMatch": ["zuplo.jsonc"], | ||
"url": "https://cdn.zuplo.com/schemas/zuplo.json", | ||
"schema": { | ||
"allowTrailingCommas": true | ||
} | ||
} | ||
] | ||
} |
{ | ||
"name": "create-zuplo-api", | ||
"version": "6.53.1", | ||
"version": "6.54.0", | ||
"keywords": [ | ||
@@ -5,0 +5,0 @@ "api", |
Sorry, the diff of this file is too big to display
791514
-0.93%34
-32%1879
-8.96%