You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
(FM-8336) Capture and expose attribute ordering from transport schema
When exposing attributes in the UI, they currently need to be alphabetised by their name, since the transmission through APIs does not preserve key order of the connection_info hash.
To facilitate showing attributes in the order defined by the module author, this change embeds the key-insertion order from the TypeDefinition into the API response.
raisePuppet::DevError,'`:connection_info` must be a hash, not `%{other_type}`' % {other_type: schema[:connection_info].class}unlessschema[:connection_info].is_a?(Hash)
raisePuppet::DevError,'`:connection_info_order` must be an array, not `%{other_type}`' % {other_type: schema[:connection_info_order].class}unlessschema[:connection_info_order].is_a?(Array)
15
+
end
11
16
12
17
unlesstransports[schema[:name]].nil?
13
18
raisePuppet::DevError,'Transport `%{name}` is already registered for `%{environment}`' % {
it{expect{described_class.register(name: 'no hash attributes',desc: 'some description',connection_info: [])}.toraise_error(Puppet::DevError,%r{`:connection_info` must be a hash, not})}
0 commit comments