jsonschema2pojo Interfaces

jsonschema2pojo extension to generate interfaces

License

License

Categories

Categories

JSON Data
GroupId

GroupId

dev.hctbst
ArtifactId

ArtifactId

jsonschema2pojo-interfaces
Last Version

Last Version

1.0.0
Release Date

Release Date

Type

Type

jar
Description

Description

jsonschema2pojo Interfaces
jsonschema2pojo extension to generate interfaces
Project URL

Project URL

https://github.com/hectorbst/jsonschema2pojo-interfaces
Source Code Management

Source Code Management

https://github.com/hectorbst/jsonschema2pojo-interfaces

Download jsonschema2pojo-interfaces

How to add to project

<!-- https://jarcasting.com/artifacts/dev.hctbst/jsonschema2pojo-interfaces/ -->
<dependency>
    <groupId>dev.hctbst</groupId>
    <artifactId>jsonschema2pojo-interfaces</artifactId>
    <version>1.0.0</version>
</dependency>
// https://jarcasting.com/artifacts/dev.hctbst/jsonschema2pojo-interfaces/
implementation 'dev.hctbst:jsonschema2pojo-interfaces:1.0.0'
// https://jarcasting.com/artifacts/dev.hctbst/jsonschema2pojo-interfaces/
implementation ("dev.hctbst:jsonschema2pojo-interfaces:1.0.0")
'dev.hctbst:jsonschema2pojo-interfaces:jar:1.0.0'
<dependency org="dev.hctbst" name="jsonschema2pojo-interfaces" rev="1.0.0">
  <artifact name="jsonschema2pojo-interfaces" type="jar" />
</dependency>
@Grapes(
@Grab(group='dev.hctbst', module='jsonschema2pojo-interfaces', version='1.0.0')
)
libraryDependencies += "dev.hctbst" % "jsonschema2pojo-interfaces" % "1.0.0"
[dev.hctbst/jsonschema2pojo-interfaces "1.0.0"]

Dependencies

provided (1)

Group / Artifact Type Version
org.jsonschema2pojo : jsonschema2pojo-core jar 1.0.2

test (5)

Group / Artifact Type Version
org.junit.jupiter : junit-jupiter-api jar
org.junit.jupiter : junit-jupiter-engine jar
org.junit.platform : junit-platform-runner jar
org.junit.jupiter : junit-jupiter-params jar
org.assertj : assertj-core jar 3.17.2

Project Modules

There are no modules declared in this project.

Build Coverage Violations Maven Central License

jsonschema2pojo-interfaces

This project is a jsonschema2pojo extension dedicated to interface generation.

Features

Interfaces

This extension generate interfaces. It acts like a post-processing tool removing all field and method bodies.

E.g., this schema:

{
	"title": "Sample entity",
	"type": "object",
	"properties": {
		"field": {
			"title": "A field",
			"type": "string"
		}
	}
}

Will produce:

public interface Entity {

	String getField();

	void setField(String field);
}

Maven configuration

Here is an example of how the extension can be added to the jsonschema2pojo Maven plugin.

<plugin>
	<groupId>org.jsonschema2pojo</groupId>
	<artifactId>jsonschema2pojo-maven-plugin</artifactId>
	<version>${jsonschema2pojo-interfaces.version}</version>
	<executions>
		<execution>
			<goals>
				<goal>generate</goal>
			</goals>
			<configuration>
				...
				<!-- Extension RuleFactory -->
				<customRuleFactory>
					dev.hctbst.jsonschema2pojo.interfaces.InterfacesRuleFactory
				</customRuleFactory>
			</configuration>
		</execution>
	</executions>
	<dependencies>
		<!-- Extension dependency -->
		<dependency>
			<groupId>dev.hctbst</groupId>
			<artifactId>jsonschema2pojo-interfaces</artifactId>
			<version>${jsonschema2pojo-interfaces.version}</version>
		</dependency>
</plugin>

A more complete example is available here.

License

This project is released under version 2.0 of the Apache License.

Versions

Version
1.0.0