Skip to content

Conversation

nbruno
Copy link
Contributor

@nbruno nbruno commented Oct 23, 2015

Fixes #1429

Using the spec from the issue, Child now looks like:

{
  "model" : {
    "parent" : "Parent",
    "name" : "Child",
    "classname" : "Child",
    "classVarName" : "child",
    "modelJson" : "{\n  \"allOf\" : [ {\n    \"$ref\" : \"#/definitions/Parent\"\n  }, {\n    \"properties\" : {\n      \"childProp\" : {\n        \"type\" : \"string\"\n      }\n    }\n  } ]\n}",
    "vars" : [ {
      "baseName" : "id",
      "getter" : "getId",
      "setter" : "setId",
      "datatype" : "String",
      "datatypeWithEnum" : "String",
      "name" : "id",
      "defaultValue" : "null",
      "baseType" : "String",
      "jsonSchema" : "{\n  \"type\" : \"string\"\n}",
      "hasMore" : true,
      "isPrimitiveType" : true,
      "isNotContainer" : true,
      "isEnum" : false
    }, {
      "baseName" : "childProp",
      "getter" : "getChildProp",
      "setter" : "setChildProp",
      "datatype" : "String",
      "datatypeWithEnum" : "String",
      "name" : "childProp",
      "defaultValue" : "null",
      "baseType" : "String",
      "jsonSchema" : "{\n  \"type\" : \"string\"\n}",
      "hasMore" : true,
      "isPrimitiveType" : true,
      "isNotContainer" : true,
      "isEnum" : false
    }, {
      "baseName" : "error",
      "getter" : "getError",
      "setter" : "setError",
      "datatype" : "String",
      "datatypeWithEnum" : "String",
      "name" : "error",
      "defaultValue" : "null",
      "baseType" : "String",
      "jsonSchema" : "{\n  \"type\" : \"string\"\n}",
      "isPrimitiveType" : true,
      "isNotContainer" : true,
      "isEnum" : false
    } ],
    "imports" : [ "Parent" ],
    "hasVars" : true,
    "hasEnums" : true
  },
  "importPath" : "io.swagger.model.Child"
}

Notice the hasMore attribute on the error var is now gone.

fehguy added a commit that referenced this pull request Oct 23, 2015
Ensure hasMore is updated when reconciling enum properties from parent
@fehguy fehguy merged commit 83afaff into swagger-api:master Oct 23, 2015
@nbruno nbruno deleted the java-child-enum-bug branch October 23, 2015 17:48
@fehguy fehguy modified the milestone: v2.1.4 Oct 26, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants