guardrail-dev / guardrail-dev/guardrail

Odd behavior with OpenAPI v3 specs and form data adding an extra 'body' param

Open
#237 4 comments 0 reactions 0 assignees View on GitHub
core help wanted question
Dominant language
Scala
Stars
541
Forks
138
PR merge metrics
No merged PRs in 30d

Description

The [OpenAPI Form Data examples](https://swagger.io/docs/specification/describing-request-body/) include `type: object` when defining schemas for the form parameters. When doing this, however, Guardrail emits the form params, plus an extra body param. Unclear if this is intended (and if leaving out `type` is correct), or if this is a problem with the OpenAPI parser or with how Guardrail is interpreting the parser's output. For reference, this triggers the issue:

```
openapi: 3.0.2
info:
title: Whatever
version: 1.0.0
paths:
/foo:
post:
operationId: doFoo
requestBody:
required: true
content:
multipart/form-data:
schema:
type: object
properties:
bar:
type: integer
format: int64
baz:
type: string
responses:
'200':
description: OK
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.