<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Flask on Sawyer Zheng's Blog</title><link>https://elated-raman-42e0c2.netlify.app/tags/flask/</link><description>Recent content in Flask on Sawyer Zheng's Blog</description><generator>Hugo</generator><language>zh-cn</language><lastBuildDate>Fri, 10 Feb 2023 16:53:38 +0800</lastBuildDate><atom:link href="https://elated-raman-42e0c2.netlify.app/tags/flask/index.xml" rel="self" type="application/rss+xml"/><item><title>flask-restx notes</title><link>https://elated-raman-42e0c2.netlify.app/post/notes/swagger/flask-restx/</link><pubDate>Thu, 17 Jun 2021 00:00:00 +0000</pubDate><guid>https://elated-raman-42e0c2.netlify.app/post/notes/swagger/flask-restx/</guid><description>&lt;div id="outline-container-headline-1" class="outline-2"&gt;
&lt;h2 id="headline-1"&gt;
教程
&lt;/h2&gt;
&lt;div id="outline-text-headline-1" class="outline-text-2"&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://flask-restx.readthedocs.io/en/latest/api.html"&gt;Api 类教程&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="outline-container-headline-2" class="outline-2"&gt;
&lt;h2 id="headline-2"&gt;
namespace
&lt;/h2&gt;
&lt;div id="outline-text-headline-2" class="outline-text-2"&gt;
&lt;ul&gt;
&lt;li&gt;作用：对 Resource 分组&lt;/li&gt;
&lt;li&gt;参考：&lt;a href="https://flask-restx.readthedocs.io/en/latest/api.html?highlight=namespace#flask_restx.Namespace"&gt;API — Flask-RESTX documentation–Namspace class&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;调用&lt;/p&gt;
&lt;div class="src src-python"&gt;
&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;
&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt;1
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-python" data-lang="python"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;api&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;namespace&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;...&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="outline-container-headline-3" class="outline-2"&gt;
&lt;h2 id="headline-3"&gt;
Model
&lt;/h2&gt;
&lt;div id="outline-text-headline-3" class="outline-text-2"&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;参考：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://flask-restx.readthedocs.io/en/latest/api.html?highlight=namespace#flask_restx.Model"&gt;API — Flask-RESTX restx.Model&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://flask-restx.readthedocs.io/en/latest/api.html?highlight=namespace#flask_restx.Namespace.model"&gt;api.model 方法&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;parameters 字段&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Parameters:
default – The default value for the field, if no value is specified.
attribute – If the public facing value differs from the internal value, use this to retrieve a different attribute from the response than the publicly named value.
title (str) – The field title (for documentation purpose)
description (str) – The field description (for documentation purpose)
required (bool) – Is the field required ?
readonly (bool) – Is the field read only ? (for documentation purpose)
example – An optional data example (for documentation purpose)
mask (callable) – An optional mask function to be applied to output&lt;/p&gt;</description></item></channel></rss>