Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix model docstring to use keyword instead of param #1026

Merged
merged 2 commits into from
Sep 8, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
**Bug Fixes**

- Correctly pad operation groups with reserved names with `Operations` #1005
- Fix the generated docstrings for input kwargs of models #1026

### 2021-07-13 - 5.8.4

Expand Down
4 changes: 2 additions & 2 deletions autorest/codegen/serializers/model_base_serializer.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def prop_documentation_string(prop: Property) -> str:
if prop.constant or prop.readonly:
param_doc_string = f":ivar {prop.name}:"
else:
param_doc_string = f":param {prop.name}:"
param_doc_string = f":keyword {prop.name}:"
description = prop.description
if prop.name == "tags":
description = "A set of tags. " + description
Expand Down Expand Up @@ -90,7 +90,7 @@ def prop_type_documentation_string(prop: Property) -> str:
if prop.constant or prop.readonly:
type_doc_string = f":vartype {prop.name}: "
else:
type_doc_string = f":type {prop.name}: "
type_doc_string = f":paramtype {prop.name}: "
type_doc_string += prop.schema.docstring_type
return type_doc_string

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
class Error(msrest.serialization.Model):
"""Error.

:param status:
:type status: int
:param message:
:type message: str
:keyword status:
:paramtype status: int
:keyword message:
:paramtype message: str
"""

_attribute_map = {
Expand All @@ -36,8 +36,8 @@ def __init__(
class Product(msrest.serialization.Model):
"""Product.

:param properties:
:type properties: ~azure.directives.sample.models.ProductProperties
:keyword properties:
:paramtype properties: ~azure.directives.sample.models.ProductProperties
"""

_attribute_map = {
Expand All @@ -55,10 +55,10 @@ def __init__(
class ProductProperties(msrest.serialization.Model):
"""ProductProperties.

:param id:
:type id: int
:param name:
:type name: str
:keyword id:
:paramtype id: int
:keyword name:
:paramtype name: str
"""

_attribute_map = {
Expand All @@ -78,10 +78,10 @@ def __init__(
class ProductResult(msrest.serialization.Model):
"""ProductResult.

:param value:
:type value: list[~azure.directives.sample.models.Product]
:param next_link:
:type next_link: str
:keyword value:
:paramtype value: list[~azure.directives.sample.models.Product]
:keyword next_link:
:paramtype next_link: str
"""

_attribute_map = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
class Error(msrest.serialization.Model):
"""Error.

:param status:
:type status: int
:param message:
:type message: str
:keyword status:
:paramtype status: int
:keyword message:
:paramtype message: str
"""

_attribute_map = {
Expand All @@ -41,8 +41,8 @@ def __init__(
class Product(msrest.serialization.Model):
"""Product.

:param properties:
:type properties: ~azure.directives.sample.models.ProductProperties
:keyword properties:
:paramtype properties: ~azure.directives.sample.models.ProductProperties
"""

_attribute_map = {
Expand All @@ -62,10 +62,10 @@ def __init__(
class ProductProperties(msrest.serialization.Model):
"""ProductProperties.

:param id:
:type id: int
:param name:
:type name: str
:keyword id:
:paramtype id: int
:keyword name:
:paramtype name: str
"""

_attribute_map = {
Expand All @@ -88,10 +88,10 @@ def __init__(
class ProductResult(msrest.serialization.Model):
"""ProductResult.

:param value:
:type value: list[~azure.directives.sample.models.Product]
:param next_link:
:type next_link: str
:keyword value:
:paramtype value: list[~azure.directives.sample.models.Product]
:keyword next_link:
:paramtype next_link: str
"""

_attribute_map = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
class Error(msrest.serialization.Model):
"""Error.

:param status:
:type status: int
:param message:
:type message: str
:keyword status:
:paramtype status: int
:keyword message:
:paramtype message: str
"""

_attribute_map = {
Expand All @@ -36,10 +36,10 @@ def __init__(
class PagingResult(msrest.serialization.Model):
"""PagingResult.

:param values:
:type values: list[~azure.multiapi.sample.v1.models.Product]
:param next_link:
:type next_link: str
:keyword values:
:paramtype values: list[~azure.multiapi.sample.v1.models.Product]
:keyword next_link:
:paramtype next_link: str
"""

_attribute_map = {
Expand All @@ -59,8 +59,8 @@ def __init__(
class Product(msrest.serialization.Model):
"""Product.

:param id:
:type id: int
:keyword id:
:paramtype id: int
"""

_attribute_map = {
Expand All @@ -78,11 +78,11 @@ def __init__(
class TestLroAndPagingOptions(msrest.serialization.Model):
"""Parameter group.

:param maxresults: Sets the maximum number of items to return in the response.
:type maxresults: int
:param timeout: Sets the maximum time that the server can spend processing the request, in
:keyword maxresults: Sets the maximum number of items to return in the response.
:paramtype maxresults: int
:keyword timeout: Sets the maximum time that the server can spend processing the request, in
seconds. The default is 30 seconds.
:type timeout: int
:paramtype timeout: int
"""

_attribute_map = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
class Error(msrest.serialization.Model):
"""Error.

:param status:
:type status: int
:param message:
:type message: str
:keyword status:
:paramtype status: int
:keyword message:
:paramtype message: str
"""

_attribute_map = {
Expand All @@ -41,10 +41,10 @@ def __init__(
class PagingResult(msrest.serialization.Model):
"""PagingResult.

:param values:
:type values: list[~azure.multiapi.sample.v1.models.Product]
:param next_link:
:type next_link: str
:keyword values:
:paramtype values: list[~azure.multiapi.sample.v1.models.Product]
:keyword next_link:
:paramtype next_link: str
"""

_attribute_map = {
Expand All @@ -67,8 +67,8 @@ def __init__(
class Product(msrest.serialization.Model):
"""Product.

:param id:
:type id: int
:keyword id:
:paramtype id: int
"""

_attribute_map = {
Expand All @@ -88,11 +88,11 @@ def __init__(
class TestLroAndPagingOptions(msrest.serialization.Model):
"""Parameter group.

:param maxresults: Sets the maximum number of items to return in the response.
:type maxresults: int
:param timeout: Sets the maximum time that the server can spend processing the request, in
:keyword maxresults: Sets the maximum number of items to return in the response.
:paramtype maxresults: int
:keyword timeout: Sets the maximum time that the server can spend processing the request, in
seconds. The default is 30 seconds.
:type timeout: int
:paramtype timeout: int
"""

_attribute_map = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
class Error(msrest.serialization.Model):
"""Error.

:param status:
:type status: int
:param message:
:type message: str
:keyword status:
:paramtype status: int
:keyword message:
:paramtype message: str
"""

_attribute_map = {
Expand All @@ -38,10 +38,10 @@ class ModelTwo(msrest.serialization.Model):

All required parameters must be populated in order to send to Azure.

:param id: Required.
:type id: int
:param message:
:type message: str
:keyword id: Required.
:paramtype id: int
:keyword message:
:paramtype message: str
"""

_validation = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
class Error(msrest.serialization.Model):
"""Error.

:param status:
:type status: int
:param message:
:type message: str
:keyword status:
:paramtype status: int
:keyword message:
:paramtype message: str
"""

_attribute_map = {
Expand All @@ -43,10 +43,10 @@ class ModelTwo(msrest.serialization.Model):

All required parameters must be populated in order to send to Azure.

:param id: Required.
:type id: int
:param message:
:type message: str
:keyword id: Required.
:paramtype id: int
:keyword message:
:paramtype message: str
"""

_validation = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
class Error(msrest.serialization.Model):
"""Error.

:param status:
:type status: int
:param message:
:type message: str
:keyword status:
:paramtype status: int
:keyword message:
:paramtype message: str
"""

_attribute_map = {
Expand All @@ -36,8 +36,8 @@ def __init__(
class ModelThree(msrest.serialization.Model):
"""Only exists in api version 3.0.0.

:param optional_property:
:type optional_property: str
:keyword optional_property:
:paramtype optional_property: str
"""

_attribute_map = {
Expand All @@ -55,10 +55,10 @@ def __init__(
class PagingResult(msrest.serialization.Model):
"""PagingResult.

:param values:
:type values: list[~azure.multiapi.sample.v3.models.ModelThree]
:param next_link:
:type next_link: str
:keyword values:
:paramtype values: list[~azure.multiapi.sample.v3.models.ModelThree]
:keyword next_link:
:paramtype next_link: str
"""

_attribute_map = {
Expand All @@ -78,8 +78,8 @@ def __init__(
class SourcePath(msrest.serialization.Model):
"""Uri or local path to source data.

:param source: File source path.
:type source: str
:keyword source: File source path.
:paramtype source: str
"""

_validation = {
Expand Down
Loading