Skip to content
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

Generated JSON schema contains an array prototype #573

Open
neen-psk opened this issue Sep 28, 2023 · 0 comments
Open

Generated JSON schema contains an array prototype #573

neen-psk opened this issue Sep 28, 2023 · 0 comments

Comments

@neen-psk
Copy link

We are using the JsonValue type from @angular-devkit/core which looks like this

export interface JsonArray extends Array<JsonValue> {
}
export interface JsonObject {
    [prop: string]: JsonValue;
}
export type JsonValue = boolean | string | number | JsonArray | JsonObject | null;

The JSON schema was correctly generated up to version 0.59.0, but starting from version 0.60.0, an array prototype began to be included in the generated schema. Is it possible to avoid this kind of noise?

             {
               "additionalProperties": false,
               "patternProperties": { "^[0-9]+$": { "$ref": "#/definitions/JsonValue" } },
+              "properties": {
+                "__@unscopables@380": {
+                  "additionalProperties": false,
+                  "patternProperties": { "^[0-9]+$": { "type": "boolean" } },
+                  "properties": {
+                    "__@iterator@378": { "type": "boolean" },
+                    "__@unscopables@380": { "type": "boolean" },
+                    "at": {
+                      "description": "Takes an integer value and returns the item at that index,\nallowing for positive and negative integers.\nNegative integers count back from the last item in the array.",
+                      "type": "boolean"
+                    },
+                    "concat": { "type": "boolean" },
+                    "copyWithin": { "type": "boolean" },
+                    "entries": { "type": "boolean" },
+                    "every": { "type": "boolean" },
+                    "fill": { "type": "boolean" },
+                    "filter": { "type": "boolean" },
+                    "find": { "type": "boolean" },
+                    "findIndex": { "type": "boolean" },
+                    "flat": { "type": "boolean" },
+                    "flatMap": { "type": "boolean" },
+                    "forEach": { "type": "boolean" },
+                    "includes": { "type": "boolean" },
+                    "indexOf": { "type": "boolean" },
+                    "join": { "type": "boolean" },
+                    "keys": { "type": "boolean" },
+                    "lastIndexOf": { "type": "boolean" },
+                    "length": { "type": "boolean" },
+                    "map": { "type": "boolean" },
+                    "pop": { "type": "boolean" },
+                    "push": { "type": "boolean" },
+                    "reduce": { "type": "boolean" },
+                    "reduceRight": { "type": "boolean" },
+                    "reverse": { "type": "boolean" },
+                    "shift": { "type": "boolean" },
+                    "slice": { "type": "boolean" },
+                    "some": { "type": "boolean" },
+                    "sort": { "type": "boolean" },
+                    "splice": { "type": "boolean" },
+                    "toLocaleString": { "type": "boolean" },
+                    "toString": { "type": "boolean" },
+                    "unshift": { "type": "boolean" },
+                    "values": { "type": "boolean" }
+                  },
+                  "type": "object"
+                },
+                "length": { "type": "number" }
+              },
+              "required": ["__@unscopables@380", "length"],
               "type": "object"
             },
             { "$ref": "#/definitions/JsonObject" },
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

No branches or pull requests

1 participant