Test revision requirement in schema service
[netconf.git] / restconf / restconf-openapi / src / main / java / org / opendaylight / restconf / openapi / model / PathsEntity.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 static java.util.Objects.requireNonNull;
11
12 import com.fasterxml.jackson.core.JsonGenerator;
13 import java.io.IOException;
14 import java.util.Deque;
15 import org.eclipse.jdt.annotation.NonNull;
16
17 public final class PathsEntity extends OpenApiEntity {
18     private final @NonNull Deque<PathEntity> paths;
19
20     public PathsEntity(final @NonNull Deque<PathEntity> paths) {
21         this.paths = requireNonNull(paths);
22     }
23
24     @Override
25     public void generate(final @NonNull JsonGenerator generator) throws IOException {
26         generator.writeObjectFieldStart("paths");
27         for (final var path : paths) {
28             path.generate(generator);
29         }
30         generator.writeEndObject();
31     }
32 }