openapi_type 0.4.2

OpenAPI type information for Rust structs and enums
# openapi_type [![Rust 1.58+]] [![License Apache-2.0]] [![GitHub]]

This crate gives static type information for primitives and commonly used types from the standard library and other commonly used libraries `chrono`, `indexmap`, `linked-hash-map`, `time` and `uuid` when the according feature is enabled. Also, it provides a derive macro for structs and enums to gain access to their static type information at runtime.

The core of this crate is the [`OpenapiType`][__link0] trait. It has one static function, [`schema`][__link1], which returns an [`OpenapiSchema`][__link2]. This assembles the static type information in a way that is convenient to use for a generated OpenAPI specification, but can also be utilized in other use cases as well.

## Custom Types

To gain access to the static type information of your custom types at runtime, the easiest way is to use the derive macro:

struct FooBar {
	foo: String,
	bar: u64

## OpenAPI specification

Using above type, running `FooBar::schema().into_schema()` yields

type: object
title: FooBar
    type: string
    type: integer
    format: int64
    minimum: 0
  - foo
  - bar

Note, however, that this is not sufficient for more complex types. If one of your structs fields is a type that has a name (that is, `Type::schema().name` is not `None`), above schema will contain a reference to that schema. Therefore, always remember to put the [`dependencies`][__link3] into the specification alongside the type you are interested in.

## Versioning

Like all rust crates, this crate will follow semantic versioning guidelines. However, changing
the MSRV (minimum supported rust version) is not considered a breaking change.

## License

Copyright (C) 2021-2023 Dominic Meiser and [contributors].

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
See the License for the specific language governing permissions and
limitations under the License.

 [__cargo_doc2readme_dependencies_info]: ggGkYW0BYXSEG7SHp4CHYJTUG32g8S8ZLTbKG-tOgOVi2h0_G0-3WfSf5f82YXKEGx-WnjBiXfMmG4V3M75ny0WUG3hGD9I-WPRHG94Lm2E6FONkYWSBgmxvcGVuYXBpX3R5cGVlMC40LjI