Skip to content

floriankammermann/tmforum_openapi_scrape

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Scrape all resources from the tmforum OpenAPI Directory

You can directly start with "download all content", since the file generated from "get the OpenAPI TMF relative paths" is commited.

get the OpenAPI TMF relative paths

  1. go to https://www.tmforum.org/oda/open-apis/directory
  2. open the dev tools
  3. go to Elements -> select <html lang="en" style> -> right click -> copy
  4. save the copied content in a file named output/open_api.html
  5. format output/open_api.html with e.g. visual code formatter. We need linebreaks for the next step
  6. extract the relevant path with cat output/open_api.html | grep href | grep '/oda/open-apis/directory' | grep TMF | sed 's/.*href="\/oda\/open-apis\/directory\///g' | sed 's/"//g' > output/open_api_path.txt

download all content

  1. install python3
  2. execute python3 source/fetch_tmf_api_content.py
  3. content will be fetched to output/TMF<number>

browsing the content

Visual Studio Code

For efficiently browsing the content use this setup.

  1. Install Visual Studio Code
  2. Install vscode-pdf
  3. Install OpenAPI (Swagger) Editor

OpenAPI Specs on command line

In the cli folder you find extract_definitions_from_apispec You can use this command line tool to browse the OpenAPI schemas and extract them. It only works on OpenAPI specs and not swagger. Use cli/extract_definitions_from_apispec -h to explore the options.

additional sources for slicing through the content

creating diagrams from the OpenAPI TMF Specifications

  1. Install java
  2. Download https://github.com/knutaa/oas2puml/releases/tag/Release_1.3.0
  3. Generate the plantuml files for a OpenAPI TMF Specification: java -jar apidiagram-1.3.0-SNAPSHOT.jar diagrams -f TMF620-Product_Catalog_Management-v5.0.0.oas.yaml
  4. Download https://plantuml.com/download
  5. Generate a diagram from the plantuml files: java -Djava.awt.headless=true -jar plantuml.jar Resource_ProductSpecification.puml

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages