Skip to content

lex and lexgen: Allow encodings in Lexicon files to be arrays of strings #1107

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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mikekasprzak
Copy link

As per bluesky-social/atproto-website#426 and bluesky-social/atproto#3986, this PR adds initial support for arrays of encodings in Lexicon files. See the following example:

{
  "lexicon": 1,
  "id": "org.w3.activitypub.putInbox",
  "defs": {
    "main": {
      "type": "procedure",
      "input": {
        "encoding": [
          "application/json",
          "application/activity+json",
          "application/ld+json; profile=\"https://www.w3.org/ns/activitystreams\""
        ],
        "schema": { "type": "ref", "ref": "org.w3.activitypub.object" }
      },
      "output": {
        "encoding": "application/activity+json",
        "schema": { "type": "ref", "ref": "org.w3.activitypub.object" }
      }
    }
  }
}

In essence, this PR stops lexgen from emitting errors when an array of encodings is found in a Lexicon file. This feature is currently of no use to the Go codebase, as Lexicons used here all have only a single encoding. That said, it ensures interoperability should bluesky-social/atproto-website#426 get approved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant