From 693b4de256f8c416125661c102d19c56053f806c Mon Sep 17 00:00:00 2001 From: "Nate Hopkins (hopsoft)" Date: Thu, 12 Sep 2024 13:41:03 -0600 Subject: [PATCH] Update to OpenAPI spec v3.1.0 The current implementation uses the deprecated field `example` which causes test failures whenever creating a new Bullet Train application, and whenever a new Super Scaffold is generated. This PR updates the implementation to use the current `examples` field instead. SEE: https://spec.openapis.org/oas/latest.html#fixed-fields-5 --- bullet_train-api/app/helpers/api/open_api_helper.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bullet_train-api/app/helpers/api/open_api_helper.rb b/bullet_train-api/app/helpers/api/open_api_helper.rb index 7018f1214..7b71b7914 100644 --- a/bullet_train-api/app/helpers/api/open_api_helper.rb +++ b/bullet_train-api/app/helpers/api/open_api_helper.rb @@ -97,7 +97,10 @@ def automatic_components_for(model, **options) "description" => attribute_name.titleize.to_s } - attributes_output["example"].merge!({attribute_name.to_s => nil}) + attributes_output["examples"] = [{ + "summary" => "default", + "value" => nil + }] end end