Skip to content
This repository was archived by the owner on Jan 11, 2023. It is now read-only.
This repository was archived by the owner on Jan 11, 2023. It is now read-only.

Custom attributes #11

@sergeysova

Description

@sergeysova

Single attribute:

schema:
  properties:
    demo:
      type: string
        x-rust-attribute: serde(skip_serializing_if = "Option::is_none")

Should generate something like:

struct Example {
  #[serde(skip_serializing_if = "Option::is_none")]
  demo: String,
}

Multiple attributes:

schema:
  properties:
    demo:
      type: string
        x-rust-attribute:
          - serde(skip_serializing_if = “Option::is_none”)
          - validate(url)

Output:

struct Example {
  #[serde(skip_serializing_if = "Option::is_none")]
  #[validate(url)]
  demo: String,
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions