RepreZen / KaiZen-OpenApi-Parser

High-performance Parser, Validator, and Java Object Model for OpenAPI 3.x
130 stars 31 forks source link

Create convenience methods to obtain names of named objects #156

Open andylowry opened 6 years ago

andylowry commented 6 years ago

The approach here will be to manually add methods to affected model classes (e.g. adding getName() to SchemaImpl). These methods can be replaced by generated methods if https://github.com/RepreZen/JsonOverlay/issues/4 gets implemented.

The methods will return the same value as Overlay#getPathInParent, as long as the parent overlay is a MapOverlay. Otherwise it will return null, meaning that the object instance is unnamed (e.g. an inlined media type schema, or a shema that appears only through references and therefore has no actual parent in the overlay structure.