Re: Getting the JSON schema of commands

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




Le 16/11/2018 à 21:31, Sage Weil a écrit :
I can't really comment on golang here, but in python this is trivial:
either you can tolerate a missing key (e.g., by substituting a default
value), and use foo.get('field'[, 'default'[), or you can't tolerate it,
and use foo['field'] so that an exception is thrown if it's missing.

I perfectly understand what you mean here which imply that every single external tool, as it will not be in a position to validate the json scheme will have to implement accessors with catch exception for every single part of the structure.

That's also a lot of useless work.

[...]
I liked Noah's initial proposal because it was (1) not much work and (2)
focused on flagging changes before they are introduced, during make check
time, so that the developer can either fix their mistake or make a
conscious decision to change the output schema.

This is a place where I'm not really comfortable. The scheme is made manually and from my experience, until you put the cluster in every possible state, you could miss some structures.

Noah, how do you deal with this in your validation scheme ?


[...]
If there's something even simpler, great.  Let's just not sink time into
overengineering a solution the problem based on the brevity of golang...

Please don't reduce this to a golang issue as it's not related at all with this language.

It just emphases it as it (and surely other language) can offer good helpers to import & map json to specific data structures.

That helpers cannot be used with Ceph then.




[Index of Archives]     [CEPH Users]     [Ceph Large]     [Information on CEPH]     [Linux BTRFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux