Replace escape character by empty line
[netconf.git] / restconf / restconf-openapi / src / main / java / org / opendaylight / restconf / openapi / model / InfoEntity.java
1 /*
2  * Copyright (c) 2023 PANTHEON.tech, s.r.o. and others.  All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8 package org.opendaylight.restconf.openapi.model;
9
10 import com.fasterxml.jackson.core.JsonGenerator;
11 import java.io.IOException;
12 import org.eclipse.jdt.annotation.NonNull;
13
14 public final class InfoEntity extends OpenApiEntity {
15     private final String title;
16     private static final String DESCRIPTION = """
17         We are providing full API for configurational data which can be edited (by POST, PUT, PATCH and DELETE).
18         For operational data we only provide GET API.
19
20         For majority of request you can see only config data in examples. That's because we can show only one example
21         per request. The exception when you can see operational data in example is when data are representing
22         operational (config false) container with no config data in it.""";
23
24     public InfoEntity(final String title) {
25         this.title = title;
26     }
27
28     @Override
29     public void generate(@NonNull JsonGenerator generator) throws IOException {
30         generator.writeObjectFieldStart("info");
31         generator.writeStringField("version", "1.0.0");
32         if (title != null) {
33             generator.writeStringField("title", title);
34         }
35         generator.writeStringField("description", DESCRIPTION);
36         generator.writeEndObject();
37     }
38 }