3 ms·
Its autocomplete story is a mess, but https://github.com/Kong/insomnia#readme https://github.com/Kong/insomnia#readme at least allows one to visualize any schem
by mdaniel 3y ago
Its autocomplete story is a mess, but https://github.com/Kong/insomnia#readme https://github.com/Kong/insomnia#readme at least allows one to visualize any schema authored in the document (it generates examples as well as a schema browser). It's possible that other OpenAPI tools behave similarly, I just happen to have the most hand's on with Insomnia
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 it
ok:
[{"alpha": true}, {"alpha":false}]
problematic:
[
{"alpha":{"beta": ["charlie", 3.1415, null]}},
{"alpha":[{"beta":null}]},
{"alpha": null}
}