Skip to content

Instantly share code, notes, and snippets.

@kymmt90
Created October 1, 2017 05:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kymmt90/6c427f92f2e4f1d2118122a75dfe9188 to your computer and use it in GitHub Desktop.
Save kymmt90/6c427f92f2e4f1d2118122a75dfe9188 to your computer and use it in GitHub Desktop.
Append additionalProperties: false to all schemas in the OpenAPI definitions section
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