Skip to content

[REQ] [rust-axum] model documentation #21937

@jacob-vincent-mink

Description

@jacob-vincent-mink

While working on my own spec with the beta rust-axum generator, I encountered lots of models generated that look like

pub struct ModelName(Box<serde_json::value::RawValue>)

Obviously, the struct is public but

  1. The value inside is not
  2. The value inside is opaque, especially in an AnyOf case

I actually came across similar structs in the examples:

pub struct AnyOfHashMapObject(Box<serde_json::value::RawValue>);

I would appreciate someone explaining the right way to discriminate these structs into the real types.

This is a request for documentation on how to use generated models like this when implementing a server api with the rust-axum generated traits.

Closing this issue would mean that we (I, at least, have) sufficient documentation on implementing a server based on the rust-axum generator.

I considered filing this as a bug report as an alternative, but I do not know enough about the intention of the model design to say this is a bug.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions