parse-community / parse-server

Parse Server for Node.js / Express
https://parseplatform.org
Apache License 2.0
20.91k stars 4.78k forks source link

Parse.Schema save method has invalid return type #9290

Open alino20 opened 2 months ago

alino20 commented 2 months ago

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

Database

Client

parse-github-assistant[bot] commented 2 months ago

Thanks for opening this issue!

mtrezza commented 2 weeks ago

@Moumouls Is this actually a bug?