Skip to content

Conversation

jmini
Copy link
Member

@jmini jmini commented Jun 26, 2018

This PR restores the unit test that consider minLength, maxLength and pattern when they are defined in a in referenced schema.

OAS2 example:

definitions:
  SomeObj:
    type: object
    properties:
      nick:
        $ref: "#/definitions/NickName"
  NickName:
    type: string
    minLength: 1
    maxLength: 3
    pattern: "^[A-Z]+$"

This was filed as originally as swagger-api/swagger-codegen#8001

I have tried to implement a solution for this with #45, but my solution had too many side effects and was reverted with #82.

This PR brings back the tests without changing anything to the implementation. I think the changes made with #360 by @wing328 solves also issue swagger-api/swagger-codegen#8001.

When they are defined in a in referenced schema
Originally introduced with OpenAPITools#45, reverted with OpenAPITools#82
@jmini jmini added this to the 3.1.0 milestone Jun 26, 2018
@jmini
Copy link
Member Author

jmini commented Jun 26, 2018

Unit tests are green, this PR is just about new assertions in one unit test, no changes to the implementation. => Self approving.

@jmini jmini merged commit ea81b0c into OpenAPITools:3.1.x Jun 26, 2018
@jmini jmini deleted the restore_unit-test_pr45 branch June 26, 2018 07:11
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.

1 participant