Skip to content
This repository was archived by the owner on Feb 20, 2026. It is now read-only.
This repository was archived by the owner on Feb 20, 2026. It is now read-only.

Warn user in case an OpenAPI description with inline schema is provided as input #17

@LorenzHW

Description

@LorenzHW

Regarding Tim's comment:

Since schema references often correspond to named structs, I'm inclined to force all inlined schemas to be converted to references, either with a linter rule or a transformation.

As long as this linter rule or transformation does not exist we should display a warning that the output of gnostic-grpc might be faulty in case the user provides an OpenAPI description with inline schemas.

Example input API with inline schema:

paths:
  /inlineSchema:
    get:
      operationId: inlineSchema
      responses:
        200:
          description: succes
          content:
            application/json:
              schema:
                type: integer
                format: int32

Expected console output after running gnostic --grpc-out...:

level:WARNING  code: "" text: "An inline schema is provided. The output of gnostic-grpc might be incorrect. Consider using a reference for your schema" keys:"paths" keys:"/inlineSchema" keys:"get" keys:"responses" keys:"200" keys:"content" keys:"application/json" keys:"schema"

Example input API with reference schema:

paths:
  /referenceSchema:
    get:
      operationId: referenceSchema
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Person'
components:
  schemas:
    Person:
      type: object
      properties:
        age:
          type: integer
          format: int64
        name:
          type: string
          example: Peter

Expected console output:
No warning regarding inline schema

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueThis issue is a good place to started contributing to this repository.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions