is there a good tool or library to create a JSON Schema manually/programmatically ?
for example:
openapi: 3.0.0
info:
title: this is my title
description: a long description goes here
version: v1
servers:
- url: http://127.0.0.1:9090
description: the local server
paths:
/thingy:
get:
responses:
"200":
description: ok
content:
application/json:
schema:
$ref: '#/components/schemas/Thingy'
components:
schemas:
Thingy:
type: object
properties:
alpha:
type: boolean
as for the "create automatically," I'd guess that's a genuinely hard problem although if your example documents are simple/homogeneous enough you may get away with itok:
[{"alpha": true}, {"alpha":false}]
problematic: [
{"alpha":{"beta": ["charlie", 3.1415, null]}},
{"alpha":[{"beta":null}]},
{"alpha": null}
}