From 94f9f3ff83da9e920d30e6ca4a5fb404317232b3 Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Fri, 22 May 2026 16:39:23 +0000 Subject: [PATCH 1/3] docs: add example plant store OpenAPI spec to SDK quickstart pages Co-Authored-By: Devin Logan --- .../sdks/snippets/example-openapi.mdx | 117 ++++++++++++++++++ .../sdks/snippets/init-fern-folder.mdx | 2 + 2 files changed, 119 insertions(+) create mode 100644 fern/products/sdks/snippets/example-openapi.mdx diff --git a/fern/products/sdks/snippets/example-openapi.mdx b/fern/products/sdks/snippets/example-openapi.mdx new file mode 100644 index 0000000000..299828ed2a --- /dev/null +++ b/fern/products/sdks/snippets/example-openapi.mdx @@ -0,0 +1,117 @@ + + + Use this example plant store API to try out SDK generation: + + + + + Save the following as `openapi.yml`: + + ```yaml title="openapi.yml" + openapi: 3.0.3 + info: + title: Plant Store API + version: 1.0.0 + paths: + /plants: + get: + operationId: plants_list + summary: List all plants + parameters: + - name: limit + in: query + schema: + type: integer + responses: + "200": + description: A list of plants + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/Plant" + post: + operationId: plants_create + summary: Add a new plant + requestBody: + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/CreatePlantRequest" + responses: + "201": + description: The created plant + content: + application/json: + schema: + $ref: "#/components/schemas/Plant" + /plants/{plantId}: + get: + operationId: plants_get + summary: Get a plant by ID + parameters: + - name: plantId + in: path + required: true + schema: + type: string + format: uuid + responses: + "200": + description: The requested plant + content: + application/json: + schema: + $ref: "#/components/schemas/Plant" + "404": + description: Plant not found + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + components: + schemas: + Plant: + type: object + required: [id, name, species] + properties: + id: + type: string + format: uuid + name: + type: string + example: "Monstera Deliciosa" + species: + type: string + example: "Monstera" + wateringSchedule: + type: string + enum: [daily, weekly, biweekly, monthly] + CreatePlantRequest: + type: object + required: [name, species] + properties: + name: + type: string + species: + type: string + wateringSchedule: + type: string + enum: [daily, weekly, biweekly, monthly] + Error: + type: object + required: [message] + properties: + message: + type: string + ``` + + + ```bash + fern init --openapi openapi.yml --organization my-org + ``` + + + diff --git a/fern/products/sdks/snippets/init-fern-folder.mdx b/fern/products/sdks/snippets/init-fern-folder.mdx index f977e3fc71..c3e3b3b3c6 100644 --- a/fern/products/sdks/snippets/init-fern-folder.mdx +++ b/fern/products/sdks/snippets/init-fern-folder.mdx @@ -29,6 +29,8 @@ OpenAPI accepts both JSON and YAML formats. + + This creates a `fern` folder in your current directory. From 9e4107a9688881ab4b90e734ebc296a5cac56e7d Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Fri, 22 May 2026 17:05:35 +0000 Subject: [PATCH 2/3] docs: simplify example to use public Petstore spec URL Co-Authored-By: Devin Logan --- .../sdks/snippets/example-openapi.mdx | 118 +----------------- 1 file changed, 5 insertions(+), 113 deletions(-) diff --git a/fern/products/sdks/snippets/example-openapi.mdx b/fern/products/sdks/snippets/example-openapi.mdx index 299828ed2a..781a6c7567 100644 --- a/fern/products/sdks/snippets/example-openapi.mdx +++ b/fern/products/sdks/snippets/example-openapi.mdx @@ -1,117 +1,9 @@ - - Use this example plant store API to try out SDK generation: + + Don't have an OpenAPI spec? Try the [Swagger Petstore](https://petstore3.swagger.io/api/v3/openapi.json) example: - - - - Save the following as `openapi.yml`: - - ```yaml title="openapi.yml" - openapi: 3.0.3 - info: - title: Plant Store API - version: 1.0.0 - paths: - /plants: - get: - operationId: plants_list - summary: List all plants - parameters: - - name: limit - in: query - schema: - type: integer - responses: - "200": - description: A list of plants - content: - application/json: - schema: - type: array - items: - $ref: "#/components/schemas/Plant" - post: - operationId: plants_create - summary: Add a new plant - requestBody: - required: true - content: - application/json: - schema: - $ref: "#/components/schemas/CreatePlantRequest" - responses: - "201": - description: The created plant - content: - application/json: - schema: - $ref: "#/components/schemas/Plant" - /plants/{plantId}: - get: - operationId: plants_get - summary: Get a plant by ID - parameters: - - name: plantId - in: path - required: true - schema: - type: string - format: uuid - responses: - "200": - description: The requested plant - content: - application/json: - schema: - $ref: "#/components/schemas/Plant" - "404": - description: Plant not found - content: - application/json: - schema: - $ref: "#/components/schemas/Error" - components: - schemas: - Plant: - type: object - required: [id, name, species] - properties: - id: - type: string - format: uuid - name: - type: string - example: "Monstera Deliciosa" - species: - type: string - example: "Monstera" - wateringSchedule: - type: string - enum: [daily, weekly, biweekly, monthly] - CreatePlantRequest: - type: object - required: [name, species] - properties: - name: - type: string - species: - type: string - wateringSchedule: - type: string - enum: [daily, weekly, biweekly, monthly] - Error: - type: object - required: [message] - properties: - message: - type: string - ``` - - ```bash - fern init --openapi openapi.yml --organization my-org + fern init --openapi https://petstore3.swagger.io/api/v3/openapi.json \ + --organization my-org ``` - - - + From ceacb6ccf6f48924e31a5c4ca40b5b74978e0e27 Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Fri, 22 May 2026 18:01:46 +0000 Subject: [PATCH 3/3] docs: inline Petstore example as third CodeBlock, remove separate snippet Co-Authored-By: Devin Logan --- fern/products/sdks/snippets/example-openapi.mdx | 9 --------- fern/products/sdks/snippets/init-fern-folder.mdx | 6 ++++-- 2 files changed, 4 insertions(+), 11 deletions(-) delete mode 100644 fern/products/sdks/snippets/example-openapi.mdx diff --git a/fern/products/sdks/snippets/example-openapi.mdx b/fern/products/sdks/snippets/example-openapi.mdx deleted file mode 100644 index 781a6c7567..0000000000 --- a/fern/products/sdks/snippets/example-openapi.mdx +++ /dev/null @@ -1,9 +0,0 @@ - - - Don't have an OpenAPI spec? Try the [Swagger Petstore](https://petstore3.swagger.io/api/v3/openapi.json) example: - - ```bash - fern init --openapi https://petstore3.swagger.io/api/v3/openapi.json \ - --organization my-org - ``` - diff --git a/fern/products/sdks/snippets/init-fern-folder.mdx b/fern/products/sdks/snippets/init-fern-folder.mdx index c3e3b3b3c6..0cf8ac2e96 100644 --- a/fern/products/sdks/snippets/init-fern-folder.mdx +++ b/fern/products/sdks/snippets/init-fern-folder.mdx @@ -24,13 +24,15 @@ fern init --openapi https://api.example.com/openapi.yml \ --organization ``` + ```bash title="Example (Petstore)" + fern init --openapi https://petstore3.swagger.io/api/v3/openapi.json \ + --organization my-org + ``` OpenAPI accepts both JSON and YAML formats. - - This creates a `fern` folder in your current directory.