import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.databind.node.ObjectNode;
@JsonInclude(Include.NON_NULL)
-public record Path(@JsonProperty("$ref") String ref, String summary, String description, Operation get,
- Operation put, Operation post, Operation delete, Operation options, Operation head, Operation patch,
- Operation trace, ObjectNode servers) {
+public record Path(
+ @JsonProperty("$ref") String ref,
+ String summary,
+ String description,
+ Operation get,
+ Operation put,
+ Operation post,
+ Operation delete,
+ Operation options,
+ Operation head,
+ Operation patch,
+ Operation trace) {
+
private Path(final Builder builder) {
this(builder.ref, builder.summary, builder.description, builder.get, builder.put, builder.post,
- builder.delete, builder.options, builder.head, builder.patch, builder.trace, builder.servers);
+ builder.delete, builder.options, builder.head, builder.patch, builder.trace);
}
@SuppressWarnings("checkstyle:hiddenField")
private Operation head;
private Operation patch;
private Operation trace;
- private ObjectNode servers;
public Builder ref(final String ref) {
this.ref = ref;
return this;
}
- public Builder servers(final ObjectNode servers) {
- this.servers = servers;
- return this;
- }
-
public Path build() {
return new Path(this);
}
}
-}
\ No newline at end of file
+}
*/
package org.opendaylight.restconf.openapi.model;
+import static java.util.Objects.requireNonNull;
+
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
+import org.eclipse.jdt.annotation.NonNull;
+/**
+ * Represents a Server. The target host is indicated by the {@link Server#url} field.
+ *
+ * <p>
+ * In the example URL: <b>http://localhost:8181/openapi/api/v3/mounts/{id}</b>,
+ *
+ * @param url <b>Required</b> {@link String} representing the URL to the target host.
+ */
@JsonInclude(Include.NON_NULL)
-public record Server(String url) {
+public record Server(
+ @NonNull String url) {
+
+ public Server {
+ requireNonNull(url);
+ }
}