pankajastro commented on code in PR #72853:
URL: https://github.com/apache/airflow/pull/72853#discussion_r3982139114
##########
airflow-core/src/airflow/provider.yaml.schema.json:
##########
@@ -428,8 +428,9 @@
"type": "object",
"properties": {
"connection-type": {
- "description": "Type of connection defined by the
provider",
- "type": "string"
+ "description": "Type of connection defined by the
provider. Lowercase letters, digits and '_' only, starting with a letter. The
hook is registered under this exact string, while Connection.get_uri() encodes
'_' as '-' and from_uri/from_json decode '-' back to '_'. A '-' here is
therefore indistinguishable from an encoded '_' and leaves the hook
unresolvable for any connection stored as a URI or JSON; uppercase is lost to
get_uri()'s lowercasing; and a leading digit is not a valid URI scheme under
RFC 3986.",
+ "type": "string",
+ "pattern": "^[a-z][a-z0-9_]*$"
Review Comment:
jsonschema's Python regex backend uses re.search, not re.fullmatch — and $
matches just before a trailing \n, not only end-of-string. Does
^[a-z][a-z0-9_]*$ actually reject a connection-type value with an embedded
trailing newline (e.g. from a YAML block scalar), or would that slip through
check-provider-yaml-valid the same way the hyphenated values did?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]