Skip to content

Commit b51cbb6

Browse files
committed
add tests for minus 1 enum value
1 parent 5854e28 commit b51cbb6

7 files changed

Lines changed: 10 additions & 6 deletions

File tree

modules/openapi-generator/src/test/resources/3_0/ruby/petstore-with-fake-endpoints-models-for-testing.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1936,6 +1936,7 @@ components:
19361936
OuterEnumInteger:
19371937
type: integer
19381938
enum:
1939+
- -1
19391940
- 0
19401941
- 1
19411942
- 2

samples/client/petstore/ruby-faraday/docs/FakeApi.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -497,7 +497,7 @@ require 'time'
497497
require 'petstore'
498498

499499
api_instance = Petstore::FakeApi.new
500-
outer_object_with_enum_property = Petstore::OuterObjectWithEnumProperty.new({value: Petstore::OuterEnumInteger::N0}) # OuterObjectWithEnumProperty | Input enum (int) as post body
500+
outer_object_with_enum_property = Petstore::OuterObjectWithEnumProperty.new({value: Petstore::OuterEnumInteger::NMINUS_1}) # OuterObjectWithEnumProperty | Input enum (int) as post body
501501

502502
begin
503503

samples/client/petstore/ruby-faraday/lib/petstore/models/outer_enum_integer.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,13 @@
1515

1616
module Petstore
1717
class OuterEnumInteger
18+
NMINUS_1 = -1.freeze
1819
N0 = 0.freeze
1920
N1 = 1.freeze
2021
N2 = 2.freeze
2122

2223
def self.all_vars
23-
@all_vars ||= [N0, N1, N2].freeze
24+
@all_vars ||= [NMINUS_1, N0, N1, N2].freeze
2425
end
2526

2627
# Builds the enum from string

samples/client/petstore/ruby-httpx/docs/FakeApi.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -497,7 +497,7 @@ require 'time'
497497
require 'petstore'
498498

499499
api_instance = Petstore::FakeApi.new
500-
outer_object_with_enum_property = Petstore::OuterObjectWithEnumProperty.new({value: Petstore::OuterEnumInteger::N0}) # OuterObjectWithEnumProperty | Input enum (int) as post body
500+
outer_object_with_enum_property = Petstore::OuterObjectWithEnumProperty.new({value: Petstore::OuterEnumInteger::NMINUS_1}) # OuterObjectWithEnumProperty | Input enum (int) as post body
501501

502502
begin
503503

samples/client/petstore/ruby-httpx/lib/petstore/models/outer_enum_integer.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,13 @@
1515

1616
module Petstore
1717
class OuterEnumInteger
18+
NMINUS_1 = -1.freeze
1819
N0 = 0.freeze
1920
N1 = 1.freeze
2021
N2 = 2.freeze
2122

2223
def self.all_vars
23-
@all_vars ||= [N0, N1, N2].freeze
24+
@all_vars ||= [NMINUS_1, N0, N1, N2].freeze
2425
end
2526

2627
# Builds the enum from string

samples/client/petstore/ruby/docs/FakeApi.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -497,7 +497,7 @@ require 'time'
497497
require 'petstore'
498498

499499
api_instance = Petstore::FakeApi.new
500-
outer_object_with_enum_property = Petstore::OuterObjectWithEnumProperty.new({value: Petstore::OuterEnumInteger::N0}) # OuterObjectWithEnumProperty | Input enum (int) as post body
500+
outer_object_with_enum_property = Petstore::OuterObjectWithEnumProperty.new({value: Petstore::OuterEnumInteger::NMINUS_1}) # OuterObjectWithEnumProperty | Input enum (int) as post body
501501

502502
begin
503503

samples/client/petstore/ruby/lib/petstore/models/outer_enum_integer.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,13 @@
1515

1616
module Petstore
1717
class OuterEnumInteger
18+
NMINUS_1 = -1.freeze
1819
N0 = 0.freeze
1920
N1 = 1.freeze
2021
N2 = 2.freeze
2122

2223
def self.all_vars
23-
@all_vars ||= [N0, N1, N2].freeze
24+
@all_vars ||= [NMINUS_1, N0, N1, N2].freeze
2425
end
2526

2627
# Builds the enum from string

0 commit comments

Comments
 (0)