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

add support for in: header parameters #87

Open
stolen opened this issue Feb 14, 2025 · 0 comments
Open

add support for in: header parameters #87

stolen opened this issue Feb 14, 2025 · 0 comments

Comments

@stolen
Copy link

stolen commented Feb 14, 2025

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.

@github-project-automation github-project-automation bot moved this to 📑 TODO in erf Feb 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 📑 TODO
Development

No branches or pull requests

1 participant