Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rel 0.2.0: conditional call fwd states update #48

Merged
merged 10 commits into from
Jul 16, 2024

Conversation

FabrizioMoggio
Copy link
Collaborator

@FabrizioMoggio FabrizioMoggio commented Jul 3, 2024

What type of PR is this?

  • enhancement/feature

What this PR does / why we need it:

increases the level of information on the conditional call FWD to support use case 3 (#17)

the Conditional endpoint is optional: #37 (comment)

Error codes updated according to: #50

Phone number identification with 3Legs, according to: #51

@FabrizioMoggio FabrizioMoggio mentioned this pull request Jul 5, 2024
- Error code update according to: camaraproject#50
@bigludo7
Copy link
Collaborator

bigludo7 commented Jul 10, 2024

@FabrizioMoggio one very small comment. I saw you turn to false the POST requestBody (lines 165 & 218).
This is one alternative - this other will be to keep it mandatory and if no phoneNumber is passed the body must be valued to an empty object {}.

We have similar option in sims swap and we keep the requestBody mandatory (reference: camaraproject/SimSwap#118)
I asked my lead developer a recommendation: he told me that as we can sometimes have something, something nothing it's cleaner to always mandate an object.

I can live with both but perhaps we should adopt one common pattern. Do you want me to trigger an issue in commonalities?

@FabrizioMoggio
Copy link
Collaborator Author

FabrizioMoggio commented Jul 10, 2024

@FabrizioMoggio one very small comment. I saw you turn to false the POST requestBody (lines 165 & 218). This is one alternative - this other will be to keep it mandatory and if no phoneNumber is passed the body must be valued to an empty object {}.

We have similar option in sims swap and we keep the requestBody mandatory (reference: camaraproject/SimSwap#118) I asked my lead developer a recommendation: he told me that as we can sometimes have something, something nothing it's cleaner to always mandate an object.

I can live with both but perhaps we should adopt one common pattern. Do you want me to trigger an issue in commonalities?

I agree an aligning with simswap and I also agree with you, this should be in the guidelines, so please open an issue in Commonalitis as you suggested.

Is this good?:
requestBody:
content:
application/json:
schema:
oneOf:
- $ref: '#/components/schemas/CreateCallForwardingSignal'
- {}
required: true

@bigludo7
Copy link
Collaborator

@FabrizioMoggio one very small comment. I saw you turn to false the POST requestBody (lines 165 & 218). This is one alternative - this other will be to keep it mandatory and if no phoneNumber is passed the body must be valued to an empty object {}.
We have similar option in sims swap and we keep the requestBody mandatory (reference: camaraproject/SimSwap#118) I asked my lead developer a recommendation: he told me that as we can sometimes have something, something nothing it's cleaner to always mandate an object.
I can live with both but perhaps we should adopt one common pattern. Do you want me to trigger an issue in commonalities?

I agree an aligning with simswap and I also agree with you, this should be in the guidelines, so please open an issue in Commonalitis as you suggested.

Is this good?: requestBody: content: application/json: schema: oneOf: - $ref: '#/components/schemas/CreateCallForwardingSignal' - {} required: true

for me

      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateCallForwardingSignal'
        required: true

For me this just good enough. Without the need for the oneOf.
We can just comment this point in the documentation page?

@FabrizioMoggio
Copy link
Collaborator Author

Are you sure :-). In my understanding that means that CreateCallForwardingSignal must be in the body while for the 3legs issue (#51) it should be optional. This is way I also added the VOID option.

About the documentation it is all in the new version I have ready to fire that implements #51

Maybe it is better if I include also that version

@FabrizioMoggio
Copy link
Collaborator Author

I mean, if CreateCallForwardingSignal is in the body, we also have phoneNumber and it should be optional

@bigludo7
Copy link
Collaborator

Are you sure :-). In my understanding that means that CreateCallForwardingSignal must be in the body while for the 3legs issue (#51) it should be optional. This is way I also added the VOID option.

Are we aligned that the required in lines 165 or 218 did not indicated that the endpoint is required or not. It just indicates if in the POST operation the presence of a request body is mandatory.

If we set required=true it means that use of schema CreateAllForwardingSignal is mandatory.
In this schema the phoneNumber is optional so both following payload are valid:

{}

or

{
  "phoneNumber": "+123456789"
}

@FabrizioMoggio
Copy link
Collaborator Author

Currently in CreateAllForwardingSignal there is no indication if phoneNumber is required or not. Maybe it is better to explicit state it adding:

  minItems: 0

CreateCallForwardingSignal:
  description: resource containing the phone number (PhoneNumber) regarding
   which the Call Forwarding Service must be checked. It is optional.
  type: object
  properties:
    phoneNumber:
      $ref: "#/components/schemas/PhoneNumber"
  minItems: 0

@bigludo7
Copy link
Collaborator

For me, @FabrizioMoggio , this is not required because if the phoneNumber the definition should be:

CreateCallForwardingSignal:
  description: resource containing the phone number (PhoneNumber) regarding
   which the Call Forwarding Service must be checked. It is optional.
  type: object
  required:
    -phoneNumber
  properties:
    phoneNumber:
      $ref: "#/components/schemas/PhoneNumber"

Here because the phoneNumber is not in the required list the developer get it.

- Endpoints body mandatory according to: camaraproject#48 (comment)
- Phone number identification with 3Legs, according to: camaraproject#51
FabrizioMoggio added a commit to FabrizioMoggio/CallForwardingSignal that referenced this pull request Jul 15, 2024
according to: camaraproject#51

and supporting last commit on : camaraproject#48
Copy link
Collaborator

@bigludo7 bigludo7 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved.

@FabrizioMoggio FabrizioMoggio merged commit f98a683 into camaraproject:main Jul 16, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants