Skip to content

Commit

Permalink
specially handle "docs::type_override" with "ascii_char" in generate-…
Browse files Browse the repository at this point in the history
…component-docs.rb
  • Loading branch information
scMarkus committed Jun 25, 2024
1 parent 5d30395 commit d49d239
Show file tree
Hide file tree
Showing 28 changed files with 32 additions and 28 deletions.
6 changes: 5 additions & 1 deletion scripts/generate-component-docs.rb
Original file line number Diff line number Diff line change
Expand Up @@ -746,7 +746,11 @@ def resolve_schema(root_schema, schema)
# process to provide the actual details. We only need to specify the custom type name.
type_override = get_schema_metadata(schema, 'docs::type_override')
if !type_override.nil?
resolved = { 'type' => { type_override.to_s => {} } }
if type_override == 'ascii_char'
resolved = { 'type' => { type_override.to_s => { 'default' => schema['default'].chr } } }
else
resolved = { 'type' => { type_override.to_s => {} } }
end
description = get_rendered_description_from_schema(schema)
resolved['description'] = description unless description.empty?
return resolved
Expand Down
2 changes: 1 addition & 1 deletion website/cue/reference/components/sinks/base/amqp.cue
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ base: components: sinks: amqp: configuration: {
delimiter: {
description: "The field delimiter to use when writing CSV."
required: false
type: uint: default: 44
type: ascii_char: default: ","
}
double_quote: {
description: """
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ base: components: sinks: aws_cloudwatch_logs: configuration: {
delimiter: {
description: "The field delimiter to use when writing CSV."
required: false
type: uint: default: 44
type: ascii_char: default: ","
}
double_quote: {
description: """
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ base: components: sinks: aws_kinesis_firehose: configuration: {
delimiter: {
description: "The field delimiter to use when writing CSV."
required: false
type: uint: default: 44
type: ascii_char: default: ","
}
double_quote: {
description: """
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ base: components: sinks: aws_kinesis_streams: configuration: {
delimiter: {
description: "The field delimiter to use when writing CSV."
required: false
type: uint: default: 44
type: ascii_char: default: ","
}
double_quote: {
description: """
Expand Down
2 changes: 1 addition & 1 deletion website/cue/reference/components/sinks/base/aws_s3.cue
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ base: components: sinks: aws_s3: configuration: {
delimiter: {
description: "The field delimiter to use when writing CSV."
required: false
type: uint: default: 44
type: ascii_char: default: ","
}
double_quote: {
description: """
Expand Down
2 changes: 1 addition & 1 deletion website/cue/reference/components/sinks/base/aws_sns.cue
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ base: components: sinks: aws_sns: configuration: {
delimiter: {
description: "The field delimiter to use when writing CSV."
required: false
type: uint: default: 44
type: ascii_char: default: ","
}
double_quote: {
description: """
Expand Down
2 changes: 1 addition & 1 deletion website/cue/reference/components/sinks/base/aws_sqs.cue
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ base: components: sinks: aws_sqs: configuration: {
delimiter: {
description: "The field delimiter to use when writing CSV."
required: false
type: uint: default: 44
type: ascii_char: default: ","
}
double_quote: {
description: """
Expand Down
2 changes: 1 addition & 1 deletion website/cue/reference/components/sinks/base/azure_blob.cue
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ base: components: sinks: azure_blob: configuration: {
delimiter: {
description: "The field delimiter to use when writing CSV."
required: false
type: uint: default: 44
type: ascii_char: default: ","
}
double_quote: {
description: """
Expand Down
2 changes: 1 addition & 1 deletion website/cue/reference/components/sinks/base/console.cue
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ base: components: sinks: console: configuration: {
delimiter: {
description: "The field delimiter to use when writing CSV."
required: false
type: uint: default: 44
type: ascii_char: default: ","
}
double_quote: {
description: """
Expand Down
2 changes: 1 addition & 1 deletion website/cue/reference/components/sinks/base/databend.cue
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ base: components: sinks: databend: configuration: {
delimiter: {
description: "The field delimiter to use when writing CSV."
required: false
type: uint: default: 44
type: ascii_char: default: ","
}
double_quote: {
description: """
Expand Down
2 changes: 1 addition & 1 deletion website/cue/reference/components/sinks/base/file.cue
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ base: components: sinks: file: configuration: {
delimiter: {
description: "The field delimiter to use when writing CSV."
required: false
type: uint: default: 44
type: ascii_char: default: ","
}
double_quote: {
description: """
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ base: components: sinks: gcp_chronicle_unstructured: configuration: {
delimiter: {
description: "The field delimiter to use when writing CSV."
required: false
type: uint: default: 44
type: ascii_char: default: ","
}
double_quote: {
description: """
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ base: components: sinks: gcp_cloud_storage: configuration: {
delimiter: {
description: "The field delimiter to use when writing CSV."
required: false
type: uint: default: 44
type: ascii_char: default: ","
}
double_quote: {
description: """
Expand Down
2 changes: 1 addition & 1 deletion website/cue/reference/components/sinks/base/gcp_pubsub.cue
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ base: components: sinks: gcp_pubsub: configuration: {
delimiter: {
description: "The field delimiter to use when writing CSV."
required: false
type: uint: default: 44
type: ascii_char: default: ","
}
double_quote: {
description: """
Expand Down
2 changes: 1 addition & 1 deletion website/cue/reference/components/sinks/base/http.cue
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ base: components: sinks: http: configuration: {
delimiter: {
description: "The field delimiter to use when writing CSV."
required: false
type: uint: default: 44
type: ascii_char: default: ","
}
double_quote: {
description: """
Expand Down
2 changes: 1 addition & 1 deletion website/cue/reference/components/sinks/base/humio_logs.cue
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ base: components: sinks: humio_logs: configuration: {
delimiter: {
description: "The field delimiter to use when writing CSV."
required: false
type: uint: default: 44
type: ascii_char: default: ","
}
double_quote: {
description: """
Expand Down
2 changes: 1 addition & 1 deletion website/cue/reference/components/sinks/base/kafka.cue
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ base: components: sinks: kafka: configuration: {
delimiter: {
description: "The field delimiter to use when writing CSV."
required: false
type: uint: default: 44
type: ascii_char: default: ","
}
double_quote: {
description: """
Expand Down
2 changes: 1 addition & 1 deletion website/cue/reference/components/sinks/base/loki.cue
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ base: components: sinks: loki: configuration: {
delimiter: {
description: "The field delimiter to use when writing CSV."
required: false
type: uint: default: 44
type: ascii_char: default: ","
}
double_quote: {
description: """
Expand Down
2 changes: 1 addition & 1 deletion website/cue/reference/components/sinks/base/mqtt.cue
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ base: components: sinks: mqtt: configuration: {
delimiter: {
description: "The field delimiter to use when writing CSV."
required: false
type: uint: default: 44
type: ascii_char: default: ","
}
double_quote: {
description: """
Expand Down
2 changes: 1 addition & 1 deletion website/cue/reference/components/sinks/base/nats.cue
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ base: components: sinks: nats: configuration: {
delimiter: {
description: "The field delimiter to use when writing CSV."
required: false
type: uint: default: 44
type: ascii_char: default: ","
}
double_quote: {
description: """
Expand Down
2 changes: 1 addition & 1 deletion website/cue/reference/components/sinks/base/papertrail.cue
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ base: components: sinks: papertrail: configuration: {
delimiter: {
description: "The field delimiter to use when writing CSV."
required: false
type: uint: default: 44
type: ascii_char: default: ","
}
double_quote: {
description: """
Expand Down
2 changes: 1 addition & 1 deletion website/cue/reference/components/sinks/base/pulsar.cue
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ base: components: sinks: pulsar: configuration: {
delimiter: {
description: "The field delimiter to use when writing CSV."
required: false
type: uint: default: 44
type: ascii_char: default: ","
}
double_quote: {
description: """
Expand Down
2 changes: 1 addition & 1 deletion website/cue/reference/components/sinks/base/redis.cue
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ base: components: sinks: redis: configuration: {
delimiter: {
description: "The field delimiter to use when writing CSV."
required: false
type: uint: default: 44
type: ascii_char: default: ","
}
double_quote: {
description: """
Expand Down
2 changes: 1 addition & 1 deletion website/cue/reference/components/sinks/base/socket.cue
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ base: components: sinks: socket: configuration: {
delimiter: {
description: "The field delimiter to use when writing CSV."
required: false
type: uint: default: 44
type: ascii_char: default: ","
}
double_quote: {
description: """
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ base: components: sinks: splunk_hec_logs: configuration: {
delimiter: {
description: "The field delimiter to use when writing CSV."
required: false
type: uint: default: 44
type: ascii_char: default: ","
}
double_quote: {
description: """
Expand Down
2 changes: 1 addition & 1 deletion website/cue/reference/components/sinks/base/webhdfs.cue
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ base: components: sinks: webhdfs: configuration: {
delimiter: {
description: "The field delimiter to use when writing CSV."
required: false
type: uint: default: 44
type: ascii_char: default: ","
}
double_quote: {
description: """
Expand Down
2 changes: 1 addition & 1 deletion website/cue/reference/components/sinks/base/websocket.cue
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ base: components: sinks: websocket: configuration: {
delimiter: {
description: "The field delimiter to use when writing CSV."
required: false
type: uint: default: 44
type: ascii_char: default: ","
}
double_quote: {
description: """
Expand Down

0 comments on commit d49d239

Please sign in to comment.