condAPI is a FastAPI-based application designed to manage and validate JSON schemas. It provides endpoints to set, retrieve, and compare JSON schemas.
- Description: API root. Shows available endpoints and their usage.
- Response:
{ "routes": [ { "path": "/", "method": "GET", "description": "API root. Shows available endpoints and their usage." }, { "path": "/details", "method": "GET", "description": "Returns the current schema details. No parameters required." }, { "path": "/compare", "method": "POST", "description": "Compares a provided JSON schema with the current schema. Requires JSON body." }, { "path": "/set_schema", "method": "POST", "description": "Sets a new schema from provided JSON. Requires JSON body." } ] }
- Description: Returns the current schema details.
- Response:
- If no schema is set:
{ "message": "No schema has been set yet." } - If a schema is set:
{ "schema": { ...schema details... } }
- If no schema is set:
- Description: Compares a provided JSON schema with the current schema.
- Request Body: JSON schema to compare.
- Response:
- If no schema is set:
{ "detail": "No schema has been set yet. Please set a schema first." } - If the provided JSON is invalid:
{ "detail": "Invalid JSON" } - If the schema comparison fails:
{ "detail": "...error details..." } - If the schema comparison succeeds:
{ "message": "Example JSON received and validated successfully" }
- If no schema is set:
- Description: Sets a new schema from the provided JSON.
- Request Body: JSON schema to set.
- Response:
- If the provided JSON is invalid:
{ "detail": "Invalid JSON" } - If the schema validation fails:
{ "detail": "...error details..." } - If the schema is successfully set:
{ "message": "Example JSON received and validated successfully", "generated_schema": { ...schema details... } }
- If the provided JSON is invalid:
-
Install the package. It will automatically install its required dependencies:
pip install condAPI
-
Start the server:
condapi start
-
To start the server on a different port (default is 8000), use the
--portparameter:condapi start --port <port_number>
This project is licensed under the MIT License.