---

title: Internal - OpenAPI Parser


keywords: fastai
sidebar: home_sidebar



nb_path: "90_build_lib.ipynb"
---
<!--

#################################################
### THIS FILE WAS AUTOGENERATED! DO NOT EDIT! ###
#################################################
# file to edit: 90_build_lib.ipynb
# command to build the docs after a change: nbdev_build_docs

-->

<div class="container" id="notebook-container">
        
    {% raw %}
    
<div class="cell border-box-sizing code_cell rendered">

</div>
    {% endraw %}

    {% raw %}
    
<div class="cell border-box-sizing code_cell rendered">

</div>
    {% endraw %}

<div class="cell border-box-sizing text_cell rendered"><div class="inner_cell">
<div class="text_cell_render border-box-sizing rendered_html">
<p>This library leverages the <a href="https://github.com/OAI/OpenAPI-Specification">OpenAPI Specification</a> to create a python client for the GitHub API.  The OpenAPI specification contains metadata on all of the endpoints and how to access them properly.  Using this metadata, we can construct a python client dynamically that updates automatically along with the OpenAPI Spec.</p>

</div>
</div>
</div>
    {% raw %}
    
<div class="cell border-box-sizing code_cell rendered">

</div>
    {% endraw %}

    {% raw %}
    
<div class="cell border-box-sizing code_cell rendered">

</div>
    {% endraw %}

    {% raw %}
    
<div class="cell border-box-sizing code_cell rendered">

<div class="output_wrapper">
<div class="output">

<div class="output_area">


<div class="output_markdown rendered_html output_subarea ">
<h4 id="build_funcs" class="doc_header"><code>build_funcs</code><a href="https://github.com/fastai/ghapi/tree/master/ghapi/build_lib.py#L31" class="source_link" style="float:right">[source]</a></h4><blockquote><p><code>build_funcs</code>(<strong><code>nm</code></strong>=<em><code>'ghapi/metadata.py'</code></em>, <strong><code>url</code></strong>=<em><code>'https://github.com/github/rest-api-description/raw/main/descriptions/api.github.com/api.github.com.json?raw=true'</code></em>, <strong><code>docurl</code></strong>=<em><code>'https://docs.github.com/'</code></em>)</p>
</blockquote>
<p>Build module metadata.py from an Open API spec and optionally filter by a path <code>pre</code></p>

</div>

</div>

</div>
</div>

</div>
    {% endraw %}

    {% raw %}
    
<div class="cell border-box-sizing code_cell rendered">

</div>
    {% endraw %}

<div class="cell border-box-sizing text_cell rendered"><div class="inner_cell">
<div class="text_cell_render border-box-sizing rendered_html">
<p>This module created by <a href="/build_lib.html#build_funcs"><code>build_funcs</code></a> contains a list of metadata for each endpoint, containing the path, verb, operation id, summary, documentation relative URL, and list of parameters (if any), e.g:</p>

</div>
</div>
</div>
    {% raw %}
    
<div class="cell border-box-sizing code_cell rendered">

</div>
    {% endraw %}

    {% raw %}
    
<div class="cell border-box-sizing code_cell rendered">
<div class="input">

<div class="inner_cell">
    <div class="input_area">
<div class=" highlight hl-ipython3"><pre><span></span><span class="kn">from</span> <span class="nn">ghapi.metadata</span> <span class="kn">import</span> <span class="n">funcs</span>
<span class="n">GhMeta</span><span class="p">(</span><span class="o">*</span><span class="n">funcs</span><span class="p">[</span><span class="mi">3</span><span class="p">])</span>
</pre></div>

    </div>
</div>
</div>

<div class="output_wrapper">
<div class="output">

<div class="output_area">



<div class="output_text output_subarea output_execute_result">
<pre>GhMeta(path=&#39;/app/hook/config&#39;, verb=&#39;patch&#39;, oper_id=&#39;apps/update-webhook-config-for-app&#39;, summary=&#39;Update a webhook configuration for an app&#39;, doc_url=&#39;v3/apps#update-a-webhook-configuration-for-an-app&#39;, params=[], data=[[&#39;url&#39;, &lt;class &#39;str&#39;&gt;], [&#39;content_type&#39;, &lt;class &#39;str&#39;&gt;], [&#39;secret&#39;, &lt;class &#39;str&#39;&gt;], [&#39;insecure_ssl&#39;, &lt;class &#39;str&#39;&gt;]], preview=&#39;&#39;)</pre>
</div>

</div>

</div>
</div>

</div>
    {% endraw %}

</div>
 

