-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
importer-rest-api-specs
: shelve SupplementaryData support for now, …
…since it doesn't seem to be required for DataFactory models as they use external Swagger Refs.
- Loading branch information
1 parent
924eae6
commit dfb8822
Showing
8 changed files
with
116 additions
and
99 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 15 additions & 23 deletions
38
tools/importer-rest-api-specs/internal/components/apidefinitions/parse_supplementary_data.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,18 @@ | ||
package apidefinitions | ||
|
||
import ( | ||
"fmt" | ||
|
||
"github.com/hashicorp/pandora/tools/importer-rest-api-specs/internal/components/apidefinitions/parser" | ||
parserModels "github.com/hashicorp/pandora/tools/importer-rest-api-specs/internal/components/apidefinitions/parser/models" | ||
"github.com/hashicorp/pandora/tools/importer-rest-api-specs/internal/logging" | ||
) | ||
|
||
// parseSupplementaryDataFromFile loads any available Supplementary Data from the file in question | ||
func parseSupplementaryDataFromFile(filePath string) (*parserModels.SupplementaryData, error) { | ||
logging.Tracef("Building an Definitions Parser for %q..", filePath) | ||
parser, err := parser.NewAPIDefinitionsParser(filePath) | ||
if err != nil { | ||
return nil, fmt.Errorf("building the APIDefinitions Parser for %q: %+v", filePath, err) | ||
} | ||
logging.Tracef("Parsing the Supplementary Data from %q..", filePath) | ||
data, err := parser.SupplementaryData() | ||
if err != nil { | ||
return nil, fmt.Errorf("parsing the Supplementary Data from %q: %+v", filePath, err) | ||
} | ||
logging.Tracef("Loaded the Supplementary Data from %q.", filePath) | ||
|
||
return data, nil | ||
} | ||
//func parseSupplementaryDataFromFile(filePath string) (*parserModels.SupplementaryData, error) { | ||
// logging.Tracef("Building an Definitions Parser for %q..", filePath) | ||
// parser, err := parser.NewAPIDefinitionsParser(filePath) | ||
// if err != nil { | ||
// return nil, fmt.Errorf("building the APIDefinitions Parser for %q: %+v", filePath, err) | ||
// } | ||
// logging.Tracef("Parsing the Supplementary Data from %q..", filePath) | ||
// data, err := parser.SupplementaryData() | ||
// if err != nil { | ||
// return nil, fmt.Errorf("parsing the Supplementary Data from %q: %+v", filePath, err) | ||
// } | ||
// logging.Tracef("Loaded the Supplementary Data from %q.", filePath) | ||
// | ||
// return data, nil | ||
//} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
57 changes: 0 additions & 57 deletions
57
...rest-api-specs/internal/components/apidefinitions/parser/parse_supplementary_data_test.go
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters