Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Small increments for some openapi3 support #19

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

slodge
Copy link

@slodge slodge commented Dec 23, 2021

I've been using rapiclient against some internal authenticated REST api's recently.

These APIs have necessitated a few small changes:

  • allow the JSON to have openapi instead of swagger (was only a warning anyway)
  • allow parameter definitions to come from ^#/components as well as ^#/definitions
  • allow the config and headers to be callback functions rather than fixed objects

These changes still need a little documentation added (and maybe make them less verbose in their messaging too)

Are you interested in these? If you are then, I'll happily update the docs and tidy up this PR. If not, then no problem - we can run off a fork of this library - assuming that's OK with the license (currently it's not entirely obvious which open source model this is licensed under)

Thanks for all your work on this - it's a very useful library :)

@slodge
Copy link
Author

slodge commented Jan 18, 2022

small fixes made today - especially around using servers for an openapi api

example use is:

devtools::load_all()
lovecraft <- get_api("https://randomlovecraft.com/openapi.yaml")
lovecraft_operations <- get_operations(lovecraft)

books <- lovecraft_operations$`get-books`()
books_content <- httr::content(books)

sentences <- lovecraft_operations$`get-sentences`()
sentences_content <- httr::content(sentences)

specific_sentence <- lovecraft_operations$`get-specific-sentence`(id = "74c1cd53")
specific_sentence_content <- httr::content(specific_sentence)

book_sentences <- lovecraft_operations$`get-sentences-from-book`(id = "1cb2", limit = 5)
book_sentences_content <- httr::content(book_sentences)

This obviously isn't complete (openapi has lots more in it) but at least allows openapi descriptions to be accessed.

@rcannood
Copy link

It would be really interesting to get support for openapi3!

@bergant @LiNk-NY Are there plans for this PR to get merged? 🙇

@LiNk-NY
Copy link
Collaborator

LiNk-NY commented Aug 16, 2024

Hi @rcannood @slodge,

I am hesitant to support OAS 3.0 in the same package.
rapiclient was developed with OAS 2.0 in mind.
I think it would be best to support it in a separate package.

Have you tried https://github.com/OpenAPITools/openapi-generator for OAS 3.0?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants