-
Notifications
You must be signed in to change notification settings - Fork 0
SOF-6144: JSON Schemas features for InMemoryEntity #14
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
Conversation
src/JSONSchemasInterface.js
Outdated
|
|
||
| export const JSONSchemasInterface = { | ||
| schemas() { | ||
| return schemas; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- This could be a static variable
- Maybe
allSchemasfor clarity - Is this ever used?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's remove
src/JSONSchemasInterface.js
Outdated
| import { schemas } from "@exabyte-io/esse.js/schemas"; | ||
| import mergeAllOf from "json-schema-merge-allof"; | ||
|
|
||
| const schemaCache = new Map(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nitpick, but schemasCache would be more appropriate
src/JSONSchemasInterface.js
Outdated
| return schemas; | ||
| }, | ||
|
|
||
| schemaById(schemaId) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Docstring to define schemaId pls
src/JSONSchemasInterface.js
Outdated
|
|
||
| resolvedSchemaById(schemaId) { | ||
| return this.schemaById(schemaId); | ||
| }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's remove this method
src/JSONSchemasInterface.js
Outdated
|
|
||
| const schemaCache = new Map(); | ||
|
|
||
| export const JSONSchemasInterface = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
export class JSONSchemasInterface() {
static allSchemas = schemas;
...
}
src/entity/in_memory.js
Outdated
| return null; | ||
| } | ||
|
|
||
| static getMainJsonSchema() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
static get baseJSONSchema
tests/JSONSchemasInterface.tests.js
Outdated
|
|
||
| describe("JSONSchemasInterface", () => { | ||
|
|
||
| it("can find schema", () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe just go through all schemas and all mixes in the 2 tests
package.json
Outdated
| "@babel/preset-react": "7.16.7", | ||
| "@babel/register": "^7.16.0", | ||
| "@babel/runtime-corejs3": "7.16.8", | ||
| "@exabyte-io/esse.js": "github:Exabyte-io/esse#b5516137e018dd35a060fce519dcd058eeff70c9", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's use npm published version
src/utils/schemas.js
Outdated
| @@ -0,0 +1,85 @@ | |||
| import { JSONSchemasInterface } from "../JSONSchemasInterface"; | |||
|
|
|||
| export const mainSchemas = { | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
baseSchemas
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here and below
SOF-6144: JSON Schemas features for InMemoryEntity
No description provided.