@@ -516,12 +516,21 @@ func (osa *serviceLevelStaticAnalyzer) Analyze() error {
516
516
// - expected response attributes:
517
517
// - LocalSchemaRef x 2 for sync and async schema overrides
518
518
// - OpenAPIOperationStoreRef via resolveSQLVerb()
519
- _ , svcErr := osa .registryAPI .GetServiceFragment (providerService , resourceKey )
520
- if svcErr != nil {
521
- osa .errors = append (osa .errors , fmt .Errorf ("failed to get service fragment for svc name = %s: %v" , providerService .GetName (), svcErr ))
519
+
520
+ // This is a crude trick to prevent pointless service doc re-processing
521
+ methods := resource .GetMethods ()
522
+ if len (methods ) == 0 {
523
+ _ , svcErr := osa .registryAPI .GetServiceFragment (providerService , resourceKey )
524
+ if svcErr != nil {
525
+ osa .errors = append (osa .errors , fmt .Errorf ("failed to get service fragment for svc name = %s: %v" , providerService .GetName (), svcErr ))
526
+ continue
527
+ }
528
+ methods = resource .GetMethods ()
529
+ }
530
+ if len (methods ) == 0 {
531
+ osa .errors = append (osa .errors , fmt .Errorf ("no methods found for resource %s" , resourceKey ))
522
532
continue
523
533
}
524
- methods := resource .GetMethods ()
525
534
for methodName , method := range methods {
526
535
// Perform analysis on each method
527
536
@@ -532,6 +541,17 @@ func (osa *serviceLevelStaticAnalyzer) Analyze() error {
532
541
if isGraphQL {
533
542
continue // TODO: GraphQL methods analysis
534
543
}
544
+ // Does this method have selection semantics?
545
+ sqlVerb := strings .ToLower (method .GetSQLVerb ())
546
+ isSelectMethod := sqlVerb == "select"
547
+ selectItemsKey := method .GetSelectItemsKey ()
548
+ hasSelectionSemantics := selectItemsKey != ""
549
+ if ! hasSelectionSemantics && isSelectMethod {
550
+ osa .warnings = append (osa .warnings , fmt .Sprintf ("apparent select method %s for resource %s does not have selection semantics" , methodName , resourceKey ))
551
+ }
552
+ if sqlVerb == "" {
553
+ osa .warnings = append (osa .warnings , fmt .Sprintf ("method %s for resource %s has no SQL verb" , methodName , resourceKey ))
554
+ }
535
555
shouldBeSelectable := method .ShouldBeSelectable ()
536
556
if shouldBeSelectable {
537
557
responseSchema , mediaType , responseInferenceErr := method .GetFinalResponseBodySchemaAndMediaType ()
0 commit comments