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

update returns to render as yaml #40

Merged
merged 2 commits into from
Aug 8, 2024
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
3 changes: 2 additions & 1 deletion ansible_specdoc/objects.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from __future__ import annotations

import copy
import json
from dataclasses import dataclass, field
from typing import Any, Dict, List, Optional, Tuple, Union

Expand Down Expand Up @@ -213,7 +214,7 @@ def ansible_doc(self) -> Dict[str, Any]:
"description": self.description,
"type": str(self.type),
"returned": self.returned,
"sample": self.sample,
"sample": json.loads("".join(self.sample)),
}

if self.elements is not None:
Expand Down
1 change: 1 addition & 0 deletions tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ def test_docs_file_injection():
assert f'DOCUMENTATION = r"""\n{docs}"""' in output
assert f'EXAMPLES = r"""\n{examples}"""' in output
assert f'RETURN = r"""\n{returns}"""' in output
assert "{" not in returns

@staticmethod
def test_docs_file_clear():
Expand Down