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

Parse.Schema save method has invalid return type #9290

Open
alino20 opened this issue Aug 21, 2024 · 1 comment
Open

Parse.Schema save method has invalid return type #9290

alino20 opened this issue Aug 21, 2024 · 1 comment

Comments

@alino20
Copy link

alino20 commented Aug 21, 2024

New Issue Checklist

Issue Description

Parse.Schema save method documentation says that this method has the return type of Promise<Parse.Schema> but in reality it its Promise<Parse.RestSchema>
these two objects have totally different methods and properties and can not be used interchangeably.

Steps to reproduce

let schema : Parse.Schema = new Parse.Schema("MyClass");
schema = await schema.save();
const restSchema : Parse.RestSchema  = await schema.get();

Actual Outcome

This sample code is completely acceptable by Typescript but in runtime throws an error, stating that schema object does not have a get method.

Expected Outcome

The return type should match what is actually returned. Either by changing Docs or Code.

Environment

Server

  • Parse Server version: 7.2.0
  • Operating system: Microsoft Windows 11
  • Local or remote host (AWS, Azure, Google Cloud, Heroku, Digital Ocean, etc): Local

Database

  • System (MongoDB or Postgres): MongoDB
  • Database version: 6.0.16
  • Local or remote host (MongoDB Atlas, mLab, AWS, Azure, Google Cloud, etc): Local (Docker)

Client

  • SDK (iOS, Android, JavaScript, PHP, Unity, etc): JavaScript
  • SDK version: 5.3.0
Copy link

parse-github-assistant bot commented Aug 21, 2024

Thanks for opening this issue!

  • 🚀 You can help us to fix this issue faster by opening a pull request with a failing test. See our Contribution Guide for how to make a pull request, or read our New Contributor's Guide if this is your first time contributing.

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

No branches or pull requests

1 participant