标记$ ref不显示内容openapi3.0

时间:2019-11-13 15:40:58

标签: swagger openapi api-doc

我将这部分规范添加到api,其中包含有关外部文件中的内容的信息:

@XmlRootElement(name = "complextype0")
@XmlAccessorType(XmlAccessType.PROPERTY)
public class ComplexType0 extends MyOwnClass{

    /**/
    private String value1 = null;
    /**/
    private String value2 = null;
    /**/
    private String value3 = null;
    /**/
    private String value4 = null;
    /**/
    private String value5 = null;

    @XmlElement(name = "value1", defaultValue="null")
    public void setValue1(String value1) {
        if(value1 == null) { 
            return;
        }

        if(value1.compareTo("null") == 0) { 
            return;
        }

        this.value1 = value1;
    }

    @XmlElement(name = "value2", defaultValue="null")
    public void setValue2(String value2) {
        if(value2 == null) { 
            return;
        }

        if(value2.compareTo("null") == 0) { 
            return;
        }

        this.value2 = value2;
    }

    @XmlElement(name = "value3", defaultValue="null")
    public void setValue3(String value3) {
        if(value3 == null) { 
            return;
        }

        if(value3.compareTo("null") == 0) { 
            return;
        }

        this.value3 = value3;
    }

    @XmlElement(name = "value4", defaultValue="null")
    public void setValue4(String value4) {
        if(value4 == null) { 
            return;
        }

        if(value4.compareTo("null") == 0) { 
            return;
        }

        this.value4 = value4;
    }

    @XmlElement(name = "value5", defaultValue="null")
    public void setValue5(String value5) {
        if(value5 == null) { 
            return;
        }

        if(value5.compareTo("null") == 0) { 
            return;
        }

        this.value5 = value5;
    }

    public String getValue1() {
        return value1;
    }

    public String getValue2() {
        return value2;
    }

    public String getValue3() {
        return value3;
    }

    public String getValue4() {
        return value4;
    }

    public String getValue5() {
        return value5;
    }

}

通过这种方式,当我使用openapi-cli-tool制作捆绑包时,不会加载paths: /about: $ref: ./api/about.yml#/about 内容。但是,如果我增加一个辅助标签,则会加载内容。

about

使用paths: /about: whatever: $ref: ./api/about.yml#/about 标签,Swagger编辑器显示“结构”错误,但没有加载该错误。一些提示?

糟糕:我已经在openapi 3.0的whatever标记中看到了一些错误。

0 个答案:

没有答案