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

Incorrect type information in Twilio\Rest\Api\V2010\Account\MessageInstance #727

Closed
DaveLiddament opened this issue Apr 21, 2022 · 3 comments · Fixed by twilio/twilio-oai-generator#409
Labels
code-generation issue deals with generated code status: help wanted requesting help from the community type: community enhancement feature request not on Twilio's roadmap

Comments

@DaveLiddament
Copy link

Issue Summary

There is incorrect type information for the MessageInstance::$errorCode property.

The type hint suggests it will always be an int:

 @property int $errorCode

I'm getting TypeErrors, it seems that $errorCode can also be null.

Please can you update the docblock to the correct type:

 @property int|null $errorCode

As the use of static analysis tools is increasing it is quite important that type information is correct.

Thanks

@childish-sambino
Copy link
Contributor

This issue has been added to our internal backlog to be prioritized. Pull requests and +1s on the issue summary will help it move up the backlog.

@childish-sambino childish-sambino added code-generation issue deals with generated code type: community enhancement feature request not on Twilio's roadmap status: help wanted requesting help from the community labels Apr 22, 2022
@DaveLiddament
Copy link
Author

@childish-sambino I'm happy to provide a PR for this. Can you confirm if MessageInstance is autogenerated? I see this comment at the top which suggests it might be:

/**
 * This code was generated by
 * \ / _    _  _|   _  _
 * | (_)\/(_)(_|\/| |(/_  v1.0.0
 * /       /
 */

If it is auto generated please can you point me in the direction of how to update the source data.
If it is NOT auto generated then let me know and I'll supply a fix to this file.

Thanks

@childish-sambino
Copy link
Contributor

childish-sambino commented May 10, 2022

@DaveLiddament That header indicates it is auto-generated. Unfortunately, the generator is not open source. We will be working to migrate to an open-source generator, though.

Similar to twilio/twilio-node#606

isha689 added a commit to twilio/twilio-oai-generator that referenced this issue Jan 27, 2023
<!--
We appreciate the effort for this pull request but before that please
make sure you read the contribution guidelines, then fill out the blanks
below.

Please format the PR title appropriately based on the type of change:
  <type>[!]: <description>
Where <type> is one of: docs, chore, feat, fix, test, misc.
Add a '!' after the type for breaking changes (e.g. feat!: new breaking
feature).

**All third-party contributors acknowledge that any contributions they
provide will be made under the same open-source license that the
open-source project is provided under.**

Please enter each Issue number you are resolving in your PR after one of
the following words [Fixes, Closes, Resolves]. This will auto-link these
issues and close them when this PR is merged!
e.g.
Fixes #1
Closes #2
-->

# Fixes [#727](twilio/twilio-php#727)

Set correct dataType for nullable response properties.
Jira link: https://issues.corp.twilio.com/browse/DII-789

### Checklist
- [x] I acknowledge that all my contributions will be made under the
project's license
- [ ] Run `make test-docker`
- [ ] Verify affected language:
- [ ] Generate [twilio-go](https://github.com/twilio/twilio-go) from our
[OpenAPI specification](https://github.com/twilio/twilio-oai) using the
[build_twilio_go.py](./examples/build_twilio_go.py) using `python
examples/build_twilio_go.py path/to/twilio-oai/spec/yaml
path/to/twilio-go` and inspect the diff
    - [ ] Run `make test` in `twilio-go`
    - [ ] Create a pull request in `twilio-go`
    - [ ] Provide a link below to the pull request
- [ ] I have made a material change to the repo (functionality, testing,
spelling, grammar)
- [ ] I have read the [Contribution
Guidelines](https://github.com/twilio/twilio-oai-generator/blob/main/CONTRIBUTING.md)
and my PR follows them
- [ ] I have titled the PR appropriately
- [ ] I have updated my branch with the main branch
- [ ] I have added tests that prove my fix is effective or that my
feature works
- [ ] I have added the necessary documentation about the functionality
in the appropriate .md file
- [ ] I have added inline documentation to the code I modified

If you have questions, please create a GitHub Issue in this repository.
shrutiburman added a commit to twilio/twilio-oai-generator that referenced this issue Jan 29, 2023
commit 881c2c2
Author: childish-sambino <[email protected]>
Date:   Fri Jan 27 16:15:49 2023 -0600

    test: look for all services, including those that are stopped, when checking status (#416)

commit 111ef95
Author: childish-sambino <[email protected]>
Date:   Fri Jan 27 14:55:59 2023 -0600

    fix: move lib to src and dist to lib for node backwards-compatibility (#415)

commit a0b4320
Author: Isha Bansal <[email protected]>
Date:   Fri Jan 27 20:20:56 2023 +0530

    fix: set correct type for response properties (#409)

    <!--
    We appreciate the effort for this pull request but before that please
    make sure you read the contribution guidelines, then fill out the blanks
    below.

    Please format the PR title appropriately based on the type of change:
      <type>[!]: <description>
    Where <type> is one of: docs, chore, feat, fix, test, misc.
    Add a '!' after the type for breaking changes (e.g. feat!: new breaking
    feature).

    **All third-party contributors acknowledge that any contributions they
    provide will be made under the same open-source license that the
    open-source project is provided under.**

    Please enter each Issue number you are resolving in your PR after one of
    the following words [Fixes, Closes, Resolves]. This will auto-link these
    issues and close them when this PR is merged!
    e.g.
    Fixes #1
    Closes #2
    -->

    # Fixes [#727](twilio/twilio-php#727)

    Set correct dataType for nullable response properties.
    Jira link: https://issues.corp.twilio.com/browse/DII-789

    ### Checklist
    - [x] I acknowledge that all my contributions will be made under the
    project's license
    - [ ] Run `make test-docker`
    - [ ] Verify affected language:
    - [ ] Generate [twilio-go](https://github.com/twilio/twilio-go) from our
    [OpenAPI specification](https://github.com/twilio/twilio-oai) using the
    [build_twilio_go.py](./examples/build_twilio_go.py) using `python
    examples/build_twilio_go.py path/to/twilio-oai/spec/yaml
    path/to/twilio-go` and inspect the diff
        - [ ] Run `make test` in `twilio-go`
        - [ ] Create a pull request in `twilio-go`
        - [ ] Provide a link below to the pull request
    - [ ] I have made a material change to the repo (functionality, testing,
    spelling, grammar)
    - [ ] I have read the [Contribution
    Guidelines](https://github.com/twilio/twilio-oai-generator/blob/main/CONTRIBUTING.md)
    and my PR follows them
    - [ ] I have titled the PR appropriately
    - [ ] I have updated my branch with the main branch
    - [ ] I have added tests that prove my fix is effective or that my
    feature works
    - [ ] I have added the necessary documentation about the functionality
    in the appropriate .md file
    - [ ] I have added inline documentation to the code I modified

    If you have questions, please create a GitHub Issue in this repository.

commit 780dd25
Author: Isha Bansal <[email protected]>
Date:   Fri Jan 27 10:25:53 2023 +0530

    fix: trailing comma (#414)

    <!--
    We appreciate the effort for this pull request but before that please
    make sure you read the contribution guidelines, then fill out the blanks
    below.

    Please format the PR title appropriately based on the type of change:
      <type>[!]: <description>
    Where <type> is one of: docs, chore, feat, fix, test, misc.
    Add a '!' after the type for breaking changes (e.g. feat!: new breaking
    feature).

    **All third-party contributors acknowledge that any contributions they
    provide will be made under the same open-source license that the
    open-source project is provided under.**

    Please enter each Issue number you are resolving in your PR after one of
    the following words [Fixes, Closes, Resolves]. This will auto-link these
    issues and close them when this PR is merged!
    e.g.
    Fixes #1
    Closes #2
    -->

    # Fixes #

    Removed the trailing comma within the function call.
    Correct alignment of braces.

    Cluster Tests successful run:
    [here](https://github.com/twilio/twilio-php/actions/runs/4014524180)

    ### Checklist
    - [x] I acknowledge that all my contributions will be made under the
    project's license
    - [ ] Run `make test-docker`
    - [ ] Verify affected language:
    - [ ] Generate [twilio-go](https://github.com/twilio/twilio-go) from our
    [OpenAPI specification](https://github.com/twilio/twilio-oai) using the
    [build_twilio_go.py](./examples/build_twilio_go.py) using `python
    examples/build_twilio_go.py path/to/twilio-oai/spec/yaml
    path/to/twilio-go` and inspect the diff
        - [ ] Run `make test` in `twilio-go`
        - [ ] Create a pull request in `twilio-go`
        - [ ] Provide a link below to the pull request
    - [ ] I have made a material change to the repo (functionality, testing,
    spelling, grammar)
    - [ ] I have read the [Contribution
    Guidelines](https://github.com/twilio/twilio-oai-generator/blob/main/CONTRIBUTING.md)
    and my PR follows them
    - [ ] I have titled the PR appropriately
    - [ ] I have updated my branch with the main branch
    - [ ] I have added tests that prove my fix is effective or that my
    feature works
    - [ ] I have added the necessary documentation about the functionality
    in the appropriate .md file
    - [ ] I have added inline documentation to the code I modified

    If you have questions, please create a GitHub Issue in this repository.

commit 371df1c
Author: Claudia Chua <[email protected]>
Date:   Thu Jan 26 09:11:10 2023 +0800

    fix: remove camelcase duplicates domains (#413)

commit c2b17aa
Author: cchua <[email protected]>
Date:   Thu Jan 26 04:04:46 2023 +0800

    revert last commit

commit ca3adc4
Author: cchua <[email protected]>
Date:   Thu Jan 26 04:01:50 2023 +0800

    fix: remove camelcase duplicates domains

commit 8d060e2
Author: Rohith Prakash <[email protected]>
Date:   Wed Jan 25 17:15:14 2023 +0530

    chore: Ruby add Page template (#412)

    <!--
    We appreciate the effort for this pull request but before that please
    make sure you read the contribution guidelines, then fill out the blanks
    below.

    Please format the PR title appropriately based on the type of change:
      <type>[!]: <description>
    Where <type> is one of: docs, chore, feat, fix, test, misc.
    Add a '!' after the type for breaking changes (e.g. feat!: new breaking
    feature).

    **All third-party contributors acknowledge that any contributions they
    provide will be made under the same open-source license that the
    open-source project is provided under.**

    Please enter each Issue number you are resolving in your PR after one of
    the following words [Fixes, Closes, Resolves]. This will auto-link these
    issues and close them when this PR is merged!
    e.g.
    Fixes #1
    Closes #2
    -->

    # Chore #

    Adds ruby page class template

    ### Checklist
    - [x] I acknowledge that all my contributions will be made under the
    project's license
    - [ ] Run `make test-docker`
    - [ ] Verify affected language:
    - [ ] Generate [twilio-go](https://github.com/twilio/twilio-go) from our
    [OpenAPI specification](https://github.com/twilio/twilio-oai) using the
    [build_twilio_go.py](./examples/build_twilio_go.py) using `python
    examples/build_twilio_go.py path/to/twilio-oai/spec/yaml
    path/to/twilio-go` and inspect the diff
        - [ ] Run `make test` in `twilio-go`
        - [ ] Create a pull request in `twilio-go`
        - [ ] Provide a link below to the pull request
    - [ ] I have made a material change to the repo (functionality, testing,
    spelling, grammar)
    - [ ] I have read the [Contribution
    Guidelines](https://github.com/twilio/twilio-oai-generator/blob/main/CONTRIBUTING.md)
    and my PR follows them
    - [ ] I have titled the PR appropriately
    - [ ] I have updated my branch with the main branch
    - [ ] I have added tests that prove my fix is effective or that my
    feature works
    - [ ] I have added the necessary documentation about the functionality
    in the appropriate .md file
    - [ ] I have added inline documentation to the code I modified

    If you have questions, please create a GitHub Issue in this repository.

commit 6ed2a9f
Author: Isha Bansal <[email protected]>
Date:   Tue Jan 24 16:58:13 2023 +0530

    fix: type hint for $capabilities to PhoneNumberCapabilities (#404)

    <!--
    We appreciate the effort for this pull request but before that please
    make sure you read the contribution guidelines, then fill out the blanks
    below.

    Please format the PR title appropriately based on the type of change:
      <type>[!]: <description>
    Where <type> is one of: docs, chore, feat, fix, test, misc.
    Add a '!' after the type for breaking changes (e.g. feat!: new breaking
    feature).

    **All third-party contributors acknowledge that any contributions they
    provide will be made under the same open-source license that the
    open-source project is provided under.**

    Please enter each Issue number you are resolving in your PR after one of
    the following words [Fixes, Closes, Resolves]. This will auto-link these
    issues and close them when this PR is merged!
    e.g.
    Fixes #1
    Closes #2
    -->

    # Fixes #

    Fixes [php-issue](twilio/twilio-php#627)
    Ref: [PR](twilio/twilio-php#760)
    Made changes in Dockerfile because the generated src folder will depend
    on [Deserialize::
    phoneNumberCapabilities()](https://github.com/twilio/twilio-php/blob/DII-790/src/Twilio/Deserialize.php#L34)
    which is to be merged into rc-branch.
    **Note: Dockerfile changes to be reverted before MVR release**

    ### Checklist
    - [x] I acknowledge that all my contributions will be made under the
    project's license
    - [ ] Run `make test-docker`
    - [ ] Verify affected language:
    - [ ] Generate [twilio-go](https://github.com/twilio/twilio-go) from our
    [OpenAPI specification](https://github.com/twilio/twilio-oai) using the
    [build_twilio_go.py](./examples/build_twilio_go.py) using `python
    examples/build_twilio_go.py path/to/twilio-oai/spec/yaml
    path/to/twilio-go` and inspect the diff
        - [ ] Run `make test` in `twilio-go`
        - [ ] Create a pull request in `twilio-go`
        - [ ] Provide a link below to the pull request
    - [ ] I have made a material change to the repo (functionality, testing,
    spelling, grammar)
    - [ ] I have read the [Contribution
    Guidelines](https://github.com/twilio/twilio-oai-generator/blob/main/CONTRIBUTING.md)
    and my PR follows them
    - [ ] I have titled the PR appropriately
    - [ ] I have updated my branch with the main branch
    - [ ] I have added tests that prove my fix is effective or that my
    feature works
    - [ ] I have added the necessary documentation about the functionality
    in the appropriate .md file
    - [ ] I have added inline documentation to the code I modified

    If you have questions, please create a GitHub Issue in this repository.

commit fee7ea3
Author: Charanjeet Singh <[email protected]>
Date:   Tue Jan 24 13:15:49 2023 +0530

    fix: Php lint issues (#411)

    <!--
    We appreciate the effort for this pull request but before that please
    make sure you read the contribution guidelines, then fill out the blanks
    below.

    Please format the PR title appropriately based on the type of change:
      <type>[!]: <description>
    Where <type> is one of: docs, chore, feat, fix, test, misc.
    Add a '!' after the type for breaking changes (e.g. feat!: new breaking
    feature).

    **All third-party contributors acknowledge that any contributions they
    provide will be made under the same open-source license that the
    open-source project is provided under.**

    Please enter each Issue number you are resolving in your PR after one of
    the following words [Fixes, Closes, Resolves]. This will auto-link these
    issues and close them when this PR is merged!
    e.g.
    Fixes #1
    Closes #2
    -->

    # Fixes #

    - Fix sonar lint issues for php generated example files
    - Fix php template files and generated path string from phpAPIBuilder

    ### Checklist
    - [x] I acknowledge that all my contributions will be made under the
    project's license
    - [ ] Run `make test-docker`
    - [ ] Verify affected language:
    - [ ] Generate [twilio-go](https://github.com/twilio/twilio-go) from our
    [OpenAPI specification](https://github.com/twilio/twilio-oai) using the
    [build_twilio_go.py](./examples/build_twilio_go.py) using `python
    examples/build_twilio_go.py path/to/twilio-oai/spec/yaml
    path/to/twilio-go` and inspect the diff
        - [ ] Run `make test` in `twilio-go`
        - [ ] Create a pull request in `twilio-go`
        - [ ] Provide a link below to the pull request
    - [ ] I have made a material change to the repo (functionality, testing,
    spelling, grammar)
    - [ ] I have read the [Contribution
    Guidelines](https://github.com/twilio/twilio-oai-generator/blob/main/CONTRIBUTING.md)
    and my PR follows them
    - [ ] I have titled the PR appropriately
    - [ ] I have updated my branch with the main branch
    - [ ] I have added tests that prove my fix is effective or that my
    feature works
    - [ ] I have added the necessary documentation about the functionality
    in the appropriate .md file
    - [ ] I have added inline documentation to the code I modified

    If you have questions, please create a GitHub Issue in this repository.

commit 78d623d
Author: childish-sambino <[email protected]>
Date:   Fri Jan 20 09:51:28 2023 -0600

    fix: refactor API filename generation for ruby (#408)

    Node examples are currently broken. This fixes it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code-generation issue deals with generated code status: help wanted requesting help from the community type: community enhancement feature request not on Twilio's roadmap
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants