roas-codegen 0.2.0

Generate Rust and Go types from OpenAPI 2.0 / 3.0 / 3.1 / 3.2 descriptions
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14

{% block validate %}// A deprecated field is still checked.
{% for a in t.cfg %}{{ a }}
{% endfor %}#[allow(deprecated)]
impl Validate for {{ t.name }} {
    fn validate_into(&self, {% if t.validate %}pointer{% else %}_pointer{% endif %}: &str, {% if t.validate %}report{% else %}_report{% endif %}: &mut ValidationReport) {
{% for line in t.validate %}        {{ line }}
{% endfor %}    }
{% if t.validate_null %}
    fn validate_null(pointer: &str, report: &mut ValidationReport) {
{% for line in t.validate_null %}        {{ line }}
{% endfor %}    }
{% endif %}}
{% endblock %}