open_api
Version, currently 1.0.05 versions
- 1.2.1latestOct 31, 2019
- 1.2.0not indexedAug 20, 2021
- 1.0.2not indexedAug 20, 2021
- 1.0.1not indexedAug 20, 2021
- 1.0.0not indexedAug 20, 2021
github.com/hkalexling/open_api.cr
Type safe OpenAPI spec library
Nothing has been indexed for 1.0.0 yet. The tag is recorded, its shard.yml has not been read, so the manifest and dependency list below are empty because they are unknown rather than because they are absent.
Installation
# Add this to your shard.yml
dependencies:
open_api:
github: hkalexling/open_api.cr
version: ~> 1.0.0Then run:
shards installshard.yml
No shard.yml has been indexed for 1.0.0. You can read it on the repository.
Dependencies
Unknown: the shard.yml for this version has not been read yet.
README
This README is the one indexed from the repository at its latest ref, not from the tag for this version.
OpenAPI
Aims at providing a complete more or less type safe mapping of OpenAPI specification. Currently supported version: 3.0.1. Use it to either write or parse OpenAPI specs.
Installation
Add this to your application's shard.yml:
dependencies:
open_api:
github: jreinert/open_api.cr
Usage
Writing specs
require "open_api"
OpenAPI.build do |api|
doc = api.document(
openapi: "3.0.1"
info: {
title: "Catlib",
version: "0.1"
},
paths: {
"/meow" => api.path_item(
get: {
tags: ["cats"],
request_body: {
ref: "#/components/schemas/cat"
}
}
)
},
components: {
schemas: {
:cat => api.schema(
type: "object",
description: "A cat"
)
}
}
)
puts doc.to_json
)
Parsing specs
require "open_api"
File.open("openapi.yml") do |file|
doc = OpenAPI.from_yaml(file)
puts doc.to_json
end
Contributing
- Fork it (https://github.com/jreinert/open_api.cr/fork)
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create a new Pull Request
Contributors
- jreinert Joakim Reinert - creator, maintainer
Documentation
Built from the current release. The first visit to a release nobody has asked for starts its build.
Links
This release
- Version
1.0.0- Tagged
- Aug 20, 2021
- Commit
13021c57b1f6- Indexed
- not yet
Dependents
Repository
github.com/hkalexling/open_api.cr
Metadata
- Created
- Aug 16, 2026
- Updated
- Sep 24, 2026
- Synced
- Sep 24, 2026
- Versions
- 5