slackapi / slack-api-specs

Open API specifications for platform products by Slack
MIT License
220 stars 64 forks source link

'objs_conversation' contains more than one object #46

Open dhandapani-hd opened 3 years ago

dhandapani-hd commented 3 years ago

Description

I am working with Slack Swagger for my project. I am using NSwag to create a client out of the swagger file.

The generated client file does not contain the properties for 'objs_conversation' definition. This is because, in swagger file, it does not contain 'properties' and 'data type' properties directly. Instead it contains only 'items' (which then contains 3 definitions).

Swagger definition for the same - https://justpaste.it/388lf

Questions

  1. Is this the latest swagger json file? and is it officially supported by slack? (I know it is, just getting the confirmation :) )
  2. How to identify which definition to choose for 'objs_conversation'?

What type of issue is this? (place an x in one of the [ ])

Requirements (place an x in each of the [ ])


Bug Report

I am using NSwag to create a client out of the swagger file.

The generated client file does not contain the properties for 'objs_conversation' definition. This is because, in swagger file, it does not contain 'properties' and 'data type' properties directly. Instead it contains only 'items' (which then contains 3 definitions).

Swagger definition for the same - https://justpaste.it/388lf

Reproducible in:

All environments

Steps to reproduce:

Generate the c# client using NSwag from the swagger file.

Expected result:

'objs_conversation' to contains properties. (3 different objects under 'objs_converstion' is confusing and how would we be able to differentiate? it could be with three different names)

Actual result:

It is empty

Attachments:

image

krissirk commented 3 years ago

The schema for objs_conversation has “items” declared without a type. It appears that what is desired is to declare a mixed array, which is only supported in OAS 3.0. One alternative option is to use “allOf” to combine all fields of all the channel types and beside “non-requiredness,” it should assign the values to whatever matching field(s).

FWIW, the reference to objs_conversation from the operation conversations.list already is a list input parameter.