Skip to content

feat: Update config to automatically check types #8535

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

Draft
wants to merge 6 commits into
base: alpha
Choose a base branch
from

Conversation

dblythy
Copy link
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

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

Thanks for opening this pull request!

Copy link
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!

@@ -20,7 +20,7 @@
* @property {Adapter<AnalyticsAdapter>} analyticsAdapter Adapter module for the analytics
* @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
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
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
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 (?).

@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