Nigel Finley
10/14/2022, 9:18 PMValidator Error
can't resolve reference #components/schemas/class from id #
Here is the api spec:
openapi: 3.0.0
info:
title: "API"
version: "1.0.0"
components:
schemas:
class:
type: object
properties:
attempted:
type: boolean
paths:
/api/v1/instructor/me:
get:
tags:
- Instructor
description: This will fetch a users classes.
responses:
200:
description: You have successfully found all classes and their status for the current user
content:
application/json:
schema:
type: object
properties:
Classes:
type: array
items:
$ref: '#components/schemas/class'
Elem:
type: array
items:
$ref: '#components/schemas/class'
Trainings:
type: array
items:
$ref: '#components/schemas/class'
Sela:
type: array
items:
$ref: '#components/schemas/class'
SelaFT:
type: array
items:
$ref: '#components/schemas/class'
401:
description: Unauthorized
And here is the consumer contract:
{
"consumer": {
"name": "Consumer"
},
"provider": {
"name": "Provider"
},
"interactions": [
{
"description": "A request for a single user classes",
"providerState": "User exists with no classes",
"request": {
"method": "GET",
"path": "/api/v1/instructor/me",
"headers": {
"Authorization": "Bearer undefined",
"Accept": "application/json, text/plain, */*",
"Cache-Control": "no-cache"
}
},
"response": {
"status": 200,
"headers": {
"Content-Type": "application/json; charset=utf-8 "
},
"body": {
"Classes": [],
"Elementary": [],
"Sela": [],
"SelaFT": [],
"Trainings": []
}
}
}
],
"metadata": {
"pactSpecification": {
"version": "2.0.0"
}
}
}
Hoping to get some guidance as to why I might be receiving this error. I have validated the Spec. One thing I was curious about is I am using the the pact specification of 2.0.0
on the consumer side. Should I be using 3.0.0
?
Thank you!!!Yousaf Nabi (pactflow.io)
$ref: '#/components/schemas/class'
The pact will return an error, as it specifies the field Elementary
but your spec states Elem
Best of luck in your bi-directional journey buddyYousaf Nabi (pactflow.io)
Nigel Finley
10/14/2022, 9:33 PMNigel Finley
10/14/2022, 9:34 PMYousaf Nabi (pactflow.io)