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

REST API documentation via OpenAPI #13

Open
danielmarschall opened this issue May 12, 2023 · 7 comments
Open

REST API documentation via OpenAPI #13

danielmarschall opened this issue May 12, 2023 · 7 comments
Labels
help wanted Extra attention is needed

Comments

@danielmarschall
Copy link
Owner

There should be an OpenAPI documentation that is automatically generated from the restApiInfo() methods of the plugins. I don't have the time to study the OpenAPI specification, so maybe someone can help me with this task? Thank you very much!

@danielmarschall danielmarschall added the help wanted Extra attention is needed label May 12, 2023
@wehowski
Copy link
Collaborator

Hello Daniel,
as I know you are not a big friend of libraries/dependencies.
Although I suggest to take a look at https://github.com/cebe/php-openapi#writing-api-description-files
Maybe this helps?

I m not sure if I can promise any help, have to read the spec first ...

@MarieSnajderova
Copy link

Hello,
Do you still working on that project and need API documentation?
I would like to try working with API documentation. Maybe it will help and could contribute to your project.
Marie

@danielmarschall
Copy link
Owner Author

Hello,
thank you very much for that offer! Yes, I still need help with the documentation. The current documentation is written in plain text, but it would be good if it could follow the OpenAPI specification (which is a bit too complex for me at the moment).

@MarieSnajderova
Copy link

Could you please send me the documentation in plain text. I will try to write API specification based on that.

@danielmarschall
Copy link
Owner Author

Hello,

the field list is like this:

Please note that the fields are not actually described (I can do that later). My main issue is the OpenAPI data structure. If you could do this, then I can easily edit the explanations of the fields later. Thank you very much.

  • Receive
    • GET https://www.example.com/oidplus/rest/v1/objects/[ns]:[id]
    • Input parameters
      • None
    • Output parameters
      • status (<0 is error, >=0 is success)
      • status_bits
      • error (if an error occurred)
      • ra_email
      • comment
      • iris (for OID only)
      • asn1ids (for OID only)
      • confidential
      • title
      • description
      • children
      • created
      • updated
  • Re-Create
    • PUT https://www.example.com/oidplus/rest/v1/objects/[ns]:[id]
    • Input parameters
      • ra_email (optional)
      • comment (optional)
      • iris (optional)
      • asn1ids (optional)
      • confidential (optional)
      • title (optional)
      • description (optional)
    • Output parameters
      • status (<0 is error, >=0 is success)
      • status_bits
      • error (if an error occurred)
      • inserted_id (if it was created)
  • Create
    • POST https://www.example.com/oidplus/rest/v1/objects/[ns]:[id]
    • Input parameters
      • ra_email (optional)
      • comment (optional)
      • iris (optional)
      • asn1ids (optional)
      • confidential (optional)
      • title (optional)
      • description (optional)
    • Output parameters
      • status (<0 is error, >=0 is success)
      • status_bits
      • error (if an error occurred)
      • inserted_id
  • Update
    • PATCH https://www.example.com/oidplus/rest/v1/objects/[ns]:[id]
    • Input parameters
      • ra_email (optional)
      • comment (optional)
      • iris (optional)
      • asn1ids (optional)
      • confidential (optional)
      • title (optional)
      • description (optional)
    • Output parameters
      • status (<0 is error, >=0 is success)
      • status_bits
      • error (if an error occurred)
  • Remove

@Azuris2
Copy link

Azuris2 commented Mar 18, 2024

Hi Marie,

Are you in the midst of working on this?

Hi Daniel,

Just to clarify - would the response for the endpoints be a JSON/XML object containing the output parameters as key value pairs?

@danielmarschall
Copy link
Owner Author

Hello,
yes, it is a REST interface with the result being a JSON object. The "value" can be an array, not just a string.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

4 participants