Skip to content

Parse.Schema save method has invalid return type #9290

Open
@alino20

Description

@alino20

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    type:bugImpaired feature or lacking behavior that is likely assumed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions