# reedelk-openapi
**Repository Path**: mirrors_codecentric/reedelk-openapi
## Basic Information
- **Project Name**: reedelk-openapi
- **Description**: OpenAPI v3 JSON/YAML serializer/deserializer
- **Primary Language**: Unknown
- **License**: Apache-2.0
- **Default Branch**: develop
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 0
- **Forks**: 0
- **Created**: 2020-12-24
- **Last Updated**: 2025-10-18
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
# Reedelk OpenAPI v3 serializer / deserializer
[](https://github.com/reedelk/reedelk-runtime/blob/master/LICENSE)
[](https://twitter.com/intent/follow?screen_name=reedelk)
This project refers to the [OpenAPI Specification](https://github.com/OAI/OpenAPI-Specification) project from the [OpenAPI initiative](https://www.openapis.org/).
## Overview
The Reedelk OpenAPI v3.x serializer/deserializer library is a lightweight library to serialize/deserialize OpenAPI
v3.x model to/from JSON and to/from YAML.
The library uses only [JSON-java (org.json)](https://github.com/stleary/JSON-java) and
[SnakeYAML](https://github.com/asomov/snakeyaml) as dependencies making it the perfect choice if you are just
looking for a very lightweight solution to serialize/deserialize OpenAPI v3.x definitions.
## Features
- Serialize OpenAPI v3.x model to JSON
- Serialize OpenAPI v3.x model to YAML
- Deserialize OpenAPI v3.x model from JSON
- Deserialize OpenAPI v3.x model from YAML
## Maven
Add the Reedelk Repository to your pom.xml:
```xml
reedelk-repository
Reedelk Repository
http://repository.reedelk.com/release/
```
Add the following dependency to your pom.xml file:
```xml
com.reedelk
reedelk-openapi
X.Y.Z
```
## Usage
### Serialize
#### To JSON or YAML:
```java
InfoObject infoModel = new InfoObject();
infoModel.setDescription("This is a sample API.");
infoModel.setVersion("1.0.2");
OpenApiObject openApiModel = new OpenApiObject();
openApiModel.setInfo(info);
// to JSON string
String openApiAsJson = OpenApi.toJson(openApiModel);
// to YAML string
String openApiAsYaml = OpenApi.toYaml(openApiModel);
```
### Deserialize
#### From JSON or YAML:
```java
// from JSON string
String openApiAsJson = "{"openapi": "3.0.3","info": {"title": "API","version": "v1" }}";
OpenApiObject openApiModel = OpenApi.from(openApiAsJson);
InfoObject infoModel = actual.getInfo();
...
// from YAML string
String openApiAsYaml = "openapi: 3.0.0
info:
version: 1.0.2
title: Petstore API";
OpenApiObject openApiModel = OpenApi.from(openApiAsYaml);
InfoObject infoModel = actual.getInfo();
...
```
## Contribute
- If you find a bug in Reedelk OpenAPI, please [file a bug report](https://github.com/reedelk/reedelk-openapi/issues).
- If you want to discuss Reedelk OpenAPI, suggest new features, you have issues getting started with the library or just say 'Hi', let us know in the [Reedelk Slack Developers Community](https://join.slack.com/t/reedelk/shared_invite/zt-fz3wx56f-XDylXpqXERooKeOtrhdZug) [](https://join.slack.com/t/reedelk/shared_invite/zt-fz3wx56f-XDylXpqXERooKeOtrhdZug).