{
    "$id": "https://docs.digdir.no/schemas/common/problem.schema.json",
    "$schema": "http://json-schema.org/draft-07/schema#",
    "description": "Digdir schema for problem+json described in RFC7807",
    "definitions": {
        
        "problemtype": {
            "type": "string",
            "$id": "#/definitions/problemtype",
            "format": "uri",
            "description": "A URI reference that identifies the problem type.",
            "$comment": "A URI reference [RFC3986] that identifies the problem type.  This specification encourages that, when dereferenced, it provide human-readable documentation for the problem type (e.g., using HTML [W3C.REC-html5-20141028]). When this member is not present, its value is assumed to be 'about:blank'."
        },

        "title" : {
            "type": "string",
            "$id": "#/definitions/title",
            "description": "A short, human-readable summary of the problem type",
            "$comment": "A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4)."
        },

        "status": {
            "type": "integer",
            "$id": "#/definitions/status",
            "description": "The HTTP status code",
            "$comment": " The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem."
        },

        "detail":{
            "type": "string",
            "$id": "#/definitions/detail",
            "description": "A human-readable explanation specific to this occurrence of the problem."
        },

        "instance": {
            "type": "string",
            "$id": "#/definitions/instance",
            "description": "A URI reference that identifies the specific occurrence of the problem",
            "$comment": "A URI reference that identifies the specific occurrence of the problem. It may or may not yield further information if dereferenced."
        }
      },
      "required": ["type", "detail"],
    
    "type": "object",    
    "properties": {
        "type": { "$ref": "#/definitions/problemtype"},
        "title": {"$ref": "#/definitions/title"},
        "status" : {"$ref": "#/definitions/status"},
        "detail": {"$ref": "#/definitions/detail"},
        "instance": {"$ref": "#/definitions/instance"}
    },
    "additionalProperties": true
   
}