Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
79 changes: 79 additions & 0 deletions APIs/techtenstein.com/lorem-forge/1.0.0/openapi.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
openapi: "3.1.0"
info:
title: "lorem-forge API"
version: "1.0.0"
description: "Lorem ipsum placeholder text. Words, sentences, paragraphs. Plain text or HTML output."
contact:
name: "Techtenstein"
url: "https://techtenstein.com"
email: "sathvickollu@gmail.com"
license:
name: "MIT"
url: "https://opensource.org/licenses/MIT"
x-providerName: "techtenstein.com"
x-serviceName: "lorem-forge"
x-origin:
- format: "openapi"
version: "3.1"
url: "https://lorem-forge.techtenstein.com/openapi.json"
x-logo:
url: "https://techtenstein.com/logo.png"
servers:
- url: "https://lorem-forge.techtenstein.com"
paths:
/:
get:
summary: "Landing / docs"
/health:
get:
summary: "Health"
/openapi.json:
get:
summary: "OpenAPI spec"
Comment on lines +24 to +32

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

According to the OpenAPI Specification, the responses field is required for every operation object. Currently, the /, /health, and /openapi.json paths do not define any responses, which makes this an invalid OpenAPI document. Adding a default 200 response for these paths resolves this issue.

  /:
    get:
      summary: "Landing / docs"
      responses:
        200:
          description: "Success"
  /health:
    get:
      summary: "Health"
      responses:
        200:
          description: "Success"
  /openapi.json:
    get:
      summary: "OpenAPI spec"
      responses:
        200:
          description: "Success"

/words:
get:
summary: "N random words"
parameters:
- name: "n"
in: "query"
schema:
type: "integer"
default: 20
maximum: 500
responses:
200:
description: "Words"
/sentences:
get:
summary: "N sentences"
parameters:
- name: "n"
in: "query"
schema:
type: "integer"
default: 3
maximum: 50
responses:
200:
description: "Sentences"
/paragraphs:
get:
summary: "N paragraphs"
parameters:
- name: "n"
in: "query"
schema:
type: "integer"
default: 3
maximum: 20
- name: "html"
in: "query"
schema:
type: "string"
default: "false"
Comment on lines +69 to +73

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The html parameter is a boolean flag but is currently defined as a string type with a default value of "false". It is cleaner and more idiomatic to define it as a boolean type with a boolean default value of false.

        - name: "html"
          in: "query"
          schema:
            type: "boolean"
            default: false

responses:
200:
description: "Paragraphs"
externalDocs:
url: "https://lorem-forge.techtenstein.com"
description: "Live API + docs"