Skip to content

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

@SecretJuJu

Description

@SecretJuJu

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!

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions