stablekernel / aqueduct

Dart HTTP server framework for building REST APIs. Includes PostgreSQL ORM and OAuth2 provider.
https://aqueduct.io
BSD 2-Clause "Simplified" License
2.41k stars 280 forks source link

[OpenAPI client] Excluding ignored fields in request body #873

Open owczaro opened 3 years ago

owczaro commented 3 years ago

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.

mihai1voicescu commented 3 years ago

Any news on this?

owczaro commented 3 years ago

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