Skip to content

fix: handle invalid return types when parsing endpoint methods - #967

Merged
vlidholt merged 5 commits into
serverpod:mainfrom
Isakdl:fixEndpointAnalyzer
May 29, 2023
Merged

vlidholt merged 5 commits into
serverpod:mainfrom
Isakdl:fixEndpointAnalyzer

Conversation

@Isakdl

@Isakdl Isakdl commented May 29, 2023 •

Copy link
Copy Markdown
Collaborator

Fixes

The analyzer package was updated with a new type: InvalidType this PR implements support for this when checking the return type of endpoint methods.

This PR also changes the behaviour of the parsing somewhat as it will NOT include any methods that does not meet the requirements for endpoint methods. Requirements here meaning the return types are following the required synax, e.g. Must be a Future, Must be a superset of InterfaceType, Must be a Valid type.

A type can be for example be invalid if it was not defined or imported to the endpoint file.

List which issues are fixed by this PR. You must list at least one issue.
#963

Pre-launch Checklist

  • I read the Contribute page and followed the process outlined there for submitting PRs.
  • This update contains only one single feature or bug fix and nothing else. (If you are submitting multiple fixes, please make multiple PRs.)
  • I read and followed the Dart Style Guide and formatted the code with dart format.
  • I listed at least one issue that this PR fixes in the description above.
  • I updated/added relevant documentation (doc comments with ///), and made sure that the documentation follows the same style as other Serverpod documentation. I checked spelling and grammar.
  • I added new tests to check the change I am making.
  • All existing and new tests are passing.
  • Any breaking changes are documented below.

If you need help, consider asking for advice on the discussion board.

@Isakdl
Isakdl requested a review from vlidholt May 29, 2023 13:30
@vlidholt
vlidholt merged commit fd1c061 into serverpod:main May 29, 2023
@github-actions github-actions Bot locked and limited conversation to collaborators May 29, 2023
@Isakdl
Isakdl deleted the fixEndpointAnalyzer branch November 13, 2023 15:16
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants