Skip to content

Latest commit

 

History

History
126 lines (107 loc) · 4.71 KB

Usage.md

File metadata and controls

126 lines (107 loc) · 4.71 KB

Repository Structure

Note: All folders mentioned here are relative to the root folder protocol-specs

The full specification can be found at api/{module_name}/build/{module_name}.yaml

This is an autogenerated file created by compiling multiple sets of components namely,

  1. Enum: found at api/{module_name}/components/enum/
    • These are all the enums used in module specification while creating the module artifact
  2. Examples: found at api/{module_name}/components/examples/
    • These are the examples created Illustrative use of the specification and embeeded in the yaml
    • Structure api/{module_name}/components/examples/{api_name}/example_{#}.yaml
  3. Unresolved YAML: found at api/{module_name}/components/beck_yaml.yaml

Diagaram



/ (root directory)
|
|--beckn-core-protocol-specs (git submodule to specific beckn inheritated release)
|--api (contains all the api specific details)
|  |--{module_name} (Module/Domain)
|  |  |--build
|  |  |  |--build.yaml (Built Single YAML with api specification of the module)
|  |  |--components (contains all components of the specification)
|  |  |  |--enum (contains all enums used in module)
|  |  |  |  |--index.yaml (index yaml) 
|  |  |  |  |  | {Group/Theme/Flow}
|  |  |  |  |  |  |  content
|  |  |  |  |  |  |    {Schema1}:
|  |  |  |  |  |  |      $ref: ./{schema1}.yaml
|  |  |  |  |  |  |    {Schema2}:
|  |  |  |  |  |  |      $ref: ./{schema2}.yaml
|  |  |  |  |  |  |    ....
|  |  |  |  |--{schema1}.yaml (enum1 yaml)
|  |  |  |  |  |  content
|  |  |  |  |  |    {atttribute}:
|  |  |  |  |  |      - code: ENUM_VALUE1
|  |  |  |  |  |        description: enum description md format
|  |  |  |  |  |        reference: links md format
|  |  |  |  |  |      - code: ENUM_VALUE2
|  |  |  |  |  |        description: enum description md format
|  |  |  |  |  |        reference: links md format
|  |  |  |  |--{schema2}.yaml (enum2 yaml)
|  |  |  |  |  |  content
|  |  |  |  |  |    {atttribute}:
|  |  |  |  |  |      - code: ENUM_VALUE1
|  |  |  |  |  |        description: enum description md format
|  |  |  |  |  |        reference: links md format
|  |  |  |  |  |      - code: ENUM_VALUE2
|  |  |  |  |  |        description: enum description md format
|  |  |  |  |  |        reference: links md format
|  |  |  |--examples (conatins examples of the APIs)
|  |  |  |  |--(theme/usecase/base/behaviour)
|  |  |  |  |  |--search (search request examples yaml)
|  |  |  |  |  |  |--example_0.yaml (example_0 yaml)
|  |  |  |  |  |  |  |  content
|  |  |  |  |  |  |  |    summary: Search Ride
|  |  |  |  |  |  |  |    value:
|  |  |  |  |  |  |  |        context:
|  |  |  |  |  |  |  |        ....
|  |  |  |--tags (contains Tags all tags used in module)
|  |  |  |  |--tag_group.yaml (tag group yaml) 
|  |  |  |  |  |  content
|  |  |  |  |  |     {schema}:
|  |  |  |  |  |  |     tags:
|  |  |  |  |  |  |      - code: TAG_GROUP_TEST1
|  |  |  |  |  |  |        description: description md format
|  |  |  |  |  |  |        refrence: refrence links
|  |  |  |  |  |  |        lists:
|  |  |  |  |  |  |         - $ref: "tag.yaml#/{tag_group_name}"
|  |  |  |  |  |  |        ....
|  |  |  |  |  |  |      ....  
|  |  |  |  |--tag.yaml (tag yaml) 
|  |  |  |  |  |  content
|  |  |  |  |  |     {tag_group_name}:
|  |  |  |  |  |  |     tags:
|  |  |  |  |  |  |      - code: TAG_GROUP_TEST1
|  |  |  |  |  |  |        description: description md format
|  |  |  |  |  |  |        refrence: refrence links
|  |  |  |  |  |  |        lists:
|  |  |  |  |  |  |         - $ref: "tag.yaml#/{tag_name}"
|  |  |  |  |  |  |        ....
|  |  |  |  |  |  |      ....  
|  |  |  |--financial-core-unresolved.yaml (unresolved yaml to build final yaml)
|  |  |  |  |   changes:
|  |  |  |  |     - Add module specific examples[if any]
|  |  |  |  |     - include tags in components section 
|  |  |  |  |     - include enums in components section 
|  |  |--docs
|  |  |  |--Readme.md (Module Introduction & description)
|  |  |  |--workflow.md (API work flow illuration for business)
|  |  |  |--attribute.md (Attribute to business terminology mapping)description)

The compilation flow is illustrated below

Setup steps

Pre-requisite

Install swagger CLI

  • Install the swagger command line tool using npm (Note: you may need to use root privileges if installing it globally)
sudo npm install -g swagger-cli

Generate the resolved OpenAPI illustration viewer file on-demand

  • Run the following command
./build_util ./api/b2b/components/beckn_yaml.yaml ./api/mobility/components/index.yaml {out_file_path} 
  • If the command runs successfully, you should see an output like this,
Created Created {out_file_path} from ./api/mobility/components/beckn_yaml.yaml
Temporary file deleted