io.muserver.openapi.PathsObjectBuilder Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of mu-server Show documentation
Show all versions of mu-server Show documentation
A simple but powerful web server framework
package io.muserver.openapi;
import java.util.Map;
/**
* Holds the relative paths to the individual endpoints and their operations. The path is appended to the
* URL from the {@link ServerObject} in order to construct the full URL. The Paths MAY be empty, due to
* ACL constraints.
*/
public class PathsObjectBuilder {
private Map pathItemObjects;
/**
* @param pathItemObjects A relative path to an individual endpoint. The field name MUST begin with a slash.
* The path is appended (no relative URL resolution) to the expanded
* URL from the {@link ServerObject}'s url
field in order to construct the
* full URL. Path templating is allowed. When matching URLs, concrete (non-templated)
* paths would be matched before their templated counterparts. Templated paths with the
* same hierarchy but different templated names MUST NOT exist as they are identical.
* In case of ambiguous matching, it's up to the tooling to decide which one to use.
* @return The current builder
*/
public PathsObjectBuilder withPathItemObjects(Map pathItemObjects) {
this.pathItemObjects = pathItemObjects;
return this;
}
public PathsObject build() {
return new PathsObject(pathItemObjects);
}
/**
* Creates a builder for a {@link PathsObject}
*
* @return A new builder
*/
public static PathsObjectBuilder pathsObject() {
return new PathsObjectBuilder();
}
}