Issue:
Found an issue where when I use theOpenAPIEncodedSchemaType.openAPISchema(using encoder: JSONEncoder) to create a JSONSchema with passing an encoder that has keyEncodingStrategy set to convertToSnakeCase, the JSONSchema's keys wasn't converting the keys to use convertToSnakeCase and returning as what the variable name is set to.
How to reproduce:
Create a JSONEncoder with the following:
let encoder = JSONEncoder()
encoder.keyEncodingStrategy = .convertToSnakeCase
Create a sample model
struct SampleObject: Codable, Sampleable, OpenAPIEncodedSchemaType {
let sampleKey: String
let sampleValue: String
}
Initialize the model with any values and use the SampleObject's openAPISchema(_:) to generate the schema.
Verify the keys of the model as sampleKey and sampleValue instead of sample_key and sample_value.
Expected:
The expected result should be having the keys as sample_key and sample_value.
Closing this issue and will open a new one to the correct repo. The following issue might not be all the way down to the OpenAPIKit library but more like in OpenAPIReflection
Issue: Found an issue where when I use the
OpenAPIEncodedSchemaType.openAPISchema(using encoder: JSONEncoder)
to create aJSONSchema
with passing an encoder that haskeyEncodingStrategy
set toconvertToSnakeCase
, the JSONSchema's keys wasn't converting the keys to use convertToSnakeCase and returning as what the variable name is set to.How to reproduce:
openAPISchema(_:)
to generate the schema.sampleKey
andsampleValue
instead ofsample_key
andsample_value
.Expected: The expected result should be having the keys as
sample_key
andsample_value
.