Skip to content

FactomProject/swapi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Swapi

Tool for checking consistency between swagger file and routes in phoenix application. Use only with phoenix framework.

Installation

If available in Hex, the package can be installed by adding swapi to your list of dependencies in mix.exs:

def deps do
  [{:swapi, "~> 0.1.0", only: :dev}]
end

Otherwise please add it with git: directive:

def deps do
     {:swapi, git: "git@github.com:FactomProject/swapi.git", only: :dev},
end

How to use it

mix swapi swagger.yaml

where swagger.yaml is a swagger specification file.

Uniform parameters in paths

Sometimes paths in swagger file and routes are consistent but because documentation, and developer convenience could differ parameters have different names, like: /users/:user_id vs. /users/:id. You may use --uniform option which will change given path parameters to :param1, :param2 etc.

mix swapi swagger.yaml --uniform

This way you can still check if documentation and routes are consistent but preserve naming (which is hard).

Misc

Right now swapi omits PATCH methods, as phoenix generates those and PUT methods with resource directive for updates, making it redundant.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages