aqueduct icon indicating copy to clipboard operation
aqueduct copied to clipboard

[OpenAPI client] Excluding ignored fields in request body

Open owczaro opened this issue 5 years ago • 2 comments

Let's use one of the templates as an example and follow the instructions below:

  1. Set @Bind.body(ignore: ['id']) User user in the 11th line
  2. Generate an OpenAPI client web page with command pub run aqueduct document client
  3. Open generated file in your browser
  4. Look inside body of Register -> post -> Request body

There is

{
  "password": "string",
  "id": 0,
  "username": "string"
}

But expected schema is

{
  "password": "string",
  "username": "string"
}

Any of ignored values should be present there.

Also, when we set @Serialize(input: false, output: true) to some model's field (inside that model class), then this field should be excluded as well.

owczaro avatar Jul 14 '20 19:07 owczaro

Any news on this?

mihai1voicescu avatar Sep 21 '20 20:09 mihai1voicescu

Nope. I had no time recently. If I find a solution I'll create a PR though.

owczaro avatar Dec 09 '20 10:12 owczaro