Skip to content

[Question] [OpenAPI] Regarding application/x-www-form-urlencoded request body schema and example validation #2848

@Marckman

Description

@Marckman

Hi Spectral community!

Just opening this in hopes of getting some clarification on how OpenAPI documents are validated.

While doing some tests with Microcks, I found an interesting scenario: for operations with a request body of application/x-www-form-urlencoded content type, documenting examples as objects leads to improper serialization, whereas defining them as strings with the appropriate format (as per OpenAPI example spec, e.g. name1=value1&name2=value2) actually made the tests work.

Now, if I run spectral with Microcks' ruleset after the change, it complains because the schema definition is still of type object; if I change it to string, this could potentially cause other problems, e.g. with code generation.

So for the actual question: could this be a validation problem, or is there a better way of documenting these operations?

Please see the original issue for more context.

Thanks in advance,
M

Metadata

Metadata

Assignees

No one assigned

    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