Skip to content

Conversation

@k0stik
Copy link
Member

@k0stik k0stik commented Jul 20, 2022

No description provided.


export const JSONSchemasInterface = {
schemas() {
return schemas;
Copy link
Member

Choose a reason for hiding this comment

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

  1. This could be a static variable
  2. Maybe allSchemas for clarity
  3. Is this ever used?

Copy link
Member

Choose a reason for hiding this comment

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

Let's remove

import { schemas } from "@exabyte-io/esse.js/schemas";
import mergeAllOf from "json-schema-merge-allof";

const schemaCache = new Map();
Copy link
Member

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

return schemas;
},

schemaById(schemaId) {
Copy link
Member

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


resolvedSchemaById(schemaId) {
return this.schemaById(schemaId);
},
Copy link
Member

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


const schemaCache = new Map();

export const JSONSchemasInterface = {
Copy link
Member

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;
...
}

return null;
}

static getMainJsonSchema() {
Copy link
Member

Choose a reason for hiding this comment

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

static get baseJSONSchema


describe("JSONSchemasInterface", () => {

it("can find schema", () => {
Copy link
Member

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",
Copy link
Member

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

@@ -0,0 +1,85 @@
import { JSONSchemasInterface } from "../JSONSchemasInterface";

export const mainSchemas = {
Copy link
Member

Choose a reason for hiding this comment

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

baseSchemas

Copy link
Member

Choose a reason for hiding this comment

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

Here and below

@timurbazhirov timurbazhirov merged commit bc0dd65 into main Jul 29, 2022
@timurbazhirov timurbazhirov deleted the featute/SOF-6144 branch July 29, 2022 02:33
k0stik pushed a commit that referenced this pull request Jul 31, 2023
SOF-6144: JSON Schemas features for InMemoryEntity
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.

3 participants