The YAML type manifold provides comprehensive support for YAML (1.2+). You can define a YAML or JSON API with YAML resource
files (.yml
and .yaml
files). Manifold can derive an API from sample data in YAML format, or you can build JSON Schema
APIs directly with YAML.
Manifold lets you use YAML and JSON interchangeably, as such please refer to the JSON and JSON Schema project reference. All that applies to JSON applies to YAML.
Manifold is fully supported in IntelliJ IDEA and Android Studio.
Get the Manifold plugin directly from within the IDE via:
Settings ➜ Plugins ➜ Marketplace ➜ search: Manifold
Experiment with the Manifold Sample Project via:
File ➜ New ➜ Project from Version Control ➜ Git
Enter: https://github.com/manifold-systems/manifold-sample-project.git
Use the plugin to really boost your productivity. Use code completion to conveniently build queries and discover the schema's API. Navigate to/from call-sites and YAML/schema file elements. Make changes to your YAML/schema files and use the changes immediately, no compilation! Find usages of any element in your YAML/schema files. Perform rename refactors to quickly and safely make project-wide changes.
The manifold-yaml
project is defined with Maven. To build it install Maven and run the following command.
mvn compile
The manifold-yaml
dependency works with all build tooling, including Maven and Gradle. It also works with Java
versions 8 - 21.
This project consists of two modules:
manifold-yaml
manifold-yaml-rt
For optimal performance and to work with Android and other JVM languages it is recommended to:
- Add a dependency on
manifold-yaml-rt
(Gradle: "implementation", Maven: "compile") - Add
manifold-yaml
to the annotationProcessor path (Gradle: "annotationProcessor", Maven: "annotationProcessorPaths")
If you are not using Maven or Gradle, you can download the latest binaries here.
Note, if you are targeting Android, please see the Android docs.
Note, if you are using Kotlin, please see the Kotlin docs.
Here is a sample build.gradle
script. Change targetCompatibility
and sourceCompatibility
to your desired Java
version (8 - 21), the script takes care of the rest.
plugins {
id 'java'
}
group 'systems.manifold'
version '1.0-SNAPSHOT'
targetCompatibility = 11
sourceCompatibility = 11
repositories {
jcenter()
maven { url 'https://oss.sonatype.org/content/repositories/snapshots/' }
}
dependencies {
implementation 'systems.manifold:manifold-yaml-rt:2024.1.34'
testImplementation 'junit:junit:4.12'
// Add manifold to -processorpath for javac
annotationProcessor 'systems.manifold:manifold-yaml:2024.1.34'
testAnnotationProcessor 'systems.manifold:manifold-yaml:2024.1.34'
}
if (JavaVersion.current() != JavaVersion.VERSION_1_8 &&
sourceSets.main.allJava.files.any {it.name == "module-info.java"}) {
tasks.withType(JavaCompile) {
// if you DO define a module-info.java file:
options.compilerArgs += ['-Xplugin:Manifold', '--module-path', it.classpath.asPath]
}
} else {
tasks.withType(JavaCompile) {
// If you DO NOT define a module-info.java file:
options.compilerArgs += ['-Xplugin:Manifold']
}
}
Use with accompanying settings.gradle
file:
rootProject.name = 'MyProject'
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.example</groupId>
<artifactId>my-yaml-app</artifactId>
<version>0.1-SNAPSHOT</version>
<name>My Yaml App</name>
<properties>
<!-- set latest manifold version here -->
<manifold.version>2024.1.34</manifold.version>
</properties>
<dependencies>
<dependency>
<groupId>systems.manifold</groupId>
<artifactId>manifold-yaml-rt</artifactId>
<version>${manifold.version}</version>
</dependency>
</dependencies>
<!--Add the -Xplugin:Manifold argument for the javac compiler-->
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
<configuration>
<source>11</source>
<target>11</target>
<encoding>UTF-8</encoding>
<compilerArgs>
<!-- Configure manifold plugin -->
<arg>-Xplugin:Manifold</arg>
</compilerArgs>
<!-- Add the processor path for the plugin -->
<annotationProcessorPaths>
<path>
<groupId>systems.manifold</groupId>
<artifactId>manifold-yaml</artifactId>
<version>${manifold.version}</version>
</path>
</annotationProcessorPaths>
</configuration>
</plugin>
</plugins>
</build>
</project>
Open source Manifold is free and licensed under the Apache 2.0 license.
For the versions available, see the tags on this repository.