mattpolzin / mattpolzin/OpenAPIKit

Allow $refs for vendor extensions

Open
#255 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Swift
Stars
333
Forks
49
Avg merge
19h 9m
Merged PRs (30d)
10

Description

Hi,

I could be wrong, but it looks like vendor extensions can only be resolved as AnyCodable dictionaries of [String: Any]. It would be great if we could use $refs in vendor extensions, i.e be able to do something like this:

openapi: 3.1.0
...
x-vendor-extension-cors: "#/components/schemas/cors"
...
components:
  schemas:
    cors:
      allowedOrigins: 
        - "*"
      allowedMethods:
        - GET
        - POST
        - PUT
        - OPTIONS
        - PATCH
        - DELETE
      allowedHeaders:
        - Accept 
        - Authorization 
        - Content-Type 
        - Origin 
        - X-Requested-With,
        - Application-ID
    

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing how vendor extensions are decoded and how $ref values are resolved in the Swift OpenAPI implementation. Use the YAML example in the issue as the behavior to investigate; done means vendor extensions can reference component schemas instead of being limited to AnyCodable dictionaries, with coverage for the example case.

Written by the indexing model from the issue text.

Assessment

Tech stack
swift
Domain
api
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.