Skip to content

feat: Update config to automatically check types#8535

Draft
dblythy wants to merge 6 commits intoparse-community:alphafrom
dblythy:validate-options
Draft

feat: Update config to automatically check types#8535
dblythy wants to merge 6 commits intoparse-community:alphafrom
dblythy:validate-options

Conversation

@dblythy
Copy link
Copy Markdown
Member

@dblythy dblythy commented May 17, 2023

Pull Request

Issue

Parse Server options need to validated manually, where they should be compared directly against their definitions.

Closes: #8202

Approach

Tasks

  • Add tests

@parse-github-assistant
Copy link
Copy Markdown

I will reformat the title to use the proper commit message syntax.

@parse-github-assistant parse-github-assistant Bot changed the title feat: update config to automatically check types feat: Update config to automatically check types May 17, 2023
@parse-github-assistant
Copy link
Copy Markdown

Thanks for opening this pull request!

Copy link
Copy Markdown
Member

@mtrezza mtrezza left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Amazing PR and clean-up!

Comment thread src/Options/docs.js
* @property {String} appId Your Parse Application ID
* @property {String} appName Sets the app name
* @property {AuthAdapter[]} auth Configuration for your authentication providers, as stringified JSON. See http://docs.parseplatform.org/parse-server/guide/#oauth-and-3rd-party-authentication
* @property {Auth} auth Configuration for your authentication providers, as stringified JSON. See http://docs.parseplatform.org/parse-server/guide/#oauth-and-3rd-party-authentication
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you give some insight about this change? It looks like a breaking change, or was the type incorrect?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's an incorrect type, the Auth option is not an array, it's an object with keys:

auth: {
  facebook: {},
  myAuth: {},
}

Copy link
Copy Markdown
Member

@mtrezza mtrezza May 19, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please check:

  • What do the docs (API docs and in docs repo) currently say - array or object?
  • Are there any tests that currently use an array, or do they all use an object?
  • If a developer currently set an array instead of object, would Parse Server accept that option and would that actually work? If it works, will this change break an existing Parse Server where an array is set?

Just so we understand the full implications of this change / bug fix (?).

Signed-off-by: Daniel <daniel-blyth@live.com.au>
@dblythy dblythy marked this pull request as draft May 19, 2023 02:53
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

Successfully merging this pull request may close these issues.

Parse Server options should set default

2 participants