Skip to content

Request body is required but all properties are optional #247

@bigludo7

Description

@bigludo7

Problem description
A small one but need global alignement in all our API.
This one was raised by @fernandopradocabrillo in SIM Swap API and we got the same question with @FabrizioMoggio in Call Forwarding API.

The request body is required for an api, but all attributes are optional. What should be the body when the client doesn't need to send any attributes?

We have 2 options:

  1. Leave it as required and force the client to send an empty body -> {}
  2. Remove the requirement (required=true for the requestBody) and let the client send a POST without body

Expected action
Define the behaviour when the client doen't need to send any request body param. It could a sentence in the design guideline.
As of now with @fernandopradocabrillo we have a preference for option 1 in sim-swap.

Additional context
It is important to define this behavior to include the scenarios in the test plan.

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions