Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: how to allow oneOf selection in Schema combinations #60

Open
SecretJuJu opened this issue Jun 19, 2024 · 0 comments
Open

Question: how to allow oneOf selection in Schema combinations #60

SecretJuJu opened this issue Jun 19, 2024 · 0 comments
Assignees

Comments

@SecretJuJu
Copy link

SecretJuJu commented Jun 19, 2024

I am defining an API specification as follows:

export type MyController = Tspec.DefineApiSpec<{
  tags: ['ABC'];
  basePath: '/abc';
  paths: {
    '/': {
      post: {
        operationId: 'abc';
        summary: 'abc';
        responses: {
          201: Success;
          400:
            | ExceptionSpec<A>
            | ExceptionSpec<B>
            | ExceptionSpec<C>;
        };
      };
    };
  };
}>;

Currently, the schema automatically uses anyOf for combining the exception specifications (A, B, C) in the 400 response.

Issue

I want to use oneOf instead of anyOf, but I can't find a way.

Could you provide guidance on how to modify the schema definitions or adjust the library settings to use oneOf for the 400 response schemas?

Thank you for your help!

@hyeonss0417 hyeonss0417 self-assigned this Jun 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants