Skip to content

api-linter fails to resolve the import path #1519

@CuriousStork

Description

@CuriousStork

Environment details

  • OS: Windows
  • Package version: 1.70.2

Steps to reproduce

  1. Create a project structured like below

    Image

    Set the test.proto text as

    syntax = "proto3";
    
    package api.v1;
    
    import "google/api/field_behavior.proto";
    
    message Test {
      string name = 1 [(google.api.field_behavior) = IDENTIFIER];
    }

    Set the field_behavior.proto text as https://github.com/googleapis/googleapis/blob/67fe1ece997ef298d8d86b026195ea2fd588c538/google/api/field_behavior.proto

  2. Set the console cwd to the project root.

  3. Run the console command

    api-linter --proto-path .\third_party .\api\v1\test.proto

    or

    api-linter --proto-path third_party .\api\v1\test.proto

This returns an error:

2025/08/07 14:56:11 api/v1/test.proto:5:8: could not resolve path "google/api/field_behavior.proto": open google\api\field_behavior.proto: The system cannot find the path specified.

The problem isn't reproduced via v. 1.67.*

Metadata

Metadata

Assignees

Labels

priority: p2type: bugv1Please ensure all issues related to the api-linter version v1.x.x are tagged with this label.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions