From ef20b4e7da3c120f611a98610335969f98df2499 Mon Sep 17 00:00:00 2001 From: Konstantin Munteanu Date: Sat, 9 Sep 2023 22:09:43 +0200 Subject: [PATCH] Nullable transformer is obsolete --- lib/openapi_contracts/parser.rb | 2 +- lib/openapi_contracts/parser/transformers/nullable.rb | 10 ---------- 2 files changed, 1 insertion(+), 11 deletions(-) delete mode 100644 lib/openapi_contracts/parser/transformers/nullable.rb diff --git a/lib/openapi_contracts/parser.rb b/lib/openapi_contracts/parser.rb index 41c22b4..1bed63c 100644 --- a/lib/openapi_contracts/parser.rb +++ b/lib/openapi_contracts/parser.rb @@ -2,7 +2,7 @@ module OpenapiContracts class Parser autoload :Transformers, 'openapi_contracts/parser/transformers' - TRANSFORMERS = [Transformers::Nullable, Transformers::Pointer].freeze + TRANSFORMERS = [Transformers::Pointer].freeze def self.call(dir, filename) new(dir.join(filename)).parse diff --git a/lib/openapi_contracts/parser/transformers/nullable.rb b/lib/openapi_contracts/parser/transformers/nullable.rb deleted file mode 100644 index fac0a0f..0000000 --- a/lib/openapi_contracts/parser/transformers/nullable.rb +++ /dev/null @@ -1,10 +0,0 @@ -module OpenapiContracts::Parser::Transformers - class Nullable < Base - def call(object) - return unless object['type'].present? && object['nullable'] == true - - object.delete('nullable') - object['type'] = [object['type'], 'null'] - end - end -end