{"action":"created","issue":{"url":"https://api.github.com/repos/OctoPrint/OctoPrint-Yamlpatcher/issues/1","labels_url":"https://api.github.com/repos/OctoPrint/OctoPrint-Yamlpatcher/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/OctoPrint/OctoPrint-Yamlpatcher/issues/1/comments","events_url":"https://api.github.com/repos/OctoPrint/OctoPrint-Yamlpatcher/issues/1/events","html_url":"https://github.com/OctoPrint/OctoPrint-Yamlpatcher/issues/1","id":104565222,"number":1,"title":"YAML Input Order","user":{"login":"cfunseth","id":7550148,"avatar_url":"https://avatars.githubusercontent.com/u/7550148?v=3","gravatar_id":"","url":"https://api.github.com/users/cfunseth","html_url":"https://github.com/cfunseth","followers_url":"https://api.github.com/users/cfunseth/followers","following_url":"https://api.github.com/users/cfunseth/following{/other_user}","gists_url":"https://api.github.com/users/cfunseth/gists{/gist_id}","starred_url":"https://api.github.com/users/cfunseth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cfunseth/subscriptions","organizations_url":"https://api.github.com/users/cfunseth/orgs","repos_url":"https://api.github.com/users/cfunseth/repos","events_url":"https://api.github.com/users/cfunseth/events{/privacy}","received_events_url":"https://api.github.com/users/cfunseth/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-09-02T20:30:45Z","updated_at":"2015-09-02T21:03:20Z","closed_at":"2015-09-02T21:03:20Z","body":"There seems to be an issue when I enter YAML dictionary inputs that the resulting preview organizes them into alphabetical order.  I'm attempting to modify my config.yaml for custom Pushbullet notifications with the following code:\r\n\r\n```\r\n- event: PowerOn\r\n  command: curl --header 'Access-Token:xxx' -X POST https://api.pushbullet.com/v2/pushes --header 'Content-Type:application/json' --data-binary '{\"type\":\"note\", \"title\":\"Title\", \"body\":\"Body\"}'\r\n  type: system\r\n```\r\n\r\nThe preview window in Yamlpatcher will then generate the following:\r\n\r\n```\r\n- command: curl --header 'Access-Token:xxx'\r\n      -X POST https://api.pushbullet.com/v2/pushes --header 'Content-Type:application/json'\r\n      --data-binary '{\"type\":\"note\", \"title\":\"Title\", \"body\":\"Body\"}'\r\n  event: PowerOn\r\n  type: system\r\n```\r\n\r\nI'm not savvy enough to know whether the order of the YAML commands makes a difference but figured that the preview should match what was entered."},"comment":{"url":"https://api.github.com/repos/OctoPrint/OctoPrint-Yamlpatcher/issues/comments/137243564","html_url":"https://github.com/OctoPrint/OctoPrint-Yamlpatcher/issues/1#issuecomment-137243564","issue_url":"https://api.github.com/repos/OctoPrint/OctoPrint-Yamlpatcher/issues/1","id":137243564,"user":{"login":"foosel","id":83657,"avatar_url":"https://avatars.githubusercontent.com/u/83657?v=3","gravatar_id":"","url":"https://api.github.com/users/foosel","html_url":"https://github.com/foosel","followers_url":"https://api.github.com/users/foosel/followers","following_url":"https://api.github.com/users/foosel/following{/other_user}","gists_url":"https://api.github.com/users/foosel/gists{/gist_id}","starred_url":"https://api.github.com/users/foosel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/foosel/subscriptions","organizations_url":"https://api.github.com/users/foosel/orgs","repos_url":"https://api.github.com/users/foosel/repos","events_url":"https://api.github.com/users/foosel/events{/privacy}","received_events_url":"https://api.github.com/users/foosel/received_events","type":"User","site_admin":false},"created_at":"2015-09-02T21:03:20Z","updated_at":"2015-09-02T21:03:20Z","body":"The order doesn't matter, dictionaries are unordered. \r\n\r\nMore importantly, when OctoPrint persists the contents of the config from its internal representation (an unordered dictionary) to the yaml file on disk, the resulting structure will be ordered alphabetically - this is how the yaml rendered works, and that is completely correct. The diff view is a reflection of this exact behavior, it shows you how the result on disk will look like after your supplied patch set is applied. This is intentional - it is supposed to show you the actual change that will be done, nothing more, nothing less.\r\n\r\nAny yaml data you enter will btw - still on the client - be converted into a json merge patch (see the docs for that), which will transform your data into the (unordered) internal dictionary representation already. \r\n\r\nI will not change that behavior, since it would basically stop the plugin from doing its most important task: accurately presenting how an entered patch will change the file on disk exactly as a means of final control by the user."}}