Code clean-up: refactor CodegenResponse, CodegenProperty and CodegenParameter
Created by: jmini
CodegenResponse
, CodegenProperty
and CodegenParameter
are very similar, but for the moment they to not share nothing.
With OAS2 specification, it made sense to have three objects because every of these concepts was different in the spec. Now with OAS3, everything is Schema based. But in our methods fromModel(..)
, fromProperty(..)
and fromResponse(..)
reimplement everything three times…
The first step will be to identify what is common between CodegenResponse
, CodegenProperty
and CodegenParameter
. A new abstract Codegen should be created: AbstractSchemaBasedCodegen
(or something like that). It contains the common stuff and it is derived from the schema.
Then we will be able to remove the redundancy in DefaultCodegen
and we will have something that works the same way for consumers of CodegenResponse
, CodegenProperty
and CodegenParameter
.