Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(feature): Add support for x-fern-encoding #4249

Merged
merged 4 commits into from
Aug 10, 2024
Merged

Conversation

amckinney
Copy link
Contributor

@amckinney amckinney commented Aug 10, 2024

This adds support for the x-fern-encoding extension. For now, we only support this extension on the types where they're most commonly used (e.g. map and oneof):

components:
  schemas:
    Metadata:
      type: object
      additionalProperties:
        $ref: '#/components/schemas/MetadataValue'
      x-fern-encoding:
        proto:
          type: google.protobuf.Struct
    MetadataValue:
      nullable: true
      oneOf:
        - type: number
          format: double
        - type: string
        - type: boolean
        - type: array
          items:
            $ref: '#/components/schemas/Value'
      x-fern-encoding:
        proto:
          type: google.protobuf.Value
    Value:
      oneOf:
        - type: number
          format: double
        - type: string
        - type: boolean

This also makes a slight adjustment to the IR generator so that we consider creating a ProtobufType for types that specify an encoding without a source (which is particularly relevant for users that specify x-fern-encoding).

@amckinney amckinney requested a review from dsinghvi as a code owner August 10, 2024 01:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants