Skip to content

Add composition support to templates #358

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

Closed
fehguy opened this issue Dec 24, 2014 · 10 comments
Closed

Add composition support to templates #358

fehguy opened this issue Dec 24, 2014 · 10 comments

Comments

@fehguy
Copy link
Contributor

fehguy commented Dec 24, 2014

No description provided.

@davesag
Copy link

davesag commented Apr 17, 2015

+1 to this

@ialmetwally
Copy link

+1

@mxl
Copy link

mxl commented Jul 24, 2015

Is this feature implemented for static html documentation generator?
I'm using build of develop_2.0 branch and generated html has empty Return type sections for responses with allOf.

@wing328
Copy link
Contributor

wing328 commented Jul 25, 2015

@mxl the latest develop_2.0 branch should have supported of allOf, which means the response should contains all properties defined in allOf. Do you mind sharing the swagger spec that I can help repeat the issue (assuming the spec can be shared publicly) ?

@mxl
Copy link

mxl commented Jul 25, 2015

@wing328 I created simplified spec
Also $ref to response object is not rendering in html.
Running swagger-codegen gives this output:

reading from test.json
321 [main] ERROR io.swagger.models.properties.PropertyBuilder - no property for null, null
322 [main] WARN io.swagger.util.PropertyDeserializer - no property from null, null, {ENUM=null, TITLE=null, DESCRIPTION=null, DEFAULT=null, PATTERN=null, DESCRIMINATOR=null, MIN_ITEMS=null, MAX_ITEMS=null, MIN_PROPERTIES=null, MAX_PROPERTIES=null, MIN_LENGTH=null, MAX_LENGTH=null, MINIMUM=null, MAXIMUM=null, EXCLUSIVE_MINIMUM=null, EXCLUSIVE_MAXIMUM=null, UNIQUE_ITEMS=null, EXAMPLE=null, TYPE=null, FORMAT=null}
380 [main] WARN io.swagger.codegen.DefaultCodegen - generated operationId test1Get
384 [main] WARN io.swagger.codegen.DefaultCodegen - generated operationId test2Get

@wing328
Copy link
Contributor

wing328 commented Jul 25, 2015

@mxl Thanks. I'll take a look tomorrow (Sunday)

@meskall
Copy link

meskall commented Mar 18, 2016

Is this not yet supported?

@wing328
Copy link
Contributor

wing328 commented Mar 19, 2016

@meskall depending on language. Which language are you referring to so that I can take a look?

@meskall
Copy link

meskall commented Mar 20, 2016

Java

On Fri, Mar 18, 2016, 7:49 PM wing328 [email protected] wrote:

@meskall https://github.com/meskall depending on language. Which
language are you referring to so that I can take a look?


You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
#358 (comment)

@meskall
Copy link

meskall commented Mar 21, 2016

I'm attempting to fix some swagger documentation and use swagger codegen to build my client.

I believe this is the proper way to define it:

ViewModelResponse:
properties:
view_models:
type: "array"
items:
$ref: "#/definitions/ViewModel"

ViewModel:
properties:
type:
description: "Type Differentiator"
type: "string"
discriminator: "type"
ViewModelOne:
allOf:
-
$ref: "#/definitions/ViewModel"
-
properties:
data:
$ref: "#/definitions/SpecificViewModelData"

I was hoping that not only would the class extend the base class properly but it would deserialize into the proper ViewModelOne so that I can in java go through the list on ViewModelResponse and check the class of each item...

This is possible with Jackson annotation but I cannot seem to codegen them.

@wing328 wing328 modified the milestones: v2.1.0, v2.3.0 Jul 7, 2016
@wing328 wing328 modified the milestones: v2.2.1, v2.2.2 Aug 8, 2016
@wing328 wing328 removed this from the v2.2.1 milestone Aug 8, 2016
@wing328 wing328 modified the milestones: Future, v2.2.2 Feb 15, 2017
bdaroz added a commit to bdaroz/the-blue-alliance that referenced this issue Feb 26, 2017
This affects at least C#, Java, and perhaps others.

Removed `allOf` references in spec and duplicated the `...Simple` elements into the full model.

See swagger-api/swagger-codegen#632 and swagger-api/swagger-codegen#358
@wing328 wing328 changed the title [develop 2.0] add composition support to templates Add composition support to templates Jul 26, 2017
@wing328 wing328 removed the P2 label Feb 1, 2018
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

8 participants