Skip to content

Validate language-model mock output against the schema in OpenApiMockResponsePlugin #2039

Open

Description

@waldekmastykarz

OpenApiMockResponsePlugin (#2036) can generate mock bodies with a language model, but it checks only the top-level JSON type of the model's output. If the output breaks schema constraints (e.g. minimum, required, enum, pattern), it is still served as the mock.

Proposal: once OpenApiValidationPlugin (#2037) is merged, validate the model's output with its OpenApiSchemaValidator. If validation fails, fall back to the schema-based sample generator (and log why).

On hold until these are merged:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

on holdIssue/PR is on hold for a reason

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions