diff --git a/autodocodec-api-usage/autodocodec-api-usage.cabal b/autodocodec-api-usage/autodocodec-api-usage.cabal index a624beb..04bfbed 100644 --- a/autodocodec-api-usage/autodocodec-api-usage.cabal +++ b/autodocodec-api-usage/autodocodec-api-usage.cabal @@ -1,6 +1,6 @@ cabal-version: 1.12 --- This file has been generated from package.yaml by hpack version 0.34.4. +-- This file has been generated from package.yaml by hpack version 0.34.7. -- -- see: https://github.com/sol/hpack @@ -17,6 +17,252 @@ license-file: LICENSE build-type: Simple extra-source-files: LICENSE + test_resources/error/bool-error-string.txt + test_resources/error/char-error-number.txt + test_resources/error/either-bool-text-error-array.txt + test_resources/error/example-error-bool-number.txt + test_resources/error/example-error-fruit-number.txt + test_resources/error/int-error-big.txt + test_resources/error/int8-error-200.txt + test_resources/error/lazy-text-error-null.txt + test_resources/error/list-text-error-string.txt + test_resources/error/maybe-text-error-object.txt + test_resources/error/null-error-number.txt + test_resources/error/object-error-array.txt + test_resources/error/ordering-error-list.txt + test_resources/error/recursive-error-recurse-string.txt + test_resources/error/scientific-error-string.txt + test_resources/error/string-error-object.txt + test_resources/error/text-error-bool.txt + test_resources/error/word-error-negative.txt + test_resources/error/word8-error-300.txt + test_resources/json-schema/ainur.json + test_resources/json-schema/bool.json + test_resources/json-schema/char.json + test_resources/json-schema/day.json + test_resources/json-schema/difftime.json + test_resources/json-schema/either-bool-text.json + test_resources/json-schema/either-either-bool-scientific-text.json + test_resources/json-schema/example.json + test_resources/json-schema/fruit.json + test_resources/json-schema/int.json + test_resources/json-schema/int16.json + test_resources/json-schema/int32.json + test_resources/json-schema/int64.json + test_resources/json-schema/int8.json + test_resources/json-schema/lazy-text.json + test_resources/json-schema/legacy-object.json + test_resources/json-schema/legacy-value.json + test_resources/json-schema/list-text.json + test_resources/json-schema/local-time.json + test_resources/json-schema/map-text-ind.json + test_resources/json-schema/maybe-text.json + test_resources/json-schema/mutually-recursive.json + test_resources/json-schema/nominal-difftime.json + test_resources/json-schema/nonempty-text.json + test_resources/json-schema/null.json + test_resources/json-schema/object.json + test_resources/json-schema/ordering.json + test_resources/json-schema/recursive.json + test_resources/json-schema/scientific.json + test_resources/json-schema/set-text.json + test_resources/json-schema/string.json + test_resources/json-schema/text.json + test_resources/json-schema/time-of-day.json + test_resources/json-schema/utc-time.json + test_resources/json-schema/value.json + test_resources/json-schema/very-comment.json + test_resources/json-schema/via.json + test_resources/json-schema/war.json + test_resources/json-schema/word.json + test_resources/json-schema/word16.json + test_resources/json-schema/word32.json + test_resources/json-schema/word64.json + test_resources/json-schema/word8.json + test_resources/openapi-schema/ainur.json + test_resources/openapi-schema/bool.json + test_resources/openapi-schema/char.json + test_resources/openapi-schema/day.json + test_resources/openapi-schema/declareSchemaRef/ainur.json + test_resources/openapi-schema/declareSchemaRef/example.json + test_resources/openapi-schema/declareSchemaRef/fruit.json + test_resources/openapi-schema/declareSchemaRef/legacy-object.json + test_resources/openapi-schema/declareSchemaRef/legacy-value.json + test_resources/openapi-schema/declareSchemaRef/mutually-recursive.json + test_resources/openapi-schema/declareSchemaRef/null.json + test_resources/openapi-schema/declareSchemaRef/recursive.json + test_resources/openapi-schema/declareSchemaRef/very-comment.json + test_resources/openapi-schema/declareSchemaRef/via.json + test_resources/openapi-schema/declareSchemaRef/war.json + test_resources/openapi-schema/difftime.json + test_resources/openapi-schema/either-bool-text.json + test_resources/openapi-schema/either-either-bool-scientific-text.json + test_resources/openapi-schema/example.json + test_resources/openapi-schema/fruit.json + test_resources/openapi-schema/int.json + test_resources/openapi-schema/int16.json + test_resources/openapi-schema/int32.json + test_resources/openapi-schema/int64.json + test_resources/openapi-schema/int8.json + test_resources/openapi-schema/lazy-text.json + test_resources/openapi-schema/legacy-object.json + test_resources/openapi-schema/legacy-value.json + test_resources/openapi-schema/list-text.json + test_resources/openapi-schema/local-time.json + test_resources/openapi-schema/map-text-int.json + test_resources/openapi-schema/maybe-text.json + test_resources/openapi-schema/mutually-recursive.json + test_resources/openapi-schema/nominal-difftime.json + test_resources/openapi-schema/nonempty-text.json + test_resources/openapi-schema/null.json + test_resources/openapi-schema/object.json + test_resources/openapi-schema/ordering.json + test_resources/openapi-schema/recursive.json + test_resources/openapi-schema/scientific.json + test_resources/openapi-schema/set-text.json + test_resources/openapi-schema/string.json + test_resources/openapi-schema/text.json + test_resources/openapi-schema/time-of-day.json + test_resources/openapi-schema/utc-time.json + test_resources/openapi-schema/value.json + test_resources/openapi-schema/very-comment.json + test_resources/openapi-schema/via.json + test_resources/openapi-schema/war.json + test_resources/openapi-schema/word.json + test_resources/openapi-schema/word16.json + test_resources/openapi-schema/word32.json + test_resources/openapi-schema/word64.json + test_resources/openapi-schema/word8.json + test_resources/show-codec/ainur.txt + test_resources/show-codec/bool.txt + test_resources/show-codec/char.txt + test_resources/show-codec/day.txt + test_resources/show-codec/either-bool-text.txt + test_resources/show-codec/either-either-bool-scientific-text.txt + test_resources/show-codec/example.txt + test_resources/show-codec/fruit.txt + test_resources/show-codec/int.txt + test_resources/show-codec/int16.txt + test_resources/show-codec/int32.txt + test_resources/show-codec/int64.txt + test_resources/show-codec/int8.txt + test_resources/show-codec/lazy-text.txt + test_resources/show-codec/legacy-object.txt + test_resources/show-codec/legacy-value.txt + test_resources/show-codec/list-text.txt + test_resources/show-codec/local-time.txt + test_resources/show-codec/map-text-int.txt + test_resources/show-codec/maybe-text.txt + test_resources/show-codec/mutually-recursive.txt + test_resources/show-codec/nonempty-text.txt + test_resources/show-codec/null.txt + test_resources/show-codec/object.txt + test_resources/show-codec/ordering.txt + test_resources/show-codec/recursive.txt + test_resources/show-codec/scientific.txt + test_resources/show-codec/set-text.txt + test_resources/show-codec/string.txt + test_resources/show-codec/text.txt + test_resources/show-codec/time-of-day.txt + test_resources/show-codec/utc-time.txt + test_resources/show-codec/value.txt + test_resources/show-codec/very-comment.txt + test_resources/show-codec/via.txt + test_resources/show-codec/war.txt + test_resources/show-codec/word.txt + test_resources/show-codec/word16.txt + test_resources/show-codec/word32.txt + test_resources/show-codec/word64.txt + test_resources/show-codec/word8.txt + test_resources/show-codec/zoned-time.txt + test_resources/swagger-schema/ainur.json + test_resources/swagger-schema/bool.json + test_resources/swagger-schema/char.json + test_resources/swagger-schema/day.json + test_resources/swagger-schema/difftime.json + test_resources/swagger-schema/either-bool-text.json + test_resources/swagger-schema/either-either-bool-scientific-text.json + test_resources/swagger-schema/example.json + test_resources/swagger-schema/fruit.json + test_resources/swagger-schema/int.json + test_resources/swagger-schema/int16.json + test_resources/swagger-schema/int32.json + test_resources/swagger-schema/int64.json + test_resources/swagger-schema/int8.json + test_resources/swagger-schema/lazy-text.json + test_resources/swagger-schema/legacy-object.json + test_resources/swagger-schema/legacy-value.json + test_resources/swagger-schema/list-text.json + test_resources/swagger-schema/local-time.json + test_resources/swagger-schema/map-text-int.json + test_resources/swagger-schema/maybe-text.json + test_resources/swagger-schema/mutually-recursive.json + test_resources/swagger-schema/nominal-difftime.json + test_resources/swagger-schema/nonempty-text.json + test_resources/swagger-schema/null.json + test_resources/swagger-schema/object.json + test_resources/swagger-schema/ordering.json + test_resources/swagger-schema/recursive.json + test_resources/swagger-schema/scientific.json + test_resources/swagger-schema/set-text.json + test_resources/swagger-schema/string.json + test_resources/swagger-schema/text.json + test_resources/swagger-schema/time-of-day.json + test_resources/swagger-schema/utc-time.json + test_resources/swagger-schema/value.json + test_resources/swagger-schema/very-comment.json + test_resources/swagger-schema/via.json + test_resources/swagger-schema/war.json + test_resources/swagger-schema/word.json + test_resources/swagger-schema/word16.json + test_resources/swagger-schema/word32.json + test_resources/swagger-schema/word64.json + test_resources/swagger-schema/word8.json + test_resources/yaml-schema/ainur.txt + test_resources/yaml-schema/bool.txt + test_resources/yaml-schema/char.txt + test_resources/yaml-schema/day.txt + test_resources/yaml-schema/difftime.txt + test_resources/yaml-schema/either-bool-text.txt + test_resources/yaml-schema/either-either-bool-scientific-text.txt + test_resources/yaml-schema/example.txt + test_resources/yaml-schema/fruit.txt + test_resources/yaml-schema/int.txt + test_resources/yaml-schema/int16.txt + test_resources/yaml-schema/int32.txt + test_resources/yaml-schema/int64.txt + test_resources/yaml-schema/int8.txt + test_resources/yaml-schema/lazy-text.txt + test_resources/yaml-schema/legacy-object.txt + test_resources/yaml-schema/legacy-value.txt + test_resources/yaml-schema/list-text.txt + test_resources/yaml-schema/local-time.txt + test_resources/yaml-schema/map-text-int.txt + test_resources/yaml-schema/maybe-text.txt + test_resources/yaml-schema/multiline-default.txt + test_resources/yaml-schema/mutually-recursive.txt + test_resources/yaml-schema/nominal-difftime.txt + test_resources/yaml-schema/nonempty-text.txt + test_resources/yaml-schema/null.txt + test_resources/yaml-schema/object.txt + test_resources/yaml-schema/ordering.txt + test_resources/yaml-schema/recursive.txt + test_resources/yaml-schema/scientific.txt + test_resources/yaml-schema/set-text.txt + test_resources/yaml-schema/string.txt + test_resources/yaml-schema/text.txt + test_resources/yaml-schema/time-of-day.txt + test_resources/yaml-schema/utc-time.txt + test_resources/yaml-schema/value.txt + test_resources/yaml-schema/very-comment.txt + test_resources/yaml-schema/via.txt + test_resources/yaml-schema/war.txt + test_resources/yaml-schema/word.txt + test_resources/yaml-schema/word16.txt + test_resources/yaml-schema/word32.txt + test_resources/yaml-schema/word64.txt + test_resources/yaml-schema/word8.txt + test_resources/yaml-schema/zoned-time.txt source-repository head type: git diff --git a/autodocodec-api-usage/package.yaml b/autodocodec-api-usage/package.yaml index cb9edee..ea30563 100644 --- a/autodocodec-api-usage/package.yaml +++ b/autodocodec-api-usage/package.yaml @@ -9,6 +9,7 @@ synopsis: Autodocodec api usage tests extra-source-files: - LICENSE +- test_resources/**/* dependencies: - base >= 4.7 && < 5 diff --git a/autodocodec-api-usage/test_resources/openapi-schema/declareSchemaRef/example.json b/autodocodec-api-usage/test_resources/openapi-schema/declareSchemaRef/example.json index 4a589d7..d1ff864 100644 --- a/autodocodec-api-usage/test_resources/openapi-schema/declareSchemaRef/example.json +++ b/autodocodec-api-usage/test_resources/openapi-schema/declareSchemaRef/example.json @@ -1,23 +1,50 @@ { - "reference": { - "$ref": "#/components/schemas/Example" - }, "definitions": { "Example": { - "required": [ - "text", - "bool", - "maybe", - "fruit" - ], - "type": "object", "properties": { + "bool": { + "description": "a bool", + "type": "boolean" + }, + "fruit": { + "description": "fruit!!", + "enum": [ + "Apple", + "Orange", + "Banana", + "Melon" + ], + "type": "string" + }, "maybe": { - "type": "string", "description": "a maybe text", - "nullable": true + "nullable": true, + "type": "string" + }, + "optional": { + "description": "an optional text", + "type": "string" + }, + "optional-or-null": { + "description": "an optional-or-null text", + "nullable": true, + "type": "string" + }, + "optional-with-default": { + "default": "foobar", + "description": "an optional text with a default", + "type": "string" + }, + "optional-with-null-default": { + "default": [], + "description": "an optional list of texts with a default empty list where the empty list would be omitted", + "items": { + "type": "string" + }, + "type": "array" }, "single-or-list": { + "additionalProperties": true, "anyOf": [ { "type": "string" @@ -30,51 +57,23 @@ } ], "default": [], - "additionalProperties": true, "description": "an optional list that can also be specified as a single element" }, "text": { - "type": "string", - "description": "a text" - }, - "optional-with-null-default": { - "default": [], - "items": { - "type": "string" - }, - "type": "array", - "description": "an optional list of texts with a default empty list where the empty list would be omitted" - }, - "fruit": { - "additionalProperties": true, - "type": "string", - "enum": [ - "Apple", - "Orange", - "Banana", - "Melon" - ], - "description": "fruit!!" - }, - "optional-with-default": { - "default": "foobar", - "type": "string", - "description": "an optional text with a default" - }, - "optional-or-null": { - "type": "string", - "description": "an optional-or-null text", - "nullable": true - }, - "bool": { - "type": "boolean", - "description": "a bool" - }, - "optional": { - "type": "string", - "description": "an optional text" + "description": "a text", + "type": "string" } - } + }, + "required": [ + "text", + "bool", + "maybe", + "fruit" + ], + "type": "object" } + }, + "reference": { + "$ref": "#/components/schemas/Example" } } \ No newline at end of file diff --git a/autodocodec-api-usage/test_resources/openapi-schema/example.json b/autodocodec-api-usage/test_resources/openapi-schema/example.json index d524930..ebe4535 100644 --- a/autodocodec-api-usage/test_resources/openapi-schema/example.json +++ b/autodocodec-api-usage/test_resources/openapi-schema/example.json @@ -2,20 +2,50 @@ "components": { "schemas": { "Example": { - "required": [ - "text", - "bool", - "maybe", - "fruit" - ], - "type": "object", "properties": { + "bool": { + "description": "a bool", + "type": "boolean" + }, + "fruit": { + "description": "fruit!!", + "enum": [ + "Apple", + "Orange", + "Banana", + "Melon" + ], + "type": "string" + }, "maybe": { - "type": "string", "description": "a maybe text", - "nullable": true + "nullable": true, + "type": "string" + }, + "optional": { + "description": "an optional text", + "type": "string" + }, + "optional-or-null": { + "description": "an optional-or-null text", + "nullable": true, + "type": "string" + }, + "optional-with-default": { + "default": "foobar", + "description": "an optional text with a default", + "type": "string" + }, + "optional-with-null-default": { + "default": [], + "description": "an optional list of texts with a default empty list where the empty list would be omitted", + "items": { + "type": "string" + }, + "type": "array" }, "single-or-list": { + "additionalProperties": true, "anyOf": [ { "type": "string" @@ -28,58 +58,27 @@ } ], "default": [], - "additionalProperties": true, "description": "an optional list that can also be specified as a single element" }, "text": { - "type": "string", - "description": "a text" - }, - "optional-with-null-default": { - "default": [], - "items": { - "type": "string" - }, - "type": "array", - "description": "an optional list of texts with a default empty list where the empty list would be omitted" - }, - "fruit": { - "additionalProperties": true, - "type": "string", - "enum": [ - "Apple", - "Orange", - "Banana", - "Melon" - ], - "description": "fruit!!" - }, - "optional-with-default": { - "default": "foobar", - "type": "string", - "description": "an optional text with a default" - }, - "optional-or-null": { - "type": "string", - "description": "an optional-or-null text", - "nullable": true - }, - "bool": { - "type": "boolean", - "description": "a bool" - }, - "optional": { - "type": "string", - "description": "an optional text" + "description": "a text", + "type": "string" } - } + }, + "required": [ + "text", + "bool", + "maybe", + "fruit" + ], + "type": "object" } } }, - "openapi": "3.0.0", "info": { - "version": "", - "title": "" + "title": "", + "version": "" }, + "openapi": "3.0.0", "paths": {} } \ No newline at end of file