Skip to content

add support for in: header parameters #87

@stolen

Description

@stolen

I tried to import this schema: https://github.com/Redocly/redoc/raw/refs/heads/main/demo/big-openapi.json
It failed with silent error.
After some tracing found the actual error:

compile:lint_module/2 -> {error,
                               {compile,[],".",[],[],".beam",[],[],
                                   [binary],
                                   [binary],
                                   none,
                                   [{[],
                                     [{0,erl_lint,{unbound_var,'Headers'}},
                                      {0,erl_lint,{unbound_var,'Headers'}},
                                      {0,erl_lint,{unbound_var,'Extension'}},
                                      {0,erl_lint,{unbound_var,'Headers'}},
                                      {0,erl_lint,{unbound_var,'Headers'}},
                                      {0,erl_lint,{unbound_var,'Headers'}},
                                      {0,erl_lint,{unbound_var,'Headers'}},
                                      {0,erl_lint,{unbound_var,...}},
                                      {0,erl_lint,{...}}]}],
                                   [{[],
                                     [{0,erl_lint,{unused_var,'EventType'}},
                                      {0,erl_lint,{unused_var,'EventType'}},
                                      {0,erl_lint,{unused_var,'EventType'}},
                                      {0,erl_lint,{unused_var,'EventType'}},
                                      {0,erl_lint,{unused_var,'EventType'}},
                                      {0,erl_lint,{unused_var,'Hash'}},
                                      {0,erl_lint,{unused_var,...}},
                                      {0,erl_lint,{...}},
                                      {0,erl_lint,...},
                                      {0,...},
                                      {...}|...]}],
                                   []}}

Lots of errors, hard to fix.

I tried this schema instead: https://github.com/flussonic/openapi_handler/blob/master/test/flussonic-230127.json
After hacking openapi 3.1 support, I got the same {unbound_var,'Headers'}, but just one.
I removed one parameter and it worked:

@@ -15275,14 +15275,6 @@
         "summary": "Get server config",
         "description": "Method allows to fetch global server configuration and current runtime status.\n",
         "parameters": [
-          {
-            "name": "Accept",
-            "description": "Ask for `text/plain` to get original text config.\nBy default it will be `application/json`.\n",
-            "in": "header",
-            "schema": {
-              "type": "string"
-            }
-          }
         ],
         "responses": {
           "200": {

So, it looks like there are some troubles with parameters in headers.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    📑 TODO

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions