-
Notifications
You must be signed in to change notification settings - Fork 11
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
feat(input_schema): Resource properties #484
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, just have two idea on how we can simplify.
} | ||
} | ||
} | ||
}, | ||
"additionalProperties": false, | ||
"required": ["title", "type", "properties", "schemaVersion"], | ||
"definitions": { | ||
"resourceProperty": { | ||
"title": "Resource property", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: It looks the title, description, nullable, sectionCaption, sectionDescription appear in all definition. Could we move these to special definitions?
{
...
"definitions": {
"baseProperty": {
"type": "object",
"properties": {
"title": {"type": "string"},
"description": {
"type": "string"
},
"nullable": { "type": "boolean"}
},
"required": ["title", "description"]
},
"resourceProperty": {
"allOf": [
{"$ref": "#/definitions/baseProperty"},
{
"properties": {
...the rest of props on top of baseProperty
}
}
],
"required": ["type", "title", "description", "resourceType"]
},
...
}
...
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the "allOf" base property Kuba has. Otherwise preapproving
The solution with baseProperty and
So it's possible but do we really need it in this case with the increased complexity of validation? According to: |
I liked the idea because it reduces repetition of the schema, but if it's at the cost of increased complexity of the schema, then I do not mind the current solution where the properties are repeated. |
@drobnikj I was able to remove this condition at all by updating our custom validation and moving some tests from |
Update of input schema based on apify/apify-docs#1261:
New properties in schema:
resourceProperty
andresourceArrayProperty
To distinguish between resource properties with
resourceType
and string/array properties custom validation is done invalidateField
(because of clash on sametype
)Input ui to support this schmena is ready here: https://github.com/apify/apify-core/pull/18093