Hey, everyone! I’m currently stuck on Day 18. Sorry in advance if my write-up seems a bit random.
I followed the collection documentation’s instructions, importing the API spec as Step 1. See, it’s available in the API’s tab.
In Step 2, I validated the schema and fixed the syntax error, making the validation look clean. Nevertheless, there are numerous warnings for each Request example.
Moving on to Step 3 - Click to Validate" to highlight any issues or discrepancies - Where do I find this in Postman App?
Here is my modified Definition file:
> openapi: "3.0.0"
> info:
> version: 1.1.0
> title: Cosmos
> description: A sample API that retrieves constellations as an example to demonstrate features in the OpenAPI 3.0 specification
> license:
> name: MIT
> servers:
> - url: https://2a6e0231-05f5-4028-8571-cbce1dcfb5b5.mock.pstmn.io
> paths:
> /cosmos:
> get:
> description: Returns all constellations in this sample dataset
> summary: List all cosmos
> operationId: listCosmos
> tags:
> - cosmos
> responses:
> "200":
> description: An array of constellations
> content:
> application/json:
> schema:
> type: object
> properties:
> constellations:
> type: array
> items:
> $ref: "#/components/schemas/Cosmos"
> default:
> description: unexpected error
> content:
> application/json:
> schema:
> $ref: "#/components/schemas/Error"
> /cosmos/{cosmoId}:
> get:
> description: Returns a constellation based on a single ID
> summary: Info for a specific constellation
> operationId: showCosmoById
> tags:
> - cosmos
> parameters:
> - name: cosmoId
> in: path
> required: true
> description: The id of the constellation to retrieve
> schema:
> type: string
> responses:
> "200":
> description: Expected response to a valid request
> headers:
> date:
> description: The current date and time
> schema:
> type: string
> content:
> application/json:
> schema:
> $ref: "#/components/schemas/Cosmo"
> default:
> description: unexpected error
> content:
> application/json:
> schema:
> $ref: "#/components/schemas/Error"
> components:
> schemas:
> Cosmos:
> type: object
> required:
> - id
> - name
> properties:
> id:
> type: integer
> format: int64
> name:
> type: string
> tag:
> type: string
> Cosmo:
> type: object
> properties:
> id:
> type: integer
> format: int64
> name:
> type: string
> tag:
> type: string
> description:
> type: string
> Error:
> type: object
> required:
> - code
> - message
> properties:
> code:
> type: integer
> format: int32
> message:
> type: string
As I checked other posts, I realized that their Day 18 issues are quite different from mine.
I’d really appreciate any help with this. I’m new to all of this, and while I’ve been learning, Day 18 seems to be a bit challenging for me, and I’m struggling to grasp it for some reason.
Also, I made sure to remove the original <integer>
placement for comsoid and replaced it with the actual ID from the List of all cosmos Get request. This approach seems to be correct as it avoids the mockServerNotFoundError. However, I’m not entirely sure, and I’d appreciate your input on this.
Thank you!