Skip to content
This repository has been archived by the owner on Jun 11, 2024. It is now read-only.

Validate system constants - Closes #2889 #2893

Merged
merged 14 commits into from
Feb 21, 2019

Conversation

michielmulders
Copy link
Contributor

What was the problem?

No validation present for system-wide constants when instantiating the app.

How did I fix it?

Add JSON Schema validation.

How to test it?

Run node index -n devnet or use any other network, inside of /src folder.

Review checklist

framework/src/controller/schema/application.js Outdated Show resolved Hide resolved
framework/src/controller/schema/application.js Outdated Show resolved Hide resolved
framework/src/controller/schema/application.js Outdated Show resolved Hide resolved
framework/src/controller/schema/application.js Outdated Show resolved Hide resolved
framework/src/controller/schema/application.js Outdated Show resolved Hide resolved
framework/src/controller/schema/application.js Outdated Show resolved Hide resolved
framework/src/controller/schema/application.js Outdated Show resolved Hide resolved
framework/src/controller/schema/application.js Outdated Show resolved Hide resolved
framework/src/controller/schema/application.js Outdated Show resolved Hide resolved
framework/src/controller/schema/application.js Outdated Show resolved Hide resolved
framework/src/controller/schema/application.js Outdated Show resolved Hide resolved
framework/src/controller/schema/application.js Outdated Show resolved Hide resolved
Copy link
Contributor

@nazarhussain nazarhussain left a comment

Choose a reason for hiding this comment

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

Please make above changes and just look into other places and where needed add proper ids to each schema.

framework/src/controller/schema/constants.js Outdated Show resolved Hide resolved
framework/src/controller/schema/constants.js Outdated Show resolved Hide resolved
framework/src/controller/schema/constants.js Outdated Show resolved Hide resolved
@nazarhussain
Copy link
Contributor

@michielmulders Please look into tests, seems they started failing now.

@shuse2
Copy link
Collaborator

shuse2 commented Feb 19, 2019

we require a lot of specific format for validation.
Why don't we create validation folder (instead of putting in helper), and add custom format there to be used in the schema validation along with schema definition?
ie)

/controller
  /validation
    validator.js
    format.js
    schema_application.js (or schema/application.js)
    schema_config.js

nazarhussain
nazarhussain previously approved these changes Feb 20, 2019
framework/src/controller/helpers/validator.js Show resolved Hide resolved
framework/src/controller/schema/constants.js Outdated Show resolved Hide resolved
framework/src/controller/schema/constants.js Outdated Show resolved Hide resolved
framework/src/controller/schema/constants.js Show resolved Hide resolved
framework/src/controller/schema/constants.js Outdated Show resolved Hide resolved
@MaciejBaj MaciejBaj merged commit 61d1ba1 into development Feb 21, 2019
@MaciejBaj MaciejBaj deleted the 2889-json-schema-app-constants branch February 21, 2019 15:12
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create controller/schemas/constants.js to validate system wide constants
4 participants