Team, need help. i am getting an error for the below spec in swagger. can you please let me know why .. as when i just create a schema definition, not sure why it complains for "items". couldnt see any documentation which explains the hierarchy of the swagger nodes. below is the error i get and also further below the actual Yaml content that I created.
i get the above in a few lines though. please help when you get a chance.
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
# this is an example of the Uber API
# as a demonstration of an API spec in YAML
swagger: '2.0'
info:
title: Product Information
description: Information related to Products and Options
version: "1.0.0"
# the domain of the service
# array of all schemes that your API supports
schemes:
- https
# will be prefixed to all paths
basePath: /v1
produces:
- application/json
paths:
/products/5:
get:
summary: Product Details
description: |
The Products endpoint returns information about the products
and all its options, features and footnotes. If invoked without a product id, it will return an array of all products.
tags:
- Products
responses:
200:
description: An array of products
schema:
type: array
items:
$ref: '#/definitions/Product'
default:
description: Unexpected error
schema:
$ref: '#/definitions/Error'
definitions:
Product:
type: object
properties:
categoryIds:
type: array
chargeList:
$ref: '#/definitions/ChargeList'
defaultOptionProducts:
type: array
isEmbedType:
type: boolean
isExcluded:
type: boolean
isInstalled:
type: boolean
isReplacement:
type: boolean
productSO:
$ref: '#/definitions/ProductSO'
ProductInformation:
$ref: '#/definitions/ProductInformation'
ProductFootNote:
$ref: '#/definitions/ProductFootNote'
AssociatedFeatures:
$ref: '#/definitions/AssociatedFeatures'
ChargeList:
type: object
properties:
ChargeType__c:
type: string
Apttus_Config2__ListPrice__c:
type: integer
Apttus_Config2__ChargeType__c:
type: string
ProductSO:
type: object
properties:
Id:
type: string
Name:
type: string
Uom__c:
type: string
ProductCode:
type: string
Customizable__c:
type: boolean
IsActive:
type: boolean
Description:
type: string
ConfigurationType__c:
type: string
HasOptions__c:
type: boolean
HasAttributes__c:
type: boolean
rating:
type: integer
Apttus_Config2__Uom__c:
type: string
Apttus_Config2__Customizable__c:
type: boolean
Apttus_Config2__ConfigurationType__c:
type: string
Apttus_Config2__HasOptions__c:
type: boolean
Apttus_Config2__HasAttributes__c:
type: boolean
AttributeGroupIds:
type: array
OptionGroupIds:
type: array
ProductInformation:
type: object
properties:
Id:
type: string
OwnerId:
type: string
IsDeleted:
type: boolean
Name:
type: string
CreatedDate:
type: string
CreatedById:
type: string
LastModifiedDate:
type: string
LastModifiedById:
type: string
SystemModstamp:
type: string
ContentUrl__c:
type: string
Description__c:
type: string
InformationType__c:
type: string
ProductId__c:
type: string
ProductFootNote:
type: object
properties:
Id:
type: string
OwnerId:
type: string
IsDeleted:
type : boolean
Name:
type: string
CreatedDate:
type: string
CreatedById:
type: string
LastModifiedDate:
type: string
LastModifiedById:
type: string
SystemModstamp:
type: string
Type__c:
type: string
AssociatedFeatures:
type: object
properties:
ProductFeatureValueSOs:
$ref: '#/definitions/ProductFeatureValueSOs'
FeatureSetSO:
$ref: '#/definitions/FeatureSetSO'
ProductFeatureValueSOs:
type: object
properties:
Id:
type: string
FeatureId__c:
type: string
FeatureSetSO:
type: object
properties:
Id:
type: string
Name:
type: string
Error:
type: object
properties:
code:
type: integer
format: int32
message:
type: string
fields:
type: string