OpenAPITools / OpenAPITools/openapi-generator

[BUG] rust-server doesn't seem to like examples

Open
#3,313 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Issue: Bug Server: Rust
Dominant language
Java
Stars
26.8k
Forks
7.7k
PR merge metrics
PR metrics pending

Description

Hi,

I'm using rust-server with 4.0.1.

I have a path which returns an schema defined as below:

$ref: '#/components/schemas/Alert

This schema is a test one, and is defined as:

Alert:
  type: object
  properties:
     name:
       type: string
       example: "Test string"

This renders the following code in examples/client.rs

 // Disabled because there's no example.
        Some("ExecuteAlert") => {
            let result = core.run(client.execute_alert(???));
            println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &Has<XSpanIdString>).get().clone());
         },

Is this something which is meant to work when examples are set?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Begin with the generated examples/client.rs output from the rust-server case and the OpenAPI schema shown in the report. Reproduce using rust-server 4.0.1, then trace why the Alert property's example does not yield a usable argument; done means the generated example no longer contains ??? when examples are provided.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
api, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.