Skip to content

Conversation

@HugoMario
Copy link
Contributor

Required properties are not properly read from a composed schema, for example, in this example:

definitions:
  User:
    type: object
    required:
      - email
    properties:
      email:
        type: string
  UserRegister:
    allOf:
      - $ref: '#/definitions/User'
    type: object
    required:
      - password
    properties:
      password:
        type: string

the required property password is not found when i call:

final Model model = swagger.getDefinitions().get("UserRegister");
final ComposedModel composedModel = (ComposedModel) model;

composedModel.getRequired(); // empty or null

This issue is affecting swagger-codegen reported at swagger-api/swagger-codegen#7058

@HugoMario HugoMario added the Bug label Nov 8, 2020
@HugoMario HugoMario added this to the M10 milestone Nov 8, 2020
@HugoMario HugoMario self-assigned this Nov 8, 2020
@HugoMario HugoMario merged commit 6db94b4 into v1 Nov 8, 2020
@HugoMario HugoMario deleted the required-items-in-composed-model branch November 8, 2020 05:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants