Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Title as name in any inline model defined (when title is defined) #3523

Closed
dmytrobr opened this issue Aug 4, 2016 · 1 comment
Closed

Comments

@dmytrobr
Copy link
Contributor

dmytrobr commented Aug 4, 2016

Description

Feature has been introduced to support "title" as model name:
#2868

However it has not been applied to some type of inline models (inline models defined within MapProperty and ArrayProperty. I see it as a bug in the feature introduced with Issue-2868.

Swagger-codegen version

2.2.1-SNAPSHOT

Swagger declaration file content or url
```java
   @Test
public void resolveInlineArrayModelWithTitle() throws Exception {
    Swagger swagger = new Swagger();

    swagger.addDefinition("User", new ArrayModel()
            .items(new ObjectProperty()
                    .title("InnerUserTitle")
                    ._default("default")
                    .access("access")
                    .readOnly(false)
                    .required(true)
                    .description("description")
                    .name("name")
                    .property("street", new StringProperty())
                    .property("city", new StringProperty())));

    new InlineModelResolver().flatten(swagger);

    Model model = swagger.getDefinitions().get("User");
    assertTrue(model instanceof ArrayModel);

    Model user = swagger.getDefinitions().get("InnerUserTitle");
    assertNotNull(user);
    assertEquals("description", user.getDescription());
}

'''

Command line used for generation

Used Maven plugin to generate Java client

Steps to reproduce

See Unit Test above

Related issues

Issue-2868.

Suggest a Fix

I'm submitting pull request to fix this

@wing328
Copy link
Contributor

wing328 commented Aug 9, 2016

PR meged. Thanks for the contribution.

@wing328 wing328 closed this as completed Aug 9, 2016
@wing328 wing328 added this to the v2.2.2 milestone Aug 9, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants