smartdoc API documentation issue for Request and response objects

@Anil Sagar, @Dino,All,

we have created swagger 2.0 JSON defining request & response objects and created a smartdoc for the API. we are using on-premise 4.17.5 version and drupal based dev portal.

1. In the request structure, we have created a common definition type and referred this definition type for the elements within the request.

Definitions section:

	"definitions": {
		"PhoneType": {
			"type": "string",
			"minLength": 10,
			"maxLength": 10
		},
		"Request":{
			"type": "object",
			"properties": {
				"phoneNumber": {
					"$ref": "#/definitions/crt:PhoneType"
				}

		}
}

In Swagger Open API parameters section, we referred Request object.

					{
						"in": "body",
						"name": "body",
						"description": "request object",
						"required": true,
						"schema": {
						"$ref": "#/definitions/Request"
						}
					}

Once we publish the API documentation, it is not showing Response schema & structure.

When Smartdoc is published, in the documentation, it displays the request as below. for phoneNumber property, it is surrounding the value with curley braces ( {}) instead of showing value in double quotes as it is string type. Also, if the common definition type is having enum value, it is not automatically using one of the enumerated values and showing curley braces.

smartdoc-request-sample.png

We used the same Swagger json in other tools like Swagger IO & API studio and they display the sample value correctly.

Could anyone please let us know how to get this issue fixed?

2. Smartdoc does not show the response object structure & its restrictions. From documentation point of view, consumers will not know the response structure & element's allowed values. Is this a open defect ? or is there a way to display response structure? Other tools like Swagger IO or API studio clearly displays the response object structure.

0 3 821
3 REPLIES 3

Having the same issue. Did you ever get an answer?

Not applicable

Same issue here also... i got this link may be help, but didn't tried it for now : https://community.apigee.com/idea/36231/add-ability-to-display-response-schema-or-sample-r.html

It sounds like a bug in SmartDocs! I don't know the solution to that, If you have a paid support contract, please open a support ticket to ask for a fix.