GithubHelp home page GithubHelp logo

russell / fairy-slipper Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 2.0 274 KB

API documentation for OpenStack

License: Apache License 2.0

HTML 5.09% Python 81.19% Shell 5.37% JavaScript 7.66% CSS 0.69%

fairy-slipper's People

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

fairy-slipper's Issues

rendering of table with embedded list

  • Possibly re-design the table (currently in wadl) and remove the list from the table.
    • Create a separate list element.
  • Verify that the generated rst is correct for an embedded list in table.
  • Verify that markdown can handle a list embedded in table cell.
  • An example can be found in ch_identity-v3.xml.

multiple status codes in response

The object storage method, createContainer, has a method that returns a response with status codes 201 and 204 and this results in an error setting the response header params. Update the processing of multiple status codes per response.

Nest extensions in navigation

Currently in the navigation extensions are listed as a separate section,

screenshot from 2015-09-24 17-28-02

The extensions should be listed under the version e.g.

Compute
- v2.0
-- Exensions
- v2.1
-- Extensions

Remove by-path navigation link

That view probably wont be used too much. It should still be maintained, but if i remove it from the navigation then it will bring us closer to a polished product.

Full end to end conversion test

look at confirming that the conversion of the source to Swaggerish matches our custom Swagger Schema. So we will need to find a schema validator and write a test that migrates all the data and checks it validates.

Routes inspector needs improvement

It's working again, and documented. But it needs to convert the stubs to swagger format if it can't find any documentation. This resulting swagger can then be fed to the swagger_to_rst script to generate an initial service documentation.

Action URLs

I have been thinking about how we can document some of the calls that take multiple requests and responses.

The mime type spec can use a ; to indicate subsequent parameters are options. You often see these used to indicate that the encoding is utf8 but we could use it to uniquely identify. I was thinking that they could be used to identify groups of request/responses. This would help in this case you describe above and it would also help in the case of the action url.

e.g.
application/text;action_id=reboot could be used to group request/responses that we want to match back to a reboot VM example?

This way we can have multiple example request/responses without them getting mixed up.

To implement this we would need to extend the RST example specification so that we could include the action_id

label overlaps operation title

Sometimes the left hand label overlaps the operation title. The title is on the next line instead
of next to the label. I see this occurring, in orchestration -> Templates -> Show resource schema.

generated rst, missing single space between words

.. swagger:tag:: policies
:synopsis: Policies

Manages policies.

You can encode policy rule sets into a blob to be consumed byremote
services. To do so, set typeto application/jsonand specify
policy rules as JSON strings in a blob. For example:

Move repository to openstack organization

Just wanted to note here that we discussed at the Summit to move this repo to use the Gerrit workflow. Let us know in this issue if you have any difficulties with that move. I think it makes sense to move so that projects will know about it and use it for the API docs.

Add support for link tags in WADL

Currently the swagger to WADL ignores link tags like

<link xlink:href="http://specs.openstack.org/">Filtering and Column Selection</link>

RST flavoured swagger

To provide an easy way to alter the embedded markup format in the swagger output. This will be another way to round trip the data from rst -> swagger -> rst without needing to modify a markdown parser.

This will make writing supporting bots easier.

wadl_to_swagger, missing newline before itemizedList

Output in database-v1-swagger.json contains,
Notes- A user is granted all privileges

There is a title node before the itemizedList node and no new line to separate the title from the list.
The first element of the list is missing the bullet and indentation.

Parse request/response examples from the tempest

I have started to do this already, so i thought i should make sure it's visible.

Basically it's trivial to modify tempest to log all requests/responses to a log file the output looks like

Request (FlavorsV2TestJSON:test_get_flavor): 200 GET http://192.168.122.201:8774/v2.1/6b45254f6f7c44a1b65ddb8218932226/flavors/1 0.117s
Request - Headers: {'Content-Type': 'application/json', 'Accept': 'application/json', 'X-Auth-Token': '<omitted>'}
        Body: None
    Response - Headers: {'status': '200', 'content-length': '430', 'content-location': 'http://192.168.122.201:8774/v2.1/6b45254f6f7c44a1b65ddb8218932226/flavors/1', 'x-compute-request-id': 'req-959a09e8-3628-419d-964a-1be4ca604232', 'vary': 'X-OpenStack-Nova-API-Version', 'connection': 'close', 'x-openstack-nova-api-version': '2.1', 'date': 'Sun, 13 Sep 2015 07:43:01 GMT', 'content-type': 'application/json'}
        Body: {"flavor": {"name": "m1.tiny", "links": [{"href": "http://192.168.122.201:8774/v2.1/6b45254f6f7c44a1b65ddb8218932226/flavors/1", "rel": "self"}, {"href": "http://192.168.122.201:8774/6b45254f6f7c44a1b65ddb8218932226/flavors/1", "rel": "bookmark"}], "ram": 512, "OS-FLV-DISABLED:disabled": false, "vcpus": 1, "swap": "", "os-flavor-access:is_public": true, "rxtx_factor": 1.0, "OS-FLV-EXT-DATA:ephemeral": 0, "disk": 1, "id": "1"}}

From here i plan to write a tool to parse this into a data structure, then i will be able to merge this raw data with the existing swagger examples.

Inheritance of methods

I think that we should define a new http method type called abstract, It's purpose will be to define the generic values of return codes and headers/parameters/tags that are relevant to all calls that inherit from this abstract implementation.

.. http:_abstract_:: /

   :statuscode 200: Success

Each real method definition should be able to inherit from a single abstract method. The abstract methods should be able to inherit from each other and the order they are loaded will determine which ones take precedence.

.. http:get:: /
   :inherits: /

   List versions

The resulting method from this contrived example should be equivalent to

.. http:get:: /

   List versions
   :statuscode 200: Success

This should allow for a massive reduction as any common elements like, headers or path arguments, or common return status codes can be easily defined and will be expressed from a single location. Instead of duplicated throughout the documentation.

Generation of response schema

  • Add the description string to the swagger response object. Use the operationId and response status code for the description.
  • Add the schema object to the swagger response object
    • For methods that list response parameters, update schema object to refer to this schema
  • Generate the responseschema tags for displaying the response schema, see #27.

migrate.sh fails to install venv

i'm trying to follow the workflow described in the README, but the defaults don't seem to be available.

steps to reproduce:

  1. clone new fairy-slipper repository
  2. run ./migrate.sh -V

output is as follows:

$ ./migrate.sh -V
python: can't open file 'tools/install_venv.py': [Errno 2] No such file or directory
./migrate.sh: line 96: tools/with_venv.sh: No such file or directory
./migrate.sh: line 97: tools/with_venv.sh: No such file or directory
./migrate.sh: line 98: tools/with_venv.sh: No such file or directory

dbaas.wadl table output with extra header names, wadl_to_swagger

The database wadl file in api-site, dbaas.wadl contains several tables. The file database-v1-swagger.json, generated by wadl_to_swagger contains the tables, but with extra header fields, such as "Field 1", "Field 2", "Field 3" in each table. See prettytable.py add_row() and its usage in depart_tr(), wadl_to_swagger.py.

Integrate with horizon

Consider integrating with horizon, so host out of the normal horizon interface.

Pros

  • access to a token
  • access to a proxy that will allow us to call other services without CORS
  • access to the service catalog

extra space after hyphen in text

Occasionally, there is a space inserted after the hyphen in a word, probably due to text wrapping. Typically the word is formatted as a code literal.
Ex. manilla- share

rst literals followed by punctuation, back to back literals

Two issues:

  • When two literals are back to back there need to be two spaces between them, for example:
    Some example text another text and then more text.
  • Should remove space after literal if next char is punctuation (. ; :) such as:
    This is an example of ending literal.
    Or, This is a sample text: and some more.

wadl: programlisting, paragraphs

The wadl files appear to have introduced a change in the area of para and programlisting elements.
As a result, the rst rendering is not correct. The rendering of literal blocks, code examples in lists will need to be revisited as well as how and where to display curl examples (possibly not in the main description for the operation). See objectstorage as an example.

rst tables written out as plain text, not html tables, rest.py

I narrowed down a problem loading the page for a number of services that contain tables,
database v1, image v2, blockstorage v2, networking-extension v2, identity-extension v2.
Two problems:

  1. There appears to be a problem with the method,
    default_visit(self, node) in rest.py
    This is called after the table is visited and the subsequent index is a string not an integer.
  2. The tables in the various .rst files are correct, but the table nodes in rest.py are
    written as text not html tables. I added methods visit_table, depart_table verifying that the
    node contains the table as html.

literal blocks in itemizedlist, incorrect format

Literal blocks in an itemized list are not rendering correctly. Evaluate processing of programlisting elements within a paragraph in an itemizedlist. The generated json from wadl is missing new lines after the double colon.

directive for curl client cmd, http server resp

Some of the service method descriptions embed curl commands along with http responses. Would it be useful to pull these out of the description and create a directive to tag as, for example, http req/resp output. This text could be associated with a curl/http (cmd, code block) widget and used within the display, outside of the description.

Display response schema

The response schema isn't displayed.

It should probably be incorporated along side the examples.

I think we want a interface that associates the schemas for requests with the request examples and vice versa.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.