Different View of same model

23 views
Skip to first unread message

Dharmendra Dubey

unread,
Nov 8, 2017, 12:07:57 AM11/8/17
to Swagger
Hi All,
Is there any way to have different view of same model?

I have a scenario where I have a model created and is being used for two different APIs but one API needs all the properties of the model but other one needs only few.

Is there any way to handle this case in swagger?

Ron Ratovsky

unread,
Nov 8, 2017, 11:16:14 AM11/8/17
to swagger-sw...@googlegroups.com

That’s where composition comes in (which works slightly differently depending on which version of the spec you use).

--
You received this message because you are subscribed to the Google Groups "Swagger" group.
To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggers...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Dheeru

unread,
Nov 8, 2017, 1:40:51 PM11/8/17
to swagger-sw...@googlegroups.com

Thanks for the response Ratovsky!

Can you please help me with some more details or provide me any link where I can refer the composition? I am a newbie in swagger.

Thanks,
Dharmendra


To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggersocket+unsub...@googlegroups.com.


For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the Google Groups "Swagger" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/swagger-swaggersocket/1WpXqHMldJo/unsubscribe.
To unsubscribe from this group and all its topics, send an email to swagger-swaggersocket+unsub...@googlegroups.com.

Ron Ratovsky

unread,
Nov 8, 2017, 1:59:49 PM11/8/17
to swagger-sw...@googlegroups.com

I can, but I need to know which version of the spec you’re using.

 

 

 

From: <swagger-sw...@googlegroups.com> on behalf of Dheeru <mail2...@gmail.com>
Reply-To: "swagger-sw...@googlegroups.com" <swagger-sw...@googlegroups.com>
Date: Wednesday, November 8, 2017 at 10:40
To: "swagger-sw...@googlegroups.com" <swagger-sw...@googlegroups.com>
Subject: Re: Different View of same model

 

Thanks for the response Ratovsky!

Can you please help me with some more details or provide me any link where I can refer the composition? I am a newbie in swagger.

Thanks,
Dharmendra

On 09-Nov-2017 3:16 AM, "Ron Ratovsky" <r...@swagger.io> wrote:

That’s where composition comes in (which works slightly differently depending on which version of the spec you use).

 

 

 

From: <swagger-sw...@googlegroups.com> on behalf of Dharmendra Dubey <mail2...@gmail.com>
Reply-To: "swagger-sw...@googlegroups.com" <swagger-sw...@googlegroups.com>
Date: Tuesday, November 7, 2017 at 21:08
To: Swagger <swagger-sw...@googlegroups.com>
Subject: Different View of same model

 

Hi All,

Is there any way to have different view of same model?

 

I have a scenario where I have a model created and is being used for two different APIs but one API needs all the properties of the model but other one needs only few.

 

Is there any way to handle this case in swagger?

--
You received this message because you are subscribed to the Google Groups "Swagger" group.

To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggers...@googlegroups.com.


For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the Google Groups "Swagger" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/swagger-swaggersocket/1WpXqHMldJo/unsubscribe.

To unsubscribe from this group and all its topics, send an email to swagger-swaggers...@googlegroups.com.


For more options, visit https://groups.google.com/d/optout.

 

--

You received this message because you are subscribed to the Google Groups "Swagger" group.

To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggers...@googlegroups.com.

Dharmendra Dubey

unread,
Nov 8, 2017, 6:21:15 PM11/8/17
to Swagger
I am using Version 2.0.


On Thursday, 9 November 2017 05:59:49 UTC+11, Ron wrote:

I can, but I need to know which version of the spec you’re using.

 

 

 

From: <swagger-sw...@googlegroups.com> on behalf of Dheeru <mail2...@gmail.com>
Reply-To: "swagger-sw...@googlegroups.com" <swagger-sw...@googlegroups.com>
Date: Wednesday, November 8, 2017 at 10:40
To: "swagger-sw...@googlegroups.com" <swagger-sw...@googlegroups.com>
Subject: Re: Different View of same model

 

Thanks for the response Ratovsky!

Can you please help me with some more details or provide me any link where I can refer the composition? I am a newbie in swagger.

Thanks,
Dharmendra

On 09-Nov-2017 3:16 AM, "Ron Ratovsky" <r...@swagger.io> wrote:

That’s where composition comes in (which works slightly differently depending on which version of the spec you use).

 

 

 

From: <swagger-sw...@googlegroups.com> on behalf of Dharmendra Dubey <mail2...@gmail.com>
Reply-To: "swagger-sw...@googlegroups.com" <swagger-sw...@googlegroups.com>
Date: Tuesday, November 7, 2017 at 21:08
To: Swagger <swagger-sw...@googlegroups.com>
Subject: Different View of same model

 

Hi All,

Is there any way to have different view of same model?

 

I have a scenario where I have a model created and is being used for two different APIs but one API needs all the properties of the model but other one needs only few.

 

Is there any way to handle this case in swagger?

--
You received this message because you are subscribed to the Google Groups "Swagger" group.

To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggersocket+unsub...@googlegroups.com.


For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the Google Groups "Swagger" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/swagger-swaggersocket/1WpXqHMldJo/unsubscribe.

To unsubscribe from this group and all its topics, send an email to swagger-swaggersocket+unsub...@googlegroups.com.


For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Swagger" group.

To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggersocket+unsub...@googlegroups.com.

Ron Ratovsky

unread,
Nov 8, 2017, 6:26:38 PM11/8/17
to swagger-sw...@googlegroups.com

To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggers...@googlegroups.com.


For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the Google Groups "Swagger" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/swagger-swaggersocket/1WpXqHMldJo/unsubscribe.

To unsubscribe from this group and all its topics, send an email to swagger-swaggers...@googlegroups.com.


For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Swagger" group.

To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggers...@googlegroups.com.


For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Swagger" group.

To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggers...@googlegroups.com.

Dharmendra Dubey

unread,
Nov 8, 2017, 7:10:00 PM11/8/17
to Swagger
Thanks Ron! That can help me.

To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggersocket+unsub...@googlegroups.com.


For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the Google Groups "Swagger" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/swagger-swaggersocket/1WpXqHMldJo/unsubscribe.

To unsubscribe from this group and all its topics, send an email to swagger-swaggersocket+unsub...@googlegroups.com.


For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Swagger" group.

To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggersocket+unsub...@googlegroups.com.


For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Swagger" group.

To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggersocket+unsub...@googlegroups.com.

Reply all
Reply to author
Forward
0 new messages