Skip to content

Use pydantic models and include documentation code#267

Merged
rogelioLpz merged 11 commits intomainfrom
docs
Jun 1, 2022
Merged

Use pydantic models and include documentation code#267
rogelioLpz merged 11 commits intomainfrom
docs

Conversation

@rogelioLpz
Copy link
Copy Markdown
Member

@rogelioLpz rogelioLpz commented May 25, 2022

  • Use BaseModel from pydantic instead of pydantic.dataclasses
  • Add documentation code for multiple resources

@codecov
Copy link
Copy Markdown

codecov bot commented May 25, 2022

Codecov Report

Merging #267 (6c7b4e0) into main (963d190) will not change coverage.
The diff coverage is 100.00%.

@@            Coverage Diff            @@
##              main      #267   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           42        42           
  Lines         1026       973   -53     
=========================================
- Hits          1026       973   -53     
Flag Coverage Δ
unittests 100.00% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
cuenca/resources/accounts.py 100.00% <ø> (ø)
cuenca/resources/arpc.py 100.00% <ø> (ø)
cuenca/resources/balance_entries.py 100.00% <ø> (ø)
cuenca/resources/bill_payments.py 100.00% <ø> (ø)
cuenca/resources/card_activations.py 100.00% <ø> (ø)
cuenca/resources/card_transactions.py 100.00% <ø> (ø)
cuenca/resources/card_validations.py 100.00% <ø> (ø)
cuenca/resources/cards.py 100.00% <ø> (ø)
cuenca/resources/commissions.py 100.00% <ø> (ø)
cuenca/resources/deposits.py 100.00% <ø> (ø)
... and 26 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 963d190...6c7b4e0. Read the comment docs.

@rogelioLpz rogelioLpz self-assigned this May 26, 2022
@rogelioLpz rogelioLpz changed the title Openapi Migrate to native pydantic models and include documentation code May 31, 2022
@rogelioLpz rogelioLpz requested a review from pachCode May 31, 2022 20:55
@rogelioLpz rogelioLpz changed the title Migrate to native pydantic models and include documentation code Use pydantic models and include documentation code May 31, 2022
@rogelioLpz rogelioLpz marked this pull request as ready for review May 31, 2022 20:57
@rogelioLpz rogelioLpz requested a review from alexviquez as a code owner May 31, 2022 20:57
Copy link
Copy Markdown
Contributor

@alexviquez alexviquez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

solo bump y un comment de niveles

requirements.txt Outdated
@@ -1,3 +1,3 @@
requests==2.27.1
cuenca-validations==0.10.6
cuenca-validations==0.10.7.dev4
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bump

@@ -1,3 +1,3 @@
__version__ = '0.9.4'
__version__ = '0.10.0.dev5'
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bump

class Config:
fields = {
'level': {
'description': 'Account level according to KYC information'
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Quizas agregar de que nivel a que nivel es permitido este campo

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agregado en los docs

alexviquez
alexviquez previously approved these changes Jun 1, 2022
' from RENAPO. Accents in names are ignored'
},
}
schema_extra = {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

usar un solo tipo de comillas

Copy link
Copy Markdown
Member Author

@rogelioLpz rogelioLpz Jun 1, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

El json de los example lo puse con comillas dobles porque es el formato de json. Se puede poner comillas simples pero me parecio mejor ponerlo así para que si alguien guste lo queda tomar de ahi y usarlo en otro lado tenga el standar de json y no tenga que estar editandolo.
No se que opines @Felipaoo ?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

aunque quieras usarlo como json tendrian que cambiar None por null y True por true. Mejor ser uniformes con la convención que usamos

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Arre 👍

pachCode
pachCode previously approved these changes Jun 1, 2022
@rogelioLpz rogelioLpz dismissed stale reviews from pachCode and alexviquez via 6c7b4e0 June 1, 2022 00:20
Copy link
Copy Markdown
Contributor

@felipao-mx felipao-mx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hágale!

@rogelioLpz rogelioLpz merged commit 1304600 into main Jun 1, 2022
@rogelioLpz rogelioLpz deleted the docs branch June 1, 2022 00:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants