generated from fastai/nbdev_template
/
build_lib.html
142 lines (88 loc) · 4.14 KB
/
build_lib.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
---
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='/app/hook/config', verb='patch', oper_id='apps/update-webhook-config-for-app', summary='Update a webhook configuration for an app', doc_url='v3/apps#update-a-webhook-configuration-for-an-app', params=[], data=[['url', <class 'str'>], ['content_type', <class 'str'>], ['secret', <class 'str'>], ['insecure_ssl', <class 'str'>]], preview='')</pre>
</div>
</div>
</div>
</div>
</div>
{% endraw %}
</div>