Skip to content

Add yaml and ini parsers#39

Merged
bogdandm merged 4 commits intomasterfrom
yaml-ini-parsers
Jul 22, 2021
Merged

Add yaml and ini parsers#39
bogdandm merged 4 commits intomasterfrom
yaml-ini-parsers

Conversation

@bogdandm
Copy link
Copy Markdown
Owner

@bogdandm bogdandm commented Jul 13, 2021

(Fixes #37)

Add yaml and ini file parsers.

class YamlFile(BaseModel):
    swagger: float
    schemes: List[Literal["https"]]
    host: Literal["api.spotify.com"]
    base_path: Literal["/v1"] = Field(..., alias="basePath")
    info: 'Info'
    external_docs: 'ExternalDoc_XLogo' = Field(..., alias="externalDocs")
    consumes: List[Literal["application/json"]]
    produces: List[Literal["application/json"]]
    security_definitions: 'SecurityDefinition' = Field(..., alias="securityDefinitions")
    paths: 'Path'
    definitions: 'Definition'

...
class IniFile(BaseModel):
    owner: 'Owner'
    database: 'Database'


class Owner(BaseModel):
    name: Literal["John Doe"]
    organization: Literal["Acme Widgets Inc."]


class Database(BaseModel):
    server: Literal["192.0.2.62"]
    port: int
    file: Literal["payroll.dat"]

@coveralls
Copy link
Copy Markdown

coveralls commented Jul 13, 2021

Coverage Status

Coverage decreased (-0.5%) to 97.955% when pulling 9895ea7 on yaml-ini-parsers into d00e80d on master.

bogdandm added 2 commits July 13, 2021 18:54
Change default yaml parser;
Handle non-str keys in dicts
@bogdandm bogdandm merged commit fff9a03 into master Jul 22, 2021
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.

add yaml , ini

2 participants