Generate JSON Schema
generateJsonSchema Mutation
Generates a JSON Schema definition from provided JSON data. This utility mutation helps create standardized schema definitions for dynamic data structures in the pyck system.
Arguments
jsonData
String!
Required JSON string from which to generate the schema
Return Type
GenerateJsonSchemaResponse! - Contains the generated JSON Schema.
Response Fields
GenerateJsonSchemaResponse:
jsonSchema
String!
The generated JSON Schema as a string
Usage Example
mutation {
generateJsonSchema(
jsonData: "{\"name\": \"John Doe\", \"age\": 30, \"email\": \"[email protected]\", \"active\": true}"
) {
jsonSchema
}
}JavaScript Example
Expected Response
The generated JSON Schema will follow the JSON Schema specification and might look like:
Notes
The input must be valid JSON string format
The generated schema follows JSON Schema Draft 7 specification
Complex nested objects and arrays are supported
The schema can be used for validation in data type definitions
This is useful for creating dynamic data validation rules based on example data
Last updated
Was this helpful?
