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

Use model and view when describing the message type #750

Closed
4 tasks done
vordimous opened this issue Jan 18, 2024 · 0 comments
Closed
4 tasks done

Use model and view when describing the message type #750

vordimous opened this issue Jan 18, 2024 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@vordimous
Copy link
Contributor

vordimous commented Jan 18, 2024

Is your feature request related to a problem? Please describe.
Describe the message type using unique naming to not conflate other aspects of the zilla config like a binding's type.

Describe the solution you'd like
Use the word model when referring to the message type as it is stored and transmitted. Use the word view when describing a the message type after the stored message is converted from or to.

generic example

key:
  model: string
value:
  model: protobuf
  view: json

Additional context
Specific examples from the bindings this change may affect.

Kafka:

type: kafka
kind: cache_server
options:
  topics:
    - name: my_topic
      value:
        model: protobuf
        view: json
        catalog:
          my_registry:
            - id: 1

HTTP:

type: http
kind: server
options:
  requests:
    - path: /hello
      method: GET
      content:
        model: json
    - path: /valid/{category}/{id}
      method: POST
      content-type:
        - application/json
      headers:
        code:
          model: string
          length: 13
      params:
        path:
          category:
            model: string
            length: 13
          id:
            model: integer
        query:
          page:
            model: integer
      content:
        model: json

MQTT

type: mqtt
kind: server
options:
  topics:
    - name: sensor/one
      content:
        model: json

Tasks

  • refactor types-* modules to model-* modules
  • unify ValidatorFactorySpi and ConverterFactorySpi to ModelFactorySpi
    • unify Validator and Converter to Model
    • unify ValidatorContext and ConverterContext to ModelContext
    • retain ValidatorHandler and ConverterHandler obtained from ModelContext
    • consider implications of unifying ValidatorConfig and ConverterConfig into ModelConfig, restrict view via schema?
  • update http and mqtt reference docs to allow only validators (not converters) in type information (using model view terms now instead)
  • document protobuf support in zilla reference (using model view terms)
@vordimous vordimous added the enhancement New feature or request label Jan 18, 2024
@jfallows jfallows closed this as completed Feb 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants