diff --git a/amf-api-contract/shared/src/main/scala/amf/apicontract/internal/metamodel/domain/bindings/KafkaBindingModel.scala b/amf-api-contract/shared/src/main/scala/amf/apicontract/internal/metamodel/domain/bindings/KafkaBindingModel.scala index 419bdb5e7b..5ff0b85951 100644 --- a/amf-api-contract/shared/src/main/scala/amf/apicontract/internal/metamodel/domain/bindings/KafkaBindingModel.scala +++ b/amf-api-contract/shared/src/main/scala/amf/apicontract/internal/metamodel/domain/bindings/KafkaBindingModel.scala @@ -102,12 +102,10 @@ object KafkaMessageBinding030Model extends KafkaMessageBindingModel { override def modelInstance: AmfObject = KafkaMessageBinding030() override def fields: List[Field] = List( - MessageKey, SchemaIdLocation, SchemaIdPayloadEncoding, - SchemaLookupStrategy, - BindingVersion - ) ++ MessageBindingModel.fields + SchemaLookupStrategy + ) ++ KafkaMessageBindingModel.fields override val `type`: List[ValueType] = ApiBinding + "KafkaMessageBinding030" :: MessageBindingModel.`type` @@ -220,8 +218,7 @@ object KafkaChannelBinding040Model extends KafkaChannelBindingModel { ) ) - override def fields: List[Field] = - List(Topic, Partitions, Replicas, TopicConfiguration, BindingVersion) ++ ChannelBindingModel.fields + override def fields: List[Field] = TopicConfiguration +: KafkaChannelBindingModel.fields } object KafkaChannelBinding050Model extends KafkaChannelBindingModel { @@ -239,8 +236,7 @@ object KafkaChannelBinding050Model extends KafkaChannelBindingModel { ) ) - override def fields: List[Field] = - List(Topic, Partitions, Replicas, TopicConfiguration, BindingVersion) ++ ChannelBindingModel.fields + override def fields: List[Field] = TopicConfiguration +: KafkaChannelBindingModel.fields } trait KafkaTopicConfigurationModel extends DomainElementModel { @@ -249,32 +245,32 @@ trait KafkaTopicConfigurationModel extends DomainElementModel { val CleanupPolicy: Field = Field( Array(Str), - ApiBinding + "cleanup.policy", - ModelDoc(ModelVocabularies.ApiBinding, "cleanup.policy", "The cleanup.policy configuration option.") + ApiBinding + "CleanupPolicy", + ModelDoc(ModelVocabularies.ApiBinding, "CleanupPolicy", "The cleanup.policy configuration option.") ) val RetentionMs: Field = Field( Int, - ApiBinding + "retention.ms", - ModelDoc(ModelVocabularies.ApiBinding, "retention.ms", "The retention.ms configuration option.") + ApiBinding + "RetentionMs", + ModelDoc(ModelVocabularies.ApiBinding, "RetentionMs", "The retention.ms configuration option.") ) val RetentionBytes: Field = Field( Int, - ApiBinding + "retention.bytes", - ModelDoc(ModelVocabularies.ApiBinding, "retention.bytes", "The retention.bytes configuration option.") + ApiBinding + "RetentionBytes", + ModelDoc(ModelVocabularies.ApiBinding, "RetentionBytes", "The retention.bytes configuration option.") ) val DeleteRetentionMs: Field = Field( Int, - ApiBinding + "delete.retention.ms", - ModelDoc(ModelVocabularies.ApiBinding, "delete.retention.ms", "The delete.retention.ms configuration option.") + ApiBinding + "DeleteRetentionMs", + ModelDoc(ModelVocabularies.ApiBinding, "DeleteRetentionMs", "The delete.retention.ms configuration option.") ) val MaxMessageBytes: Field = Field( Int, - ApiBinding + "max.message.bytes", - ModelDoc(ModelVocabularies.ApiBinding, "max.message.bytes", "The max.message.bytes configuration option.") + ApiBinding + "MaxMessageBytes", + ModelDoc(ModelVocabularies.ApiBinding, "MaxMessageBytes", "The max.message.bytes configuration option.") ) override def fields: List[Field] = List( @@ -303,53 +299,48 @@ object KafkaTopicConfiguration050Model extends KafkaTopicConfigurationModel { val ConfluentKeySchemaValidation: Field = Field( Bool, - ApiBinding + "confluent.key.schema.validation", + ApiBinding + "ConfluentKeySchemaValidation", ModelDoc( ModelVocabularies.ApiBinding, - "confluent.key.schema.validation", + "ConfluentKeySchemaValidation", "It shows whether the schema validation for the message key is enabled. Vendor specific config." ) ) val ConfluentKeySubjectNameStrategy: Field = Field( Str, - ApiBinding + "confluent.key.subject.name.strategy", + ApiBinding + "ConfluentKeySubjectNameStrategy", ModelDoc( ModelVocabularies.ApiBinding, - "confluent.key.subject.name.strategy", + "ConfluentKeySubjectNameStrategy", "The name of the schema lookup strategy for the message key. Vendor specific config." ) ) val ConfluentValueSchemaValidation: Field = Field( Bool, - ApiBinding + "confluent.value.schema.validation", + ApiBinding + "ConfluentValueSchemaValidation", ModelDoc( ModelVocabularies.ApiBinding, - "confluent.value.schema.validation", + "ConfluentValueSchemaValidation", "It shows whether the schema validation for the message value is enabled. Vendor specific config." ) ) val ConfluentValueSubjectNameStrategy: Field = Field( Str, - ApiBinding + "confluent.value.subject.name.strategy", + ApiBinding + "ConfluentValueSubjectNameStrategy", ModelDoc( ModelVocabularies.ApiBinding, - "confluent.value.subject.name.strategy", + "ConfluentValueSubjectNameStrategy", "The name of the schema lookup strategy for the message value. Vendor specific config." ) ) override def fields: List[Field] = List( - CleanupPolicy, - RetentionMs, - RetentionBytes, - DeleteRetentionMs, - MaxMessageBytes, ConfluentKeySchemaValidation, ConfluentKeySubjectNameStrategy, ConfluentValueSchemaValidation, ConfluentValueSubjectNameStrategy - ) + ) ++ KafkaTopicConfigurationModel.fields } diff --git a/amf-cli/shared/src/test/resources/validations/reports/async20/kafka-channel-binding-validations.report b/amf-cli/shared/src/test/resources/validations/reports/async20/kafka-channel-binding-validations.report index efceb1a868..dfd131cbe0 100644 --- a/amf-cli/shared/src/test/resources/validations/reports/async20/kafka-channel-binding-validations.report +++ b/amf-cli/shared/src/test/resources/validations/reports/async20/kafka-channel-binding-validations.report @@ -25,7 +25,7 @@ Level: Violation Message: Kafka Topic Configuration 'cleanup.policy' field can only contain 'delete' and/or 'compact'. Severity: Violation Target: file://amf-cli/shared/src/test/resources/validations/async20/validations/kafka-channel-binding-validations.yaml#/async-api/endpoint/other-channel/channel-bindings/bindings/kafka-channel-040 - Property: http://a.ml/vocabularies/apiBinding#cleanup.policy + Property: http://a.ml/vocabularies/apiBinding#CleanupPolicy Range: [(21,27)-(28,0)] Location: file://amf-cli/shared/src/test/resources/validations/async20/validations/kafka-channel-binding-validations.yaml @@ -33,7 +33,7 @@ Level: Violation Message: Kafka topic configuration 'delete.retention.ms' field must be a positive number Severity: Violation Target: file://amf-cli/shared/src/test/resources/validations/async20/validations/kafka-channel-binding-validations.yaml#/async-api/endpoint/other-channel/channel-bindings/bindings/kafka-channel-040 - Property: http://a.ml/vocabularies/apiBinding#delete.retention.ms + Property: http://a.ml/vocabularies/apiBinding#DeleteRetentionMs Range: [(21,27)-(28,0)] Location: file://amf-cli/shared/src/test/resources/validations/async20/validations/kafka-channel-binding-validations.yaml @@ -41,7 +41,7 @@ Level: Violation Message: Kafka topic configuration 'max.message.bytes' field must be a positive number Severity: Violation Target: file://amf-cli/shared/src/test/resources/validations/async20/validations/kafka-channel-binding-validations.yaml#/async-api/endpoint/other-channel/channel-bindings/bindings/kafka-channel-040 - Property: http://a.ml/vocabularies/apiBinding#max.message.bytes + Property: http://a.ml/vocabularies/apiBinding#MaxMessageBytes Range: [(21,27)-(28,0)] Location: file://amf-cli/shared/src/test/resources/validations/async20/validations/kafka-channel-binding-validations.yaml @@ -49,7 +49,7 @@ Level: Violation Message: Kafka Topic Configuration 'retention.ms' field valid values are [-1,...] Severity: Violation Target: file://amf-cli/shared/src/test/resources/validations/async20/validations/kafka-channel-binding-validations.yaml#/async-api/endpoint/other-channel/channel-bindings/bindings/kafka-channel-040 - Property: http://a.ml/vocabularies/apiBinding#retention.ms + Property: http://a.ml/vocabularies/apiBinding#RetentionMs Range: [(21,27)-(28,0)] Location: file://amf-cli/shared/src/test/resources/validations/async20/validations/kafka-channel-binding-validations.yaml @@ -57,7 +57,7 @@ Level: Violation Message: Kafka Topic Configuration 'cleanup.policy' field can only contain 'delete' and/or 'compact'. Severity: Violation Target: file://amf-cli/shared/src/test/resources/validations/async20/validations/kafka-channel-binding-validations.yaml#/async-api/endpoint/the-other-channel/channel-bindings/bindings/kafka-channel-050 - Property: http://a.ml/vocabularies/apiBinding#cleanup.policy + Property: http://a.ml/vocabularies/apiBinding#CleanupPolicy Range: [(35,27)-(40,58)] Location: file://amf-cli/shared/src/test/resources/validations/async20/validations/kafka-channel-binding-validations.yaml @@ -65,7 +65,7 @@ Level: Violation Message: Kafka topic configuration 'delete.retention.ms' field must be a positive number Severity: Violation Target: file://amf-cli/shared/src/test/resources/validations/async20/validations/kafka-channel-binding-validations.yaml#/async-api/endpoint/the-other-channel/channel-bindings/bindings/kafka-channel-050 - Property: http://a.ml/vocabularies/apiBinding#delete.retention.ms + Property: http://a.ml/vocabularies/apiBinding#DeleteRetentionMs Range: [(35,27)-(40,58)] Location: file://amf-cli/shared/src/test/resources/validations/async20/validations/kafka-channel-binding-validations.yaml @@ -73,7 +73,7 @@ Level: Violation Message: Kafka topic configuration 'max.message.bytes' field must be a positive number Severity: Violation Target: file://amf-cli/shared/src/test/resources/validations/async20/validations/kafka-channel-binding-validations.yaml#/async-api/endpoint/the-other-channel/channel-bindings/bindings/kafka-channel-050 - Property: http://a.ml/vocabularies/apiBinding#max.message.bytes + Property: http://a.ml/vocabularies/apiBinding#MaxMessageBytes Range: [(35,27)-(40,58)] Location: file://amf-cli/shared/src/test/resources/validations/async20/validations/kafka-channel-binding-validations.yaml @@ -81,6 +81,6 @@ Level: Violation Message: Kafka Topic Configuration 'retention.ms' field valid values are [-1,...] Severity: Violation Target: file://amf-cli/shared/src/test/resources/validations/async20/validations/kafka-channel-binding-validations.yaml#/async-api/endpoint/the-other-channel/channel-bindings/bindings/kafka-channel-050 - Property: http://a.ml/vocabularies/apiBinding#retention.ms + Property: http://a.ml/vocabularies/apiBinding#RetentionMs Range: [(35,27)-(40,58)] Location: file://amf-cli/shared/src/test/resources/validations/async20/validations/kafka-channel-binding-validations.yaml diff --git a/documentation/model.md b/documentation/model.md index 6d90ae84dd..088bba3ec8 100644 --- a/documentation/model.md +++ b/documentation/model.md @@ -1955,10 +1955,10 @@ Types: | Name | Value | Sorted | Documentation | Namespace | | ------ | ------ | ------ | ------ | ------ | + | topicConfiguration040 | [KafkaTopicConfiguration040](#kafkatopicconfiguration040) | - | Topic configuration properties that are relevant for the API. | `http://a.ml/vocabularies/apiBinding#topicConfiguration040` | | topic | string | - | Kafka topic name if different from channel name. | `http://a.ml/vocabularies/apiBinding#topic` | | partitions | int | - | Number of partitions configured on this topic. | `http://a.ml/vocabularies/apiBinding#partitions` | | replicas | int | - | Number of replicas configured on this topic. | `http://a.ml/vocabularies/apiBinding#replicas` | - | topicConfiguration040 | [KafkaTopicConfiguration040](#kafkatopicconfiguration040) | - | Topic configuration properties that are relevant for the API. | `http://a.ml/vocabularies/apiBinding#topicConfiguration040` | | bindingVersion | string | - | The version of this binding | `http://a.ml/vocabularies/apiBinding#bindingVersion` | | type | string | - | Binding for a corresponding known type | `http://a.ml/vocabularies/apiBinding#type` | | extends | [[DomainElement](#domainelement)] | false | Entity that is going to be extended overlaying or adding additional information The type of the relationship provide the semantics about thow the referenced and referencer elements must be combined when generating the domain model from the document model. | `http://a.ml/vocabularies/document#extends` | @@ -1972,10 +1972,10 @@ Types: | Name | Value | Sorted | Documentation | Namespace | | ------ | ------ | ------ | ------ | ------ | + | topicConfiguration050 | [KafkaTopicConfiguration050](#kafkatopicconfiguration050) | - | Topic configuration properties that are relevant for the API. | `http://a.ml/vocabularies/apiBinding#topicConfiguration050` | | topic | string | - | Kafka topic name if different from channel name. | `http://a.ml/vocabularies/apiBinding#topic` | | partitions | int | - | Number of partitions configured on this topic. | `http://a.ml/vocabularies/apiBinding#partitions` | | replicas | int | - | Number of replicas configured on this topic. | `http://a.ml/vocabularies/apiBinding#replicas` | - | topicConfiguration050 | [KafkaTopicConfiguration050](#kafkatopicconfiguration050) | - | Topic configuration properties that are relevant for the API. | `http://a.ml/vocabularies/apiBinding#topicConfiguration050` | | bindingVersion | string | - | The version of this binding | `http://a.ml/vocabularies/apiBinding#bindingVersion` | | type | string | - | Binding for a corresponding known type | `http://a.ml/vocabularies/apiBinding#type` | | extends | [[DomainElement](#domainelement)] | false | Entity that is going to be extended overlaying or adding additional information The type of the relationship provide the semantics about thow the referenced and referencer elements must be combined when generating the domain model from the document model. | `http://a.ml/vocabularies/document#extends` | @@ -2017,10 +2017,10 @@ Types: | Name | Value | Sorted | Documentation | Namespace | | ------ | ------ | ------ | ------ | ------ | - | messageKey | [Shape](#shape) | - | Schema that defines the message key | `http://a.ml/vocabularies/apiBinding#messageKey` | | schemaIdLocation | string | - | If a Schema Registry is used when performing this operation, tells where the id of schema is stored (e.g. header or payload). | `http://a.ml/vocabularies/apiBinding#schemaIdLocation` | | schemaIdPayloadEncoding | string | - | Number of bytes or vendor specific values when schema id is encoded in payload (e.g confluent/ apicurio-legacy / apicurio-new). | `http://a.ml/vocabularies/apiBinding#schemaIdPayloadEncoding` | | schemaLookupStrategy | string | - | Freeform string for any naming strategy class to use. Clients should default to the vendor default if not supplied. | `http://a.ml/vocabularies/apiBinding#schemaLookupStrategy` | + | messageKey | [Shape](#shape) | - | Schema that defines the message key | `http://a.ml/vocabularies/apiBinding#messageKey` | | bindingVersion | string | - | The version of this binding | `http://a.ml/vocabularies/apiBinding#bindingVersion` | | type | string | - | Binding for a corresponding known type | `http://a.ml/vocabularies/apiBinding#type` | | extends | [[DomainElement](#domainelement)] | false | Entity that is going to be extended overlaying or adding additional information The type of the relationship provide the semantics about thow the referenced and referencer elements must be combined when generating the domain model from the document model. | `http://a.ml/vocabularies/document#extends` | @@ -2063,11 +2063,11 @@ Types: | Name | Value | Sorted | Documentation | Namespace | | ------ | ------ | ------ | ------ | ------ | - | cleanup.policy | [string] | false | The cleanup.policy configuration option. | `http://a.ml/vocabularies/apiBinding#cleanup.policy` | - | retention.ms | int | - | The retention.ms configuration option. | `http://a.ml/vocabularies/apiBinding#retention.ms` | - | retention.bytes | int | - | The retention.bytes configuration option. | `http://a.ml/vocabularies/apiBinding#retention.bytes` | - | delete.retention.ms | int | - | The delete.retention.ms configuration option. | `http://a.ml/vocabularies/apiBinding#delete.retention.ms` | - | max.message.bytes | int | - | The max.message.bytes configuration option. | `http://a.ml/vocabularies/apiBinding#max.message.bytes` | + | CleanupPolicy | [string] | false | The cleanup.policy configuration option. | `http://a.ml/vocabularies/apiBinding#CleanupPolicy` | + | RetentionMs | int | - | The retention.ms configuration option. | `http://a.ml/vocabularies/apiBinding#RetentionMs` | + | RetentionBytes | int | - | The retention.bytes configuration option. | `http://a.ml/vocabularies/apiBinding#RetentionBytes` | + | DeleteRetentionMs | int | - | The delete.retention.ms configuration option. | `http://a.ml/vocabularies/apiBinding#DeleteRetentionMs` | + | MaxMessageBytes | int | - | The max.message.bytes configuration option. | `http://a.ml/vocabularies/apiBinding#MaxMessageBytes` | ## KafkaTopicConfiguration040 @@ -2077,11 +2077,11 @@ Types: | Name | Value | Sorted | Documentation | Namespace | | ------ | ------ | ------ | ------ | ------ | - | cleanup.policy | [string] | false | The cleanup.policy configuration option. | `http://a.ml/vocabularies/apiBinding#cleanup.policy` | - | retention.ms | int | - | The retention.ms configuration option. | `http://a.ml/vocabularies/apiBinding#retention.ms` | - | retention.bytes | int | - | The retention.bytes configuration option. | `http://a.ml/vocabularies/apiBinding#retention.bytes` | - | delete.retention.ms | int | - | The delete.retention.ms configuration option. | `http://a.ml/vocabularies/apiBinding#delete.retention.ms` | - | max.message.bytes | int | - | The max.message.bytes configuration option. | `http://a.ml/vocabularies/apiBinding#max.message.bytes` | + | CleanupPolicy | [string] | false | The cleanup.policy configuration option. | `http://a.ml/vocabularies/apiBinding#CleanupPolicy` | + | RetentionMs | int | - | The retention.ms configuration option. | `http://a.ml/vocabularies/apiBinding#RetentionMs` | + | RetentionBytes | int | - | The retention.bytes configuration option. | `http://a.ml/vocabularies/apiBinding#RetentionBytes` | + | DeleteRetentionMs | int | - | The delete.retention.ms configuration option. | `http://a.ml/vocabularies/apiBinding#DeleteRetentionMs` | + | MaxMessageBytes | int | - | The max.message.bytes configuration option. | `http://a.ml/vocabularies/apiBinding#MaxMessageBytes` | ## KafkaTopicConfiguration050 @@ -2091,15 +2091,15 @@ Types: | Name | Value | Sorted | Documentation | Namespace | | ------ | ------ | ------ | ------ | ------ | - | cleanup.policy | [string] | false | The cleanup.policy configuration option. | `http://a.ml/vocabularies/apiBinding#cleanup.policy` | - | retention.ms | int | - | The retention.ms configuration option. | `http://a.ml/vocabularies/apiBinding#retention.ms` | - | retention.bytes | int | - | The retention.bytes configuration option. | `http://a.ml/vocabularies/apiBinding#retention.bytes` | - | delete.retention.ms | int | - | The delete.retention.ms configuration option. | `http://a.ml/vocabularies/apiBinding#delete.retention.ms` | - | max.message.bytes | int | - | The max.message.bytes configuration option. | `http://a.ml/vocabularies/apiBinding#max.message.bytes` | - | confluent.key.schema.validation | boolean | - | It shows whether the schema validation for the message key is enabled. Vendor specific config. | `http://a.ml/vocabularies/apiBinding#confluent.key.schema.validation` | - | confluent.key.subject.name.strategy | string | - | The name of the schema lookup strategy for the message key. Vendor specific config. | `http://a.ml/vocabularies/apiBinding#confluent.key.subject.name.strategy` | - | confluent.value.schema.validation | boolean | - | It shows whether the schema validation for the message value is enabled. Vendor specific config. | `http://a.ml/vocabularies/apiBinding#confluent.value.schema.validation` | - | confluent.value.subject.name.strategy | string | - | The name of the schema lookup strategy for the message value. Vendor specific config. | `http://a.ml/vocabularies/apiBinding#confluent.value.subject.name.strategy` | + | ConfluentKeySchemaValidation | boolean | - | It shows whether the schema validation for the message key is enabled. Vendor specific config. | `http://a.ml/vocabularies/apiBinding#ConfluentKeySchemaValidation` | + | ConfluentKeySubjectNameStrategy | string | - | The name of the schema lookup strategy for the message key. Vendor specific config. | `http://a.ml/vocabularies/apiBinding#ConfluentKeySubjectNameStrategy` | + | ConfluentValueSchemaValidation | boolean | - | It shows whether the schema validation for the message value is enabled. Vendor specific config. | `http://a.ml/vocabularies/apiBinding#ConfluentValueSchemaValidation` | + | ConfluentValueSubjectNameStrategy | string | - | The name of the schema lookup strategy for the message value. Vendor specific config. | `http://a.ml/vocabularies/apiBinding#ConfluentValueSubjectNameStrategy` | + | CleanupPolicy | [string] | false | The cleanup.policy configuration option. | `http://a.ml/vocabularies/apiBinding#CleanupPolicy` | + | RetentionMs | int | - | The retention.ms configuration option. | `http://a.ml/vocabularies/apiBinding#RetentionMs` | + | RetentionBytes | int | - | The retention.bytes configuration option. | `http://a.ml/vocabularies/apiBinding#RetentionBytes` | + | DeleteRetentionMs | int | - | The delete.retention.ms configuration option. | `http://a.ml/vocabularies/apiBinding#DeleteRetentionMs` | + | MaxMessageBytes | int | - | The max.message.bytes configuration option. | `http://a.ml/vocabularies/apiBinding#MaxMessageBytes` | ## Key Model that represents the Key of an element to be retrieved by the federated graph