Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Clarify why we're messing around with $ref
  • Loading branch information
asmundg committed Apr 29, 2020
commit 6e716f49053b17485c97f9589f7d93232b36f23f
Original file line number Diff line number Diff line change
Expand Up @@ -2845,6 +2845,9 @@ public CodegenProperty fromProperty(String name, Schema p) {
if (p.getDeprecated() != null) {
property.deprecated = p.getDeprecated();
} else if (p.get$ref() != null) {
// Since $ref should be replaced with the model it refers
// to, $ref'ing a model with 'deprecated' set should cause
// the property to reflect the model's 'deprecated' value.
String ref = ModelUtils.getSimpleRef(p.get$ref());
if (ref != null) {
Schema referencedSchema = ModelUtils.getSchemas(this.openAPI).get(ref);
Expand Down