10000 GitHub · Where software is built
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Using t.Ref as response schema results in invalid OpenAPI specification #1063
Closed
@recanman

Description

@recanman

What version of Elysia is running?

1.2.6

What platform is your computer?

Linux 6.9.7-arch1-1 x86_64 unknown

What steps can reproduce the bug?

const schema = t.Object({
	test: t.Literal('hello'),
});
new Elysia()
	.model({schema})
	.get('/', () => {test: 'hello'},
	{
		response: t.Ref<typeof schema>('#/components/schemas/schema')
	}
).listen(3000));

What is the expected behavior?

The $ref should not be a child of 200.

What do you see instead?

Image

Additional information

Workaround: wrap the response in t.Object, e.g t.Object({result: t.Ref<typeof schema>('#/components/schemas/schema') })

Have you try removing the node_modules and bun.lockb and try again yet?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0