A description of your project
Project description
condAPI
condAPI is a FastAPI-based application designed to manage and validate JSON schemas. It provides endpoints to set, retrieve, and compare JSON schemas.
Endpoints
GET /
- 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." } ] }
GET /details
- 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:
POST /compare
- 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:
POST /set_schema
- 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:
How to Run
-
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>
License
This project is licensed under the MIT License.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file condapi-1.0.0.tar.gz.
File metadata
- Download URL: condapi-1.0.0.tar.gz
- Upload date:
- Size: 4.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.8.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1331f0baa76520020cd76fdf0c6db5c661ac00be35563ab7ea9425384279c43f
|
|
| MD5 |
7f562fc3dbe0921d52e43aba47479f8a
|
|
| BLAKE2b-256 |
e107417262ea78531c37dd47fb6fea7f4f43ec219b46271a701db402c4479ca0
|
File details
Details for the file condapi-1.0.0-py3-none-any.whl.
File metadata
- Download URL: condapi-1.0.0-py3-none-any.whl
- Upload date:
- Size: 6.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.8.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
72b24993091268fa9760fead124158b810cd04e27369cde35b0fa8d61cc7e7f9
|
|
| MD5 |
a9793d6a1e46325880958c4a8387a6d6
|
|
| BLAKE2b-256 |
a90d4a5eb2b4fe7a8d6f95a72f383a58e90332c744cd8b400043be4b1583e43c
|