Skip to content

Latest commit

 

History

History
49 lines (39 loc) · 1.12 KB

File metadata and controls

49 lines (39 loc) · 1.12 KB

Using VS Code for OpenAPI Editing

Step 1: Install VS Code Extensions

In VS Code, install these extensions:

  1. OpenAPI (Swagger) Editor by 42Crunch
  2. YAML Language Support by Red Hat
  3. Swagger Viewer by Arjun G

Step 2: Open Our YAML File

  1. Open VS Code
  2. Open the file: swagger-editor-demo.yaml
  3. You'll see syntax highlighting and validation

Step 3: Try These Edits

Edit Descriptions:

# Change line 6:
description: |
  A REST API for managing customer data.

  **I edited this in VS Code!**

Add Validation:

# Add after line 46:
        - name: type
          in: query
          description: Filter by customer type
          schema:
            type: string
            enum: [INDIVIDUAL, BUSINESS, VIP, PREMIUM]

Test Error Detection:

# Break something (line 35):
            typ: integer  # ← Wrong field - see red underline

VS Code Features:

  • Syntax highlighting
  • Real-time validation (red underlines for errors)
  • Auto-completion
  • Schema references (click to jump to definitions)
  • Preview (right-click → "Preview Swagger")