Skip to content

initial, metadata endpoint for json-stat2 #123

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

Merged
merged 2 commits into from
Jun 3, 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
8 changes: 6 additions & 2 deletions PxWeb/Controllers/Api2/TableApiController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ public class TableApiController : PxWeb.Api2.Server.Controllers.TableApiControll
private readonly IDataSource _dataSource;
private readonly ILanguageHelper _languageHelper;
private readonly ITableMetadataResponseMapper _tableMetadataResponseMapper;
private readonly IDatasetMapper _datasetMapper;
private readonly ITablesResponseMapper _tablesResponseMapper;
private readonly ITableResponseMapper _tableResponseMapper;
private readonly ICodelistResponseMapper _codelistResponseMapper;
Expand All @@ -48,11 +49,12 @@ public class TableApiController : PxWeb.Api2.Server.Controllers.TableApiControll
private readonly ISelectionHandler _selectionHandler;
private readonly ISelectionResponseMapper _selectionResponseMapper;

public TableApiController(IDataSource dataSource, ILanguageHelper languageHelper, ITableMetadataResponseMapper responseMapper, ISearchBackend backend, IOptions<PxApiConfigurationOptions> configOptions, ITablesResponseMapper tablesResponseMapper, ITableResponseMapper tableResponseMapper, ICodelistResponseMapper codelistResponseMapper, ISelectionResponseMapper selectionResponseMapper, ISerializeManager serializeManager, ISelectionHandler selectionHandler)
public TableApiController(IDataSource dataSource, ILanguageHelper languageHelper, ITableMetadataResponseMapper responseMapper, IDatasetMapper datasetMapper, ISearchBackend backend, IOptions<PxApiConfigurationOptions> configOptions, ITablesResponseMapper tablesResponseMapper, ITableResponseMapper tableResponseMapper, ICodelistResponseMapper codelistResponseMapper, ISelectionResponseMapper selectionResponseMapper, ISerializeManager serializeManager, ISelectionHandler selectionHandler)
{
_dataSource = dataSource;
_languageHelper = languageHelper;
_tableMetadataResponseMapper = responseMapper;
_datasetMapper = datasetMapper;
_backend = backend;
_configOptions = configOptions.Value;
_tablesResponseMapper = tablesResponseMapper;
Expand All @@ -77,7 +79,9 @@ public override IActionResult GetMetadataById([FromRoute(Name = "id"), Required]

if (outputFormat != null && outputFormat == MetadataOutputFormatType.Stat2Enum)
{
throw new NotImplementedException();

Dataset ds = _datasetMapper.Map(model, id, lang);
return new ObjectResult(ds);
}
else
{
Expand Down
Loading