Skip to content
New issue

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

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

Already on GitHub? # to your account

docs: integrate onvif schemas and validation matrix to swagger #180

Merged
merged 16 commits into from
Oct 26, 2022

Conversation

ajcasagrande
Copy link
Contributor

@ajcasagrande ajcasagrande commented Oct 18, 2022

Lots of additional changes/improvements to the swagger generation:

  • Link json schemas converted from wsdl to the corresponding endpoints in the swagger file
  • Cleanup and fix response types and include base types from core-command service
  • For GET calls with jsonObject field, provide documentation on the format and schema of the field, along with descriptions of each field.
  • Parse the tested onvif cameras validation matrix and insert it (footnotes and all) into the description of each linked command
  • Add useful warning messages during generation if some commands are missing required or optional data
  • Switch to ruamel.yaml to allow multi-line strings to support Markdown sytanx for description fields.
  • Remove unused schema definitions from onvif wsdl
  • Auto generate documentation for base64 env vars

PR Checklist

Please check if your PR fulfills the following requirements:

  • I am not introducing a breaking change (if you are, flag in conventional commit message with BREAKING CHANGE: describing the break)
  • I am not introducing a new dependency (add notes below if you are)
  • [N/A] I have added unit tests for the new feature or bug fix (if not, why?)
  • I have fully tested (add details below) this the new feature or bug fix (if not, why?)
  • I have opened a PR for the related docs change (if not, why?)

Testing Instructions

Browse the hosted version:
https://app.swaggerhub.com/apis-docs/ANTHONYJINTEL/edge-x_onvif_device_service/2.2.0

New Dependency Instructions (If applicable)

Note: these dependencies are only used for the purpose of generating the OpenAPI 3.0 swagger file.

JavaScript:

Python:


A few example screenshots:

jsonObject schema:

tested cameras matrix:

response event/object schemas:

Signed-off-by: Anthony Casagrande <anthony.j.casagrande@intel.com>
Signed-off-by: Anthony Casagrande <anthony.j.casagrande@intel.com>
Signed-off-by: Anthony Casagrande <anthony.j.casagrande@intel.com>
Signed-off-by: Anthony Casagrande <anthony.j.casagrande@intel.com>
Signed-off-by: Anthony Casagrande <anthony.j.casagrande@intel.com>
@codecov-commenter
Copy link

codecov-commenter commented Oct 18, 2022

Codecov Report

Merging #180 (c44d1cb) into main (c32d12c) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##             main     #180   +/-   ##
=======================================
  Coverage   30.82%   30.82%           
=======================================
  Files          18       18           
  Lines        1810     1810           
=======================================
  Hits          558      558           
  Misses       1187     1187           
  Partials       65       65           

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

Signed-off-by: Anthony Casagrande <anthony.j.casagrande@intel.com>
doc/openapi/README.md Outdated Show resolved Hide resolved
Signed-off-by: Anthony Casagrande <anthony.j.casagrande@intel.com>
Signed-off-by: Anthony Casagrande <anthony.j.casagrande@intel.com>
Signed-off-by: Anthony Casagrande <anthony.j.casagrande@intel.com>
Signed-off-by: Anthony Casagrande <anthony.j.casagrande@intel.com>
Signed-off-by: Anthony Casagrande <anthony.j.casagrande@intel.com>
Signed-off-by: Anthony Casagrande <anthony.j.casagrande@intel.com>
Signed-off-by: Anthony Casagrande <anthony.j.casagrande@intel.com>
brianointel
brianointel previously approved these changes Oct 21, 2022
Copy link
Contributor

@brianointel brianointel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

Copy link
Contributor

@ChristianDarr-personal ChristianDarr-personal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm still looking through this, but I think that are too many output statements. Maybe an option to disable it or just removing some of the more extraneous ones would be mote helpful.

Signed-off-by: Anthony Casagrande <anthony.j.casagrande@intel.com>
@ajcasagrande
Copy link
Contributor Author

I'm still looking through this, but I think that are too many output statements. Maybe an option to disable it or just removing some of the more extraneous ones would be mote helpful.

@ChristianDarr-personal I agree. The prints were helpful when creating the scripts, but now they are just noise. I have switched to using the python logging package and have set a majority of them as debug. By default they are off, but can be enabled by doing DEBUG_LOGGING=1 make ....

Signed-off-by: Anthony Casagrande <anthony.j.casagrande@intel.com>
Signed-off-by: Anthony Casagrande <anthony.j.casagrande@intel.com>
@ajcasagrande ajcasagrande merged commit 68a981f into edgexfoundry:main Oct 26, 2022
@ajcasagrande ajcasagrande deleted the swagger-wsdl-3 branch October 26, 2022 18:17
@ajcasagrande ajcasagrande restored the swagger-wsdl-3 branch October 27, 2022 02:57
@ajcasagrande ajcasagrande deleted the swagger-wsdl-3 branch October 27, 2022 19:16
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants