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

Fails to generate for GitHub API #1028

Open
hoijui opened this issue Dec 31, 2024 · 1 comment
Open

Fails to generate for GitHub API #1028

hoijui opened this issue Dec 31, 2024 · 1 comment

Comments

@hoijui
Copy link

hoijui commented Dec 31, 2024

https://github.com/github/rest-api-description/raw/refs/heads/main/descriptions/api.github.com/api.github.jparrowsec.cn.json

thread 'main' panicked at /home/user/.cargo/registry/src/index.crates.io-6f17d22bba15001f/progenitor-impl-0.9.0/src/method.rs:2023:23:
not yet implemented: more media types than expected for markdown/render-raw: 2

claims to be "openapi": "3.0.3"

@hoijui hoijui changed the title Fails to parse GitHub schema Fails to parse GitHub API Dec 31, 2024
@hoijui hoijui changed the title Fails to parse GitHub API Fails to generate for GitHub API Dec 31, 2024
@2bndy5
Copy link

2bndy5 commented Feb 8, 2025

I removed the unsupported content type from the spec:

            "text/x-markdown": {
              "schema": {
                "type": "string"
              },
              "examples": {
                "default": {
                  "summary": "Rendering markdown",
                  "value": {
                    "text": "Hello **world**"
                  }
                }
              }
            }

But now it fails to generate with a less helpful error:

  process didn't exit successfully: `/path/to/target/debug/build/github-client-9a409abff822b299/build-script-build` (exit status: 101)
  --- stdout
  cargo:rerun-if-changed=api.github.jparrowsec.cn.json

  --- stderr
  thread 'main' panicked at path/to/build.rs:8:51:
  called `Result::unwrap()` on an `Err` value: TypeError(InvalidValue)
  stack backtrace:
     0: rust_begin_unwind
               at /rustc/e71f9a9a98b0faf423844bf0ba7438f29dc27d58/library/std/src/panicking.rs:665:5
     1: core::panicking::panic_fmt
               at /rustc/e71f9a9a98b0faf423844bf0ba7438f29dc27d58/library/core/src/panicking.rs:76:14
     2: core::result::unwrap_failed
               at /rustc/e71f9a9a98b0faf423844bf0ba7438f29dc27d58/library/core/src/result.rs:1699:5
     3: build_script_build::main
     4: core::ops::function::FnOnce::call_once
  note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

which is emitted from this line in build.rs:

    let tokens = generator.generate_tokens(&spec).unwrap();

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

No branches or pull requests

2 participants