-
Notifications
You must be signed in to change notification settings - Fork 61
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
Serialization - 1000 cuts #363
Comments
Hi @jlpedrosa The current serealization is flawed and that's a fact. I don't mind trying to improve it. But at the same time I would like to keep it simple and readable. |
@vaerh feel free to add things (edit comment) or add in a response and I'll join them here.| Requirements:
Scenarios:
|
I'll just give my thoughts on the problems I'm having with the provider and router interaction: Another problem is the overcomplication of creating uniform resources, but there is granular control over the data. The funny thing about this is that this is the approach under which the original gfenn-newbury and terraform-provider-mikrotik was written. One resource - one static data exchange structure. It seems to me that MT sometimes resembles a large coral reef with long-term layers from which it is impossible to escape. I don't understand what to do if the time is returned to the user in a format that does not match the fields in WinBox. But maybe you have some fresh ideas? Or we can solve problems as they come in )))) |
Hi @vaerh
I got myself into another pitfal because how we serialize the objects and the default values. In this case, the defaults was overriding a behavior when some field is unset. (BGP timers).
In other cases we found defaults that change over time. We tried the "AlwaysPresentUserNotProvided", but that also comes with it's own problems.
I think we need a mechanism to have more fine grained control how the fields are serialised when the user provides it, or how to behave when the router provided it and the user didn't At the same time,terraform schema has it's own limitations.
I think there are multiple ways to tackle this.
Struct holding schema and serialization options per field, ie:
Or having object types per resource with tags, ie:
Any option in this sense would be a really big swing and a big task (that could be done progressively). Are you open to any of this ideas? (or any other way to take on the problem)?
The text was updated successfully, but these errors were encountered: