AnyCrawl icon indicating copy to clipboard operation
AnyCrawl copied to clipboard

Validation error on schema type "enum"

Open megafetis opened this issue 3 months ago • 2 comments

unfortunately, the validator does not allow the enum type in the json schema.

"contacts": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {

              "description": {
                "type": "string"
              },

              "is_main": {
                "type": "boolean"
              },
              "contact_value": {
                "type": "string"
              },
              "contact_type": {
                "enum": [
                  "email",
                  "phone",
                  "social_url",
                  "web_site"
                ]
              }
            }
          }
        },

megafetis avatar Sep 03 '25 14:09 megafetis

We are currently using a tiny version of the JSON schema and do not support enum for now. its for extract better and more accurate. You can add the enum values to the description. And, it may be considered to support it in the future.

QThans avatar Sep 03 '25 15:09 QThans

Thank you. In strongly typed languages such as C#, it is a cool feature to translate a class into a json schema via reflection, where enums are widely used (and other simple types). Ok, Okay, I get it. It is not critical

megafetis avatar Sep 03 '25 18:09 megafetis