Created
October 1, 2017 05:17
-
-
Save kymmt90/6c427f92f2e4f1d2118122a75dfe9188 to your computer and use it in GitHub Desktop.
Append additionalProperties: false to all schemas in the OpenAPI definitions section
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'yaml' | |
doc = YAML.parse(STDIN).to_ruby | |
doc['definitions'].transform_values! { |schema| schema.merge('additionalProperties' => false) } | |
puts doc.to_yaml |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment