Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/Nexmo/oas_parser
An open source Open API Spec 3 Definition Parser
https://github.com/Nexmo/oas_parser
developer-destination nexmo oas3 openapi-specification openapi3 ruby vonage
Last synced: 3 months ago
JSON representation
An open source Open API Spec 3 Definition Parser
- Host: GitHub
- URL: https://github.com/Nexmo/oas_parser
- Owner: Nexmo
- License: mit
- Created: 2017-12-19T18:12:33.000Z (about 7 years ago)
- Default Branch: main
- Last Pushed: 2024-02-14T19:25:56.000Z (12 months ago)
- Last Synced: 2024-11-14T03:04:50.259Z (3 months ago)
- Topics: developer-destination, nexmo, oas3, openapi-specification, openapi3, ruby, vonage
- Language: Ruby
- Homepage:
- Size: 166 KB
- Stars: 51
- Watchers: 18
- Forks: 16
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.txt
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# ⚠️ This repository is no longer maintained.
---
# Open API Definition Parser
A Ruby parser for Open API Spec 3.0+ definitions.
### Install
Install the gem:
```
$ gem install oas_parser
```Or add it to your Gemfile:
```ruby
gem 'oas_parser'
```### Usage
Here is a basic example of how you can traverse through an Open API Spec 3 Definition:
```ruby
require 'oas_parser'definition = OasParser::Definition.resolve('petstore.yml')
# => ## Get a specific path
path = definition.path_by_path('/pets')
# => ## Get all paths.
definition.paths
# => [#, ...]# Get a specific endpoint by method
endpoint = path.endpoint_by_method('get')
# => ## Get all endpoints
path.endpoints
# => [#, ...]# Get endpoint description
endpoint.description
# => "Returns all pets from the system that the user has access to"
```Checkout the tests and `lib` directory for more classes and methods.
### Development
Run tests:
```
$ rspec
```### Publishing
Clone the repo and navigate to its directory:
```
$ cd oas-parser
```Bump the latest version in `oas_parser/lib/oas_parser/version.rb`:
```
//old
module OasParser
VERSION = '1.0.0'.freeze
end//new
module OasParser
VERSION = '1.1.0'.freeze
end
```Build the gem:
```
$ gem build oas_parser.gemspec
```_This will create a `oas_parser-1.1.0.gem` file._
Push the gem to rubygems.org:
```
$ gem push oas_parser-1.1.0.gem
```Verify the change was made by checking for the [new version on rubygems.org](https://rubygems.org/gems/oas_parser)
## Contributing
Contributions are welcome, please follow [GitHub Flow](https://guides.github.com/introduction/flow/index.html)