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

Add com.snowplowanalytics.iglu/client_error/jsonschema/1-0-0 #924

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
101 changes: 101 additions & 0 deletions schemas/com.snowplowanalytics.iglu/client_error/jsonschema/1-0-0
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
{
"$schema": "http://iglucentral.com/schemas/com.snowplowanalytics.self-desc/schema/jsonschema/1-0-0#",
"description": "Possible unsuccessful result produced by Iglu Client",
"self": {
"vendor": "com.snowplowanalytics.iglu",
"name": "client_error",
"format": "jsonschema",
"version": "1-0-0"
},
"type": "object",
"required": ["error"],
Copy link
Contributor

Choose a reason for hiding this comment

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

does this relate to the anyOf?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, some error is always present. Either ResolutionError or ValidationError

"anyOf": [
{
"description": "Problem during schema resolution, missing schema or internal error",
"properties": {
"error": {
"enum": ["ResolutionError"]
},
"lookupHistory": {
"description": "Set of all traversed repositories with their failures",
"type": "array",
"minItems": 1,
"items": {
"type": "object",
"properties": {
"repository": {
"description": "Repository name from resolver config",
"type": "string"
},
"errors": {
"type": "array",
Copy link
Contributor

Choose a reason for hiding this comment

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

should there be a minItems?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, good idea.

"items": {
"properties": {
"error": {
"enum": ["ClientFailure", "RepoFailure", "NotFound"]
},
"message": {
"type": "string"
}
},
"required": ["error"]
}
},
"attempts": {
"description": "Number of attempts this repository has been queried",
"type": "integer",
"minimum": 0
},
"fatal": {
"type": "boolean"
Copy link
Contributor

Choose a reason for hiding this comment

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

could we have a desc?

}
},
"required": ["repository", "errors", "attempts"],
"additionalProperties": false
}
}
},
"required": ["error", "lookupHistory"],
"additionalProperties": false
},
{
"description": "Data is invalid against its schema",
"properties": {
Copy link
Contributor

Choose a reason for hiding this comment

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

we seem to be missing required and additionalProperties

"error": {
"enum": ["ValidationError"]
},
"dataReports": {
"type": "array",
"minItems": 1,
"items": {
"type": "object",
"description": "List of reports",
Copy link
Contributor

Choose a reason for hiding this comment

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

this is just one report, no?

"properties": {
"message": {
"description": "Human-readable error message",
"type": "string"
},
"path": {
"description": "JSON Path to problematic property in instance",
"type": ["string", "null"]
},
"keyword": {
"description": "JSON Schema keyword caused this report",
"type": ["string", "null"]
},
"targets": {
"description": "List of properties affected in instance",
"type": "array",
Copy link
Contributor

Choose a reason for hiding this comment

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

should there be a minItems?

"items": {
"type": "string"
}
}
},
"required": ["message", "path", "keyword", "targets"],
"additionalProperties": false
}
}
}
}
]
}