json-spec-openapi: json-spec-openapi
This version is deprecated.
This package provides a way to produce <code>openapi3</code> documentation from a `json-spec` specification.
Example
Given this data type:
data User = User { name :: Text , lastLogin :: UTCTime } deriving ToSchema via (EncodingSchema User) -- <-- ToSchema instance defined here instance HasJsonEncodingSpec User where type EncodingSpec User = JsonObject '[ '("name", JsonString) , '("last-login", JsonDateTime) ] toJSONStructure user = (Field @"name" (name user), (Field @"last-login" (lastLogin user), ()))
Calling `Data.Aeson.encode (Data.OpenApi3.toSchema (Proxy :: Proxy User))` will produce the following Schema:
{ "additionalProperties": false, "properties": { "last-login": { "format": "date-time", "type": "string" }, "name": { "type": "string" } }, "required": [ "name", "last-login" ], "type": "object" }
[Skip to Readme]
Downloads
- json-spec-openapi-0.1.0.0.tar.gz [browse] (Cabal source package)
- Package description (as included in the package)
Maintainer's Corner
For package maintainers and hackage trustees
Candidates
- No Candidates
Versions [RSS] | 0.1.0.0, 0.1.0.1, 0.1.0.2, 0.1.0.3, 0.2.0.0, 0.2.1.0, 0.2.1.1, 0.3.0.0, 0.3.1.0, 0.3.1.1, 0.3.1.2, 1.0.0.0 (info) |
---|---|
Dependencies | base (>=4.17 && <4.18), json-spec (>=0.1.0.0 && <0.2), lens (>=5.2.2 && <5.3), openapi3 (>=3.2.3 && <3.3), text (>=2.0.2 && <2.1) [details] |
License | MIT |
Copyright | 2022 Rick Owens |
Author | Rick Owens |
Maintainer | rick@owensmurray.com |
Category | JSON, OpenApi |
Home page | https://github.com/owensmurray/json-spec-openapi |
Uploaded | by rickowens at 2023-06-28T01:38:35Z |
Distributions | Stackage:1.0.0.0 |
Downloads | 487 total (40 in the last 30 days) |
Rating | (no votes yet) [estimated by Bayesian average] |
Your Rating | |
Status | Docs uploaded by user Build status unknown [no reports yet] |