MCPcopy Index your code
hub / github.com/Effect-TS/effect / getSpec

Function getSpec

packages/platform/test/OpenApi.test.ts:41–131  ·  view source on GitHub ↗
(parts: Parts, options?: Options)

Source from the content-addressed store, hash-verified

39}
40
41const getSpec = (parts: Parts, options?: Options): OpenApi.OpenAPISpec => {
42 const additionalPropertiesStrategy = (options?.additionalPropertiesStrategy ?? "strict") === "allow"
43 return {
44 "openapi": "3.1.0",
45 "info": { "title": "Api", "version": "0.0.1" },
46 "paths": parts.paths,
47 "tags": parts.tags ?? [{ "name": "group" }],
48 "components": {
49 "schemas": {
50 "HttpApiDecodeError": {
51 "type": "object",
52 "required": ["issues", "message", "_tag"],
53 "properties": {
54 "issues": {
55 "type": "array",
56 "items": {
57 "$ref": "#/components/schemas/Issue"
58 }
59 },
60 "message": { "type": "string" },
61 "_tag": {
62 "type": "string",
63 "enum": [
64 "HttpApiDecodeError"
65 ]
66 }
67 },
68 "additionalProperties": additionalPropertiesStrategy,
69 "description": "The request did not match the expected schema"
70 },
71 "Issue": {
72 "type": "object",
73 "description": "Represents an error encountered while parsing a value to match the schema",
74 "required": ["_tag", "path", "message"],
75 "properties": {
76 "_tag": {
77 "type": "string",
78 "description": "The tag identifying the type of parse issue",
79 "enum": [
80 "Pointer",
81 "Unexpected",
82 "Missing",
83 "Composite",
84 "Refinement",
85 "Transformation",
86 "Type",
87 "Forbidden"
88 ]
89 },
90 "path": {
91 "type": "array",
92 "description": "The path to the property where the issue occurred",
93 "items": {
94 "$ref": "#/components/schemas/PropertyKey"
95 }
96 },
97 "message": {
98 "type": "string",

Callers 2

expectPartsFunction · 0.85
expectSpecPathsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected